texlive[63366] Master/texmf-dist: causets (22may22)
commits+karl at tug.org
commits+karl at tug.org
Sun May 22 22:19:01 CEST 2022
Revision: 63366
http://tug.org/svn/texlive?view=revision&revision=63366
Author: karl
Date: 2022-05-22 22:19:01 +0200 (Sun, 22 May 2022)
Log Message:
-----------
causets (22may22)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/causets/README.md
trunk/Master/texmf-dist/doc/latex/causets/causet_tikz_example1.pdf
trunk/Master/texmf-dist/doc/latex/causets/causet_tikz_example1.tex
trunk/Master/texmf-dist/doc/latex/causets/causet_tikz_example2.pdf
trunk/Master/texmf-dist/doc/latex/causets/causet_tikz_example2.tex
trunk/Master/texmf-dist/doc/latex/causets/causets.pdf
trunk/Master/texmf-dist/doc/latex/causets/causets.tex
trunk/Master/texmf-dist/tex/latex/causets/causets.sty
Modified: trunk/Master/texmf-dist/doc/latex/causets/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/causets/README.md 2022-05-22 13:13:46 UTC (rev 63365)
+++ trunk/Master/texmf-dist/doc/latex/causets/README.md 2022-05-22 20:19:01 UTC (rev 63366)
@@ -1,7 +1,7 @@
-LaTeX Package: causets
-======================
-This is a LaTeX package to create (Hasse) diagrams of causal sets - short causets (locally finite, partially ordered sets) to be used inline with text or mathematical expressions, as well as with TikZ pictures.
+# The `causets` package
+The LaTeX package `causets` lets you create (Hasse) diagrams of causal sets. Causal sets (causets) are locally finite, partially ordered sets and are consider as a framework for quantum gravity. This package is built on the package `tikz`, which is usually included in the standard LaTeX installations and loaded automatically with `\usepackage{causets}`.
+The diagrams can be used inline with text or mathematical expressions, or they may be included in a TikZ pictures.
The three main commands (macros) are
```tex
% causet generated from a permutation:
@@ -13,13 +13,11 @@
```
For a full documentation, please see causets.pdf.
+The documentation includes some examples.
+More examples are included at
+https://github.com/c-minz/LaTeX-causets/tree/main/examples
-Additional Packages
-===================
-This package is built on the package `tikz`, which is usually included in the standard LaTeX installations.
-
-Bug Reports
-===========
+## Bug reports
Problems with the package are reported here:
https://github.com/c-minz/LaTeX-causets/issues
@@ -34,12 +32,11 @@
C. Minz
christoph{dot}minz[AT]gmail{dot}com
-Information on Distribution
-===========================
+## License and distribution
Copyright 2020-2022 by C. Minz
-This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 of this license or (at your option) any later version.
-The latest version of this license is in
+This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 of this licence or (at your option) any later version.
+The latest version of this licence is in
http://www.latex-project.org/lppl.txt
This work has the LPPL maintenance status "maintained".
@@ -47,7 +44,7 @@
The current maintainer of this work is C. Minz.
https://github.com/c-minz
-Current version: 1.2
+**Current version: v1.3**
CTAN location: /graphics/pgf/contrib/causets/
Modified: trunk/Master/texmf-dist/doc/latex/causets/causet_tikz_example1.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/causets/causet_tikz_example1.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/causets/causet_tikz_example1.tex 2022-05-22 13:13:46 UTC (rev 63365)
+++ trunk/Master/texmf-dist/doc/latex/causets/causet_tikz_example1.tex 2022-05-22 20:19:01 UTC (rev 63366)
@@ -1,18 +1,23 @@
\documentclass[tikz]{standalone}
-\usepackage[permutation,huge,neon]{causets}
+\usepackage[permutation,larger,neon]{causets}
\usetikzlibrary{fit,shapes.geometric}
\begin{document}
\begin{tikzpicture}
+ % Create causet, shifted in x- and y-direction:
\begin{scope}[xshift=3cm, yshift=-1cm]
+ \tikzcausetsset{offset=-2}
\drawpcauset{5,2,7,3,6,1,4}
\draw[red, double] (0, 0) circle[radius=0.1];
\end{scope}
- \node[draw=blue, inner sep=1pt, thick, ellipse, fit=(E4) (E6) (E7)] (Finf) {};
- \node[draw=blue] (FinfLabel) at (6.5, -0.5) {future infinity};
- \node[draw=red] (centerLabel) at (0.5, -0.5) {center};
- \node[draw=green!50!black] (myEventLabel) at (5.5, -2.5) {event (E2)};
+ % Circumscribe the future infinity:
+ \node[draw=blue, inner sep=1pt, thick, ellipse, fit=(E2) (E4) (E5)] (Finf) {};
+ % Add labels on top:
+ \node[draw=blue, right, align=right] (FinfLabel) at (4.8, -0.5) {future infinity / \\ maximal events};
+ \node[draw=red] (centerLabel) at (0.5, -0.5) {centre};
+ \node[draw=green!50!black] (myEventLabel) at (5.5, -2.5) {event (E0)};
+ % Draw arrows from the labels to the references:
\draw[ultra thick, blue, ->] (FinfLabel) -- (Finf);
\draw[ultra thick, red, ->] (centerLabel) -- (3, -1);
- \draw[ultra thick, green!50!black, ->] (myEventLabel) -- (E2);
+ \draw[ultra thick, green!50!black, ->] (myEventLabel) -- (E0);
\end{tikzpicture}
\end{document}
Modified: trunk/Master/texmf-dist/doc/latex/causets/causet_tikz_example2.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/causets/causet_tikz_example2.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/causets/causet_tikz_example2.tex 2022-05-22 13:13:46 UTC (rev 63365)
+++ trunk/Master/texmf-dist/doc/latex/causets/causet_tikz_example2.tex 2022-05-22 20:19:01 UTC (rev 63366)
@@ -1,69 +1,101 @@
\documentclass[tikz]{standalone}
-\usepackage[blue]{causets}
+\usepackage[black]{causets}
\usetikzlibrary{fit,shapes.geometric}
+% Set colours and style:
+\colorlet{future colour}{green!50!black}
+\colorlet{past colour}{yellow!50!orange!80!black}
+\colorlet{anywhere colour}{red!80!black}
+\tikzset{prob arrow/.style={line width=1.5pt}}
+% Define some helper functions:
+\def\defCevents#1#2#3{\xdef\Ea{#1}\xdef\Eb{#2}\xdef\Ec{#3}}
+\def\defDevents#1#2#3#4{\expandafter\defCevents#1#2#3\xdef\Ed{#4}}
+\newcommand*{\semiopaque}[1]{% Adds a transparency group.
+\begin{scope}[transparency group, opacity=0.5]
+ #1
+\end{scope}
+}
+\newcommand*{\drawprobarrow}[4][]{% Draws a (probability) arrow.
+\draw[prob arrow] (#2) -- node[sloped, midway, below, #1] {$#3$} (#4);
+}
+\newcommand{\drawlegendsymbol}{% Draws the symbol for a legend entry.
+\draw[prob arrow] (0,0) -- +(10pt, 6pt);
+}
+\newcommand{\legendsymbol}[1]{% Creates the legend symbol.
+\begin{tikzpicture}
+ \ifnum#1=0
+ \drawlegendsymbol
+ \else
+ \semiopaque{\drawlegendsymbol}
+ \fi
+\end{tikzpicture}
+}
\begin{document}
-\begin{tikzpicture}[-stealth, line width=2pt]
- \matrix[nodes={draw, fill=yellow!10, thin, circle, inner sep=0.6ex, minimum size=5ex}, row sep=1.5cm, column sep=0.1cm]
- {
- \node (C1234) {\pcauset{1,2,3,4}};
- & \node (C1243) {\pcauset{1,2,4,3}};
- & \node[fill=yellow!20] (C1423) {\pcauset{1,4,2,3}};
- & \node (C1324) {\pcauset{1,3,2,4}};
- & \node (C1432) {\pcauset{1,4,3,2}};
- & \node[fill=yellow!30] (C4123) {\pcauset{4,1,2,3}};
- & \node[fill=yellow!30] (C4132) {\pcauset{4,1,3,2}};
- & \node[fill=yellow!20] (C3124) {\pcauset{3,1,2,4}};
- & & \node[fill=yellow!20] (C3412) {\pcauset{3,4,1,2}};
- & \node[fill=yellow!30] (C3142) {\pcauset{3,1,4,2}};
- & \node[fill=yellow!30] (C4312) {\pcauset{4,3,1,2}};
- & \node (C2134) {\pcauset{2,1,3,4}};
- & \node (C2143) {\pcauset{2,1,4,3}};
- & \node[fill=yellow!20] (C4213) {\pcauset{4,2,1,3}};
- & \node (C3214) {\pcauset{3,2,1,4}};
- & \node (C4321) {\pcauset{4,3,2,1}};
- \\
- \\
- & & \node (C123) {\pcauset{1,2,3}};
- & & & \node (C132) {\pcauset{1,3,2}};
- & & & \node[fill=yellow!20] (C312) {\pcauset{3,1,2}};
- & & & \node (C213) {\pcauset{2,1,3}};
- & & & \node (C321) {\pcauset{3,2,1}};
- \\
- & & & & & \node (C12) {\pcauset{1,2}};
- & & & & & & \node (C21) {\pcauset{2,1}};
- \\
- & & & & & & & & \node (C1) {\pcauset{1}};
- \\
- };
- \draw (C1) -- node[below left] {$p_{12}$} (C12);
- \draw (C12) -- node[below left] {$p_{123}$} (C123);
- \draw (C123) -- node[sloped, midway, below] {$p_{1234}$} (C1234);
- \draw (C123) -- node[sloped, near end, below] {$p_{1243}$} (C1243);
- \draw (C123) -- node[sloped, midway, below] {$p_{1423}$} (C1423);
- \draw (C123) -- node[sloped, near start, below] {$p_{4123}$} (C4123);
- \draw (C12) -- node[left] {$p_{132}$} (C132);
- \draw (C132) -- node[sloped, near start, below] {$p_{1342}$} (C1423);
- \draw (C132) -- node[sloped, near end, below] {$p_{1324}$} (C1324);
- \draw (C132) -- node[sloped, midway, above] {$p_{1432}$} (C1432);
- \draw (C132) -- node[sloped, near start, below] {$p_{4132}$} (C4132);
- \draw (C12) -- node[below right] {$p_{312}$} (C312);
- \draw (C312) -- node[sloped, near end, above] {$p_{3124}$} (C3124);
- \draw (C312) -- node[sloped, near end, above] {$p_{3412}$} (C3412);
- \draw (C312) -- node[sloped, near end, above] {$p_{3142}$} (C3142);
- \draw (C312) -- node[sloped, near start, below] {$p_{4312}$} (C4312);
- \draw (C1) -- node[below right] {$p_{21}$} (C21);
- \draw (C21) -- node[below left] {$p_{231}$} (C312);
- \draw (C312) -- node[sloped, near start, below] {$p_{2341}$} (C4123);
- \draw (C312) -- node[sloped, near end, above] {$p_{2431}$} (C4132);
- \draw (C21) -- node[right] {$p_{213}$} (C213);
- \draw (C213) -- node[sloped, midway, above] {$p_{2134}$} (C2134);
- \draw (C213) -- node[sloped, near start, below] {$p_{2413}$} (C3142);
- \draw (C213) -- node[sloped, near end, below] {$p_{2143}$} (C2143);
- \draw (C213) -- node[sloped, near start, below] {$p_{4213}$} (C4213);
- \draw (C21) -- node[below right] {$p_{321}$} (C321);
- \draw (C321) -- node[sloped, near start, below] {$p_{3421}$} (C4312);
- \draw (C321) -- node[sloped, midway, above] {$p_{3241}$} (C4213);
- \draw (C321) -- node[sloped, near end, above] {$p_{3214}$} (C3214);
- \draw (C321) -- node[sloped, midway, below] {$p_{4321}$} (C4321);
+\begin{tikzpicture}[-stealth]
+ \def\ystep{2.0cm}
+ \def\xstep{0.52cm}
+ % Create nodes of all causets with 1 to 4 events:
+ \begin{scope}[nodes={draw, thin, circle, minimum size=1.02cm}]
+ \node (C1) at ( 0, 0) {\pcauset{1}};
+ \node (C12) at (-4*\xstep, 1*\ystep) {\pcauset{1,2}};
+ \node (C21) at ( 4*\xstep, 1*\ystep) {\pcauset{2,1}};
+ \foreach \perm [count=\i from 0] in {123, 132, 312, 213, 321}{%
+ \expandafter\defCevents\perm
+ \node (C\perm) at (4*\i*\xstep-8*\xstep, 2*\ystep) {\pcauset{\Ea,\Eb,\Ec}};
+ }
+ \foreach \perm [count=\i from 0] in {1234, 1243, 1423, 1324, 1432, 4123, 4132, 3124, 3412, 3142, 4312, 2134, 2143, 4213, 3214, 4321}{%
+ \expandafter\defDevents\perm
+ \node (C\perm) at (2*\i*\xstep-15*\xstep, 3.75*\ystep) {\pcauset{\Ea,\Eb,\Ec,\Ed}};
+ }
+ \end{scope}
+ % Add graph edges for expandings ...
+ % ... to the past (additionally):
+ \begin{scope}[past colour]
+ \foreach \perma/\permb in {12/213, 123/3124, 123/2134, 132/1243, 132/3142, 132/2143, 312/1423, 312/4213, 213/1324, 213/3124, 213/3214, 321/1432, 321/4132, 21/132}
+ \semiopaque{\drawprobarrow{C\perma}{}{C\permb}};
+ \end{scope}
+ % ... to anywhere (additionally, further):
+ \begin{scope}[anywhere colour]
+ \semiopaque{\drawprobarrow{C123}{}{C1324}};
+ \end{scope}
+ % ... to the future:
+ \begin{scope}[prob arrow, future colour]
+ \drawprobarrow{C1}{p_{12}}{C12}
+ \drawprobarrow{C12}{p_{123}}{C123}
+ \drawprobarrow{C123}{p_{1234}}{C1234}
+ \drawprobarrow[near end]{C123}{p_{1243}}{C1243}
+ \drawprobarrow[near end]{C123}{p_{1423}}{C1423}
+ \drawprobarrow[near start, above]{C123}{p_{4123}}{C4123}
+ \drawprobarrow[above]{C12}{p_{132}}{C132}
+ \drawprobarrow[near end]{C132}{p_{1342}}{C1423}
+ \drawprobarrow[near end]{C132}{p_{1324}}{C1324}
+ \drawprobarrow[midway, above]{C132}{p_{1432}}{C1432}
+ \drawprobarrow[near start]{C132}{p_{4132}}{C4132}
+ \drawprobarrow[near start, above]{C12}{p_{312}}{C312}
+ \drawprobarrow[near end]{C312}{p_{3124}}{C3124}
+ \drawprobarrow[near end]{C312}{p_{3412}}{C3412}
+ \drawprobarrow[near end]{C312}{p_{3142}}{C3142}
+ \drawprobarrow[near start]{C312}{p_{4312}}{C4312}
+ \drawprobarrow{C1}{p_{21}}{C21}
+ \drawprobarrow[near start, above]{C21}{p_{231}}{C312}
+ \drawprobarrow[near start]{C312}{p_{2341}}{C4123}
+ \drawprobarrow[near end]{C312}{p_{2431}}{C4132}
+ \drawprobarrow{C21}{p_{213}}{C213}
+ \drawprobarrow[above]{C213}{p_{2134}}{C2134}
+ \drawprobarrow[near start]{C213}{p_{2413}}{C3142}
+ \drawprobarrow[near end]{C213}{p_{2143}}{C2143}
+ \drawprobarrow[near end]{C213}{p_{4213}}{C4213}
+ \drawprobarrow{C21}{p_{321}}{C321}
+ \drawprobarrow[near start, above]{C321}{p_{3421}}{C4312}
+ \drawprobarrow[near end]{C321}{p_{3241}}{C4213}
+ \drawprobarrow[near end]{C321}{p_{3214}}{C3214}
+ \drawprobarrow{C321}{p_{4321}}{C4321}
+ \end{scope}
+ % Add legend:
+ \node[above left, align=left, draw, inner sep=3ex, fill=gray!05]
+ at (15*\xstep, 0)
+ {Expanding towards\\
+ \bfseries\color{future colour}\legendsymbol{0}\ the future\\
+ \bfseries\color{past colour}\legendsymbol{1}\ + the past\\
+ \bfseries\color{anywhere colour}\legendsymbol{1}\ + anywhere};
\end{tikzpicture}
\end{document}
Modified: trunk/Master/texmf-dist/doc/latex/causets/causets.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/causets/causets.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/causets/causets.tex 2022-05-22 13:13:46 UTC (rev 63365)
+++ trunk/Master/texmf-dist/doc/latex/causets/causets.tex 2022-05-22 20:19:01 UTC (rev 63366)
@@ -16,9 +16,9 @@
\pagestyle{fancy}
\fancypagestyle{plain}{\fancyhf{}\renewcommand{\headrulewidth}{0.0pt}}
\setlength{\headheight}{16.0pt}
-\fancyhead[L]{\sffamily causets - Documentation}
+\fancyhead[L]{}
\fancyhead[C]{}
-\fancyhead[R]{\sffamily \nouppercase{\rightmark}}
+\fancyhead[R]{\sffamily causets package manual}
\renewcommand{\headrulewidth}{0.2pt}
\renewcommand{\footrulewidth}{0.0pt}
\fancyfoot[L]{}
@@ -29,7 +29,7 @@
bookmarksopen = true, %
bookmarksopenlevel = 0, %
bookmarksnumbered = true, %
- pdftitle = {{Package Documentation: causets}}, %
+ pdftitle = {{Package documentation: causets}}, %
pdfauthor = {{Christoph Minz}}, %
pdfstartpage = 1, %
pdfstartview = {FitH}, %
@@ -49,19 +49,19 @@
\usepackage{longtable} % tables spanning pages
\usepackage{multirow} % spanning multiple rows
\usepackage{listings} % code environments
-\lstset{
+\lstset{
backgroundcolor=\color{yellow!50!black!10},
basicstyle=\ttfamily\footnotesize,
breakatwhitespace=true,
breaklines=true,
captionpos=b,
- commentstyle=\color{green!25!gray},
+ commentstyle=\color{green!50!black!50!gray},
keepspaces=true,
- keywordstyle=\color{black},
+ keywordstyle={},
language=TeX,
numbers=left,
numbersep=5pt,
- numberstyle=\tiny\color{gray},
+ numberstyle=\scriptsize\color{black!35},
rulecolor=\color{black},
showspaces=false,
showstringspaces=false,
@@ -73,13 +73,19 @@
\usepackage{amsmath}
\usepackage{causets}
-\renewcommand{\causetspath}{.}
-\newcommand*{\valuePH}{{\small\itshape$\langle$value$\rangle$}} % placeholder
+\newcommand*{\PH}[1][value]{{\small\itshape$\langle$#1$\rangle$}} % placeholder
-\title{{\small package}\\[0.5cm] \huge causets \\[0.2cm]{\small version 1.2}\\[0.5cm]}
+\usetikzlibrary{tikzmark}
+\newcommand*{\versioncauset}[3][-1.03cm]{%
+\tikzmark{#2}%
+\tikz[remember picture, overlay]%
+ \path (pic cs:#2) -- ++(-1cm, 0.5em) -- ++(#1, 0) node {#3};%
+}% version causet
+
+\title{{\small package}\\[0.5cm] \huge causets \\[0.2cm]{\small version 1.3\\[0.5cm]}}
\author{Christoph Minz}
-\date{February 07, 2022}
+\date{May 23, 2022}
\begin{document}
@@ -88,98 +94,103 @@
\begin{center}
$\displaystyle
\tikzcausetsset{large}
- \left\{
- \pcauset{3,2,1},
- \pcauset{3,1,2},
- \pcauset{2,1,3},
- \pcauset{1,3,2},
- \pcauset{1,2,3}
- \right\}
+ \left\{
+ \pcauset{3,2,1},
+ \pcauset{3,1,2},
+ \pcauset{2,1,3},
+ \pcauset{1,3,2},
+ \pcauset{1,2,3}
+ \right\}
$
\\
$\displaystyle
\tikzcausetsset{large}
\causetsDrawLabelstrue
- \left\{
- \pcauset{3,2,1},
- \pcauset{4,5,3,1,2},
- \pcauset{2,1,3},
- \pcauset{1,3,2},
- \pcauset{1,2,3}
- \right\}
+ \left\{
+ \pcauset{3,2,1},
+ \pcauset{3,1,2},
+ \pcauset{2,1,3},
+ \pcauset{1,3,2},
+ \pcauset{1,2,3}
+ \right\}
$
\\
$\displaystyle
\tikzcausetsset{large}
\causetsDrawPermutationtrue
- \left\{
- \pcauset{3,2,1},
- \pcauset{3,1,2},
- \pcauset{2,1,3},
- \pcauset{1,3,2},
- \pcauset{1,2,3}
- \right\}
+ \left\{
+ \pcauset{3,2,1},
+ \pcauset{3,1,2},
+ \pcauset{2,1,3},
+ \pcauset{1,3,2},
+ \pcauset{1,2,3}
+ \right\}
$
\end{center}
\vspace{2em}
-\section*{What Is the Purpose of This Package?}
+\section*{What is the purpose of this package?}
\label{sec:Purpose}
-Causal set theory is a proposed framework for quantum gravity.
-Causal sets (\textbf{causets} for short) are locally finite, partially ordered sets.
-Though one can describe them mathematically as a set with a partial order, it is usually much simpler to just draw (Hasse) diagrams.
+Causal set theory is a proposed framework for quantum gravity.
+Causal sets (\textbf{causets} for short) are locally finite, partially ordered sets.
+Though one can describe them mathematically as a set with a partial order, it is usually much simpler to just draw (Hasse) diagrams.
-This package implements some simple functionality to produce such diagrams for causets by drawing them as TikZ graphics.
-The drawing algorithm makes use of the fact that every finite causet that embeds in $\smash{1 + 1}$ dimensional Minkowski spacetime can be represented by a product of two total orders (2D-orders), where one order can be the total order of the integers labeling the 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 2D-orders and causal sets.}.
-The idea is then used as a blueprint to draw diagrams for any generic (finite) causet, so that it becomes easy to draw causets and even use them in mathematical expressions.
+This package implements some simple functionality to produce such diagrams for causets by drawing them as TikZ graphics.
+The drawing algorithm makes use of the fact that every finite causet that embeds in $\smash{1 + 1}$ dimensional Minkowski spacetime can be represented by a product of two total orders (2D-orders), where one order can be the total order of the integers labelling the 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 2D-orders and causal sets.}.
+The idea is then used as a blueprint to draw diagrams for any generic (finite) causet, so that it becomes easy to draw causets and even use them in mathematical expressions.
\clearpage
-\section{Introduction - the Main Commands}
+\section{Introduction - the main commands}
\label{sec:Introduction}
-This package is built on the package \lstinline\xA7tikz\xA7 to draw the diagrams.
-To import the \lstinline\xA7causets\xA7 package into a \LaTeX\ file, write
+This package is built on the package \lstinline\xA7tikz\xA7 to draw the diagrams.
+To import the \lstinline\xA7causets\xA7 package into a \LaTeX\ file, write
\begin{lstlisting}
\usepackage{causets}
\end{lstlisting}
-in the preamble of the document.
+in the preamble of the document (this will automatically load the \lstinline\xA7tikz\xA7 package as well).
-For a more demonstrative introduction in this first section, I use the package options \lstinline\xA7black\xA7 (only black and white diagrams) and \lstinline\xA7permutation\xA7 (also shows the permutation),
+For the command introduction in \autoref{tab:MainCommandsExamples}, I use the package options \lstinline\xA7black\xA7 (only black and white diagrams) and \lstinline\xA7permutation\xA7 (also shows the permutation),
\begin{lstlisting}
\usepackage[black,permutation]{causets}
\end{lstlisting}
-The three main commands of this package are
+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,..}
+\pcauset{...,i,...,k,...,j,...}
+\rcauset{...}{...,i/j,...}
+\causet{...}{...,i/j,...}
\end{lstlisting}
-The first command takes a permutation of the integers $[ 1, N ]$ (where $N$ 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 < j$ and there is no $k > j$ between $i$ and $j$.
-The second command does the same, but ignores links between event pairs \lstinline\xA7i/j\xA7 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\xA7i/j\xA7 in the second argument.
+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 < j$ and there is no $k > j$ between $i$ and $j$ in the permutation.
+The second command does the same, but ignores links between event pairs \lstinline\xA7i/j\xA7 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\xA7i/j\xA7 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 2D-order).
-Let the causets elements be labeled by an increasing null coordinate $u$ (pointing upwards along the right axis of the grids under the diagrams below), then the causal relation (partial order) implies a label permutation along the null coordinate $v$ (pointing upwards along the left axis of the grids under the diagrams below).
-This permutation is the input of the \lstinline\xA7\pcauset\xA7 command that computes the causal relation from the permutation.
-See example 1 in \autoref{tab:MainCommandsExamples}.
-\tikzcausetsset{black colors, show permutation}
+Any causet that can be embedded in $1 + 1$ dimensional Minkowski spacetime can also be described by the product of two total orders (a 2D-order).
+Let the causets 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\xA7\pcauset\xA7 command that computes the causal relation from the permutation.
+See example 1 in \autoref{tab:MainCommandsExamples}.
\begin{table}[h!]
- \begin{tabular*}{\textwidth}{lp{0.72\textwidth}c}
+ \centering
+ \tikzcausetsset{black colors, show permutation}
+ \begin{tabular*}{\textwidth}{lp{0.73\textwidth}c}
\toprule
\#
- & command
- & inline output
+ & command
+ & inline output
\\\midrule
- 1
+ 1
& \lstinline\xA7\pcauset{4,7,2,6,1,5,3}\xA7
& \pcauset{4,7,2,6,1,5,3}
\\\midrule
- 2
+ 2
& \lstinline\xA7\rcauset{4,7,2,6,1,5,3}{2/5}\xA7
& \rcauset{4,7,2,6,1,5,3}{2/5}
\\\midrule
- 3
+ 3
& \lstinline\xA7\causet{4,7,2,6,1,5,3}{1/3,1/5,2/3,2/6,4/5,4/6,4/7}\xA7
& \causet{4,7,2,6,1,5,3}{1/3,1/5,2/3,2/6,4/5,4/6,4/7}
\\\bottomrule
@@ -186,70 +197,97 @@
\end{tabular*}
\caption{\label{tab:MainCommandsExamples} Examples for the three main commands of the package.}
\end{table}
-\tikzcausetsset{gray colors, show permutation=false}
-Every causet that does not embed in $1 + 1$ dimensional Minkowski spacetime can be made embeddable by adding links to it.
-Adding the minimal number of links yields permutations that should be used to determine the coordinates of the diagram.
-The links that have been added to obtain the permutation need to be removed from the generated causet, which is specified by link pairs \lstinline\xA7i/j\xA7.
-See example 2 in \autoref{tab:MainCommandsExamples}.
+Every causet that does not embed in $1 + 1$ dimensional Minkowski spacetime can be made embeddable by adding links, for which the \lstinline\xA7\rcauset\xA7 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\xA7\pcauset\xA7 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\xA7i/j\xA7 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\xA7\causet\xA7 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\xA7\rcauset\xA7 command was actually much shorter for this particular example.
-However, if the list of link pairs in the \lstinline\xA7\rcauset\xA7 command is very long, specifying all existing link pairs instead with the \lstinline\xA7\causet\xA7 yields a faster performance.
+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\xA7\causet\xA7 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\xA7\rcauset\xA7 command was actually much shorter for this particular example.
+However, if the list of link pairs in the \lstinline\xA7\rcauset\xA7 command is very long, specifying all existing link pairs instead with the \lstinline\xA7\causet\xA7 yields a faster performance.
-As an example for the use in mathematical expressions, here is the code for the first set of causets on the title page:
+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*}
- \left\{
- \pcauset{3,2,1}, \pcauset{3,1,2}, \pcauset{2,1,3}, \pcauset{1,3,2}, \pcauset{1,2,3}
- \right\}.
-\end{align*}
+
+...
+
+\begin{document}
+
+...
+
+\begin{align}
+ S &=
+ \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{-1.5em}
-\begin{align*}
- \left\{
- \pcauset{3,2,1},
- \pcauset{3,1,2},
- \pcauset{2,1,3},
- \pcauset{1,3,2},
- \pcauset{1,2,3}
- \right\}
- .
-\end{align*}
-(Note that here the package is imported without any options.)
+\begin{align}
+ S &=
+ \left\{
+ \pcauset{3,2,1},\,
+ \pcauset{3,1,2},\,
+ \pcauset{2,1,3},\,
+ \pcauset{1,3,2},\,
+ \pcauset{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\xA7\pcauset{3,1,2}\xA7, \pcauset{3,1,2}, as opposed to \lstinline\xA7\pcauset{2,3,1}\xA7, \pcauset{2,3,1}.
+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\xA7\pcauset{3,1,2}\xA7, \pcauset{3,1,2}, as opposed to \lstinline\xA7\pcauset{2,3,1}\xA7, \pcauset{2,3,1}.
-It is possible to use dots in a permutation so that TikZ will auto-complete the list.
-For example, the command \lstinline\xA7\pcauset{14,...,10,8,2,1,9,3,4,...,7}\xA7 will generate the diagram
-\begin{align*}
- \pcauset[black colors, show permutation]{14,...,10,8,2,1,9,3,4,...,7}
-\end{align*}
-which is the same as \lstinline\xA7\pcauset{14,13,12,11,10,8,2,1,9,3,4,5,6,7}\xA7. (This graphic uses the package options \lstinline\xA7black\xA7 and \lstinline\xA7permutation\xA7 again.)
+The arguments of the commands are lists that are iterated over by a \lstinline\xA7\foreach\xA7 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{1,...,5} (with \lstinline\xA7\pcauset{1,...,5}\xA7) or antichains like \pcauset{5,...,1} (with \lstinline\xA7\pcauset{5,...,1}\xA7).
+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]{20,18,16,...,8,1,7,6,...,2,9,11,...,19}
+\end{center}
-\clearpage
-\section{Package Options}
+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]{2,4,5,1,3} is obtained with
+\begin{lstlisting}
+\pcauset[blue colors]{2,4,5,1,3}
+\end{lstlisting}
+
+\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).
+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{4,2,7,6,1,5,3}{2/5} is obtained with the commands
\begin{lstlisting}
\usepackage{causets}
-... % ... \begin{document} ...
+... \begin{document} ...
\rcauset{4,2,7,6,1,5,3}{2/5}
\end{lstlisting}
-The options -- given in the following table -- are passed to the \lstinline\xA7causets\xA7 package as optional parameter and can be combined. If not specified otherwise, any package option works with the command \lstinline\xA7\causet\xA7 as well as with the two shown examples created with the commands
+The options -- given in the following table -- are passed to the \lstinline\xA7causets\xA7 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\xA7\causet\xA7.
\begin{longtable}{p{0.65\textwidth}p{0.13\textwidth}p{0.13\textwidth}}
\toprule
@@ -256,19 +294,19 @@
Package option & \lstinline\xA7\pcauset\xA7 & \lstinline\xA7\rcauset\xA7
\\\midrule
\endfirsthead
-
- \multicolumn{3}{c}{\footnotesize \textit{continued from the previous page}}
+
+ \multicolumn{3}{c}{\footnotesize \textit{continued from the previous page}}
\\\midrule
Package option & \lstinline\xA7\pcauset\xA7 & \lstinline\xA7\rcauset\xA7
\\\midrule
\endhead
-
+
\midrule
\multicolumn{3}{c}{\footnotesize \textit{continued on the next page}}
\endfoot
-
+
\endlastfoot
-
+
\lstinline\xA7\usepackage[permutation]{causets}\xA7 shows permutations
& \multirow{3}{5em}{%
\causetsDrawPermutationtrue \pcauset{4,2,7,6,1,5,3}}
@@ -275,11 +313,11 @@
& \multirow{3}{5em}{%
\causetsDrawPermutationtrue \rcauset{4,2,7,6,1,5,3}{2/5}}
\\
- ~~(\lstinline\xA7\causetsDrawPermutationtrue\xA7 activates this option)
+ (\lstinline\xA7\causetsDrawPermutationtrue\xA7 activates this option)
\\
- ~~(\lstinline\xA7\causetsDrawPermutationfalse\xA7 deactivates this option)
+ (\lstinline\xA7\causetsDrawPermutationfalse\xA7 deactivates this option)
\\\midrule
- \lstinline\xA7\usepackage[permutation, unlabeled u]{causets}\xA7
+ \lstinline\xA7\usepackage[permutation, uunlabeled]{causets}\xA7
& \multirow{4}{5em}{%
\causetsDrawPermutationtrue \causetsDrawULabelsfalse \pcauset{4,2,7,6,1,5,3}}
& \multirow{4}{5em}{%
@@ -287,11 +325,11 @@
\\
shows permutations without u-labels
\\
- ~~(\lstinline\xA7\causetsDrawULabelstrue\xA7 activates u-labels)
+ (\lstinline\xA7\causetsDrawULabelstrue\xA7 activates u-labels)
\\
- ~~(\lstinline\xA7\causetsDrawULabelsfalse\xA7 deactivates u-labels)
+ (\lstinline\xA7\causetsDrawULabelsfalse\xA7 deactivates u-labels)
\\\midrule
- \lstinline\xA7\usepackage[permutation, unlabeled v]{causets}\xA7
+ \lstinline\xA7\usepackage[permutation, vunlabeled]{causets}\xA7
& \multirow{4}{5em}{%
\causetsDrawPermutationtrue \causetsDrawVLabelsfalse \pcauset{4,2,7,6,1,5,3}}
& \multirow{4}{5em}{%
@@ -299,10 +337,10 @@
\\
shows permutations without v-labels
\\
- ~~(\lstinline\xA7\causetsDrawVLabelstrue\xA7 activates v-labels)
+ (\lstinline\xA7\causetsDrawVLabelstrue\xA7 activates v-labels)
\\
- ~~(\lstinline\xA7\causetsDrawVLabelsfalse\xA7 deactivates v-labels)
-\\\midrule
+ (\lstinline\xA7\causetsDrawVLabelsfalse\xA7 deactivates v-labels)
+\\\midrule\midrule
\lstinline\xA7\usepackage[labeled]{causets}\xA7 shows labeled events
& \multirow{3}{5em}{%
\causetsDrawLabelstrue \pcauset{4,2,7,6,1,5,3}}
@@ -309,31 +347,31 @@
& \multirow{3}{5em}{%
\causetsDrawLabelstrue \rcauset{4,2,7,6,1,5,3}{2/5}}
\\
- ~~(\lstinline\xA7\causetsDrawLabelstrue\xA7 activates labels)
+ (\lstinline\xA7\causetsDrawLabelstrue\xA7 activates labels)
\\
- ~~(\lstinline\xA7\causetsDrawLabelsfalse\xA7 deactivates labels)
-\\\midrule
- \lstinline\xA7\usepackage[continuously linked]{causets}\xA7 allows links to cross over events. Broken links (that is the default option: \lstinline\xA7\usepackage[brokenly linked]{causets}\xA7) affects only the \lstinline\xA7\causet\xA7 command, but not the examples of \lstinline\xA7\pcauset\xA7 and \lstinline\xA7\rcauset\xA7, shown on the right.
-& \multirow{3}{5em}{%
+ (\lstinline\xA7\causetsDrawLabelsfalse\xA7 deactivates labels)
+\\\midrule\midrule
+ \lstinline\xA7\usepackage[continuous]{causets}\xA7 allows links to cross over events. Link interruptions (default) only affect the \lstinline\xA7\causet\xA7 command, but not the examples of \lstinline\xA7\pcauset\xA7 and \lstinline\xA7\rcauset\xA7, shown on the right.
+& \multirow{5}{5em}{%
\causetsBreakLinkstrue \pcauset{4,2,7,6,1,5,3}}
-& \multirow{3}{5em}{%
+& \multirow{5}{5em}{%
\causetsBreakLinkstrue \rcauset{4,2,7,6,1,5,3}{2/5}}
\\
- Details on broken links are given below.
-\\[0.5cm]
- \lstinline\xA7\usepackage[cap linked]{causets}\xA7 sets caps as link tips
+ Details on interrupted (broken) links are given below.
+\\\midrule
+ \lstinline\xA7\usepackage[caps]{causets}\xA7 sets caps as link tips
& \multirow{2}{5em}{%
\pcauset[cap links]{4,2,7,6,1,5,3}}
& \multirow{2}{5em}{%
\rcauset[cap links]{4,2,7,6,1,5,3}{2/5}}
\\
-\\
- \lstinline\xA7\usepackage[arrow linked]{causets}\xA7 sets arrows (rounded, open stealth) as link tips
+\\\midrule
+ \lstinline\xA7\usepackage[arrows]{causets}\xA7 sets arrows (rounded, open stealth) as link tips
& \multirow{2}{5em}{%
\pcauset[arrow links]{4,2,7,6,1,5,3}}
& \multirow{2}{5em}{%
\rcauset[arrow links]{4,2,7,6,1,5,3}{2/5}}
-\\
+\\\midrule
\lstinline\xA7\usepackage[unlinked]{causets}\xA7 does not draw links
& \multirow{3}{5em}{%
\causetsDrawLinksfalse \pcauset{4,2,7,6,1,5,3}}
@@ -340,10 +378,10 @@
& \multirow{3}{5em}{%
\causetsDrawLinksfalse \rcauset{4,2,7,6,1,5,3}{2/5}}
\\
- ~~(\lstinline\xA7\causetsDrawLinkstrue\xA7 actives links)
+ (\lstinline\xA7\causetsDrawLinkstrue\xA7 actives links)
\\
- ~~(\lstinline\xA7\causetsDrawLinksfalse\xA7 deactivates links)
-\\\midrule
+ (\lstinline\xA7\causetsDrawLinksfalse\xA7 deactivates links)
+\\\midrule\midrule
\lstinline\xA7\usepackage[tiny]{causets}\xA7 for tiny diagrams
& \multirow{2}{5em}{%
\pcauset[tiny]{4,2,7,6,1,5,3}}
@@ -350,8 +388,16 @@
& \multirow{2}{5em}{%
\rcauset[tiny]{4,2,7,6,1,5,3}{2/5}}
\\
- ~~(\lstinline\xA7\tikzcausetsset{tiny}\xA7 sets tiny sizes)
+ (\lstinline\xA7\tikzcausetsset{tiny}\xA7 sets tiny sizes)
+\\\midrule
+ \lstinline\xA7\usepackage[smaller]{causets}\xA7 for very small diagrams
+& \multirow{2}{5em}{%
+ \pcauset[very small]{4,2,7,6,1,5,3}}
+& \multirow{2}{5em}{%
+ \rcauset[very small]{4,2,7,6,1,5,3}{2/5}}
\\
+ (\lstinline\xA7\tikzcausetsset{very small}\xA7 sets very small sizes)
+\\\midrule
\lstinline\xA7\usepackage[small]{causets}\xA7 for small diagrams
& \multirow{2}{5em}{%
\pcauset[small]{4,2,7,6,1,5,3}}
@@ -358,8 +404,16 @@
& \multirow{2}{5em}{%
\rcauset[small]{4,2,7,6,1,5,3}{2/5}}
\\
- ~~(\lstinline\xA7\tikzcausetsset{small}\xA7 sets small sizes)
+ (\lstinline\xA7\tikzcausetsset{small}\xA7 sets small sizes)
+\\\pagebreak%\midrule
+ For comparison, here are the normal sized causets.
+& \multirow{2}{5em}{%
+ \pcauset[normal]{4,2,7,6,1,5,3}}
+& \multirow{2}{5em}{%
+ \rcauset[normal]{4,2,7,6,1,5,3}{2/5}}
\\
+ (\lstinline\xA7\tikzcausetsset{normal}\xA7 sets normal sizes)
+\\\midrule
\lstinline\xA7\usepackage[large]{causets}\xA7 for large diagrams
& \multirow{3}{5em}{%
\pcauset[large]{4,2,7,6,1,5,3}}
@@ -366,21 +420,24 @@
& \multirow{3}{5em}{%
\rcauset[large]{4,2,7,6,1,5,3}{2/5}}
\\
- ~~(\lstinline\xA7\tikzcausetsset{large}\xA7 sets large sizes)
+ (\lstinline\xA7\tikzcausetsset{large}\xA7 sets large sizes)
+\\[1.3em]\midrule
+ \lstinline\xA7\usepackage[larger]{causets}\xA7 for very large diagrams
+& \multirow{3}{5em}{%
+ \pcauset[very large]{4,2,7,6,1,5,3}}
+& \multirow{3}{5em}{%
+ \rcauset[very large]{4,2,7,6,1,5,3}{2/5}}
\\
-\\
+ (\lstinline\xA7\tikzcausetsset{very large}\xA7 sets very large sizes)
+\\[2.1em]\midrule
\lstinline\xA7\usepackage[huge]{causets}\xA7 for huge diagrams
& \multirow{4}{5em}{%
\pcauset[huge]{4,2,7,6,1,5,3}}
-& \multirow{4}{5em}{%
- \rcauset[huge]{4,2,7,6,1,5,3}{2/5}}
\\
- ~~(\lstinline\xA7\tikzcausetsset{huge}\xA7 sets huge sizes)
+ (\lstinline\xA7\tikzcausetsset{huge}\xA7 sets huge sizes)
\\
- ~~(\lstinline\xA7\tikzcausetsset{normal}\xA7 resets to normal sizes)
-\\
Details on size options are given in \autoref{sec:Sizes}.
-\\\midrule
+\\[2.5em]\midrule\midrule
\lstinline\xA7\usepackage[black]{causets}\xA7 for black and white causets
& \multirow{2}{5em}{%
\pcauset[black colors]{4,2,7,6,1,5,3}}
@@ -387,16 +444,16 @@
& \multirow{2}{5em}{%
\rcauset[black colors]{4,2,7,6,1,5,3}{2/5}}
\\
- ~~(\lstinline\xA7\tikzcausetsset{black colors}\xA7 activates the option)
-\\
- \lstinline\xA7\usepackage[gray]{causets}\xA7 for gray scale causets (default)
+ (\lstinline\xA7\tikzcausetsset{black colors}\xA7 activates the option)
+\\\midrule
+ \lstinline\xA7\usepackage[gray]{causets}\xA7 for grey scale causets (default)
& \multirow{2}{5em}{%
\pcauset[gray colors]{4,2,7,6,1,5,3}}
& \multirow{2}{5em}{%
\rcauset[gray colors]{4,2,7,6,1,5,3}{2/5}}
\\
- ~~(\lstinline\xA7\tikzcausetsset{gray colors}\xA7 activates the option)
-\\
+ (\lstinline\xA7\tikzcausetsset{gray colors}\xA7 activates the option)
+\\\midrule
\lstinline\xA7\usepackage[blue]{causets}\xA7 for blue causets
& \multirow{2}{5em}{%
\pcauset[blue colors]{4,2,7,6,1,5,3}}
@@ -403,137 +460,242 @@
& \multirow{2}{5em}{%
\rcauset[blue colors]{4,2,7,6,1,5,3}{2/5}}
\\
- ~~(\lstinline\xA7\tikzcausetsset{blue colors}\xA7 activates the option)
-\\
- \lstinline\xA7\usepackage[neon]{causets}\xA7 for brightly colored causets
-& \multirow{2}{5em}{%
+ (\lstinline\xA7\tikzcausetsset{blue colors}\xA7 activates the option)
+\\\midrule
+ \lstinline\xA7\usepackage[neon]{causets}\xA7 for brightly coloured causets
+& \multirow{3}{5em}{%
\pcauset[neon colors]{4,2,7,6,1,5,3}}
-& \multirow{2}{5em}{%
+& \multirow{3}{5em}{%
\rcauset[neon colors]{4,2,7,6,1,5,3}{2/5}}
\\
- ~~(\lstinline\xA7\tikzcausetsset{neon colors}\xA7 activates the option)
+ (\lstinline\xA7\tikzcausetsset{neon colors}\xA7 activates the option)
\\
- Details on color options are given in \autoref{sec:Colors}.
-\\\midrule
- \lstinline\xA7\usepackage[spatially linked]{causets}\xA7 shows dashed lines between spatially separated events (which is a secondary partial order for the causets drawn with \lstinline\xA7\pcauset\xA7). This option only affects the \lstinline\xA7\pcauset\xA7 and \lstinline\xA7\rcauset\xA7 commands, but not the \lstinline\xA7\causet\xA7 command.
+ Details on colour options are given in \autoref{sec:Colors}.
+\\\midrule\midrule
+ \lstinline\xA7\usepackage[spatial]{causets}\xA7 shows dashed lines between spatially separated events (which is a secondary partial order for the causets drawn with \lstinline\xA7\pcauset\xA7). This option only affects the \lstinline\xA7\pcauset\xA7 and \lstinline\xA7\rcauset\xA7 commands, but not the \lstinline\xA7\causet\xA7 command.
& \multirow{3}{5em}{%
\pcauset[spatially linked]{4,2,7,6,1,5,3}}
& \multirow{3}{5em}{%
\rcauset[spatially linked]{4,2,7,6,1,5,3}{2/5}}
\\
- ~~(\lstinline\xA7\causetsDrawSpatialLinkstrue\xA7 activates the option)
+ (\lstinline\xA7\causetsDrawSpatialLinkstrue\xA7 activates the option)
\\
- ~~(\lstinline\xA7\causetsDrawSpatialLinksfalse\xA7 deactivates the option)
+ (\lstinline\xA7\causetsDrawSpatialLinksfalse\xA7 deactivates the option)
\\\bottomrule
\end{longtable}
-By default, the links in a diagram created with the \lstinline\xA7\causet\xA7 command are interrupted if they hit another event (exactly in their center).
-Any such crossing of links over events can only be caused by the manually drawn links, explicitly given in the second argument of \lstinline\xA7\causet\xA7, but not with the links drawn by \lstinline\xA7\pcauset\xA7 or \lstinline\xA7\rcauset\xA7.
+By default, the links in a \lstinline\xA7\causet\xA7 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\xA7\causet\xA7 command, but not for the links drawn by \lstinline\xA7\pcauset\xA7 or \lstinline\xA7\rcauset\xA7.
This feature is activated by default (\lstinline\xA7\causetsBreakLinkstrue\xA7) and can be deactivated with \lstinline\xA7\causetsBreakLinksfalse\xA7, or with the option \lstinline\xA7continuously linked\xA7.
For example, here is a causet that embeds in 3-dimensional but not in 2-dimensional Minkowski spacetime.
-This causet has one event (8) in the center that is linked to events 7 and 9, but not to events 2 and 14, while the link from 2 to 14 crosses the event 8 in the center.
+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 from -6 to 6 crosses over it.
\begin{lstlisting}
-\usepackage[huge,labeled]{causets}
-\tikzcausetsset{labels={right=0.5ex}}
-... % ... \begin{document} ...
+\usepackage[larger]{causets}
+\tikzcausetsset{labels={right, position=east}, offset=-8}
+
+... \begin{document} ...
+
\causet[brokenly linked]{7,10,3,1,12,5,2,8,14,11,4,15,13,6,9} {1/2,1/12,2/4,2/14,3/4,3/5,4/6,4/15,5/6,5/8,6/9,7/8,7/10,8/9,8/11, 10/11,10/12,11/13,12/13,12/14,14/15}
\causet[continuously linked]{7,10,3,1,12,5,2,8,14,11,4,15,13,6,9} {1/2,1/12,2/4,2/14,3/4,3/5,4/6,4/15,5/6,5/8,6/9,7/8,7/10,8/9,8/11, 10/11,10/12,11/13,12/13,12/14,14/15}
\end{lstlisting}
-\causet[huge, labels={right=0.5ex}, brokenly linked]{7,10,3,1,12,5,2,8,14,11,4,15,13,6,9}{1/2,1/12,2/4,2/14,3/4,3/5,4/6,4/15,5/6,5/8,6/9,7/8,7/10,8/9,8/11,10/11,10/12,11/13,12/13,12/14,14/15}
-\causet[huge, labels={right=0.5ex}, continuously linked]{7,10,3,1,12,5,2,8,14,11,4,15,13,6,9}{1/2,1/12,2/4,2/14,3/4,3/5,4/6,4/15,5/6,5/8,6/9,7/8,7/10,8/9,8/11,10/11,10/12,11/13,12/13,12/14,14/15}
+\begin{center}
+ \causet[very large, labels={right, at=east}, offset=-8]{7,10,3,1,12,5,2,8,14,11,4,15,13,6,9}{1/2,1/12,2/4,2/14,3/4,3/5,4/6,4/15,5/6,5/8,6/9,7/8,7/10,8/9,8/11,10/11,10/12,11/13,12/13,12/14,14/15}
+ \hspace{1cm}
+ \causet[very large, labels={right, at=east}, continuously linked, offset=-8]{7,10,3,1,12,5,2,8,14,11,4,15,13,6,9}{1/2,1/12,2/4,2/14,3/4,3/5,4/6,4/15,5/6,5/8,6/9,7/8,7/10,8/9,8/11,10/11,10/12,11/13,12/13,12/14,14/15}
+\end{center}
-Note that the option \lstinline\xA7brokenly linked\xA7 is not necessary if the default option has not been changed.
-
-\section{Short Hand Macros}
+\section{Short hand macros}
\label{sec:ShortHandMacros}
The permutations and labels for causets can be switched on globally with the package options \lstinline\xA7permutation\xA7 and \lstinline\xA7labeled\xA7, or at any point in the document with the switches \\
-\lstinline\xA7\causetsDrawPermutationtrue\xA7 (same as the command \lstinline\xA7\tikzcausetsset{show permutation}\xA7 used in the preamble) and \lstinline\xA7\causetsDrawLabelstrue\xA7 (or \lstinline\xA7\tikzcausetsset{labeled}\xA7 used in the preamble), respectively.
+\lstinline\xA7\causetsDrawPermutationtrue\xA7 (same as the command \lstinline\xA7\tikzcausetsset{show permutation}\xA7) and \lstinline\xA7\causetsDrawLabelstrue\xA7 (or \lstinline\xA7\tikzcausetsset{labeled}\xA7), respectively.
-To show only single causets with either of these options, there exist short hand macros for all three main commands.
-Each main command can be followed by a capital letter \lstinline\xA7P\xA7 (to show the permutation), \lstinline\xA7L\xA7 (to show event labels), or \lstinline\xA7X\xA7 (to show both).
+To show only single causets with either of these options, there exist short hand macros for all three main commands.
+Each main command can be followed by a capital letter \lstinline\xA7P\xA7 (to show the permutation), \lstinline\xA7L\xA7 (to show event labels), or \lstinline\xA7X\xA7 (to show both).
\begin{lstlisting}
-\usepackage{causets}
-... % ... \begin{document} ...
Causets with permutations (and labels) \pcausetP{4,1,2,3}, \pcausetX{1,2,3,4}, \pcausetL{1,2,4,3}, and without any \pcauset{2,4,1,3}.
\end{lstlisting}
-Causets with permutations (and labels) \pcausetP{4,1,2,3}, \pcausetX{1,2,3,4}, \pcausetL{1,2,4,3}, and without any \pcauset{2,4,1,3}.
-These results are also obtained by using the optional parameter, for example:
+Causets with permutations (and labels) \pcausetP{4,1,2,3}, \pcausetX{1,2,3,4}, \pcausetL{1,2,4,3}, and without any \pcauset{2,4,1,3}.
+
+These results are also obtained by using the optional parameter, for example:
\begin{lstlisting}
-\usepackage{causets}
-... % ... \begin{document} ...
Causets with permutations (and labels) \pcauset[permutation]{4,1,2,3}, \pcauset[permutation,labeled]{1,2,3,4}, \pcauset[labeled]{1,2,4,3}, and without any \pcauset{2,4,1,3}.
\end{lstlisting}
-The optional argument of the main commands accepts any causets or TikZ keys to change the style of the causet.
-For example, the baseline can be moved with
+There are a few short hand macros for small common causets as shown here.
\begin{lstlisting}
-\pcauset[baseline=2mm]{2,4,5,1,3}
-\end{lstlisting}
-such that the diagram is placed with its center at $2\mathrm{mm}$ below the text base, \pcauset[baseline=2mm]{2,4,5,1,3}.
-\vspace{0.5cm}
-
-There are a few short hand macros for small common causets as shown below.
-\begin{lstlisting}
\causetFence{1}, \causetFence{2}, \ldots, \causetFence{10},
\causetClosedFence{1}, \causetClosedFence{2}, \ldots, \causetClosedFence{10},
\causetCrown
\end{lstlisting}
-\causetFence{1}, \causetFence{2}, \ldots, \causetFence{10},
-\causetClosedFence{1}, \causetClosedFence{2}, \ldots, \causetClosedFence{10},
+\causetFence{1}, \causetFence{2}, \ldots, \causetFence{10},
+\causetClosedFence{1}, \causetClosedFence{2}, \ldots, \causetClosedFence{10},
\causetCrown
-\section{Changing Sizes (Esp. for Mathematical Expressions)}
-\label{sec:Sizes}
-Apart from the pre-defined sizes \lstinline\xA7tiny\xA7, \lstinline\xA7small\xA7, \lstinline\xA7normal\xA7, \lstinline\xA7large\xA7 and \lstinline\xA7huge\xA7, sizes can be specified in the optional argument of a single causet diagram or with \lstinline\xA7\tikzcausetsset{...}\xA7 for the current scope.
-Use the keys \vspace{-1ex}
-\begin{itemize}\itemsep=-1ex
- \item \lstinline\xA7tile size=\xA7\valuePH\ stores \valuePH\ in the macro \lstinline\xA7\causetTileSize\xA7 as the size of the tiles in the permutation
- \item \lstinline\xA7region line width=\xA7\valuePH\ stores \valuePH\ in the macro \lstinline\xA7\causetRegionLine\xA7 as the thickness for the line surrounding the permutation region
- \item \lstinline\xA7grid line width=\xA7\valuePH\ stores \valuePH\ in the macro \lstinline\xA7\causetGridLine\xA7 as the line thickness of the permutation grid
- \item \lstinline\xA7event size=\xA7\valuePH\ stores \valuePH\ in the macro \lstinline\xA7\causetEventSize\xA7 as the diameter of the events
- \item \lstinline\xA7link width=\xA7\valuePH\ stores \valuePH\ in the macro \lstinline\xA7\causetLinkWidth\xA7 as the link thickness
- \item \lstinline\xA7broken link gap=\xA7\valuePH\ stores \valuePH\ in the macro \lstinline\xA7\causetBrokenLinkGap\xA7 as the gap before and after an event that interrupts a link
- \item \lstinline\xA7text scale=\xA7\valuePH\ stores \valuePH\ in the macro \lstinline\xA7\causetTextScale\xA7 as the scaling factor of all the text labels (relative to the normal font size)
-\end{itemize}
+\section{Labeling and replacing events (for infinite causets)}
+\label{sec:LabelingReplacing}
+With 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.
-For example, the \lstinline\xA7normal\xA7 size is a pre-defined style with
+By default, all events get named and labeled by the integers given in the arguments of the commands.
+For example, \lstinline\xA7\pcausetL{0,2,1}\xA7 creates the diagram \pcausetL{0,2,1} where the event notes are named \lstinline\xA7(E0)\xA7, \lstinline\xA7(E2)\xA7, \lstinline\xA7(E1)\xA7, respectively, while the label nodes have the names \lstinline\xA7(EL0)\xA7, \lstinline\xA7(EL2)\xA7, \lstinline\xA7(EL1)\xA7.
+If the permutation is displayed as well, the $u$- and $v$-coordinate labels are the nodes \lstinline\xA7(EUL\xA7\PH\lstinline\xA7)\xA7 and \lstinline\xA7(EVL\xA7\PH\lstinline\xA7)\xA7, with \PH\ taking on the values $\{0, 2, 1 \}$.
+
+To offset the names of all causet events by the same amount, use the key-value pair \lstinline\xA7offset=\xA7\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}
-\tikzcausetsset{normal/.style={tile size=0.90ex, region line width=0.06ex, grid line width=0.03ex, event size=0.48ex, link width=0.15ex, text scale=0.48}}
+\begin{align*}
+ \tikzcausetsset{large, labels={below=1pt, at=south}}
+ \cdots\quad
+ \pcausetP[offset=-12]{0,2,1,3}\quad\cdots\quad
+ \pcausetL{0,2,1,3}\quad\cdots\quad
+ \pcausetL[offset=12]{0,2,1,3}\quad\cdots
+\end{align*}
\end{lstlisting}
-However, if you want to draw a single diagram with your own sizes, use
+\vspace{-1em}
+\begin{align*}
+ \tikzcausetsset{large, labels={below=1pt, at=south}}
+ \cdots\quad
+ \pcausetP[offset=-12]{0,2,1,3}\quad\cdots\quad
+ \pcausetL{0,2,1,3}\quad\cdots\quad
+ \pcausetL[offset=12]{0,2,1,3}\quad\cdots
+\end{align*}
+Here, the three commands have the same integer argument \lstinline\xA7{0,2,1,3}\xA7, but the events are named with the specified offsets for the sub-causets, 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 events, add a slash and the new event label 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}
-\pcausetL[tile size=2.20ex, region line width=0.15ex, grid line width=0.06ex, event size=1.10ex, link width=0.35ex, text scale=1]{13,8,14,9,3,15,12,1,6,16,5,11,7,2,10,4}
+\begin{align}
+ \text{order-preserving:} &&
+ L_{\mathrm{op}} &=
+ \left\{
+ \pcausetL{1,0,2},
+ \pcausetL{1/0,0/1,2}
+ \right\}
+ , \\
+ \text{not order-preserving:} &&
+ L_{\mathrm{nop}} &=
+ \left\{
+ \pcauset{1/2,0/1,2/0},
+ \pcausetL{1,0/2,2/0},
+ \pcausetL{1/2,0,2/1},
+ \pcauset{1/0,0/2,2/1}
+ \right\}
+ .
+\end{align}
\end{lstlisting}
-\pcausetL[tile size=2.20ex, region line width=0.15ex, grid line width=0.06ex, event size=1.10ex, link width=0.35ex, text scale=1]{13,8,14,9,3,15,12,1,6,16,5,11,7,2,10,4}
+\vspace{-1em}
+\begin{align}
+ \text{order-preserving:} &&
+ L_{\mathrm{op}} &=
+ \left\{
+ \pcausetL{1,0,2},
+ \pcausetL{1/0,0/1,2}
+ \right\}
+ , \\
+ \text{not order-preserving:} &&
+ L_{\mathrm{nop}} &=
+ \left\{
+ \pcauset{1/2,0/1,2/0},
+ \pcausetL{1,0/2,2/0},
+ \pcausetL{1/2,0,2/1},
+ \pcauset{1/0,0/2,2/1}
+ \right\}
+ .
+\end{align}
-Changing sizes becomes important when you use causet diagrams in mathematical expression, where the size may be adjusted for indices or limits.
-For example:
+The replacing labels can be any text. It is recommended to write longer text labels in a \TeX\ group \lstinline\xA7{...}\xA7. Here is an example
\begin{lstlisting}
+\pcauset[large]{2/$-\infty$,6,5,7,3/{Text and maths},4/-1}
+\end{lstlisting}
+\vspace{-0.5em}
+\begin{center}
+ \pcauset[large]{2/$-\infty$,6,5,7,3/{Text and maths},4/-1}
+\end{center}
+
+Notice that replaced labels will always be visible, even if labels are deactivated (\lstinline\xA7\causetsDrawLabelsfalse\xA7) as in this example.
+To change the style of the replaced labels, add the key-value pair
+\lstinline\xA7replaced labels=\xA7\PH, which extends the style of standard labels.
+
+Similarly to the replacement of labels, you can replace event nodes by adding yet another slash and the event node text after the event integer in the permutation of the command.
+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/{$\downarrow$ continues infinitely $\downarrow$}/\rdots[90], -1,0,1,16,14,15,11,12,13,7,8,9,10, 2//\rdots[10],3,4//~,5,6//\rdots[-10]}
+\end{lstlisting}
+yields the diagram
+\begin{center}
+ \newcommand{\rdots}[1][0]{\rotatebox{#1}{...}}
+ \pcauset[large, replaced labels={below, at=south}, replaced events={text scale=1}]
+ {-2/{$\downarrow$ continues infinitely $\downarrow$}/\rdots[90], -1,0,1,16,14,15,11,12,13,7,8,9,10, 2//\rdots[10],3,4//~,5,6//\rdots[-10]}
+\end{center}
+Here, three events are replaced by ellipsis with different rotations, and one event is replaced by an empty node (\lstinline\xA7~\xA7).
+The style of the replaced events is specified via the key \lstinline\xA7replaced labels=\xA7\PH\ -- where \PH\ is \lstinline\xA7{text scale=1}\xA7 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\xA7labels=\xA7\PH, while \lstinline\xA7replaced labels=\xA7\PH\ extends this style.
+As shown in the previous example, the position of labels is defined with a key word like \lstinline\xA7left\xA7, \lstinline\xA7right\xA7, \lstinline\xA7above\xA7, \lstinline\xA7below\xA7, etc.\ (see also the TikZ manual) relative to the position given by the key \lstinline\xA7at=\xA7\PH.
+The \lstinline\xA7at\xA7 key holds a coordinate of the event note.
+The default positioning is \lstinline\xA7below left, at=south west\xA7.
+
+In summary, the three main commands take the form
+\\[1ex]
+\lstinline\xA7\pcauset{\xA7\PH[index]\lstinline\xA7/\xA7\PH[label]\lstinline\xA7/\xA7\PH[event text]\lstinline\xA7,...}\xA7
+\\[1ex]
+\lstinline\xA7\rcauset{\xA7\PH[index]\lstinline\xA7/\xA7\PH[label]\lstinline\xA7/\xA7\PH[event text]\lstinline\xA7,...}{\xA7\PH[unlink from event]\lstinline\xA7/\xA7\PH[unlink to event]\lstinline\xA7,...}\xA7
+\\[1ex]
+\lstinline\xA7\causet{\xA7\PH[index]\lstinline\xA7/\xA7\PH[label]\lstinline\xA7/\xA7\PH[event text]\lstinline\xA7,...}{\xA7\PH[link from event]\lstinline\xA7/\xA7\PH[link to event]\lstinline\xA7,...}\xA7
+\\[1ex]
+The full notation for the short hand macros (see \autoref{sec:ShortHandMacros}) is similar.
+
+\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\xA7tiny\xA7 is $\frac{1}{3}$ times the normal size
+ \item \lstinline\xA7very small\xA7 is $\frac{4}{9}$ times the normal size
+ \item \lstinline\xA7small\xA7 is $\frac{2}{3}$ times the normal size
+ \item \lstinline\xA7large\xA7 is $\frac{3}{2}$ times the normal size
+ \item \lstinline\xA7very large\xA7 is $\frac{9}{4}$ times the normal size
+ \item \lstinline\xA7huge\xA7 is $3$ times the normal size
+\end{itemize}
+Apart from the pre-defined sizes, a causet can be scaled to any size using \lstinline\xA7size unit=\xA7\PH\ (which is equal to the tile size, \lstinline\xA7tile size=\xA7\PH).
+The normal size unit has the value \lstinline\xA70.9ex\xA7.
+
+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}
\left\{
- \pcauset{1,2,3},
- \;\pcauset{1,3,2,4},
- \;\pcauset{1,4,3,2,5},
- \;\pcauset{1,5,4,3,2,6}
+ \pcauset{1,2,3},\;
+ \pcauset{1,3,2,4},\;
+ \pcauset{1,4,3,2,5},\;
+ \pcauset{1,5,4,3,2,6}
\right\}}
- | 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|
+ | 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}
\left\{
- \pcauset{1,2,3},
- \;\pcauset{1,3,2,4},
- \;\pcauset{1,4,3,2,5},
- \;\pcauset{1,5,4,3,2,6}
+ \pcauset{1,2,3},
+ \;\pcauset{1,3,2,4},
+ \;\pcauset{1,4,3,2,5},
+ \;\pcauset{1,5,4,3,2,6}
\right\}}
- | C |
+ | C |
= \left| \pcauset{1,2,3} \right|
+ \left| \pcauset{1,3,2,4} \right|
+ \left| \pcauset{1,4,3,2,5} \right|
@@ -540,35 +702,74 @@
+ \left| \pcauset{1,5,4,3,2,6} \right|
\end{equation}
-\section{Changing Colors}
+Like any other options, sizes can also be specified in the optional argument of a single causet diagram or with \lstinline\xA7\tikzcausetsset{...}\xA7 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\xA7tile size=\xA7\PH\ to store \PH\ in the macro \lstinline\xA7\causetTileSize\xA7 as the size of the tiles in the permutation (this is equivalent to setting the size unit),
+ \item \lstinline\xA7region line width=\xA7\PH\ to set the thickness for the line surrounding the permutation region,
+ \item \lstinline\xA7grid line width=\xA7\PH\ to set the line thickness of the permutation grid,
+ \item \lstinline\xA7event size=\xA7\PH\ to set the diameter of the events,
+ \item \lstinline\xA7event outline=\xA7\PH\ to set the thickness of the transparent line around the events,
+ \item \lstinline\xA7link width=\xA7\PH\ to set the link thickness, and
+ \item \lstinline\xA7broken link gap=\xA7\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\xA7text font=\xA7\PH\ to set the font used for all the text labels -- for example, \lstinline\xA7text font=\fontsize{13}{15.6}\selectfont\xA7\ sets the font size to 13pt (and the baseline skip to 1.2 times this font size),
+ \item \lstinline\xA7text scale=\xA7\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\xA7tiny\xA7 is typeset with \lstinline\xA7\tiny\xA7 (scaled by 0.30)
+ \item \lstinline\xA7very small\xA7 is typeset with \lstinline\xA7\tiny\xA7 (scaled by 0.40)
+ \item \lstinline\xA7small\xA7 is typeset with \lstinline\xA7\scriptsize\xA7 (scaled by 0.43)
+ \item \lstinline\xA7normal\xA7 is typeset with \lstinline\xA7\footnotesize\xA7 (scaled by 0.56)
+ \item \lstinline\xA7large\xA7 is typeset with \lstinline\xA7\small\xA7 (scaled by 0.75)
+ \item \lstinline\xA7very large\xA7 is typeset with \lstinline\xA7\normalsize\xA7 (scaled by 1.02)
+ \item \lstinline\xA7huge\xA7 is typeset with \lstinline\xA7\Large\xA7 (scaled by 0.97)
+\end{itemize}
+
+Below is an example for a diagram drawn with some sizes defined manually:
+\begin{lstlisting}
+\pcausetL[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}
+ \pcausetL[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 colours}
\label{sec:Colors}
Colors can be set with the following keys: \vspace{-1ex}
\begin{itemize}\itemsep=-1ex
- \item \lstinline\xA7region color=\xA7\valuePH\ for the frame of the permutation grid
- \item \lstinline\xA7grid color=\xA7\valuePH\ for the lines of the permutation grid
- \item \lstinline\xA7tile color=\xA7\valuePH\ for the occupied tiles
- \item \lstinline\xA7ulabel color=\xA7\valuePH\ for the $u$ labels
- \item \lstinline\xA7vlabel color=\xA7\valuePH\ for the $v$ labels
- \item \lstinline\xA7event color=\xA7\valuePH\ for the events
- \item \lstinline\xA7label color=\xA7\valuePH\ for the event labels
- \item \lstinline\xA7link color=\xA7\valuePH\ for the links
- \item \lstinline\xA7spatial link color=\xA7\valuePH\ for the spatial links.
+ \item \lstinline\xA7region color=\xA7\PH\ (or \lstinline\xA7region color=\xA7\PH) for the frame of the permutation grid
+ \item \lstinline\xA7grid color=\xA7\PH\ (or \lstinline\xA7grid color=\xA7\PH) for the lines of the permutation grid
+ \item \lstinline\xA7tile color=\xA7\PH\ (or \lstinline\xA7tile color=\xA7\PH) for the occupied tiles
+ \item \lstinline\xA7ulabel color=\xA7\PH\ (or \lstinline\xA7ulabel color=\xA7\PH) for the $u$ labels
+ \item \lstinline\xA7vlabel color=\xA7\PH\ (or \lstinline\xA7vlabel color=\xA7\PH) for the $v$ labels
+ \item \lstinline\xA7event color=\xA7\PH\ (or \lstinline\xA7event color=\xA7\PH) for the events
+ \item \lstinline\xA7label color=\xA7\PH\ (or \lstinline\xA7label color=\xA7\PH) for the event labels
+ \item \lstinline\xA7link color=\xA7\PH\ (or \lstinline\xA7link color=\xA7\PH) for the links
+ \item \lstinline\xA7spatial link color=\xA7\PH\ (or \lstinline\xA7spatial link color=\xA7\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\xA7\tikzcausetsset\xA7 macro, for example
+When using any of these key-value pairs in an optional arguments of the causet macros, they apply to that diagram.
+To change colours within a scope or the entire document, use the \lstinline\xA7\tikzcausetsset\xA7 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.
+changes the event colour to purple and the link colour to cyan.
-For the pre-defined color schemes, use the keys \lstinline\xA7gray colors\xA7 (default colors), \lstinline\xA7black colors\xA7 (only black and white), \lstinline\xA7blue colors\xA7 (blue color tones), or \lstinline\xA7neon colors\xA7 (bright colors).
-These keys set all the colors listed above to pre-defined values.
+For the pre-defined colour schemes, use the keys \lstinline\xA7gray colors\xA7 (or \lstinline\xA7gray colors\xA7, default), \lstinline\xA7black colors\xA7 (or \lstinline\xA7black colors\xA7, only black and white), \lstinline\xA7blue colors\xA7 (or \lstinline\xA7blue colors\xA7, blue colour tones), or \lstinline\xA7neon colors\xA7 (or \lstinline\xA7neon colors\xA7, bright colours).
+These keys set all the colours listed above to pre-defined values.
-\section{Standalone Causets}
+\section{Standalone causets}
\label{sec:Standalone}
-For any document that contains many (large) causet diagrams or the same causets that are used repeatedly, the compilation time can be reduced by putting the commands in external files using the \lstinline\xA7standalone\xA7 package.
+For any document that contains many (large) causet diagrams or the same causets that are used repeatedly, the compilation time can be reduced by placing the commands in external files using the \lstinline\xA7standalone\xA7 package.
-For example, create a file named \lstinline\xA7mycauset.tex\xA7 in the same directory as the main file with the following code:
+For example, create a file named \lstinline\xA7mycauset.tex\xA7 in the same directory as the main file with the following code:
\begin{lstlisting}
\documentclass[tikz]{standalone}
\usepackage{causets}
@@ -576,22 +777,21 @@
\pcauset{3,2,4,1}
\end{document}
\end{lstlisting}
-The compiled version is then included with the macro \lstinline\xA7\causetfile{mycauset}\xA7.
-The macro \lstinline\xA7\causetfile[#1]{#2}\xA7 also accepts one optional argument \lstinline\xA7[#1]\xA7 and redirects to
+The compiled version is then included with the macro \lstinline\xA7\causetfile{mycauset}\xA7.
+The macro \lstinline\xA7\causetfile[#1]{#2}\xA7 also accepts one optional argument \lstinline\xA7[#1]\xA7 and redirects to
\begin{lstlisting}
\includegraphics[#1]{\causetspath/#2}
\end{lstlisting}
-The macro \lstinline\xA7\causetspath\xA7 is pre-defined to \lstinline\xA7.\xA7 (the directory of the main \TeX\ file), but may be renewed to any desired directory with
+The macro \lstinline\xA7\causetspath\xA7 is pre-defined to \lstinline\xA7.\xA7 (the directory of the main \TeX\ file), but may be renewed to any desired directory with
\begin{lstlisting}
\renewcommand{\causetspath}{my_causet_directory}
\end{lstlisting}
-\clearpage
-\section{Advanced Style Changes}
-In the optional argument of the causet macros, you may use other TikZ options to change the output of the macros, for example:
+\section{Style changes in detail}
+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} ...
+... \begin{document} ...
A labeled causet with red-framed semi-transparent labels, \pcausetL[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, \pcausetL[labels={draw=red, fill=white, opacity=0.8, inner sep=1pt, scale=1.5}]{2,4,5,1,3}.
@@ -598,26 +798,26 @@
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\xA7region=\xA7\valuePH\ shows the permutation (\lstinline\xA7show permutation\xA7) and appends to the style of the permutation frame,
- \item \lstinline\xA7grid=\xA7\valuePH\ shows the permutation (\lstinline\xA7show permutation\xA7) and appends to the style of the permutation grid,
- \item \lstinline\xA7tiles=\xA7\valuePH\ shows the permutation (\lstinline\xA7show permutation\xA7) and appends to the style of the occupied permutation tiles,
- \item \lstinline\xA7events=\xA7\valuePH\ appends to the style of the event nodes (graph vertices),
- \item \lstinline\xA7links=\xA7\valuePH\ shows the links (\lstinline\xA7show links\xA7) and appends to the style of the links (main graph edges),
- \item \lstinline\xA7link starts=\xA7\valuePH\ sets the starting line tip of each link,
- \item \lstinline\xA7link ends=\xA7\valuePH\ sets the ending line tip of each link,
- \item \lstinline\xA7link pauses=\xA7\valuePH\ sets the ending line tip of each link at an interruption,
- \item \lstinline\xA7link resumes=\xA7\valuePH\ sets the starting line tip of each link at an interruption,
+ \item \lstinline\xA7region=\xA7\PH\ shows the permutation (\lstinline\xA7show permutation\xA7) and appends to the style of the permutation frame,
+ \item \lstinline\xA7grid=\xA7\PH\ shows the permutation (\lstinline\xA7show permutation\xA7) and appends to the style of the permutation grid,
+ \item \lstinline\xA7tiles=\xA7\PH\ shows the permutation (\lstinline\xA7show permutation\xA7) and appends to the style of the occupied permutation tiles,
+ \item \lstinline\xA7events=\xA7\PH\ appends to the style of the event nodes (graph vertices),
+ \item \lstinline\xA7links=\xA7\PH\ shows the links (\lstinline\xA7show links\xA7) and appends to the style of the links (main graph edges),
+ \item \lstinline\xA7link starts=\xA7\PH\ sets the starting line tip of each link,
+ \item \lstinline\xA7link ends=\xA7\PH\ sets the ending line tip of each link,
+ \item \lstinline\xA7link pauses=\xA7\PH\ sets the ending line tip of each link at an interruption,
+ \item \lstinline\xA7link resumes=\xA7\PH\ sets the starting line tip of each link at an interruption,
\item \lstinline\xA7cap links\xA7 sets the starting and ending line tip of each link to a (reversed) cap,
\item \lstinline\xA7arrow links\xA7 sets the ending line tip of each link to a rounded, open, stealth arrow,
- \item \lstinline\xA7spatial links=\xA7\valuePH\ shows the spatial links (\lstinline\xA7show spatial links\xA7) and appends to the style of the spatial links (secondary graph edges),
- \item \lstinline\xA7all labels=\xA7\valuePH\ appends to the general style of all text labels (applies to the following three label types),
- \item \lstinline\xA7labels=\xA7\valuePH\ shows the event labels (\lstinline\xA7show labels\xA7) and appends to the style that applies only to the event labels,
- \item \lstinline\xA7ulabels=\xA7\valuePH\ shows the $u$ labels (\lstinline\xA7show ulabels\xA7) and appends to the style that applies only to the $u$ labels, and
- \item \lstinline\xA7vlabels=\xA7\valuePH\ shows the $v$ labels (\lstinline\xA7show vlabels\xA7) and appends to the style that applies only to the $v$ labels.
+ \item \lstinline\xA7spatial links=\xA7\PH\ shows the spatial links (\lstinline\xA7show spatial links\xA7) and appends to the style of the spatial links (secondary graph edges),
+ \item \lstinline\xA7all labels=\xA7\PH\ appends to the general style of all text labels (applies to the following three label types),
+ \item \lstinline\xA7labels=\xA7\PH\ shows the event labels (\lstinline\xA7show labels\xA7) and appends to the style that applies only to the event labels,
+ \item \lstinline\xA7ulabels=\xA7\PH\ shows the $u$ labels (\lstinline\xA7show ulabels\xA7) and appends to the style that applies only to the $u$ labels, and
+ \item \lstinline\xA7vlabels=\xA7\PH\ shows the $v$ labels (\lstinline\xA7show vlabels\xA7) 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\xA7every causet\xA7 for the general style of the causet diagram (like \lstinline\xA7baseline\xA7),
+ \item \lstinline\xA7every causet\xA7 for the general style of the causet diagram (like \lstinline\xA7baseline\xA7, see below),
\item \lstinline\xA7every tile\xA7 for the occupied permutation tiles,
\item \lstinline\xA7every event\xA7 for the event nodes (graph vertices),
\item \lstinline\xA7every grid\xA7 for the permutation grid,
@@ -629,70 +829,129 @@
\item \lstinline\xA7every spatial link\xA7 for the spacelike separations, and
\item \lstinline\xA7every label\xA7 for the event labels.
\end{enumerate}
-With the macro \lstinline\xA7\tikzcausetsset{...}\xA7, any of these styles can also be set in the preamble of the document.
-So, for example,
+With the macro \lstinline\xA7\tikzcausetsset{...}\xA7, 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{2,4,5,1,3}
+... \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 link ends, like \pcauset[events={rectangle}, links={-Triangle Cap[]}]{2,4,5,1,3}.
+will generate all causets with square nodes as events and triangle caps on the future link ends, like \pcauset[large, events={rectangle}, links={-Triangle Cap[]}]{2,4,5,1,3}.
+\vspace{1ex}
-\section{Using this Package with TikZ}
+By default, causets are placed such that a pre-defined coordinate point falls on the text baseline, \lstinline\xA7baseline=(baseline point)\xA7.
+The baseline point is \lstinline\xA7tile size\xA7/$\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[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\xA7\draw...\xA7.
-The \lstinline\xA7\draw\xA7 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\xA7P\xA7, \lstinline\xA7L\xA7 or \lstinline\xA7X\xA7.
+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\xA7\draw...\xA7.
+The \lstinline\xA7\draw\xA7 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\xA7P\xA7, \lstinline\xA7L\xA7 or \lstinline\xA7X\xA7.
-The two following examples are given by external (standalone) TikZ graphics and included with \lstinline\xA7\causetfile{...}\xA7.
-More details on using causets in standalone files are given in \autoref{sec:Standalone}.
+The two following examples are given by external (standalone) TikZ graphics and included with \lstinline\xA7\causetfile{...}\xA7.
+More details on using causets in standalone files are given in \autoref{sec:Standalone}.
-Note that the output of the \lstinline\xA7\draw\xA7 macros has the point (0,0) in the center, so in order to shift it, we may enclose it in a TikZ scope, for example:
+Note that the output of the \lstinline\xA7\draw\xA7 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{causet_tikz_example1.tex}
-\causetfile{causet_tikz_example1}
+\begin{center}
+ \causetfile{causet_tikz_example1}
+\end{center}
-Note that this example also shows how to use the event nodes that are generated by the \lstinline\xA7\drawpcauset\xA7 macro.
-The green arrow points to the node of the second causet event \lstinline\xA7(E5)\xA7.
-The causet events, event labels, $u$-axis labels, and $v$-axis lables are the nodes \lstinline\xA7(Ei)\xA7, \lstinline\xA7(ELi)\xA7, \lstinline\xA7(EULi)\xA7, and \lstinline\xA7(EVLi)\xA7, respectively, where $\smash{i \in [ 1, N ]}$ for a causet with $N$ events.
+Note that this example also shows how to use the event nodes that are generated by the \lstinline\xA7\drawpcauset\xA7 macro.
+The green arrow points to the node of the second causet event \lstinline\xA7(E5)\xA7.
+The causet events, event labels, $u$-axis labels, and $v$-axis lables are the nodes \lstinline\xA7(Ei)\xA7, \lstinline\xA7(ELi)\xA7, \lstinline\xA7(EULi)\xA7, and \lstinline\xA7(EVLi)\xA7, respectively, where $\smash{i \in [ 1, N ]}$ for a causet with $N$ events.
-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\xA7\pcauset\xA7 (\lstinline\xA7\rcauset\xA7 or \lstinline\xA7\causet\xA7) commands without the \lstinline\xA7draw\xA7 prefix again:
+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\xA7\pcauset\xA7 (\lstinline\xA7\rcauset\xA7 or \lstinline\xA7\causet\xA7) commands without the \lstinline\xA7draw\xA7 prefix again:
\lstinputlisting{causet_tikz_example2.tex}
-\hspace{-3.0ex}\causetfile{causet_tikz_example2}
+\hspace{-1.5ex}\causetfile{causet_tikz_example2}
-\clearpage
-\section{Updates}
-\subsection{Version 1.1}
+\noindent
+More examples can be found at \\
+\url{https://github.com/c-minz/LaTeX-causets/tree/main/examples}
+
+%\clearpage
+\section{Release notes}
+\tikzcausetsset{large, events={black!20}, links={black!10}, cap links, label color={black!30}}
+\subsection{v1.3, 2022-05-23}
\begin{itemize}\itemsep=-1ex
- \item All colors, size and style options have been moved to PGF keys in the path
+ \item \versioncauset{v1-3}{\pcauset[replaced labels={left=0.5ex, at=west}]{1,4,2,3/.3}}%
+ The numbers for the arguments of the causet commands may now be chosen from an interval $[ a, b ]$, where $a$ and $b$ do no longer have to be natural numbers but are any integers ($a \leq b$) including 0 and negative numbers to name and label the events of the causet.
+ \item The integers given in the arguments of the causet commands that name (and auto label) events may now be modified with \lstinline\xA7offset=\xA7\PH\ (0 by default) before the events are named and labeled with the given numbers.
+ \item All sizes are now scaled with respect to the normal size and the line thickness of the event outline has been corrected.
+ \item The following size macros are no longer supported: \\
+ \lstinline\xA7\causetRegionLine\xA7, \lstinline\xA7\causetGridLine\xA7, \lstinline\xA7\causetEventSize\xA7, \lstinline\xA7\causetLinkWidth\xA7, and \\ \lstinline\xA7\causetBrokenLinkGap\xA7.
+ The respective values are now stored in PGF keys and are measured with respect to the size unit (stored in \lstinline\xA7\causetTileSize\xA7).
+ \item For all labels in the diagram, the font size is now adjustable with \lstinline\xA7text font=\xA7\PH\ (additionally to \lstinline\xA7text scale=\xA7\PH), for example to set the font size to 20pt (and a baseline skip of 24pt), use
\begin{lstlisting}
-/tikz/causets/
+text font=\fontsize{20}{24}\selectfont
\end{lstlisting}
+ \item Event labels and the event nodes itself may now be replaced by user-defined text in order to label events manually or use symbols like \lstinline\xA7...\xA7 for representations of infinite causets.
+ \item The package options have been fixed, they are now all single word options.
+ \item The short hand macros \lstinline\xA7\*causetL...\xA7 now deactivate the permutation and \\ \lstinline\xA7\*causetP...\xA7 now deactivate labels (if activated previously).
\end{itemize}
-\subsection{Version 1.2}
+\subsection{v1.2, 2022-02-07}
\begin{itemize}\itemsep=-1ex
- \item The color option \lstinline\xA7blue\xA7 has been modified so that a diagram is now only colored in different shades of blue, gray and black.
- \item Every event label is now positioned relative to the center point of an event, so that the position of event labels can be modified with \lstinline\xA7left=\xA7\valuePH, \lstinline\xA7right=\xA7\valuePH, etc.
- \item Arrow tips may now be added to the start and end of links via the style settings \lstinline\xA7link starts=\xA7\valuePH\ and \lstinline\xA7link ends=\xA7\valuePH, or via the pre-defined styles \lstinline\xA7cap links\xA7 and \lstinline\xA7arrow links\xA7.
- \item By default, links drawn by the command \lstinline\xA7\causet\xA7 are now broken if they cross over an event.
-The style of the start and end of the link interruption are set with \lstinline\xA7link pauses=\xA7\valuePH\ and \lstinline\xA7link resumes=\xA7\valuePH.
+ \item \versioncauset{v1-2}{\pcauset{1,3,2}}%
+ The colour option \lstinline\xA7blue\xA7 has been modified so that a blue diagram is now only coloured in different shades of blue, gray and black.
+ \item Every event label is now positioned relative to the centre point of an event, so that the position of event labels can be modified with \lstinline\xA7left=\xA7\PH, \lstinline\xA7right=\xA7\PH, etc.
+ \item Arrow tips may now be added to the start and end of links via the style settings \lstinline\xA7link starts=\xA7\PH\ and \lstinline\xA7link ends=\xA7\PH, or via the pre-defined styles \lstinline\xA7cap links\xA7 and \lstinline\xA7arrow links\xA7.
+ \item By default, links drawn by the command \lstinline\xA7\causet\xA7 are now broken if they cross over an event.
+The style of the start and end of the link interruption are set with \lstinline\xA7link pauses=\xA7\PH\ and \lstinline\xA7link resumes=\xA7\PH.
\item Links between spacelike separated events are now also supported by the command \lstinline\xA7\rcauset\xA7.
- \item More details have been added to this manual, especially to \autoref{sec:PackageOptions}.
\end{itemize}
-\section{Bug Reports and Package Requests}
+\subsection{v1.1, 2020-12-15}
+\tikzcausetsset{link starts={}, link ends={}}
+\begin{itemize}\itemsep=-1ex
+ \item \versioncauset{v1-1}{\pcauset{1,2}}%
+ All colours, 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}
+\begin{itemize}\itemsep=-1ex
+ \item \versioncauset{v1-0}{\pcauset{1}}%
+ First release of the package \lstinline\xA7causets\xA7 on CTAN, \url{https://ctan.org/pkg/causets}, including all the main commands.
+\end{itemize}
+
+\noindent
+Older versions of the package are at \\
+\url{https://github.com/c-minz/LaTeX-causets/tree/main/previous_versions}
+
+\section{Bug reports and package requests}
\label{sec:PackageDevelopment}
-Problems with the package are reported here: \\
-\url{https://github.com/c-minz/LaTeX-causets/issues}
+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.
+ \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}
+
+%% Size testing:
+\documentclass[tikz,10pt]{standalone}
+\usepackage[blue]{causets}
+\begin{document}
+\pcauset[tiny]{1,3,2,4}
+\pcauset[very small]{1,3,2,4}
+\pcauset[small]{1,3,2,4}
+\pcauset{1,3,2,4}
+\pcauset[large]{1,3,2,4}
+\pcauset[very large]{1,3,2,4}
+\pcauset[huge]{1,3,2,4}
+\end{document}
Modified: trunk/Master/texmf-dist/tex/latex/causets/causets.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/causets/causets.sty 2022-05-22 13:13:46 UTC (rev 63365)
+++ trunk/Master/texmf-dist/tex/latex/causets/causets.sty 2022-05-22 20:19:01 UTC (rev 63366)
@@ -1,16 +1,16 @@
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{causets}[2022/02/07 v1.2 Package to draw causal set diagrams]
+\ProvidesPackage{causets}[2022/05/23 v1.3 Package to draw causal set diagrams]
%% Copyright 2020-2022 by C. Minz
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
-% of this license or (at your option) any later version.
-% The latest version of this license is in
+% of this licence or (at your option) any later version.
+% The latest version of this licence is in
% http://www.latex-project.org/lppl.txt
%
% This work has the LPPL maintenance status "maintained".
%
-% The current version of this package is 1.2.
+% The current version of this package is 1.3.
%
% The current maintainer of this work is C. Minz.
% https://github.com/c-minz
@@ -22,72 +22,62 @@
\RequirePackage{tikz}
\usepgflibrary{arrows.meta}
-%% PGF keys:
+%% PGF keys and style macros:
\def\tikzcausetsset#1{\pgfqkeys{/tikz/causets}{#1}}
\pgfkeys{/tikz/causets/.search also={/tikz}}
-% size options:
+% Size options:
\tikzcausetsset{%
+ size unit/.store in=\causetTileSize,
+ size unit/.value required,
tile size/.store in=\causetTileSize,
tile size/.value required,
- region line width/.store in=\causetRegionLine,
- region line width/.value required,
- grid line width/.store in=\causetGridLine,
- grid line width/.value required,
- event size/.store in=\causetEventSize,
- event size/.value required,
- link width/.store in=\causetLinkWidth,
- link width/.value required,
- broken link gap/.store in=\causetBrokenLinkGap,
- broken link gap/.value required,
+ text font/.store in=\causetTextFont,
+ text font/.value required,
text scale/.store in=\causetTextScale,
text scale/.value required,
+ region line width/.initial=0.07*\causetTileSize,
+ grid line width/.initial=0.04*\causetTileSize,
+ event size/.initial=0.56*\causetTileSize,
+ event outline/.initial=0.04*\causetTileSize,
+ link width/.initial=0.14*\causetTileSize,
+ broken link gap/.initial=0.42*\causetTileSize,
tiny/.value forbidden,
+ tiny/.style={%
+ size unit=0.30ex,
+ text font=\tiny,
+ text scale=0.30},
+ very small/.value forbidden,
+ very small/.style={%
+ size unit=0.40ex,
+ text font=\tiny,
+ text scale=0.40},
small/.value forbidden,
+ small/.style={%
+ size unit=0.60ex,
+ text font=\scriptsize,
+ text scale=0.43},
normal/.value forbidden,
+ normal/.style={%
+ size unit=0.90ex,
+ text font=\footnotesize,
+ text scale=0.56},
large/.value forbidden,
- huge/.value forbidden,
- tiny/.style={%
- tile size=0.30ex,
- region line width=0.02ex,
- grid line width=0.01ex,
- event size=0.16ex,
- link width=0.05ex,
- broken link gap=0.15ex,
- text scale=0.16},
- small/.style={%
- tile size=0.60ex,
- region line width=0.04ex,
- grid line width=0.02ex,
- event size=0.32ex,
- link width=0.10ex,
- broken link gap=0.30ex,
- text scale=0.32},
- normal/.style={%
- tile size=0.90ex,
- region line width=0.06ex,
- grid line width=0.03ex,
- event size=0.48ex,
- link width=0.15ex,
- broken link gap=0.45ex,
- text scale=0.48},
large/.style={%
- tile size=1.35ex,
- region line width=0.09ex,
- grid line width=0.05ex,
- event size=0.75ex,
- link width=0.20ex,
- broken link gap=0.60ex,
+ size unit=1.35ex,
+ text font=\small,
text scale=0.75},
+ very large/.value forbidden,
+ very large/.style={%
+ size unit=2.025ex,
+ text font=\normalsize,
+ text scale=1.02},
+ huge/.value forbidden,
huge/.style={%
- tile size=1.80ex,
- region line width=0.12ex,
- grid line width=0.07ex,
- event size=1.00ex,
- link width=0.25ex,
- broken link gap=0.75ex,
- text scale=1.00}
+ size unit=2.70ex,
+ text font=\Large,
+ text scale=0.97}
}
-% color options:
+% Colour options:
\tikzcausetsset{%
region color/.initial=black!75,
grid color/.initial=black!25,
@@ -139,7 +129,13 @@
ulabel color=magenta,
vlabel color=magenta}
}
-% styles:
+% Causet modification options:
+\tikzcausetsset{%
+ offset/.store in=\causet at Offset,
+ every causet/.value forbidden,
+ every causet/.style={baseline=(baseline point)}
+}
+% Graphic component switches:
\newif\ifcausetsDrawPermutation
\newif\ifcausetsDrawLinks
\newif\ifcausetsBreakLinks
@@ -167,26 +163,58 @@
labeled u/.code={\causetsDrawULabelstrue},
unlabeled u/.code={\causetsDrawULabelsfalse},
labeled v/.code={\causetsDrawVLabelstrue},
- unlabeled v/.code={\causetsDrawVLabelsfalse},
+ unlabeled v/.code={\causetsDrawVLabelsfalse}
+}
+% Permutation grid styles:
+\tikzcausetsset{%
every region/.value forbidden,
- every region/.style={color=\pgfkeysvalueof{/tikz/causets/region color}, line width=\causetRegionLine},
+ every region/.style={color=\pgfkeysvalueof{/tikz/causets/region color}, line width=\pgfkeysvalueof{/tikz/causets/region line width}},
region/.style={show permutation, every region/.append style={#1}},
every grid/.value forbidden,
- every grid/.style={color=\pgfkeysvalueof{/tikz/causets/grid color}, line width=\causetGridLine, step=\causetTileSize},
+ every grid/.style={color=\pgfkeysvalueof{/tikz/causets/grid color}, line width=\pgfkeysvalueof{/tikz/causets/grid line width}, step=\causetTileSize},
grid/.style={show permutation, every grid/.append style={#1}},
every tile/.value forbidden,
- every tile/.style={color=\pgfkeysvalueof{/tikz/causets/tile color}, line width=\causetGridLine, fill},
- tiles/.style={show permutation, every tile/.append style={#1}},
+ every tile/.style={color=\pgfkeysvalueof{/tikz/causets/tile color}, line width=\pgfkeysvalueof{/tikz/causets/grid line width}, fill},
+ tiles/.style={show permutation, every tile/.append style={#1}}
+}
+% Label styles:
+\tikzcausetsset{%
+ every label base/.value forbidden,
+ every label base/.style={text opacity=1, scale=\causetTextScale, font=\causetTextFont, inner sep=0pt},
+ all labels/.style={every label base/.append style={#1}},
+ at/.initial=center,
+ every label/.value forbidden,
+ every label/.style={every label base, color=\pgfkeysvalueof{/tikz/causets/label color}, below left, at=south west},
+ labels/.style={show labels, every label/.append style={#1}},
+ every ulabel/.value forbidden,
+ every ulabel/.style={every label base, color=\pgfkeysvalueof{/tikz/causets/ulabel color}, right, rotate=-45, inner sep=1pt, align=left},
+ ulabels/.style={show ulabels, every ulabel/.append style={#1}},
+ every vlabel/.value forbidden,
+ every vlabel/.style={every label base, color=\pgfkeysvalueof{/tikz/causets/vlabel color}, left, rotate=45, inner sep=1pt, align=right},
+ vlabels/.style={show vlabels, every vlabel/.append style={#1}},
+ every replaced label/.value forbidden,
+ every replaced label/.style={every label},
+ replaced labels/.style={every replaced label/.append style={#1}}
+}
+% Event styles:
+\tikzcausetsset{%
every event/.value forbidden,
- every event/.style={color=\pgfkeysvalueof{/tikz/causets/event color}, circle, fill, inner sep=0pt, minimum size=\causetEventSize},
+ every event/.style={color=\pgfkeysvalueof{/tikz/causets/event color}, circle, fill, inner sep=0pt, minimum size=\pgfkeysvalueof{/tikz/causets/event size}, line width=\pgfkeysvalueof{/tikz/causets/event outline}},
events/.value required,
events/.style={every event/.append style={#1}},
+ every replaced event/.value forbidden,
+ every replaced event/.style={every label base, circle, minimum size=\pgfkeysvalueof{/tikz/causets/event size}},
+ replaced events/.value required,
+ replaced events/.style={every replaced event/.append style={#1}}
+}
+% Link styles:
+\tikzcausetsset{%
Link Start/.tip={},
Link Pause/.tip={Triangle Cap[] . Fast Triangle[] . Fast Triangle[]},
Link Resume/.tip={Triangle Cap[reversed] . Fast Triangle[reversed] . Fast Triangle[reversed]},
Link End/.tip={},
every link/.value forbidden,
- every link/.style={color=\pgfkeysvalueof{/tikz/causets/link color}, line width=\causetLinkWidth, {Link Start[]}-{Link End[]}},
+ every link/.style={color=\pgfkeysvalueof{/tikz/causets/link color}, line width=\pgfkeysvalueof{/tikz/causets/link width}, {Link Start[]}-{Link End[]}},
links/.style={show links, every link/.append style={#1}},
link starts/.value required,
link starts/.style={Link Start/.tip={#1}},
@@ -199,135 +227,129 @@
cap links/.value forbidden,
cap links/.style={link starts={Triangle Cap[reversed]}, link ends={Triangle Cap[]}},
arrow links/.value forbidden,
- arrow links/.style={link ends={Stealth[round, open, length=4*\causetLinkWidth, line width=\causetLinkWidth/3]}},
+ arrow links/.style={link ends={Stealth[round, open, length=4*\pgfkeysvalueof{/tikz/causets/link width}, line width=\pgfkeysvalueof{/tikz/causets/link width}/3]}},
every spatial link/.value forbidden,
every spatial link/.style={every link, color=\pgfkeysvalueof{/tikz/causets/spatial link color}, dashed},
- spatial links/.style={show spatial links, every spatial link/.append style={#1}},
- every label base/.value forbidden,
- every label base/.style={text opacity=1.0, scale=\causetTextScale, inner sep=0.5*\causetTextScale ex},
- all labels/.style={every label base/.append style={#1}},
- every label/.value forbidden,
- every label/.style={every label base, color=\pgfkeysvalueof{/tikz/causets/label color}, below left},
- labels/.style={show labels, every label/.append style={#1}},
- every ulabel/.value forbidden,
- every ulabel/.style={every label base, color=\pgfkeysvalueof{/tikz/causets/ulabel color}, right, rotate=-45, align=left},
- ulabels/.style={show ulabels, every ulabel/.append style={#1}},
- every vlabel/.value forbidden,
- every vlabel/.style={every label base, color=\pgfkeysvalueof{/tikz/causets/vlabel color}, left, rotate=45, align=right},
- vlabels/.style={show vlabels, every vlabel/.append style={#1}},
- every causet/.value forbidden,
- every causet/.style={baseline=-0.707*\causetTileSize}
+ spatial links/.style={show spatial links, every spatial link/.append style={#1}}
}
-%% delare and execute options:
-\tikzcausetsset{normal}
+%% Package options:
+\tikzcausetsset{normal, offset=0}
\causetsDrawLinkstrue
\causetsBreakLinkstrue
\causetsDrawULabelstrue
\causetsDrawVLabelstrue
\DeclareOption{tiny}{\tikzcausetsset{tiny}}
+\DeclareOption{smaller}{\tikzcausetsset{very small}}
\DeclareOption{small}{\tikzcausetsset{small}}
\DeclareOption{large}{\tikzcausetsset{large}}
+\DeclareOption{larger}{\tikzcausetsset{very large}}
\DeclareOption{huge}{\tikzcausetsset{huge}}
\DeclareOption{gray}{\tikzcausetsset{gray colors}}
\DeclareOption{black}{\tikzcausetsset{black colors}}
\DeclareOption{blue}{\tikzcausetsset{blue colors}}
\DeclareOption{neon}{\tikzcausetsset{neon colors}}
-\DeclareOption{gray colors}{\tikzcausetsset{gray colors}}
-\DeclareOption{black colors}{\tikzcausetsset{black colors}}
-\DeclareOption{blue colors}{\tikzcausetsset{blue colors}}
-\DeclareOption{neon colors}{\tikzcausetsset{neon colors}}
\DeclareOption{linked}{\causetsDrawLinkstrue}
\DeclareOption{unlinked}{\causetsDrawLinksfalse}
-\DeclareOption{cap linked}{\tikzcausetsset{cap links}}
-\DeclareOption{arrow linked}{\tikzcausetsset{arrow links}}
-\DeclareOption{brokenly linked}{\causetsBreakLinkstrue}
-\DeclareOption{continuously linked}{\causetsBreakLinksfalse}
-\DeclareOption{spatially linked}{\causetsDrawSpatialLinkstrue}
-\DeclareOption{spatially unlinked}{\causetsDrawSpatialLinksfalse}
+\DeclareOption{caps}{\tikzcausetsset{cap links}}
+\DeclareOption{arrows}{\tikzcausetsset{arrow links}}
+\DeclareOption{continuous}{\causetsBreakLinksfalse}
+\DeclareOption{spatial}{\causetsDrawSpatialLinkstrue}
\DeclareOption{permutation}{\causetsDrawPermutationtrue}
\DeclareOption{labeled}{\causetsDrawLabelstrue}
\DeclareOption{unlabeled}{\causetsDrawLabelsfalse}
-\DeclareOption{labeled u}{\causetsDrawULabelstrue}
-\DeclareOption{unlabeled u}{\causetsDrawULabelsfalse}
-\DeclareOption{labeled v}{\causetsDrawVLabelstrue}
-\DeclareOption{unlabeled v}{\causetsDrawVLabelsfalse}
+\DeclareOption{ulabeled}{\causetsDrawULabelstrue}
+\DeclareOption{uunlabeled}{\causetsDrawULabelsfalse}
+\DeclareOption{vlabeled}{\causetsDrawVLabelstrue}
+\DeclareOption{vunlabeled}{\causetsDrawVLabelsfalse}
\DeclareOption*{\PackageWarning{causets}{The package causets does not support the option: \CurrentOption}}
\ProcessOptions\relax
-%% functions:
-% variables:
-\newcounter{causet at i}
-\newcounter{causet at j}
+%% Package functions:
\newif\ifcauset at ItemFoundInList
-% count the number of events:
-\newcommand*{\causets at readCausetSize}[1]{%
-\setcounter{causet at i}{0}%
-\foreach \causet at p in {#1}{%
- \stepcounter{causet at i}%
-}%
-\pgfmathsetmacro\causet at N{\value{causet at i}}%
+\newcommand*{\causets at prepareCauset}[1]{%
+% Count the number of events (\causet at N), find the minimal value in the list argument (\causet at Start), and define baseline point.
+\foreach \causet at E@i/\causet at Label/\causet at Text [count=\causet at i] in {#1}{%
+ \ifnum\causet at i=1
+ \pgfmathparse{int(\causet at E@i)}
+ \else
+ \pgfmathparse{int(min(\causet at Start, \causet at E@i))}
+ \fi
+ \xdef\causet at Start{\pgfmathresult}
+ \xdef\causet at N{\causet at i}
}
+\pgfmathsetmacro\causet at Start{int(\causet at Start + \causet at Offset)}
+\coordinate (baseline point) at (0, -0.707*\causetTileSize);
+}
-% define and draw events as (E#):
+\newcommand*{\causets at drawEvent}[2][every event]{%
+% Draws the event node for \causet at E@i. By default the event style (optional argument #1) is that of every event. The text of the node is #2.
+\pgfmathsetmacro\causet at u{\causet at E@i - \causet at Start + 0.5}
+\pgfmathsetmacro\causet at v{\causet at i - 0.5}
+\node[causets/.cd, #1] (E\causet at E@i)
+ at ( \causet at u * \causetTileSize, \causet at v * \causetTileSize )
+ {#2};
+}
+
\newcommand*{\causets at drawEvents}[1]{%
-\setcounter{causet at i}{0}
-\foreach \causet at p in {#1}{%
- \stepcounter{causet at i}
- \pgfmathsetmacro\causet at e@U{\causet at p - 1.0}
- \pgfmathsetmacro\causet at e@V{\value{causet at i} - 1.0}
+% Draws a permutation tile and defines and draws an event node (E#) on top of the tile, for each event number # in the list argument.
+\foreach \causet at E@i/\causet at Label/\causet at Text [count=\causet at i] in {#1}{%
+ \pgfmathsetmacro\causet at E@i{int(\causet at E@i + \causet at Offset)}
+ \pgfmathsetmacro\causet at u{\causet at E@i - \causet at Start}
+ \pgfmathsetmacro\causet at v{\causet at i - 1.0}
\ifcausetsDrawPermutation
- \path[causets/.cd, every tile] ( \causet at e@U * \causetTileSize, \causet at e@V * \causetTileSize )
+ \path[causets/.cd, every tile]
+ ( \causet at u * \causetTileSize, \causet at v * \causetTileSize )
rectangle +( \causetTileSize, \causetTileSize );
\fi
- \pgfmathsetmacro\causet at e@U{\causet at p - 0.5}
- \pgfmathsetmacro\causet at e@V{\value{causet at i} - 0.5}
- \node[causets/.cd, every event] (E\causet at p)
- at ( \causet at e@U * \causetTileSize, \causet at e@V * \causetTileSize )
- {};
+ \ifx\causet at Text\causet at Label
+ \causets at drawEvent{}
+ \else
+ \causets at drawEvent[every replaced event]{\causet at Text}
+ \fi
}
}
-% draw the permutation and the null coordinate labels:
\newcommand*{\causets at drawPermutation}[1]{%
+% Draws the permutation grid and adds the u- and v-coordinate labels.
\ifcausetsDrawPermutation
\draw[causets/.cd, every grid] ( 0, 0 )
grid ( \causet at N * \causetTileSize, \causet at N * \causetTileSize );
\draw[causets/.cd, every region] ( 0, 0 )
rectangle ( \causet at N * \causetTileSize, \causet at N * \causetTileSize );
- \setcounter{causet at i}{0}
- \foreach \causet at p in {#1}{%
- \stepcounter{causet at i}
+ \foreach \causet at E@i/\causet at Label/\causet at Text [count=\causet at i] in {#1}{%
+ \pgfmathsetmacro\causet at E@i{int(\causet at E@i + \causet at Offset)}
\ifcausetsDrawULabels
- \node[causets/.cd, every ulabel] (EUL\causet at p)
- at ( \value{causet at i} * \causetTileSize - 0.5 * \causetTileSize, 0 )
- {\thecauset at i};
+ \pgfmathsetmacro\causet at u{int(\causet at i + \causet at Start - 1)}
+ \node[causets/.cd, every ulabel] (EUL\causet at E@i)
+ at ( \causet at i * \causetTileSize - 0.5 * \causetTileSize, 0 )
+ {\causet at u};
\fi
\ifcausetsDrawVLabels
- \node[causets/.cd, every vlabel] (EVL\causet at p)
- at ( 0, \value{causet at i} * \causetTileSize - 0.5 * \causetTileSize )
- {\causet at p};
+ \node[causets/.cd, every vlabel] (EVL\causet at E@i)
+ at ( 0, \causet at i * \causetTileSize - 0.5 * \causetTileSize )
+ {\causet at E@i};
\fi
}
\fi
}
-% draw the spatial links from the permutation:
\newcommand*{\causets at drawSpatialLinks}[1]{%
+% Draws the spatial links between the events (only for \drawpcauset and \drawrcauset).
\ifcausetsDrawSpatialLinks
- \setcounter{causet at i}{0}
- \foreach \causet at p in {#1}{%
- \stepcounter{causet at i}
- \edef\causet at qBound{0}
- \setcounter{causet at j}{0}
- \foreach \causet at q in {#1}{%
- \stepcounter{causet at j}
- \ifnum\value{causet at j}>\value{causet at i}
- \ifnum\causet at q>\causet at qBound
- \ifnum\causet at p>\causet at q
- \draw[causets/.cd, every spatial link] (E\causet at q) -- (E\causet at p);
- \xdef\causet at qBound{\causet at q}
+ \foreach \causet at E@i/\causet at Label/\causet at Text [count=\causet at i] in {#1}{%
+ \pgfmathsetmacro\causet at E@i{int(\causet at E@i + \causet at Offset)}
+ % \causet at Bound stores the lower bound to find spatially linked events.
+ \edef\causet at Bound{\causet at Offset}
+ \foreach \causet at E@j/\causet at Label/\causet at Text [count=\causet at j] in {#1}{%
+ \ifnum\causet at j>\causet at i
+ \pgfmathsetmacro\causet at E@j{int(\causet at E@j + \causet at Offset)}
+ \ifnum\causet at E@j>\causet at Bound
+ \ifnum\causet at E@i>\causet at E@j
+ % Add spatial link and remember new lower bound:
+ \draw[causets/.cd, every spatial link] (E\causet at E@j) -- (E\causet at E@i);
+ \xdef\causet at Bound{\causet at E@j}
\fi
\fi
\fi
@@ -336,19 +358,33 @@
\fi
}
-% draw event labels:
+\newcommand*{\causets at drawEventLabel}[1][every label]{%
+% Draws the event label for \causet at E@i (shifted by \causet at Offset). By default the label style is assumed that of a standard event label.
+\pgfmathsetmacro\causet at E@i{int(\causet at E@i + \causet at Offset)}
+\node[causets/.cd, #1] (EL\causet at E@i)
+ at (E\causet at E@i.\pgfkeysvalueof{/tikz/causets/at}) {\causet at Label};
+}
+
\newcommand*{\causets at drawEventLabels}[1]{%
-\ifcausetsDrawLabels
- \foreach \causet at p in {#1}{%
- \node[causets/.cd, every label] (EL\causet at p)
- at (E\causet at p) {\causet at p};
- }
-\fi
+% Adds event labels to the events.
+\foreach \causet at E@i/\causet at Label/\causet at Text in {#1}{%
+ \ifx\causet at E@i\causet at Label
+ \ifcausetsDrawLabels
+ \causets at drawEventLabel
+ \fi
+ \else
+ \ifx\causet at Label\empty
+ \relax% Skip empty labels
+ \else
+ \causets at drawEventLabel[every replaced label]
+ \fi
+ \fi
}
+}
-% draw a causet from a permutation:
\newcommand*{\drawpcauset}[1]{%
-\causets at readCausetSize{#1}
+% Draws a causet from a permutation.
+\causets at prepareCauset{#1}
\begin{scope}[rotate=45]
\begin{scope}[xshift=-\causet at N * \causetTileSize / 2,
yshift=-\causet at N * \causetTileSize / 2]
@@ -355,18 +391,18 @@
\causets at drawEvents{#1}
\causets at drawPermutation{#1}
\ifcausetsDrawLinks
- \setcounter{causet at i}{0}
- \foreach \causet at p in {#1}{%
- \stepcounter{causet at i}
- \pgfmathsetmacro\causet at qBound{int(\causet at N + 1)}
- \setcounter{causet at j}{0}
- \foreach \causet at q in {#1}{%
- \stepcounter{causet at j}
- \ifnum\value{causet at j}>\value{causet at i}
- \ifnum\causet at q<\causet at qBound
- \ifnum\causet at p<\causet at q
- \draw[causets/.cd, every link] (E\causet at p) -- (E\causet at q);
- \xdef\causet at qBound{\causet at q}
+ \foreach \causet at E@i/\causet at Label/\causet at Text [count=\causet at i] in {#1}{%
+ \pgfmathsetmacro\causet at E@i{int(\causet at E@i + \causet at Offset)}
+ % \causet at Bound stores the upper bound to find linked events.
+ \pgfmathsetmacro\causet at Bound{int(\causet at N + \causet at Start)}
+ \foreach \causet at E@j/\causet at Label/\causet at Text [count=\causet at j] in {#1}{%
+ \ifnum\causet at j>\causet at i
+ \pgfmathsetmacro\causet at E@j{int(\causet at E@j + \causet at Offset)}
+ \ifnum\causet at E@j<\causet at Bound
+ \ifnum\causet at E@i<\causet at E@j
+ % Add link and remember new upper bound:
+ \draw[causets/.cd, every link] (E\causet at E@i) -- (E\causet at E@j);
+ \xdef\causet at Bound{\causet at E@j}
\fi
\fi
\fi
@@ -379,9 +415,9 @@
\end{scope}
}
-% draw a causet from a permutation and a link-pair list:
\newcommand*{\drawcauset}[2]{%
-\causets at readCausetSize{#1}
+% Draws a causet from a permutation and a link-pair list.
+\causets at prepareCauset{#1}
\begin{scope}[rotate=45]
\begin{scope}[xshift=-\causet at N * \causetTileSize / 2,
yshift=-\causet at N * \causetTileSize / 2]
@@ -389,55 +425,67 @@
\causets at drawPermutation{#1}
\ifcausetsDrawLinks
\ifcausetsBreakLinks
+ % Broken links are allowed, so test every link if it crosses over an unlinked event:
\foreach \causet at From/\causet at To in {#2}{%
- \pgfmathsetmacro\causet at dU{int(\causet at To) - int(\causet at From)}
- \setcounter{causet at i}{0}
- \foreach \causet at p in {#1}{%
- \ifnum\causet at p=\causet at To
- \pgfmathparse{int(\value{causet at i})}
- \xdef\causet at dV{\pgfmathresult}
+ % In this function, \causet at u and \causet at v store the link distance in the u- and in the v-direction, respectively. Since these are coordinate differences, they are computed without adding the offset.
+ \pgfmathsetmacro\causet at u{int(\causet at To) - int(\causet at From)}
+ \foreach \causet at E@i/\causet at Label/\causet at Text [count=\causet at i] in {#1}{%
+ \ifnum\causet at E@i=\causet at From
+ \xdef\causet at v{\causet at i}
\fi
- \ifnum\value{causet at i}>0
- \stepcounter{causet at i}
+ \ifnum\causet at E@i=\causet at To
+ \pgfmathparse{int(\causet at i - \causet at v)}
+ \xdef\causet at v{\pgfmathresult}
+ \breakforeach
\fi
- \ifnum\causet at p=\causet at From
- \stepcounter{causet at i}
- \fi
}
- \def\causet at LastBreak{0}
- \setcounter{causet at i}{0}
- \foreach \causet at p in {#1}{%
- \ifnum\causet at p=\causet at To
- \setcounter{causet at i}{0}
+ % Now add offset to events:
+ \pgfmathsetmacro\causet at From{int(\causet at From + \causet at Offset)}
+ \pgfmathsetmacro\causet at To{int(\causet at To + \causet at Offset)}
+ % In this function, \causet at E@j stores the last breaking point and \causet at j the index of \causet at From.
+ \pgfmathsetmacro\causet at E@j{int(\causet at From - 1)}
+ \edef\causet at j{0}
+ \foreach \causet at E@i/\causet at Label/\causet at Text [count=\causet at i] in {#1}{%
+ \pgfmathsetmacro\causet at E@i{int(\causet at E@i + \causet at Offset)}
+ \ifnum\causet at E@i=\causet at To
+ \edef\causet at j{0}
+ \breakforeach
\fi
- \pgfmathparse{and(\value{causet at i} > 0, int((\causet at p - \causet at From) * \causet at dV) == int(\causet at dU * \value{causet at i}))}
- \ifnum\pgfmathresult=1
- \ifnum\causet at LastBreak=0
- \draw[causets/.cd, every link, {Link Start}-{Link Pause}, shorten >=\causetBrokenLinkGap]
- (E\causet at From) -- (E\causet at p);
- \else
- \draw[causets/.cd, every link, {Link Resume}-{Link Pause}, shorten <=\causetBrokenLinkGap, shorten >=\causetBrokenLinkGap]
- (E\causet at LastBreak) -- (E\causet at p);
+ \ifnum\causet at j>0
+ % If the u-/v-coordinate ratio is the same, the event \causet at E@i falls along the link and the link needs to break. The ratios are compared via cross-multiplication, which is faster and does not cause rounding errors:
+ \pgfmathequal{int((\causet at E@i - \causet at From) * \causet at v)}{int(\causet at u * (\causet at i - \causet at j)))}
+ \ifnum\pgfmathresult=1
+ \ifnum\causet at E@j<\causet at From
+ % Link is crossing over another event, so draw the link up to the (first) breaking point:
+ \draw[causets/.cd, every link, {Link Start}-{Link Pause}, shorten >=\pgfkeysvalueof{/tikz/causets/broken link gap}]
+ (E\causet at From) -- (E\causet at E@i);
+ \else
+ % Link is crossing over yet another event, so continue from last breaking point to next breaking point:
+ \draw[causets/.cd, every link, {Link Resume}-{Link Pause}, shorten <=\pgfkeysvalueof{/tikz/causets/broken link gap}, shorten >=\pgfkeysvalueof{/tikz/causets/broken link gap}]
+ (E\causet at E@j) -- (E\causet at E@i);
+ \fi
+ \xdef\causet at E@j{\causet at E@i}
\fi
- \xdef\causet at LastBreak{\causet at p}
\fi
- \ifnum\value{causet at i}>0
- \stepcounter{causet at i}
+ \ifnum\causet at E@i=\causet at From
+ \xdef\causet at j{\causet at i}
\fi
- \ifnum\causet at p=\causet at From
- \setcounter{causet at i}{1}
- \fi
}
- \ifnum\causet at LastBreak>0
- \draw[causets/.cd, every link, {Link Resume}-{Link End}, shorten <=\causetBrokenLinkGap]
- (E\causet at LastBreak) -- (E\causet at To);
+ \ifnum\causet at E@j>\causet at From
+ % Link did cross over another event, so finish the link from last breaking point to final event:
+ \draw[causets/.cd, every link, {Link Resume}-{Link End}, shorten <=\pgfkeysvalueof{/tikz/causets/broken link gap}]
+ (E\causet at E@j) -- (E\causet at To);
\else
+ % Link does not cross over another event, so just draw it:
\draw[causets/.cd, every link]
(E\causet at From) -- (E\causet at To);
\fi
}
\else
+ % Broken links are not allowed, so just draw the links:
\foreach \causet at From/\causet at To in {#2}{%
+ \pgfmathsetmacro\causet at From{int(\causet at From + \causet at Offset)}
+ \pgfmathsetmacro\causet at To{int(\causet at To + \causet at Offset)}
\draw[causets/.cd, every link] (E\causet at From) -- (E\causet at To);
}
\fi
@@ -447,9 +495,9 @@
\end{scope}
}
-% draw a causet from a permutation removes links given in a link-pair list:
\newcommand*{\drawrcauset}[2]{%
-\causets at readCausetSize{#1}
+% Draws a causet from a permutation and ignoring links given in the second list argument (of link-pairs).
+\causets at prepareCauset{#1}
\begin{scope}[rotate=45]
\begin{scope}[xshift=-\causet at N * \causetTileSize / 2,
yshift=-\causet at N * \causetTileSize / 2]
@@ -456,29 +504,31 @@
\causets at drawEvents{#1}
\causets at drawPermutation{#1}
\ifcausetsDrawLinks
- \setcounter{causet at i}{0}
- \foreach \causet at p in {#1}{%
- \stepcounter{causet at i}
- \pgfmathsetmacro\causet at qBound{int(\causet at N + 1)}
- \setcounter{causet at j}{0}
- \foreach \causet at q in {#1}{
- \stepcounter{causet at j}
- \ifnum\value{causet at j}>\value{causet at i}
- \ifnum\causet at q<\causet at qBound
- \ifnum\causet at p<\causet at q
+ \foreach \causet at E@i/\causet at Label/\causet at Text [count=\causet at i] in {#1}{%
+ \pgfmathsetmacro\causet at E@i{int(\causet at E@i + \causet at Offset)}
+ % \causet at Bound stores the upper bound to find linked events.
+ \pgfmathsetmacro\causet at Bound{int(\causet at N + \causet at Start)}
+ \foreach \causet at E@j/\causet at Label/\causet at Text [count=\causet at j] in {#1}{%
+ \ifnum\causet at j>\causet at i
+ \pgfmathsetmacro\causet at E@j{int(\causet at E@j + \causet at Offset)}
+ \ifnum\causet at E@j<\causet at Bound
+ \ifnum\causet at E@i<\causet at E@j
+ % Check second list argument if the link has to be ignored:
\global\causet at ItemFoundInListfalse
\foreach \causet at From/\causet at To in {#2}{%
- \pgfmathparse{and(int(\causet at From) == int(\causet at p), int(\causet at To) == int(\causet at q))}
+ \pgfmathparse{and(int(\causet at From + \causet at Offset) == int(\causet at E@i), int(\causet at To + \causet at Offset) == int(\causet at E@j))}
\ifnum\pgfmathresult=1
\global\causet at ItemFoundInListtrue
\fi
}
\ifcauset at ItemFoundInList
- % skip link
+ \relax% Skip link as it is included in the second argument.
\else
- \draw[causets/.cd, every link] (E\causet at p) -- (E\causet at q);
+ % Draw link as it is not included in the second argument:
+ \draw[causets/.cd, every link] (E\causet at E@i) -- (E\causet at E@j);
\fi
- \xdef\causet at qBound{\causet at q}
+ % Remember new upper bound:
+ \xdef\causet at Bound{\causet at E@j}
\fi
\fi
\fi
@@ -486,8 +536,11 @@
}
\fi
\causets at drawSpatialLinks{#1}
+ % Add omitted links as spatial links:
\ifcausetsDrawSpatialLinks
\foreach \causet at From/\causet at To in {#2}{%
+ \pgfmathsetmacro\causet at From{int(\causet at From + \causet at Offset)}
+ \pgfmathsetmacro\causet at To{int(\causet at To + \causet at Offset)}
\draw[causets/.cd, every spatial link] (E\causet at From) -- (E\causet at To);
}
\fi
@@ -496,20 +549,19 @@
\end{scope}
}
-% insert a TikZ picture with a causet from a permutation:
\newcommand*{\pcauset}[2][]{%
+% Inserts a TikZ picture with a causet, created from a permutation.
\begin{tikzpicture}[causets/.cd, every causet, #1]\drawpcauset{#2}\end{tikzpicture}}
-% insert a TikZ picture with a causet from a permutation and a link-pair list:
\newcommand*{\causet}[3][]{%
+% Inserts a TikZ picture with a causet, created from a permutation and a link-pair list.
\begin{tikzpicture}[causets/.cd, every causet, #1]\drawcauset{#2}{#3}\end{tikzpicture}}
-% insert a TikZ picture with a causet from a permutation removes links given
-% in a link-pair list:
\newcommand*{\rcauset}[3][]{%
+% Inserts a TikZ picture with a causet, created from a permutation and a link-pair list of links to remove.
\begin{tikzpicture}[causets/.cd, every causet, #1]\drawrcauset{#2}{#3}\end{tikzpicture}}
-%% short-hand functions:
+%% Short-hand and pre-computed causet functions:
\providecommand{\causetspath}{.}
\newcommand*{\causetfile}[2][]{%
@@ -516,33 +568,32 @@
\includegraphics[#1]{\causetspath/#2}}
\newcommand*{\pcausetP}[2][]{%
-{\causetsDrawPermutationtrue\pcauset[#1]{#2}}}
+{\causetsDrawPermutationtrue\causetsDrawLabelsfalse\pcauset[#1]{#2}}}
\newcommand*{\pcausetL}[2][]{%
-{\causetsDrawLabelstrue\pcauset[#1]{#2}}}
+{\causetsDrawPermutationfalse\causetsDrawLabelstrue\pcauset[#1]{#2}}}
\newcommand*{\pcausetX}[2][]{%
-{\causetsDrawPermutationtrue\pcausetL[#1]{#2}}}
+{\causetsDrawPermutationtrue\causetsDrawLabelstrue\pcauset[#1]{#2}}}
\newcommand*{\causetP}[3][]{%
-{\causetsDrawPermutationtrue\causet[#1]{#2}{#3}}}
+{\causetsDrawPermutationtrue\causetsDrawLabelsfalse\causet[#1]{#2}{#3}}}
\newcommand*{\causetL}[3][]{%
-{\causetsDrawLabelstrue\causet[#1]{#2}{#3}}}
+{\causetsDrawPermutationfalse\causetsDrawLabelstrue\causet[#1]{#2}{#3}}}
\newcommand*{\causetX}[3][]{%
-{\causetsDrawPermutationtrue\causetL[#1]{#2}{#3}}}
+{\causetsDrawPermutationtrue\causetsDrawLabelstrue\causet[#1]{#2}{#3}}}
\newcommand*{\rcausetP}[3][]{%
-{\causetsDrawPermutationtrue\rcauset[#1]{#2}{#3}}}
+{\causetsDrawPermutationtrue\causetsDrawLabelsfalse\rcauset[#1]{#2}{#3}}}
\newcommand*{\rcausetL}[3][]{%
-{\causetsDrawLabelstrue\rcauset[#1]{#2}{#3}}}
+{\causetsDrawPermutationfalse\causetsDrawLabelstrue\rcauset[#1]{#2}{#3}}}
\newcommand*{\rcausetX}[3][]{%
-{\causetsDrawPermutationtrue\rcausetL[#1]{#2}{#3}}}
+{\causetsDrawPermutationtrue\causetsDrawLabelstrue\rcauset[#1]{#2}{#3}}}
-%% some standard causets:
\newcommand*{\causetFence}[2][]{%
\ifcase#2%
\or%=1
More information about the tex-live-commits
mailing list.