<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">%% Copyright 2020-2025 by C. Minz
% Current package version: v1.5 (2025/02/24).
\documentclass[12pt]{article}
\usepackage[a4paper, left = 2.5cm, right = 2.5cm, top = 2.5cm, bottom = 2.5cm]{geometry}
\usepackage[english]{babel}
\usepackage{lmodern}
\linespread{1.20} % line spreading
\setlength{\parindent}{2em} % paragraph indent
\setlength{\parskip}{0em} % space between paragraphs
\usepackage{titlesec} % change headline formats
\renewcommand{\thesection}{\arabic{section}}
\titlespacing*{\section}{0pt}{15pt}{5pt}
\titleformat{\section}{\large\bfseries\sffamily}{\thetitle}{17pt}{}{}
\renewcommand{\thesubsection}{}
\titlespacing*{\subsection}{0pt}{15pt}{5pt}
\titleformat{\subsection}{\small\bfseries\sffamily}{\thetitle}{0pt}{}{}
\renewcommand{\thesubsubsection}{}
\titlespacing*{\subsubsection}{0pt}{5pt}{0pt}
\titleformat{\subsubsection}{\small\sffamily\itshape}{\thetitle}{0pt}{}{}
\usepackage{fancyhdr} % advanced header and footer
\pagestyle{fancy}
\fancypagestyle{plain}{\fancyhf{}\renewcommand{\headrulewidth}{0.0pt}}
\setlength{\headheight}{16.0pt}
\fancyhead[L]{}
\fancyhead[C]{}
\fancyhead[R]{\sffamily causets package manual}
\renewcommand{\headrulewidth}{0.2pt}
\renewcommand{\footrulewidth}{0.0pt}
\fancyfoot[L]{}
\fancyfoot[C]{}
\fancyfoot[R]{\sffamily \thepage}
\usepackage{hyperref} % cross references
\hypersetup{%
  bookmarksopen = true, %
  bookmarksopenlevel = 0, %
  bookmarksnumbered = true, %
  pdftitle = {{Package documentation: causets}}, %
  pdfauthor = {{Christoph Minz}}, %
  pdfstartpage = 1, %
  pdfstartview = {FitH}, %
  breaklinks = false, %
  colorlinks = true, %
  linkcolor = black!50!blue, %
  citecolor = black, %
  filecolor = black, %
  menucolor = black, %
  urlcolor = black!25!blue %
}
\addto\extrasenglish{%
  \renewcommand{\sectionautorefname}{Sec.}%
  \renewcommand{\subsectionautorefname}{Sec.}%
}
\usepackage{booktabs} % book table style
\usepackage{longtable} % tables spanning pages
\usepackage{multirow} % spanning multiple rows
\usepackage{listings} % code environments
\lstset{
  backgroundcolor=\color{yellow!50!black!10},
  basicstyle=\ttfamily\footnotesize,
  breakatwhitespace=true,
  breaklines=true,
  captionpos=b,
  commentstyle=\color{green!50!black!50!gray},
  keepspaces=true,
  keywordstyle={},
  language=TeX,
  numbers=left,
  numbersep=5pt,
  numberstyle=\scriptsize\color{black!35},
  rulecolor=\color{black},
  showspaces=false,
  showstringspaces=false,
  showtabs=false,
  stepnumber=1,
  stringstyle=\color{purple!50!black},
  tabsize=2
}

\usepackage{amsmath}
\usepackage[external]{causets}

\newcommand*{\PH}[1][value]{{\small\itshape$\langle$#1$\rangle$}} % placeholder
\newcommand*{\LaTeXML}{{\LaTeX}ML}

\usetikzlibrary{tikzmark}
\newcommand*{\versioncauset}[3][-1.03cm]{%
\tikzmark{#2}%
\tikz[remember picture, overlay]%
  \path (pic cs:#2) -- ++(-1cm, 0.5em) -- ++(#1, 0) node {#3};%
}% \versioncauset

\title{{\small package}\\[0.5cm]%
\huge causets\\[0.2cm]%
{\small version 1.5\\[0.5cm]}}
\author{Christoph Minz}
\date{2025/02/24}

\begin{document}

{\sffamily\maketitle

\vspace{-2em}
\begin{center}
--- supported with the \href{https://c-minz.github.io/assets/html/proset-editor.html}{PrOSET editor} online ---
\end{center}
}


\begin{center}\tikzcausetsset{large}
$$
  \left\{
    \pcauset[name=3Antichain_large]{3,2,1},
    \pcauset[name=2ChainUnion1Chain_large]{3,1,2},
    \pcauset[name=Wedge_large]{2,1,3},
    \pcauset[name=Vee_large]{1,3,2},
    \pcauset[name=3Chain_large]{1,2,3}
  \right\}
  ,
\qquad
  \causetsDrawLabelstrue
  \left\{
    \pcauset[name=3Antichain_largelabeled]{3,2,1},
    \pcauset[name=2ChainUnion1Chain_largelabeled]{3,1,2},
    \pcauset[name=Wedge_largelabeled]{2,1,3},
    \pcauset[name=Vee_largelabeled]{1,3,2},
    \pcauset[name=3Chain_largelabeled]{1,2,3}
  \right\}
  ,
$$
\\[-1em]
$$
  \causetsDrawPermutationtrue
  \left\{
    \pcauset[name=3Antichain_largeperm]{3,2,1},
    \pcauset[name=2ChainUnion1Chain_largeperm]{3,1,2},
    \pcauset[name=Wedge_largeperm]{2,1,3},
    \pcauset[name=Vee_largeperm]{1,3,2},
    \pcauset[name=3Chain_largeperm]{1,2,3}
  \right\}
$$
\end{center}
\vfill

{\itshape
The purpose of this package is to typeset partial ordered sets (posets for short) as Hasse diagrams in a style that is particularly suited for causal set theory (a theory of quantum gravity).
Causal sets (\textbf{causets} for short) are locally finite, partially ordered sets, where the partial order is the causal relation between elements.
This relation forms a cone structure (light-cones) such that all past and future related elements of an element fall within a lower and upper cone, respectively, opening in 90 degree angles.

The drawing algorithm (based on TikZ) makes use of the fact that every finite causet that embeds in $\smash{1 + 1}$ dimensional Minkowski spacetime is a product of two total orders (2-order), where one order is taken to be the standard total order of integers labelling all causet elements, while the other is a permutation of the labels\footnote{See \url{https://arxiv.org/abs/0706.0375} and \url{https://arxiv.org/abs/2011.02965} for more details on 2-orders and causal sets.}.
Such a permutation is the main input for the macros.
For any higher dimensional poset, there exists a 2-order such that the higher dimensional diagram is obtained by removing links from the 2-order.
The online tool ``PrOSET editor'' helps to construct any Hasse diagram and export its macro for use in a \LaTeX\ document.
}

\clearpage


\section{The three main commands}
\label{sec:Introduction}

This package is built on the package \lstinline§tikz§ to draw the diagrams.
To import the \lstinline§causets§ package into a \LaTeX\ file, write
\begin{lstlisting}
\usepackage{causets}
\end{lstlisting}
in the preamble of the document (this will automatically load the \lstinline§tikz§ package as well).

For the command introduction in \autoref{tab:MainCommandsExamples}, I use the package options \lstinline§black§ (only black and white diagrams) and \lstinline§permutation§ (also shows the permutation),
\begin{lstlisting}
\usepackage[black,permutation]{causets}
\end{lstlisting}
At first, let us take a brief look at the three main commands of the package, before we look into the (physical) ideas behind these three commands.

The three main commands of this package are
\begin{lstlisting}
\pcauset{...,i,...,k,...,j,...}
\rcauset{...}{...,i/j,...}
\causet{...}{...,i/j,...}
\end{lstlisting}
The first command takes a permutation of the integers from an interval $[ a, b ]$ (where $N = b - a + 1 \geq 0$ is the cardinality of the causet).
The permutation determines the event positions and causal structure such that events $i$ and $j$ are linked if $i &lt; j$ and there is no $k &gt; j$ between $i$ and $j$ in the permutation.
The second command does the same, but removes (restyles) links between event pairs \lstinline§i/j§ as given in the second argument.
The third command only uses the permutation to position the events, the links have to be explicitly specified by event pairs \lstinline§i/j§ in the second argument.

Any causet that can be embedded in $1 + 1$ dimensional Minkowski spacetime can also be described by the product of two total orders (a 2-order).
Let the causet elements be labeled by an increasing null coordinate $u$.
In the first diagram of \autoref{tab:MainCommandsExamples}, the $u$-coordinate axis points upwards on the right hand side.
The causal relation (partial order) implies a label permutation along the null coordinate $v$ (pointing upwards along the left axis).
This permutation is the input of the \lstinline§\pcauset§ command that computes the causal relation from the permutation.
See example 1 in \autoref{tab:MainCommandsExamples}.
\begin{table}[h!]
  \centering
  \tikzcausetsset{black colors, show permutation}
  \begin{tabular*}{\textwidth}{lp{0.75\textwidth}c}
    \toprule
    \#
  &amp; command
  &amp; inline output
  \\\midrule
    1
  &amp; \lstinline§\pcauset{4,7,2,6,1,5,3}§
  &amp; \pcauset[name=pcausetExample_perm]{4,7,2,6,1,5,3}
  \\\midrule
    2
  &amp; \lstinline§\rcauset{4,7,2,6,1,5,3}{2/5}§
  &amp; \rcauset[name=rcausetExample_perm]{4,7,2,6,1,5,3}{2/5}
  \\\midrule
    3
  &amp; \lstinline§\causet{4,7,2,6,1,5,3}{1/3,1/5,2/3,2/6,4/5,4/6,4/7}§
  &amp; \causet[name=causetExample_perm]{4,7,2,6,1,5,3}{1/3,1/5,2/3,2/6,4/5,4/6,4/7}
  \\\bottomrule
  \end{tabular*}
  \caption{\label{tab:MainCommandsExamples} Examples of the three main commands.}
\end{table}

Every causet that does not embed in $1 + 1$ dimensional Minkowski spacetime can be made embeddable by adding links, for which the \lstinline§\rcauset§ command is defined.
Find an embedding causet by adding a minimal number of causal relations to the given causet.
The so obtained, embedding causet gives a permutation as discussed before for the \lstinline§\pcauset§ causet.
The links that have been added to obtain this permutation need to be removed from the generated causet, which is specified by link pairs \lstinline§i/j§ in the second argument.
See example 2 in \autoref{tab:MainCommandsExamples}.

In some situations, it might be easier to specify the list of link pairs that exist, instead of removing links.
For this purpose, use the \lstinline§\causet§ command.
As an example, we rewrite the example 2 by specifying all existing links as pairs, see example 3 in \autoref{tab:MainCommandsExamples}.
Note that the \lstinline§\rcauset§ command was actually much shorter for this particular example.
However, if the list of link pairs in the \lstinline§\rcauset§ command is very long, specifying all existing link pairs instead with the \lstinline§\causet§ yields a faster performance.

You may use any of the three main commands to add a causet diagram in-line with text or within a mathematical expression.
As an example for the use in a mathematical equation, here is the code for the first set of causets on the title page:
\begin{lstlisting}
\usepackage{causets}
...
\begin{document}
...
\begin{align}
  S &amp;=
  \left\{
    \pcauset{3,2,1}, \pcauset{3,1,2}, \pcauset{2,1,3}, \pcauset{1,3,2}, \pcauset{1,2,3}
  \right\}.
\end{align}
\end{lstlisting}
%\vspace{-1ex}
\begin{align}
  S &amp;=
  \left\{
    \pcauset[name=3Antichain]{3,2,1},
    \pcauset[name=2ChainUnion1Chain]{3,1,2},
    \pcauset[name=Wedge]{2,1,3},
    \pcauset[name=Vee]{1,3,2},
    \pcauset[name=3Chain]{1,2,3}
  \right\}
  .
\end{align}

Of course, a given causet might have more than one representing permutation, so that any of those permutations may be used.
However, you may consider it a good practice to choose the permutation that starts with the larger integer, so that disjoint elements appear to the right in the graphs.
For example, you may write \lstinline§\pcauset{3,1,2}§, \pcauset[name=2ChainUnion1Chain]{3,1,2}, as opposed to \lstinline§\pcauset{2,3,1}§, \pcauset[name=1ChainUnion2Chain]{2,3,1}.

The arguments of the commands are lists that are iterated over by a \lstinline§\foreach§ loop of PGF/TikZ.
So you may use dots {...} to complete ranges of integers automatically.
You may use this feature to draw chains like \pcauset[name=5Chain]{1,...,5} (with \lstinline§\pcauset{1,...,5}§) or antichains like \pcauset[name=5Antichain]{5,...,1} (with \lstinline§\pcauset{5,...,1}§).
As a more complex example for the dots notation, consider
\begin{lstlisting}
\pcauset{20,18,...,8, 1,7,6,...,2, 9,11,...,19}
\end{lstlisting}
which produces the same diagram as
\begin{lstlisting}
\pcauset{20,18,16,14,12,10,8, 1,7,6,5,4,3,2, 9,11,13,15,17,19}
\end{lstlisting}
\begin{center}
  \pcauset[black colors, permutation, name=DotsExample_perm]{20,18,16,...,8,1,7,6,...,2,9,11,...,19}
\end{center}

In an optional argument, the main commands accepts any causets or TikZ keys to change the style of the causet.
For example, the blue causet \pcauset[blue colors, name=NDash_blue]{2,4,5,1,3} is obtained with
\begin{lstlisting}
\pcauset[blue colors]{2,4,5,1,3}
\end{lstlisting}

Example diagrams together with their \LaTeX\ macros are included on the project website \url{https://c-minz.github.io/projects/poset_diagrams}.
To help create and modify poset diagrams visually, I developed the PrOSET editor as an online tool, which exports the result as \LaTeX\ macros (and other data formats): \\
\url{https://c-minz.github.io/assets/html/proset-editor.html}

Whenever you use this package to compose a publication to be uploaded to the arXiv, or a document that may be converted to XML or HTML with \LaTeXML, this package provides special support.
To replace the diagram figures especially for screen readers, add a short description with the key \lstinline§alt={§\PH\lstinline§}§ in the optional argument.
For example, the code
\begin{lstlisting}
\pcauset[alt={N}]{2,4,1,3},
\pcauset[alt={union of an N and a 2-chain}]{5,6,2,4,1,3}
\end{lstlisting}
adds ``N'' as alternative text for \pcauset[name=N, alt={N}]{2,4,1,3}, and ``union of an N and a 2-chain'' as description for \pcauset[name=N_2-chain, alt={union of an N and a 2-chain}]{5,6,2,4,1,3}.
If no alternative text is specified, the default value ``causet'' is used (which is set in the style \lstinline§every causet§).


\section{Package options}
\label{sec:PackageOptions}

Each of the package options can either be specified in square brackets when declaring the package (option applies globally) or be changed with a macro at any point in the document (option applies to the local scope).

If no options are used, an output like \rcauset[name=Options_rcauset, alt={3-crown with doubled top right}]{4,2,7,6,1,5,3}{2/5} is obtained with the code
\begin{lstlisting}
\usepackage{causets}
... \begin{document} ...
\rcauset[alt={3-crown with doubled top right}]{4,2,7,6,1,5,3}{2/5}
\end{lstlisting}

The options -- given in the following table -- are passed to the \lstinline§causets§ package as optional parameter and can be combined.
The package options are listed together with example outputs created with the commands
\begin{lstlisting}
\pcauset{4,2,7,6,1,5,3}
\rcauset{4,2,7,6,1,5,3}{2/5}
\end{lstlisting}
If not specified otherwise, any package option also works with the command \lstinline§\causet§.

\begin{longtable}{p{0.63\textwidth}p{0.14\textwidth}p{0.14\textwidth}}
  \toprule
  Package option &amp; \lstinline§\pcauset§ &amp; \lstinlineง\rcausetง
  \\\midrule
  \endfirsthead

  \multicolumn{3}{c}{\footnotesize \textit{continued from the previous page}}
  \\\midrule
  Package option &amp; \lstinlineง\pcausetง &amp; \lstinlineง\rcausetง
  \\\midrule
  \endhead

  \midrule
  \multicolumn{3}{c}{\footnotesize \textit{continued on the next page}}
  \endfoot

  \endlastfoot

  \lstinlineง\usepackage[permutation]{causets}ง shows permutations
&amp; \multirow{3}{5em}{%
  \causetsDrawPermutationtrue \pcauset[name=Options_pcauset_perm]{4,2,7,6,1,5,3}}
&amp; \multirow{3}{5em}{%
  \causetsDrawPermutationtrue \rcauset[name=Options_rcauset_perm]{4,2,7,6,1,5,3}{2/5}}
\\
  (\lstinlineง\causetsDrawPermutationtrueง activates this option)
\\
  (\lstinlineง\causetsDrawPermutationfalseง deactivates this option)
\\\midrule
  \lstinlineง\usepackage[permutation, uunlabeled]{causets}ง
&amp; \multirow{4}{5em}{%
  \causetsDrawPermutationtrue \causetsDrawULabelsfalse \pcauset[name=Options_pcauset_permv]{4,2,7,6,1,5,3}}
&amp; \multirow{4}{5em}{%
  \causetsDrawPermutationtrue \causetsDrawULabelsfalse \rcauset[name=Options_rcauset_permv]{4,2,7,6,1,5,3}{2/5}}
\\
  shows permutations without u-labels
\\
  (\lstinlineง\causetsDrawULabelstrueง activates u-labels)
\\
  (\lstinlineง\causetsDrawULabelsfalseง deactivates u-labels)
\\\midrule
  \lstinlineง\usepackage[permutation, vunlabeled]{causets}ง
&amp; \multirow{4}{5em}{%
  \causetsDrawPermutationtrue \causetsDrawVLabelsfalse \pcauset[name=Options_pcauset_permu]{4,2,7,6,1,5,3}}
&amp; \multirow{4}{5em}{%
  \causetsDrawPermutationtrue \causetsDrawVLabelsfalse \rcauset[name=Options_rcauset_permu]{4,2,7,6,1,5,3}{2/5}}
\\
  shows permutations without v-labels
\\
  (\lstinlineง\causetsDrawVLabelstrueง activates v-labels)
\\
  (\lstinlineง\causetsDrawVLabelsfalseง deactivates v-labels)
\\\midrule\midrule
  \lstinlineง\usepackage[labeled]{causets}ง shows labeled events
&amp; \multirow{3}{5em}{%
  \causetsDrawLabelstrue \pcauset[name=Options_pcauset_labeled]{4,2,7,6,1,5,3}}
&amp; \multirow{3}{5em}{%
  \causetsDrawLabelstrue \rcauset[name=Options_rcauset_labeled]{4,2,7,6,1,5,3}{2/5}}
\\
  (\lstinlineง\causetsDrawLabelstrueง activates labels)
\\
  (\lstinlineง\causetsDrawLabelsfalseง deactivates labels)
\\\midrule\midrule
  \lstinlineง\usepackage[continuous]{causets}ง allows links to cross over events.
  Link interruptions (default) only affect the \lstinlineง\causetง command and ``restyled'' links of \lstinlineง\rcausetง, but not the examples shown on the right.
&amp; \multirow{6}{5em}{%
  \causetsBreakLinkstrue \pcauset[name=Options_pcauset_continuous]{4,2,7,6,1,5,3}}
&amp; \multirow{6}{5em}{%
  \causetsBreakLinkstrue \rcauset[name=Options_rcauset_continuous]{4,2,7,6,1,5,3}{2/5}}
\\
  Details on interrupted (broken) links are given below this table.
\\\midrule
  \lstinlineง\usepackage[caps]{causets}ง sets caps as link tips
&amp; \multirow{2}{5em}{%
  \pcauset[name=Options_pcauset_caps, cap links]{4,2,7,6,1,5,3}}
&amp; \multirow{2}{5em}{%
  \rcauset[name=Options_rcauset_caps, cap links]{4,2,7,6,1,5,3}{2/5}}
\\
\\\midrule
  \lstinlineง\usepackage[arrows]{causets}ง sets arrows (rounded stealth) as link tips
&amp; \multirow{2}{5em}{%
  \pcauset[name=Options_pcauset_arrows, arrow links]{4,2,7,6,1,5,3}}
&amp; \multirow{2}{5em}{%
  \rcauset[name=Options_rcauset_arrows, arrow links]{4,2,7,6,1,5,3}{2/5}}
\\\midrule
  \lstinlineง\usepackage[unlinked]{causets}ง does not draw links
&amp; \multirow{3}{5em}{%
  \causetsDrawLinksfalse \pcauset[name=Options_pcauset_unlinked]{4,2,7,6,1,5,3}}
&amp; \multirow{3}{5em}{%
  \causetsDrawLinksfalse \rcauset[name=Options_rcauset_unlinked]{4,2,7,6,1,5,3}{2/5}}
\\
  (\lstinlineง\causetsDrawLinkstrueง actives links)
\\
  (\lstinlineง\causetsDrawLinksfalseง deactivates links)
\\\pagebreak%\midrule
  \lstinlineง\usepackage[tiny]{causets}ง for tiny diagrams
&amp; \multirow{2}{5em}{%
  \pcauset[name=Options_pcauset_tiny, tiny]{4,2,7,6,1,5,3}}
&amp; \multirow{2}{5em}{%
  \rcauset[name=Options_rcauset_tiny, tiny]{4,2,7,6,1,5,3}{2/5}}
\\
  (\lstinlineง\tikzcausetsset{tiny}ง sets tiny sizes)
\\\midrule
  \lstinlineง\usepackage[smaller]{causets}ง for very small diagrams
&amp; \multirow{2}{5em}{%
  \pcauset[name=Options_pcauset_verysmall, very small]{4,2,7,6,1,5,3}}
&amp; \multirow{2}{5em}{%
  \rcauset[name=Options_rcauset_verysmall, very small]{4,2,7,6,1,5,3}{2/5}}
\\
  (\lstinlineง\tikzcausetsset{very small}ง sets very small sizes)
\\\midrule
  \lstinlineง\usepackage[small]{causets}ง for small diagrams
&amp; \multirow{2}{5em}{%
  \pcauset[name=Options_pcauset_small, small]{4,2,7,6,1,5,3}}
&amp; \multirow{2}{5em}{%
  \rcauset[name=Options_rcauset_small, small]{4,2,7,6,1,5,3}{2/5}}
\\
  (\lstinlineง\tikzcausetsset{small}ง sets small sizes)
\\\midrule
  For comparison, here are the normal sized causets.
&amp; \multirow{2}{5em}{%
  \pcauset[name=Options_pcauset, normal]{4,2,7,6,1,5,3}}
&amp; \multirow{2}{5em}{%
  \rcauset[name=Options_rcauset, normal]{4,2,7,6,1,5,3}{2/5}}
\\
  (\lstinlineง\tikzcausetsset{normal}ง sets normal sizes)
\\\midrule
  \lstinlineง\usepackage[large]{causets}ง for large diagrams
&amp; \multirow{3}{5em}{%
  \pcauset[name=Options_pcauset_large, large]{4,2,7,6,1,5,3}}
&amp; \multirow{3}{5em}{%
  \rcauset[name=Options_rcauset_large, large]{4,2,7,6,1,5,3}{2/5}}
\\
  (\lstinlineง\tikzcausetsset{large}ง sets large sizes)
\\[1.3em]\midrule
  \lstinlineง\usepackage[larger]{causets}ง for very large diagrams
&amp; \multirow{3}{5em}{%
  \pcauset[name=Options_pcauset_verylarge, very large]{4,2,7,6,1,5,3}}
&amp; \multirow{3}{5em}{%
  \rcauset[name=Options_rcauset_verylarge, very large]{4,2,7,6,1,5,3}{2/5}}
\\
  (\lstinlineง\tikzcausetsset{very large}ง sets very large sizes)
\\[2.1em]\midrule
  \lstinlineง\usepackage[huge]{causets}ง for huge diagrams
&amp; \multirow{4}{5em}{%
  \pcauset[name=Options_pcauset_huge, huge]{4,2,7,6,1,5,3}}
\\
  (\lstinlineง\tikzcausetsset{huge}ง sets huge sizes)
\\
  Details on size options are given in \autoref{sec:Sizes}.
\\[2.5em]\midrule\midrule
  \lstinlineง\usepackage[black]{causets}ง for black and white causets
&amp; \multirow{2}{5em}{%
  \pcauset[name=Options_pcauset_black, black colors]{4,2,7,6,1,5,3}}
&amp; \multirow{2}{5em}{%
  \rcauset[name=Options_rcauset_black, black colors]{4,2,7,6,1,5,3}{2/5}}
\\
  (\lstinlineง\tikzcausetsset{black colors}ง activates the option)
\\\midrule
  \lstinlineง\usepackage[gray]{causets}ง for grey scale causets (default)
&amp; \multirow{3}{5em}{%
  \pcauset[name=Options_pcauset_gray, gray colors]{4,2,7,6,1,5,3}}
&amp; \multirow{3}{5em}{%
  \rcauset[name=Options_rcauset_gray, gray colors]{4,2,7,6,1,5,3}{2/5}}
\\
  (\lstinlineง\tikzcausetsset{gray colors}ง activates the option)
\\\midrule
  \lstinlineง\usepackage[blue]{causets}ง for blue causets
&amp; \multirow{2}{5em}{%
  \pcauset[name=Options_pcauset_blue, blue colors]{4,2,7,6,1,5,3}}
&amp; \multirow{2}{5em}{%
  \rcauset[name=Options_rcauset_blue, blue colors]{4,2,7,6,1,5,3}{2/5}}
\\
  (\lstinlineง\tikzcausetsset{blue colors}ง activates the option)
\\\midrule
  \lstinlineง\usepackage[neon]{causets}ง for brightly colored causets
&amp; \multirow{3}{5em}{%
  \pcauset[name=Options_pcauset_neon, neon colors]{4,2,7,6,1,5,3}}
&amp; \multirow{3}{5em}{%
  \rcauset[name=Options_rcauset_neon, neon colors]{4,2,7,6,1,5,3}{2/5}}
\\
  (\lstinlineง\tikzcausetsset{neon colors}ง activates the option)
\\
  Details on color options are given in \autoref{sec:Colors}.
\\\midrule%\midrule
  \lstinlineง\usepackage[spatial]{causets}ง shows dashed lines between spatially separated events (which is a secondary partial order for the causets drawn with \lstinlineง\pcausetง).
  This option only affects the \lstinlineง\pcausetง and \lstinlineง\rcausetง commands, but not the \lstinlineง\causetง command.
&amp; \multirow{7}{5em}{%
  \pcauset[name=Options_pcauset_spatial, spatially linked]{4,2,7,6,1,5,3}}
&amp; \multirow{7}{5em}{%
  \rcauset[name=Options_rcauset_spatial, spatially linked]{4,2,7,6,1,5,3}{2/5}}
\\
  (\lstinlineง\causetsDrawSpatialLinkstrueง activates the option)
\\
  (\lstinlineง\causetsDrawSpatialLinksfalseง deactivates the option)
\\\midrule
  \lstinlineง\usepackage[external]{causets}ง loads the \lstinlineงexternalง library, sets the external file name prefix to ``\lstinlineงcausets/ง'', and enables the use of causet names for the external file names.
  (This feature has to be loaded as option in the preamble not later in the document.)
&amp; \multirow{6}{5em}{%
  \pcauset[name=Options_pcauset]{4,2,7,6,1,5,3}}
&amp; \multirow{6}{5em}{%
  \rcauset[name=Options_rcauset]{4,2,7,6,1,5,3}{2/5}}
\\
  For details on externalization of causets, see \autoref{sec:ExternalCausets}.
\\\bottomrule
\end{longtable}

By default, the links in a diagram are interrupted if they cross over another event (exactly over the event centre).
Any such crossing of links over events can only occur for the links explicitly specified for the \lstinlineง\causetง command or the locally restyled links of the \lstinlineง\rcausetง command, but not for the links drawn by \lstinlineง\pcausetง or automatically drawn links by \lstinlineง\rcausetง.
This feature is activated by default (\lstinlineง\causetsBreakLinkstrueง) and can be  deactivated with \lstinlineง\causetsBreakLinksfalseง, or with the option \lstinlineงcontinuously linkedง.

For example, here is a causet that embeds in 3-dimensional but not in 2-dimensional Minkowski spacetime.
This causet has one event (0) in the centre that is linked to events -3 and 3 but not to events -6 and 6, while a link (blue) from -6 to 6 crosses over it.
\begin{lstlisting}
\usepackage[larger]{causets}
\tikzcausetsset{labels={right, at=east}}
... \begin{document} ...
\causet[brokenly linked]{-1,2,-5,-7,4,-3,-6,0,6,3,-4,7,5,-2,1} {-7/-6,-7/4,-6/-4,-6/6/blue!50!cyan,-5/-4,-5/-3,-4/-2,-4/7, -3/-2,-3/0,-2/1,-1/0,-1/2,0/1,0/3,2/3,2/4,3/5,4/5,4/6,6/7}
\causet[continuously linked]{-1,2,-5,-7,4,-3,-6,0,6,3,-4,7,5,-2,1} {-7/-6,-7/4,-6/-4,-6/6/blue!50!cyan,-5/-4,-5/-3,-4/-2,-4/7, -3/-2,-3/0,-2/1,-1/0,-1/2,0/1,0/3,2/3,2/4,3/5,4/5,4/6,6/7}
\end{lstlisting}
\begin{center}
  \causet[name=BrokenlyLinkedExample_verylarge, very large, labels={right, at=east}]{-1,2,-5,-7,4,-3,-6,0,6,3,-4,7,5,-2,1}{-7/-6,-7/4,-6/-4,-6/6/blue!50!cyan,-5/-4,-5/-3,-4/-2,-4/7,-3/-2,-3/0,-2/1,-1/0,-1/2,0/1,0/3,2/3,2/4,3/5,4/5,4/6,6/7}
  \hspace{1.5cm}
  \causet[name=ContinuouslyLinkedExample_verylarge, very large, labels={right, at=east}, continuously linked]{-1,2,-5,-7,4,-3,-6,0,6,3,-4,7,5,-2,1}{-7/-6,-7/4,-6/-4,-6/6/blue!50!cyan,-5/-4,-5/-3,-4/-2,-4/7,-3/-2,-3/0,-2/1,-1/0,-1/2,0/1,0/3,2/3,2/4,3/5,4/5,4/6,6/7}
\end{center}
Note that the links are drawn in the order given by the second argument.
Similar results are obtained with the following \lstinlineง\rcausetง commands (since version 1.4) 
\begin{lstlisting}
\rcauset[brokenly linked]{-1,2,-5,-7,4,-3,-6,0,6,3,-4,7,5,-2,1} {-7/-3,-6/0,-5/4,-4/5,0/6,3/7,-6/6/blue!50!cyan}
\rcauset[continuously linked]{-1,2,-5,-7,4,-3,-6,0,6,3,-4,7,5,-2,1} {-7/-3,-6/0,-5/4,-4/5,0/6,3/7,-6/6/blue!50!cyan}
\end{lstlisting}
where all pairs of integers in the second argument are links to be removed (by default, get the local style \lstinlineงdraw=noneง).
All links with a local style specified (here the last link only) are drawn in the order they appear after all automatic links have been drawn.
Local styles are explained in \autoref{sec:LocalStyles} in more detail.

All main commands, the short hand macros (see \autoref{sec:ShortHandMacros}), and the command \lstinlineง\causetfileง (see \autoref{sec:ExternalCausets}) add a small padding to the left and right of the diagram for a better spacing within text and mathematical expressions.
The padding is adjustable with \lstinlineงpadding=ง\PH\ and stored in the macro \lstinlineง\causets@Paddingง (by default, it is \lstinlineง\thinspaceง).


\section{Changing the options for individual diagrams}
\label{sec:ShortHandMacros}

Most of the package options introduced in the section before are also defined as keys that can be specified in the optional argument of the three main macros \lstinlineง\pcausetง, \lstinlineง\rcausetง and \lstinlineง\causetง.

Additionally, the package has short hand macros to switch on labels, the permutation grid, or both (\lstinlineง\causetsDrawLabelstrueง, \lstinlineง\causetsDrawPermutationtrueง, or \lstinlineง\tikzcausetsset{ labeled, show permutation}ง) to help compile diagrams.
Since package version 1.5, these short hand macros ending in \lstinlineงLง, \lstinlineงPง and \lstinlineงXง are depreciated, because diagrams can now be designed and exported to \LaTeX\ macros with the \href{https://c-minz.github.io/assets/html/proset-editor.html}{PrOSET editor}.
To use these short hand macros nevertheless, add the following lines to the preamble after importing the package with \lstinlineง\usepackage{causets}ง:
\begin{lstlisting}
\providecommand*{\pcausetP}[2][]{%
{\causetsDrawPermutationtrue\causetsDrawLabelsfalse
\pcauset[#1]{#2}}}
\providecommand*{\pcausetL}[2][]{%
{\causetsDrawPermutationfalse\causetsDrawLabelstrue
\pcauset[#1]{#2}}}
\providecommand*{\pcausetX}[2][]{%
{\causetsDrawPermutationtrue\causetsDrawLabelstrue
\pcauset[#1]{#2}}}
\providecommand*{\causetP}[3][]{%
{\causetsDrawPermutationtrue\causetsDrawLabelsfalse
\causet[#1]{#2}{#3}}}
\providecommand*{\causetL}[3][]{%
{\causetsDrawPermutationfalse\causetsDrawLabelstrue
\causet[#1]{#2}{#3}}}
\providecommand*{\causetX}[3][]{%
{\causetsDrawPermutationtrue\causetsDrawLabelstrue
\causet[#1]{#2}{#3}}}
\providecommand*{\rcausetP}[3][]{%
{\causetsDrawPermutationtrue\causetsDrawLabelsfalse
\rcauset[#1]{#2}{#3}}}
\providecommand*{\rcausetL}[3][]{%
{\causetsDrawPermutationfalse\causetsDrawLabelstrue
\rcauset[#1]{#2}{#3}}}
\providecommand*{\rcausetX}[3][]{%
{\causetsDrawPermutationtrue\causetsDrawLabelstrue
\rcauset[#1]{#2}{#3}}}
\end{lstlisting}

To add labels or the permutation grid to a diagram, specify the respective option in the optional argument of the macro:
\begin{table}[h!]
  \centering
  \begin{tabular*}{\textwidth}{p{0.35\textwidth}p{0.60\textwidth}}
    \toprule
    command with options
  &amp; functionality
  \\\midrule
    \lstinlineง\pcauset[labeled]{1,2,4,3}ง
  &amp; Draws a diagram of a 2-order from a permutation (here 1,2,4,3) and shows labels for the elements (\lstinlineง\causetsDrawLabelstrueง). The output for this example is \pcauset[name=Macro_L, labeled]{1,2,4,3}.
  \\
    \lstinlineง\rcauset[labeled]{...}{...}ง
  &amp; Similar for a 2-order with removed links.
  \\
    \lstinlineง\causet[labeled]{...}{...}ง
  &amp; Similar for a generic diagram.
  \\\midrule
    \lstinlineง\pcauset[permutation]{4,1,2,3}ง
  &amp; Draws a diagram of a 2-order from a permutation (here 4,1,2,3) and shows the permutation grid (\lstinlineง\causetsDrawPermutationtrueง). The output for this example is \pcauset[name=Macro_P, permutation]{4,1,2,3}.
  \\
    \lstinlineง\rcauset[permutation]{...}{...}ง
  &amp; Similar for a 2-order with removed links.
  \\
    \lstinlineง\causet[permutation]{...}{...}ง
  &amp; Similar for a generic diagram.
  \\\midrule
    \multicolumn{2}{l}{These options can be combined (also with other style keys, see below).}
  \\\bottomrule
  \end{tabular*}
  \caption{\label{tab:MainCommandsWithOptions} Main commands with options.}
\end{table}

The short hand macros \lstinlineง\causetFenceง and \lstinlineง\causetCrownง have been removed in version 1.5, since diagrams of fences, crowns, polygons and other posets are supported by the \href{https://c-minz.github.io/assets/html/proset-editor.html}{PrOSET editor} and can be exported as \LaTeX\ macros.


\section{Labeling and replacing events (also to represent infinite causets)}
\label{sec:LabelingReplacing}

Since version v1.3 of the package, it is possible to relabel and replace causet events.
These features are useful for labelling events arbitrarily, and drawing diagrams of infinite causets using ellipsis.

By default, all events get named and labeled by the integers given in the arguments of the commands.
For example, \lstinlineง\pcauset[labeled]{0,2,1}ง creates the diagram \pcauset[labeled]{0,2,1} where the event notes are named \lstinlineง(E0)ง, \lstinlineง(E2)ง, \lstinlineง(E1)ง (which are always created), respectively, while the label nodes have the names \lstinlineง(EL0)ง, \lstinlineง(EL2)ง, \lstinlineง(EL1)ง (which are only created with the \lstinlineงlabeledง option).
If the permutation is displayed as well, the $u$- and $v$-coordinate labels are the nodes \lstinlineง(EULง\PH\lstinlineง)ง and \lstinlineง(EVLง\PH\lstinlineง)ง, with \PH\ taking on the values $\{0, 2, 1 \}$.

To offset the names of all causet events by an integer amount, use the key-value pair \lstinlineงoffset=ง\PH\ to adjust the naming and labelling of events and get distinct event names, while the same integers are used in the command arguments.
Consider the following example.
\begin{lstlisting}
\begin{align*}
  \tikzcausetsset{large}
  \cdots\quad
  \pcauset[permutation, offset=-12]{0,2,1,3}\quad\cdots\quad
  \pcauset[labeled]{0,2,1,3}\quad\cdots\quad
  \pcauset[labeled, offset=12]{0,2,1,3}\quad\cdots
\end{align*}
\end{lstlisting}
\vspace{-1ex}
\begin{align*}
  \tikzcausetsset{large}
  \cdots\quad
  \pcauset[name=Diamond_permoffset, permutation, offset=-12]{0,2,1,3}\quad\cdots\quad
  \pcauset[name=Diamond_labeled, labeled]{0,2,1,3}\quad\cdots\quad
  \pcauset[name=Diamond_labeledoffset, labeled, offset=12]{0,2,1,3}\quad\cdots
\end{align*}
Here, the three commands have the same integer argument \lstinlineง{0,2,1,3}ง, but the events are named with the specified offsets and the labels are adjusted accordingly.
In this way, it will be possible to address the event (and label) nodes of the (sub-)causets distinctively within a larger TikZ picture.
For more details on how to draw causets within a TikZ picture, see \autoref{sec:TikZ}.

When you (only) want to change the labelling of an event to \PH, add a slash and \lstinlineงlabel=ง\PH\ directly after the event integer in the first command argument.
For example, the causet \pcauset{2,1,3} has six different labellings by (distinct) integers from the set $\{ 0, 1, 2 \}$,
%\pagebreak
\begin{lstlisting}
\begin{align}
  \text{order-preserving:} &amp;&amp;
  L_{\mathrm{op}} &amp;=
  \left\{
    \pcauset[labeled]{1,0,2},
    \pcauset[labeled]{1/label=0,0/label=1,2}
  \right\}
  , \\
  \text{not order-preserving:} &amp;&amp;
  L_{\mathrm{nop}} &amp;=
  \left\{
    \pcauset{1/label=2,0/label=1,2/label=0},
    \pcauset[labeled]{1,0/label=2,2/label=0},
    \pcauset[labeled]{1/label=2,0,2/label=1},
    \pcauset{1/label=0,0/label=2,2/label=1}
  \right\}
  .
\end{align}
\end{lstlisting}
\vspace{-1ex}
\begin{align}
  \text{order-preserving:} &amp;&amp;
  L_{\mathrm{op}} &amp;=
  \left\{
    \pcauset[name=Wedge_labeled102, labeled]{1,0,2},
    \pcauset[name=Wedge_labeled012, labeled]{1/label=0,0/label=1,2}
  \right\}
  , \\
  \text{not order-preserving:} &amp;&amp;
  L_{\mathrm{nop}} &amp;=
  \left\{
    \pcauset[name=Wedge_labeled210, labeled]{1/label=2,0/label=1,2/label=0},
    \pcauset[name=Wedge_labeled120, labeled]{1,0/label=2,2/label=0},
    \pcauset[name=Wedge_labeled201, labeled]{1/label=2,0,2/label=1},
    \pcauset[name=Wedge_labeled021, labeled]{1/label=0,0/label=2,2/label=1}
  \right\}
  .
\end{align}

You may use any text as a label.
Longer text labels should be written in a \TeX\ group \lstinlineง{...}ง.
Here is an example
\begin{lstlisting}
\pcauset[large]{2/label=$-\infty$,6,5,7,3/label={Text and $maths$},4/label=-1}
\end{lstlisting}
\vspace{-1ex}
\begin{center}
  \pcauset[name=RelabeledEventsExample_large, large]{2/label=$-\infty$,6,5,7,3/label={Text and $maths$},4/label=-1}
\end{center}

Notice that replaced labels will always be visible, even if labels are deactivated (\lstinlineง\causetsDrawLabelsfalseง) as in this example.
To change the style of the replaced labels, add the key-value pair
\lstinlineงreplaced labels=ง\PH, which extends the style of standard labels.

Similarly to the replacement of labels, you can replace event nodes by using a slash followed by \lstinlineงevent=ง\PH.
This feature may have its main application for the representation of infinite causets, for example, the code
\begin{lstlisting}
% Define ellipsis rotated by #1 degrees:
\newcommand{\rdots}[1][0]{\rotatebox{#1}{...}}
...
% Draw infinite causet with ellipsis
\pcauset[large, replaced labels={below, at=south}, replaced events={text scale=1}]
  {-2/{label={$\downarrow$ continues infinitely $\downarrow$}, event={\rdots[90]}}, -1,0,1,16,14,15,11,12,13,7,8,9,10, 2/event={\rdots[10]},3,4/event={~},5,6/event={\rdots[-10]}}
\end{lstlisting}
yields the diagram
\begin{center}
  \newcommand{\rdots}[1][0]{\rotatebox{#1}{...}}
  \pcauset[name=ReplacedEventsExample_large, large, replaced labels={below, at=south}, replaced events={text scale=1}]
  {-2/{label={$\downarrow$ continues infinitely $\downarrow$}, event={\rdots[90]}}, -1,0,1,16,14,15,11,12,13,7,8,9,10, 2/event={\rdots[10]},3,4/event={~},5,6/event={\rdots[-10]}}
\end{center}
Here, three events are replaced by ellipsis with different rotations, and one event is replaced by an empty node (\lstinlineง~ง).
The style of the replaced events is specified via the key \lstinlineงreplaced labels=ง\PH\ -- where \PH\ is \lstinlineง{text scale=1}ง in this example.
This example also shows how to relabel and replace simultaneously (see the bottom-most event).

The style and the position of all event labels is set with \lstinlineงlabels=ง\PH, while \lstinlineงreplaced labels=ง\PH\ extends this style.
As shown in the previous example, the position of labels is defined with a key word like \lstinlineงleftง, \lstinlineงrightง, \lstinlineงaboveง, \lstinlineงbelowง, etc.\ (see also the TikZ manual) relative to the position given by the key \lstinlineงat=ง\PH.
The \lstinlineงatง key holds a coordinate of the event note.
The default positioning is \lstinlineงbelow left, at=south westง.


\section{Changing sizes and fonts (for mathematical expressions)}
\label{sec:Sizes}

The pre-defined size styles have the following scaling with respect to the normal size:\vspace{-1ex}
\begin{itemize}\itemsep=-1ex
  \item \lstinlineงtinyง is $\frac{1}{3}$ times the normal size
  \item \lstinlineงvery smallง is $\frac{4}{9}$ times the normal size
  \item \lstinlineงsmallง is $\frac{2}{3}$ times the normal size
  \item \lstinlineงlargeง is $\frac{3}{2}$ times the normal size
  \item \lstinlineงvery largeง is $\frac{9}{4}$ times the normal size
  \item \lstinlineงhugeง is $3$ times the normal size
\end{itemize}
Apart from the pre-defined sizes, a causet can be scaled to any size using \lstinlineงsize unit=ง\PH\ (which is equal to the tile size, \lstinlineงtile size=ง\PH).
The normal size unit has the value \lstinlineง0.9exง.

I recommend to change the size of a causet when used in indices or limits for mathematical expression.
For a (first level) sub-script in a summation, you may use the small size,
\begin{lstlisting}
\begin{equation}
    \sum_{C \in \tikzcausetsset{small}
      \Bigl\{ \pcauset{1,2,3}, \pcauset{1,3,2,4}, \pcauset{1,4,3,2,5}, \pcauset{1,5,4,3,2,6} \Bigr\}} | C |
  = \left| \pcauset{1,2,3} \right|
    + \left| \pcauset{1,3,2,4} \right|
    + \left| \pcauset{1,4,3,2,5} \right|
    + \left| \pcauset{1,5,4,3,2,6} \right|
\end{equation}
\end{lstlisting}
\begin{equation}
    \sum_{C \in \tikzcausetsset{small}
      \Bigl\{
        \pcauset[name=3Chain_small]{1,2,3},
        \pcauset[name=Diamond_small]{1,3,2,4},
        \pcauset[name=Pure3Diamond_small]{1,4,3,2,5},
        \pcauset[name=Pure4Diamond_small]{1,5,4,3,2,6}
      \Bigr\}}
    | C |
  = \left| \pcauset[name=3Chain]{1,2,3} \right|
    + \left| \pcauset[name=Diamond]{1,3,2,4} \right|
    + \left| \pcauset[name=Pure3Diamond]{1,4,3,2,5} \right|
    + \left| \pcauset[name=Pure4Diamond]{1,5,4,3,2,6} \right|
\end{equation}

Like any other options, sizes can also be specified in the optional argument of a single causet diagram or with \lstinlineง\tikzcausetsset{...}ง for the current scope.

If you need to set the sizes of individual components of a causet, use the keys \vspace{-1ex}
\begin{itemize}\itemsep=-1ex
  \item \lstinlineงtile size=ง\PH\ to store \PH\ in the macro \lstinlineง\causetTileSizeง as the size of the tiles in the permutation (this is equivalent to setting the size unit),
  \item \lstinlineงregion line width=ง\PH\ to set the thickness for the line surrounding the permutation region,
  \item \lstinlineงgrid line width=ง\PH\ to set the line thickness of the permutation grid,
  \item \lstinlineงevent size=ง\PH\ to set the diameter of the events,
  \item \lstinlineงevent outline=ง\PH\ to set the thickness of the transparent line around the events,
  \item \lstinlineงlink width=ง\PH\ to set the link thickness, and
  \item \lstinlineงbroken link gap=ง\PH\ to set the link gap before and after an event that interrupts a link.
\end{itemize}

The text of all labels is sized independently to the other components of the causet diagrams.
To adjust the text typesetting, use \vspace{-1ex}
\begin{itemize}\itemsep=-1ex
  \item \lstinlineงtext font=ง\PH\ to set the font used for all the text labels -- for example, \lstinlineงtext font=\fontsize{13}{15.6}\selectfontง\ sets the font size to 13pt (and the baseline skip to 1.2 times this font size),
  \item \lstinlineงtext scale=ง\PH\ to set the scaling factor of all the text labels (relative to the font size).
\end{itemize}
The pre-defined size styles use the following font sizes, \vspace{-1ex}
\begin{itemize}\itemsep=-1ex
  \item \lstinlineงtinyง is typeset with \lstinlineง\tinyง (scaled by 0.30)
  \item \lstinlineงvery smallง is typeset with \lstinlineง\tinyง (scaled by 0.40)
  \item \lstinlineงsmallง is typeset with \lstinlineง\scriptsizeง (scaled by 0.43)
  \item \lstinlineงnormalง is typeset with \lstinlineง\footnotesizeง (scaled by 0.56)
  \item \lstinlineงlargeง is typeset with \lstinlineง\smallง (scaled by 0.75)
  \item \lstinlineงvery largeง is typeset with \lstinlineง\normalsizeง (scaled by 1.02)
  \item \lstinlineงhugeง is typeset with \lstinlineง\Largeง (scaled by 0.97)
\end{itemize}

Below is an example for a diagram drawn with some sizes defined manually:
\begin{lstlisting}
\pcauset[labeled, tile size=2ex, event size=1ex, link width=0.3ex, text scale=1]{13,8,14,9,3,15,12,1,6,16,5,11,7,2,10,4}
\end{lstlisting}
\begin{center}
  \pcauset[name=Example_resized, labeled, tile size=2ex, event size=1ex, link width=0.3ex, text scale=1]{13,8,14,9,3,15,12,1,6,16,5,11,7,2,10,4}
\end{center}
\vspace{1ex}


\section{Changing colors}
\label{sec:Colors}

Colors can be set with the following keys: \vspace{-1ex}
\begin{itemize}\itemsep=-1ex
  \item \lstinlineงregion color=ง\PH\ (or \lstinlineงregion color=ง\PH) for the frame of the permutation grid
  \item \lstinlineงgrid color=ง\PH\ (or \lstinlineงgrid color=ง\PH) for the lines of the permutation grid
  \item \lstinlineงtile color=ง\PH\ (or \lstinlineงtile color=ง\PH) for the occupied tiles
  \item \lstinlineงulabel color=ง\PH\ (or \lstinlineงulabel color=ง\PH) for the $u$ labels
  \item \lstinlineงvlabel color=ง\PH\ (or \lstinlineงvlabel color=ง\PH) for the $v$ labels
  \item \lstinlineงevent color=ง\PH\ (or \lstinlineงevent color=ง\PH) for the events
  \item \lstinlineงlabel color=ง\PH\ (or \lstinlineงlabel color=ง\PH) for the event labels
  \item \lstinlineงlink color=ง\PH\ (or \lstinlineงlink color=ง\PH) for the links
  \item \lstinlineงspatial link color=ง\PH\ (or \lstinlineงspatial link color=ง\PH) for the spatial links.
\end{itemize}
When using any of these key-value pairs in an optional arguments of the causet macros, they apply to that diagram.
To change colors within a scope or the entire document, use the \lstinlineง\tikzcausetssetง macro, for example
\begin{lstlisting}
\tikzcausetsset{event color=purple, link color=cyan}
\end{lstlisting}
changes the event color to purple and the link color to cyan.

For the pre-defined color schemes, use the keys \lstinlineงgray colorsง (or \lstinlineงgray colorsง, default), \lstinlineงblack colorsง (or \lstinlineงblack colorsง, only black and white), \lstinlineงblue colorsง (or \lstinlineงblue colorsง, blue color tones), or \lstinlineงneon colorsง (or \lstinlineงneon colorsง, bright colors).
These keys set all the colors listed above to pre-defined values.


\section{Changing the styles of individual events and links}
\label{sec:LocalStyles}

The full supported formats of the three main commands are
\\[1ex]
\lstinlineง\pcauset[ง\PH[causet style]\lstinlineง]{ง\PH[index]\lstinlineง/ง\PH[event style]\lstinlineง,...}ง
\\[1ex]
\lstinlineง\rcauset[ง\PH[causet style]\lstinlineง]{ง\PH[index]\lstinlineง/ง\PH[event style]\lstinlineง,...}{ง\PH[unlink from]\lstinlineง/ง\PH[unlink to]\lstinlineง,...,ง
\\\PH[link from]\lstinlineง/ง\PH[link to]\lstinlineง/ง\PH[link style]\lstinlineง,...}ง
\\[1ex]
\lstinlineง\causet[ง\PH[causet style]\lstinlineง]{ง\PH[index]\lstinlineง/ง\PH[event style]\lstinlineง,...}{ง\PH[link from]\lstinlineง/ง\PH[link to]\lstinlineง/ง\PH[link style]\lstinlineง,...}ง
\\[1ex]
and similarly for all short hand macros as described in \autoref{sec:ShortHandMacros}.
The style values are all optional, where \PH[causet style] is applied to that causet only, \PH[event style] is applied to a single event, and \PH[link style] is applied to a single link.

The feature to apply styles only to individual events and links is to highlight or modify subsets of a causet, for example, by using different colors: 
\begin{lstlisting}
\rcauset[labeled, large, subset A/.style={red, dotted}, subset B/.style=blue, replaced labels={text scale=1, at=east, right}]{2/{subset A, label=event $a$}, 5/subset B, 1, 3/{subset A, label=$b$, replaced labels=orange}, 4/subset B, 6/subset B}{2/3/subset A, 4/6/subset B, 5/6/subset B}
\end{lstlisting}
\vspace{-1ex}
\begin{center}
  \rcauset[name=Example_locallystyled, labeled, large, subset A/.style={red, dotted}, subset B/.style=blue, replaced labels={text scale=1, at=east, right}]{2/{subset A, label=event $a$}, 5/subset B, 1, 3/{subset A, label=$b$, replaced labels=orange}, 4/subset B, 6/subset B}{2/3/subset A, 4/6/subset B, 5/6/subset B}
\end{center}
Note that \lstinlineงlabel=event $a$ง and \lstinlineงlabel=$b$ง adds (replaced) labels $a$ and $b$, respectively, but their style is not affected by \lstinlineงsubset Aง.
To change the style of the labels, we have to use the \lstinlineงreplaced labelsง key, see also \autoref{sec:LabelingReplacing}.


\section{Externalisation and standalone causets}
\label{sec:ExternalCausets}

For any document that contains many (large) causet diagrams or the same causets that are used repeatedly, the compilation time can be reduced by moving the graphics to external files using the externalisation library of TikZ or \lstinlineงstandaloneง files.

The externalisation feature of TikZ provides the tools to automatically externalise all causet diagrams and only recompile them when they are changed in the document.
To enable this feature, use the \lstinlineงexternalง option when loading the package and make sure that the document is compiled with the flag 
\begin{lstlisting}
--shell-escape
\end{lstlisting}
The \lstinlineงexternalง option loads the \lstinlineงexternalง library, sets the \lstinlineงprefixง to add ``\lstinlineงcausets/ง'' before each external file, and calls \lstinlineง\causetsNameExternaltrueง to use the manually specified names for external file names.
Any causet can be manually named by providing the name key-value pair \lstinlineงname=ง\PH\ in the optional parameter of a causet command.
As an example, the inline code 
\begin{lstlisting}
\pcauset[name=Vee, alt={Vee}]{1,3,2}
\end{lstlisting}
yields the causet \pcauset[name=Vee, alt={Vee}]{1,3,2} and creates an external pdf file with the name \lstinlineงcausets/Vee.pdfง relative to the main tex file.
The alternative text \lstinlineงalt={ง\PH\lstinlineง}ง may be the same as name for short names (like here), but the file names are usually shorter.

I recommend to always name causets, even if externalisation is not used.
In this way, it is easier to read the source code and switch to externalising at a later point more easily.
Note that the name of a causet does not have to be unique (especially if it is used repeatedly throughout the document), but you may give different names to causets with different style options to avoid unwanted overwrites.
For a repeated causet in the document, either use the same code or the \lstinlineง\causetfileง macro.
For example, \lstinlineง\pcauset[name=N]{2,4,1,3}ง can be repeated with \lstinlineง\causetfile{N}ง to print the N causet \pcauset[name=N]{2,4,1,3}.
The macro \lstinlineง\causetfile[#1]{#2}ง also accepts one optional argument \lstinlineง[#1]ง and expands to
\begin{lstlisting}
\causets@Padding%
\includegraphics[#1]{\causets@NamePrefix#2}%
\causets@Padding
\end{lstlisting}
To redefine the prefix stored in \lstinlineง\causets@NamePrefixง and also set the \lstinlineงexternalง library prefix to the same value, use \lstinlineง\tikzcausetsset{set prefix=causets/}ง.
However, to set \lstinlineง\causets@NamePrefixง only for \lstinlineงcausetsง but not for other TikZ externalisation, use \lstinlineงname prefix=ง\PH.

If you are already loading the \lstinlineงexternalง library for other uses, you do not want to use the \lstinlineงexternalง option, but add the following to the document's preamble: 
\begin{lstlisting}
\usetikzlibrary{external}
...
\usepackage{causets}
\tikzcausetsset{set prefix=causets/, name external=true}
\end{lstlisting}
For externalising only those causets that are named manually, set 
\begin{lstlisting}
\tikzset{external/only named=true}
\end{lstlisting}
For switching externalisation on/off all together, the library provides the macros 
\begin{lstlisting}
\tikzexternaldisable
\tikzexternalenable
\end{lstlisting}
Please find further information on the \lstinlineงexternalง library in the TikZ manual.

Graphics may also be moved to standalone tex files manually and included with \lstinlineง\causetfileง or \lstinlineง\includegraphicsง.
For example, create a file named \lstinlineงM.texง in the directory that was set to \lstinlineงname prefixง (by default, this is ``\lstinlineง./ง'') with the following code:
\begin{lstlisting}
\documentclass[tikz]{standalone}
\usepackage{causets}
\begin{document}
\pcauset{4,2,5,1,3}
\end{document}
\end{lstlisting}
The compiled diagram \pcauset[name=M, alt={M}]{4,2,5,1,3} is then included with the macro \lstinlineง\causetfile[alt={M}]{M}ง (where \lstinlineงaltง is directly passed to \lstinlineง\includegraphicsง to be processed with \LaTeXML).

More examples on larger standalone graphics are given in \autoref{sec:TikZ}.


\section{Style changes in detail}
\label{sec:StyleDetails}

In the optional argument of the causet macros, you may use other TikZ options to change the output of the macros, for example:
\begin{lstlisting}
\usepackage{causets}
... \begin{document} ...
A labeled causet with red-framed semi-transparent labels, \pcauset[labels={draw=red, fill=white, opacity=0.8, inner sep=1pt, scale=1.5}]{2,4,5,1,3}.
\end{lstlisting}
A labeled causet with red-framed semi-transparent labels, \pcauset[name=NDash_redframedlabels, labels={draw=red, fill=white, opacity=0.8, inner sep=1pt, scale=1.5}]{2,4,5,1,3}.

In the same way, it is possible to modify the existing styles of all parts of the diagrams, which means that the default drawing styles are extended by the options passed as value to these keys: \vspace{-1ex}
\begin{enumerate}\itemsep=-1ex
  \item \lstinlineงregion=ง\PH\ shows the permutation (\lstinlineงshow permutationง) and appends to the style of the permutation frame,
  \item \lstinlineงgrid=ง\PH\ shows the permutation (\lstinlineงshow permutationง) and appends to the style of the permutation grid,
  \item \lstinlineงtiles=ง\PH\ shows the permutation (\lstinlineงshow permutationง) and appends to the style of the occupied permutation tiles,
  \item \lstinlineงevents=ง\PH\ appends to the style of the event nodes (graph vertices),
  \item \lstinlineงlinks=ง\PH\ shows the links (\lstinlineงshow linksง) and appends to the style of the links (main graph edges),
  \item \lstinlineงlink starts=ง\PH\ sets the starting line tip of each link,
  \item \lstinlineงlink ends=ง\PH\ sets the ending line tip of each link,
  \item \lstinlineงlink pauses=ง\PH\ sets the ending line tip of each link at an interruption,
  \item \lstinlineงlink resumes=ง\PH\ sets the starting line tip of each link at an interruption,
  \item \lstinlineงcap linksง sets the starting and ending line tip of each link to a (reversed) cap,
  \item \lstinlineงarrow linksง sets the ending line tip of each link to a rounded, stealth arrow,
  \item \lstinlineงspatial links=ง\PH\ shows the spatial links (\lstinlineงshow spatial linksง) and appends to the style of the spatial links (secondary graph edges),
  \item \lstinlineงall labels=ง\PH\ appends to the general style of all text labels (applies to the following three label types),
  \item \lstinlineงlabels=ง\PH\ shows the event labels (\lstinlineงshow labelsง) and appends to the style that applies only to the event labels,
  \item \lstinlineงulabels=ง\PH\ shows the $u$ labels (\lstinlineงshow ulabelsง) and appends to the style that applies only to the $u$ labels, and
  \item \lstinlineงvlabels=ง\PH\ shows the $v$ labels (\lstinlineงshow vlabelsง) and appends to the style that applies only to the $v$ labels.
\end{enumerate}
In order to manually define the full style of the parts in the diagram -- not extending, but \emph{overwriting all} drawing options -- set the style of the following keys: \vspace{-1ex}
\begin{enumerate}\itemsep=-1ex
  \item \lstinlineงevery causetง for the general style of the causet diagram (like \lstinlineงbaselineง, see below),
  \item \lstinlineงevery tileง for the occupied permutation tiles,
  \item \lstinlineงevery eventง for the event nodes (graph vertices),
  \item \lstinlineงevery gridง for the permutation grid,
  \item \lstinlineงevery regionง for the permutation region,
  \item \lstinlineงevery label baseง for all text labels,
  \item \lstinlineงevery ulabelง for the permutation $u$ labels,
  \item \lstinlineงevery vlabelง for the permutation $v$ labels,
  \item \lstinlineงevery linkง for the links (graph edges),
  \item \lstinlineงevery spatial linkง for the spacelike separations, and
  \item \lstinlineงevery labelง for the event labels.
\end{enumerate}
With the macro \lstinlineง\tikzcausetsset{...}ง, any of these styles can also be set in the preamble of the document.
So, for example,
\begin{lstlisting}
\usepackage{causets}
\tikzcausetsset{events={rectangle}, links={-Triangle Cap[]}}
... \begin{document} ...
\pcauset[large]{2,4,5,1,3}
\end{lstlisting}
will generate all causets with square nodes as events and triangle caps on the future (upper) link ends, like \pcauset[name=NDash_rectangleeventslarge, large, events={rectangle}, links={-Triangle Cap[]}]{2,4,5,1,3}.
\vspace{1ex}

By default, causets are placed such that a pre-defined coordinate point falls on the text baseline, \lstinlineงbaseline=(baseline point)ง.
The baseline point is \lstinlineงtile sizeง/$\sqrt{2}$ below the centre of the diagram.
You may adjust the baseline as for any TikZ graphic, for example,
\begin{lstlisting}
\pcauset[baseline=2mm]{2,4,5,1,3}
\end{lstlisting}
places the diagram centre $2\mathrm{mm}$ below the text base, \pcauset[name=NDash_baseline, baseline=2mm]{2,4,5,1,3}.
\vspace{1ex}


\section{Using this package in TikZ pictures}
\label{sec:TikZ}

Since the package is TikZ based, using a causet within a TikZ picture is simple.
Each of the three main commands is based on a draw command in TikZ that has the same name but starts with \lstinlineง\draw...ง.
The \lstinlineง\drawง macros, however, do not support an optional argument (since this can be specified directly in a TikZ picture) and they also do not have any short hand macros ending in \lstinlineงPง, \lstinlineงLง or \lstinlineงXง.
The \lstinlineง\draw...ง do not add extra padding (\lstinlineง\causets@Paddingง) on the left and right of the graphic either.

The two following examples are given by external (standalone) TikZ graphics and included with \lstinlineง\includegraphics{...}ง.
More details on using causets in standalone files are given in \autoref{sec:ExternalCausets}.

Note that the output of the \lstinlineง\drawง macros has the point (0,0) in the centre, so in order to shift it, we may enclose it in a TikZ scope, for example:
\lstinputlisting{causets_example1.tex}
\begin{center}
  \includegraphics{causets_example1}
\end{center}

Note that this example also shows how to use the event nodes that are generated by the \lstinlineง\drawpcausetง macro.
The green arrow points to the node of the second causet event \lstinlineง(E5)ง.
The causet events, event labels, $u$-axis labels, and $v$-axis lables are the nodes \lstinlineง(Ei)ง, \lstinlineง(ELi)ง, \lstinlineง(EULi)ง, and \lstinlineง(EVLi)ง, respectively, where $\smash{i \in [ -1, 5 ]}$.

It is also possible to use multiple causets in more complicated graphics, like a tree for example, but note that whenever a causet is actually a text of a node within a TikZ picture (like in the following), we need to use the \lstinlineง\pcausetง (\lstinlineง\rcausetง or \lstinlineง\causetง) commands without the \lstinlineงdrawง prefix again:
\lstinputlisting{causets_example2.tex}
\begin{center}
  \includegraphics[scale=0.80]{causets_example2}
  (rescaled to 80\%)
\end{center}

\clearpage


\tikzexternaldisable


\section{Release notes}
\label{sec:ReleaseNotes}

\definecolor{XMLv1.5}{rgb}{0.44,0.12,0.6}
\tikzcausetsset{large, events={black!30}, links={black!30}, label color={black!40}}


\subsection[v1.5 (Butterfly)]{v1.5, 2025-02-24}

\subsubsection{New features}

\begin{itemize}\itemsep=-1ex
\item \versioncauset{v1-5}{\pcauset{1,5,3,6/{XMLv1.5, label=XML, labels={XMLv1.5, above=1ex, at=north}},2,4}}%
  Added support for \LaTeXML\ including the key \lstinlineงalt={ง\PH\lstinlineง}ง to define an alternative text representing a diagram for screen readers.
\item Added references to a supporting online tool, the \href{https://c-minz.github.io/assets/html/proset-editor.html}{PrOSET editor}.
\end{itemize}

\subsubsection{Modifications and fixes}

\begin{itemize}\itemsep=-1ex
\item The short hand macros \lstinlineง\pcausetLง, \lstinlineง\pcausetPง, \lstinlineง\pcausetXง, \lstinlineง\rcausetLง, \lstinlineง\rcausetPง, \\\lstinlineง\rcausetXง, \lstinlineง\causetLง, \lstinlineง\causetPง and \lstinlineง\causetXง are now depreciated.\\
Write \lstinlineง\pcauset[labeled]ง, \lstinlineง\pcauset[permutation]ง, \lstinlineง\pcauset[permutation, labeled]ง, etc. instead, or use the PrOSET editor to design diagrams.
\item Removed the short hand macros \lstinlineง\causetFenceง and \lstinlineง\causetCrownง.
\item Corrected typos in the manual.
\end{itemize}


\subsection[v1.4, 2023-03-06 (Vee-Diamond)]{v1.4, 2023-03-06}

\subsubsection{New features}

\begin{itemize}\itemsep=-1ex
\item \versioncauset{v1-4}{\rcauset[release/.style={black!40!cyan!85}]{1,5/release,3,2,4}{1/5/release}}%
  Second values in the sequence of the first argument: now modifies the style of individual events, the events are replaced with the key \lstinlineงevent=ง\PH, and the labels are set with \lstinlineงlabel=ง\PH.
\item Third values in the sequence of the second argument of \lstinlineง\causetง and \lstinlineง\rcausetง: to modify the style of individual links.
\item Broken links for restyled links of \lstinlineง\rcausetง: restyled links can also be drawn between events that would have not been automatically linked, hence these links might now be broken up like the links of \lstinlineง\causetง.
\item New key \lstinlineงname=ง\PH: to define a name of a causet for easier readability of the tex source code (and to be used as external file name when the corresponding package option has been activated).
\item New option \lstinlineงexternalง: to load the \lstinlineงexternalง library of TikZ for automatic externalisation of all diagrams.
\item New key \lstinlineงset prefix=ง\PH: to pass a file name prefix that is combined with a causet name for the external files when using \lstinlineงexternalง.
\item New key \lstinlineงname external=ง\PH[bool]: to activate/deactivate using the causet names for external files.
\item Main commands: padded by a thin space (adjustable with \lstinlineงpadding=ง\PH) for a better spacing in text and math mode.
\end{itemize}

\subsubsection{Modifications and fixes}

\begin{itemize}\itemsep=-1ex
\item Third values in the sequence of the first argument: no longer supported.
\item Spatial links: are now drawn before (so on a lower layer than) links.
\item Style \lstinlineงarrow linksง: the arrow heads are now filled.
\item Macro \lstinlineง\causetspathง: has been replaced by \lstinlineงname prefix=ง\PH.
\item Short-hand macro \lstinlineง\causetCrownง: changed to take a single argument (and the optional style argument) and returns the same output as \lstinlineง\causetClosedFenceง used to, which has been removed.
\end{itemize}

\subsection[v1.3.1, 2022-07-27 (Diamond)]{v1.3.1, 2022-07-27}
\subsubsection{Modifications and fixes}
\begin{itemize}\itemsep=-1ex
\item \versioncauset{v1-3-1}{\pcauset[replaced labels={left=0.5ex, at=west}]{1,3,2,4/label=.3}}%
  Automatic event labels: now correctly printed when using \lstinlineงoffset=ง\PH.
\end{itemize}


\subsection[v1.3, 2022-05-23 (Da)]{v1.3, 2022-05-23}

\subsubsection{New features}

\begin{itemize}\itemsep=-1ex
\item %\versioncauset{v1-3}{\pcauset[replaced labels={left=0.5ex, at=west}]{1,4,2,3/label=.3}}%
  Integer sequences in the arguments: use a permutation of an interval $[ a, b ]$, where $a$ and $b$ do no longer have to be natural numbers but can be any integers ($a \leq b$) including 0 and negative numbers.
  These numbers name and label the events of the causet if the respective options are chosen.
\item Second values in the sequence of the first argument: to change the name and label of events.
\item New key \lstinlineงoffset=ง\PH\ (0 by default): to define an integer shift for all events before they are named and labeled.
\item New style \lstinlineงtext font=ง\PH\ (additionally to \lstinlineงtext scale=ง\PH): to adjust the font style of text (labels), for example, to set the font size to 20pt (and a baseline skip of 24pt), use \lstinlineงtext font=\fontsize{20}{24}\selectfontง
\end{itemize}

\subsubsection{Modifications and fixes}

\begin{itemize}\itemsep=-1ex
\item Size options: all sizes are now scaled with respect to the normal size.
\item Event style: line thickness of the event outline has been corrected.
\item Size macros removed: \lstinlineง\causetRegionLineง, \lstinlineง\causetGridLineง, \lstinlineง\causetEventSizeง, \\ \lstinlineง\causetLinkWidthง, and \lstinlineง\causetBrokenLinkGapง.
  The respective values are now stored in PGF keys and are measured with respect to the size unit (stored in \lstinlineง\causetTileSizeง).
\item All package options: reduced to single words.
\item Permutation for \lstinlineง\*causetL...ง: now deactivated (if activated previously), by default.
\item Labels for \lstinlineง\*causetP...ง: now deactivated (if activated previously), by default.
\end{itemize}


\subsection[v1.2, 2022-02-07 (Vee)]{v1.2, 2022-02-07}

\subsubsection{New features}

\begin{itemize}\itemsep=-1ex
\item \versioncauset{v1-2}{\pcauset[arrow links]{1,3,2}}%
  New style \lstinlineงat=ง\PH: to specify the relative point of events (\lstinlineงat=ง\PH, by default) and position relative to this point using TikZ keys \lstinlineงleft=ง\PH, \lstinlineงright=ง\PH, etc.
\item New styles \lstinlineงcap linksง and \lstinlineงarrow linksง: add different arrow tips to the start and end of links.
\item New styles \lstinlineงlink starts=ง\PH\ and \lstinlineงlink ends=ง\PH: to modify arrow tips to the start and end of links.
\item Broken links for \lstinlineง\causetง: links crossing over unlinked events are broken up now.
\item New styles \lstinlineงlink pauses=ง\PH\ and \lstinlineงlink resumes=ง\PH: to set the link ending style (arrows) at breaking points.
\item Spatial links for \lstinlineง\rcausetง: spatial links for spacelike separated events are now supported by \lstinlineง\rcausetง, too.
\end{itemize}

\subsubsection{Modifications and fixes}

\begin{itemize}\itemsep=-1ex
\item Color option \lstinlineงblueง: blue colors are now different shades of blue, gray and black only.
\end{itemize}


\subsection[v1.1, 2020-12-15 (2-Chain)]{v1.1, 2020-12-15}

\subsubsection{New features}

\begin{itemize}\itemsep=-1ex
\item \versioncauset{v1-1}{\pcauset{1,2}}%
  All colors, size and style options have been moved to PGF keys in the path
\begin{lstlisting}
/tikz/causets/
\end{lstlisting}
\end{itemize}

\subsection[v1.0, 2020-11-08 (Singleton)]{v1.0, 2020-11-08}

\begin{itemize}\itemsep=-1ex
\item \versioncauset{v1-0}{\pcauset{1}}%
  First release of the package \lstinlineงcausetsง on CTAN, \url{https://ctan.org/pkg/causets}, including all the main commands.
\end{itemize}

\noindent
All previous package versions are at \\
\url{https://github.com/c-minz/LaTeX-causets/tree/main/previous_versions}


\section{Bug reports and package requests}
\label{sec:PackageDevelopment}

To see reported problems, go to \url{https://github.com/c-minz/LaTeX-causets/issues}

If you have a problem when using the package or you would like to have another feature to be implemented, please write a message to \\
christoph(dot)minz(AT)gmail(dot)com\\
For reporting a bug, I much appreciated if you do the following:
\begin{itemize}\itemsep=-1ex
\item Check the issues reported previously if your problem is already listed.
\item Describe your problem including the errors and warning messages, information about the drivers and programs versions.
\item Provide a minimal, working test file (only a single \TeX\ file) that demonstrates the problem.
\end{itemize}

\end{document}
</pre></body></html>