1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
|
\documentclass[12pt]{article}
\usepackage[a4paper, left = 2.5cm, right = 2.5cm, top = 2.5cm, bottom = 2.5cm]{geometry}
\usepackage[english]{babel}
\usepackage{lmodern}
\linespread{1.20} % line spreading
\setlength{\parindent}{2em} % paragraph indent
\setlength{\parskip}{0em} % space between paragraphs
\usepackage{titlesec} % change headline formats
\renewcommand{\thesection}{\arabic{section}}
\titlespacing*{\section}{0pt}{15pt}{5pt}
\titleformat{\section}{\large\bfseries\sffamily}{\thetitle}{17pt}{}{}
\usepackage{fancyhdr} % advanced header and footer
\pagestyle{fancy}
\fancypagestyle{plain}{\fancyhf{}\renewcommand{\headrulewidth}{0.0pt}}
\setlength{\headheight}{16.0pt}
\fancyhead[L]{\sffamily causets - Documentation}
\fancyhead[C]{}
\fancyhead[R]{\sffamily \nouppercase{\rightmark}}
\renewcommand{\headrulewidth}{0.2pt}
\renewcommand{\footrulewidth}{0.0pt}
\fancyfoot[L]{}
\fancyfoot[C]{}
\fancyfoot[R]{\sffamily \thepage}
\usepackage{hyperref} % cross references
\hypersetup{%
bookmarksopen = true, %
bookmarksopenlevel = 0, %
bookmarksnumbered = true, %
pdftitle = {{Package Documentation: causets}}, %
pdfauthor = {{Christoph Minz}}, %
pdfstartpage = 1, %
pdfstartview = {FitH}, %
breaklinks = false, %
colorlinks = true, %
linkcolor = black!50!blue, %
citecolor = black, %
filecolor = black, %
menucolor = black, %
urlcolor = black!25!blue %
}
\usepackage{booktabs} % book table style
\usepackage{multirow} % spanning multiple rows
\usepackage{listings} % code environments
\lstset{
backgroundcolor=\color{yellow!50!black!10},
basicstyle=\ttfamily\footnotesize,
breakatwhitespace=true,
breaklines=true,
captionpos=b,
commentstyle=\color{green!25!gray},
keepspaces=true,
keywordstyle=\color{black},
language=TeX,
numbers=left,
numbersep=5pt,
numberstyle=\tiny\color{gray},
rulecolor=\color{black},
showspaces=false,
showstringspaces=false,
showtabs=false,
stepnumber=1,
stringstyle=\color{purple!50!black},
tabsize=2
}
\usepackage{amsmath}
\usepackage{causets}
\renewcommand{\causetsDirectory}{.}
\title{{\small package}\\[0.5cm] \huge causets \\[0.2cm]{\small version 1.0}\\[0.5cm]}
\author{Christoph Minz}
\begin{document}
{\sffamily\maketitle}
\begin{center}
$\displaystyle
\largecausets
\left\{
\pcauset{3,2,1},
\pcauset{3,1,2},
\pcauset{2,1,3},
\pcauset{1,3,2},
\pcauset{1,2,3}
\right\}
$
\\
$\displaystyle
\largecausets
\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\}
$
\\
$\displaystyle
\largecausets
\causetsDrawPermutationtrue
\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?}
\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.
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 causet, so that it becomes easy to draw causets and even use them in mathematical expressions.
\clearpage
\section{Introduction - the Main Commands}
\label{sec:Introduction}
This package is built on the package \lstinline§tikz§ to draw the diagrams.
To import the \lstinline§causets§ package into a \LaTeX\ file, write
\begin{lstlisting}
\usepackage{causets}
\end{lstlisting}
in the preamble of the document.
For a more demonstrative introduction in this first section, I use the package options \lstinline§black§ (only black and white diagrams) and \lstinline§permutation§ (also shows the permutation),
\begin{lstlisting}
\usepackage[black,permutation]{causets}
\end{lstlisting}
The three main commands of this package are
\begin{lstlisting}
\pcauset{..,i,..,k,..,j,..}
\rcauset{...}{..,i/j,..}
\causet{...}{..,i/j,..}
\end{lstlisting}
The first command takes a permutation of the integers $[ 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§i/j§ as given in the second argument.
The third command only uses the permutation to position the events, the links have to be explicitly specified by event pairs \lstinline§i/j§ in the second argument.
Any causet that can be embedded in $1 + 1$ dimensional Minkowski spacetime can also be described by the product of two total orders (a 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§\pcauset§ command that computes the causal relation from the permutation.
See example 1 in \autoref{tab:MainCommandsExamples}.
\causetsSetColorsBlack
\causetsDrawPermutationtrue
\begin{table}[h!]
\begin{tabular*}{\textwidth}{lp{0.72\textwidth}c}
\toprule
\#
& command
& inline output
\\\midrule
1
& \lstinline§\pcauset{4,7,2,6,1,5,3}§
& \pcauset{4,7,2,6,1,5,3}
\\\midrule
2
& \lstinline§\rcauset{4,7,2,6,1,5,3}{2/5}§
& \rcauset{4,7,2,6,1,5,3}{2/5}
\\\midrule
3
& \lstinline§\causet{4,7,2,6,1,5,3}{1/3,1/5,2/3,2/6,4/5,4/6,4/7}§
& \causet{4,7,2,6,1,5,3}{1/3,1/5,2/3,2/6,4/5,4/6,4/7}
\\\bottomrule
\end{tabular*}
\caption{\label{tab:MainCommandsExamples} Examples for the three main commands of the package.}
\end{table}
\causetsSetColorsGray
\causetsDrawPermutationfalse
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§i/j§.
See example 2 in \autoref{tab:MainCommandsExamples}.
In some situations, it might be easier to specify the list of link pairs that exist, instead of removing links.
For this purpose, use the \lstinline§\causet§ command.
As an example, we rewrite the example 2 by specifying all existing links as pairs, see example 3 in \autoref{tab:MainCommandsExamples}.
Note that the \lstinline§\rcauset§ command was actually much shorter for this particular example.
However, if the list of link pairs in the \lstinline§\rcauset§ command is very long, specifying all existing link pairs instead with the \lstinline§\causet§ yields a faster performance.
As an example for the use in mathematical expressions, 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*}
\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.)
Of course, a given causet might have more than one representing permutation, so that any of those permutations may be used.
However, you may consider it a good practice to choose the permutation that starts with the larger integer, so that disjoint elements appear to the right in the graphs.
For example, you may write \lstinline§\pcauset{3,1,2}§, \pcauset{3,1,2}, as opposed to \lstinline§\pcauset{2,3,1}§, \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§\pcauset{14,...,10,8,2,1,9,3,4,...,7}§ will generate the diagram
\begin{align*}
\causetsSetColorsBlack
\causetsDrawPermutationtrue
\pcauset{14,...,10,8,2,1,9,3,4,...,7}
\end{align*}
which is the same as \lstinline§\pcauset{14,13,12,11,10,8,2,1,9,3,4,5,6,7}§. (This graphic uses the package options \lstinline§black§ and \lstinline§permutation§ again.)
\clearpage
\section{Package Options}
\label{sec:PackageOptions}
Each of the package options can either be specified in square brackets when declaring the package (option applies globally) or be changed with a macro at any point in the document (option applies to the local scope).
If no options are used, an output like \rcauset{4,2,7,6,1,5,3}{2/5} is obtained with the commands
\begin{lstlisting}
\usepackage{causets}
... % ... \begin{document} ...
\rcauset{4,2,7,6,1,5,3}{2/5}
\end{lstlisting}
The package options and their macros are shown in \autoref{tab:PackageOptions}, using the same example.
\begin{table}
\begin{tabular*}{\textwidth}{p{0.75\textwidth}c}
\toprule
package option
& inline output
\\\midrule
\lstinline§\usepackage[permutation]{causets}§ shows permutations
& \multirow{3}{5em}{%
\causetsDrawPermutationtrue \rcauset{4,2,7,6,1,5,3}{2/5}}
\\
~~(\lstinline§\causetsDrawPermutationtrue§ activates the option)
\\
~~(\lstinline§\causetsDrawPermutationfalse§ deactivates the option)
\\\midrule
\lstinline§\usepackage[labeled]{causets}§ shows labeled events
& \multirow{3}{5em}{%
\causetsDrawLabelstrue \rcauset{4,2,7,6,1,5,3}{2/5}}
\\
~~(\lstinline§\causetsDrawLabelstrue§ activates the option)
\\
~~(\lstinline§\causetsDrawLabelsfalse§ deactivates the option)
\\\midrule
\lstinline§\usepackage[unlinked]{causets}§ hides links
& \multirow{3}{5em}{%
\causetsDrawLinksfalse \rcauset{4,2,7,6,1,5,3}{2/5}}
\\
~~(\lstinline§\causetsDrawLinksfalse§ activates the option)
\\
~~(\lstinline§\causetsDrawLinkstrue§ deactivates the option)
\\\midrule
\lstinline§\usepackage[tiny]{causets}§ for tiny diagrams
& \multirow{2}{5em}{%
\tinycausets \rcauset{4,2,7,6,1,5,3}{2/5}}
\\
~~(\lstinline§\tinycausets§ sets tiny sizes)
\\
\lstinline§\usepackage[small]{causets}§ for small diagrams
& \multirow{2}{5em}{%
\smallcausets \rcauset{4,2,7,6,1,5,3}{2/5}}
\\
~~(\lstinline§\smallcausets§ sets small sizes)
\\
\lstinline§\usepackage[large]{causets}§ for large diagrams
& \multirow{3}{5em}{%
\largecausets \rcauset{4,2,7,6,1,5,3}{2/5}}
\\
~~(\lstinline§\largecausets§ sets large sizes)
\\
\\
\lstinline§\usepackage[huge]{causets}§ for huge diagrams
& \multirow{4}{5em}{%
\hugecausets \rcauset{4,2,7,6,1,5,3}{2/5}}
\\
~~(\lstinline§\hugecausets§ sets huge sizes)
\\
\\
~~(\lstinline§\normalcausets§ resets to normal sizes)
\\
(\lstinline§\causetsSetSizes{}{}{}{}{}{}§ for user-defined sizes, see \autoref{sec:Sizes})
\\\midrule
\lstinline§\usepackage[black]{causets}§ for black and white causets
& \multirow{2}{5em}{%
\causetsSetColorsBlack \rcauset{4,2,7,6,1,5,3}{2/5}}
\\
~~(\lstinline§\causetsSetColorsBlack§ activates the option)
\\
\lstinline§\usepackage[gray]{causets}§ for gray scale causets (default)
& \multirow{2}{5em}{%
\causetsSetColorsGray \rcauset{4,2,7,6,1,5,3}{2/5}}
\\
~~(\lstinline§\causetsSetColorsGray§ activates the option)
\\
\lstinline§\usepackage[blue]{causets}§ for blue causets
& \multirow{2}{5em}{%
\causetsSetColorsBlue \rcauset{4,2,7,6,1,5,3}{2/5}}
\\
~~(\lstinline§\causetsSetColorsBlue§ activates the option)
\\
\lstinline§\usepackage[neon]{causets}§ for brightly colored causets
& \multirow{2}{5em}{%
\causetsSetColorsNeon \rcauset{4,2,7,6,1,5,3}{2/5}}
\\
~~(\lstinline§\causetsSetColorsNeon§ activates the option)
\\
(more color formatting options in \autoref{sec:Colors})
\\\midrule
\lstinline§\usepackage[spacelike]{causets}§ shows a partial order for spacelike separated events, but only with the \lstinline§\pcauset§ commands
& \multirow{2}{5em}{%
\causetsDrawSeparationstrue \pcauset{2,4,1,3}}
\\
~~(\lstinline§\causetsDrawSeparationstrue§ activates the option)
\\
~~(\lstinline§\causetsDrawSeparationsfalse§ deactivates the option)
\\\bottomrule
\end{tabular*}
\caption{\label{tab:PackageOptions} All package options.}
\end{table}
All these options can also be combined, but only one of the size and color options.
The last option (\lstinline§spacelike§) is only supported by the \lstinline§\pcauset§ commands (and ignored by the other commands), so that the last example uses \lstinline§\pcauset{2,4,1,3}§.
\section{Modifiers for the Main Commands}
\label{sec:Modifiers}
The permutations and labels for causets can be switched on globally with the package options \lstinline§permutation§ and \lstinline§labeled§, or at any point in the document with the switches \lstinline§\causetsDrawPermutationtrue§ and \lstinline§\causetsDrawLabelstrue§, 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§P§ (to show the permutation), \lstinline§L§ (to show event labels), or \lstinline§X§ (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}.
All main commands have an optional argument in which any TikZ commands can be used to change the style of the causet.
By default, the optional argument is set to \lstinline§causet§, which is a TikZ style defined by the package to align the output with the baseline of the text, see the examples here.
\begin{lstlisting}
Without an optional argument \pcauset{2,4,5,1,3} aligns the center just above the baseline. Using \pcauset[]{2,4,5,1,3}, the bottom of the diagram will be aligned with the baseline; and with \pcauset[baseline=1mm]{2,4,5,1,3} the center is placed 1mm below the baseline.
\end{lstlisting}
Without an optional argument \pcauset{2,4,5,1,3} aligns the center just above the baseline. Using \pcauset[]{2,4,5,1,3}, the bottom of the diagram will be aligned with the baseline; and with \pcauset[baseline=1mm]{2,4,5,1,3} the center is placed 1mm below the baseline.
\section{Some Common Causets}
\label{sec:CommonCausets}
There are a few short hand macros for small common causets:
\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},
\causetCrown
\section{Changing Sizes and Mathematical Expressions}
\label{sec:Sizes}
Apart from the pre-defined sizes \lstinline§tiny§, \lstinline§small§, \lstinline§normal§, \lstinline§large§ and \lstinline§huge§, sizes can be defined with a macro similar to
\begin{lstlisting}
\causetsSetSizes{0.30ex}{0.02ex}{0.01ex}{0.16ex}{0.05ex}{0.16} % tiny
\causetsSetSizes{0.60ex}{0.04ex}{0.02ex}{0.32ex}{0.10ex}{0.32} % small
\causetsSetSizes{0.90ex}{0.06ex}{0.03ex}{0.48ex}{0.15ex}{0.48} % normal
\causetsSetSizes{1.35ex}{0.09ex}{0.05ex}{0.75ex}{0.20ex}{0.75} % large
\causetsSetSizes{1.80ex}{0.12ex}{0.07ex}{1.00ex}{0.25ex}{1.00} % huge
\end{lstlisting}
The arguments set the following size macros in order:
\begin{enumerate}
\item \lstinline§\causetTileSize§ as size of the tiles in the permutation
(measured in any absolute unit, like cm, or any relative unit, like ex)
\item \lstinline§\causetRegionLine§ as thickness for the line surrounding the permutation region
(measured in any absolute unit, like cm, or any relative unit, like ex)
\item \lstinline§\causetGridLine§ as line thickness of the permutation grid
(measured in any absolute unit, like cm, or any relative unit, like ex)
\item \lstinline§\causetEventSize§ as diameter of the events
(measured in any absolute unit, like cm, or any relative unit, like ex)
\item \lstinline§\causetLinkWidth§ as link thickness
(measured in any absolute unit, like cm, or any relative unit, like ex)
\item \lstinline§\causetTextScale§ as the scaling factor of text relative to the normal font size
\end{enumerate}
For example:
\begin{lstlisting}
\causetsSetSizes{1.50ex}{0.15ex}{0.06ex}{1.30ex}{0.35ex}{1.00}
\pcausetL{13,8,14,9,3,15,12,1,6,5,11,7,2,10,4}
\end{lstlisting}
\causetsSetSizes{1.50ex}{0.15ex}{0.06ex}{1.30ex}{0.35ex}{1.00}
\pcausetL{13,8,14,9,3,15,12,1,6,5,11,7,2,10,4}
\normalcausets
Causets diagrams can also be used in mathematical expression, where the size may be adjusted when they are used in indices or limits.
For example:
\begin{lstlisting}
\begin{equation}
\sum_{C \in \smallcausets
\left\{
\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|
\end{equation}
\end{lstlisting}
\begin{equation}
\sum_{C \in \smallcausets
\left\{
\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|
\end{equation}
\section{Changing Colors}
\label{sec:Colors}
This package uses the following colors
\begin{itemize}\itemsep0em
\item \lstinline§causetRegionColor§ for the lines of the permutation frame
\item \lstinline§causetGridColor§ for the lines of the permutation grid
\item \lstinline§causetTileColor§ for the occupied tiles
\item \lstinline§causetULabelColor§ for the $u$ labels
\item \lstinline§causetVLabelColor§ for the $v$ labels
\item \lstinline§causetEventColor§ for the events
\item \lstinline§causetLabelColor§ for the label text
\item \lstinline§causetLinkColor§ for the links
\item \lstinline§causetSeparationColor§ for the spacelike separations.
\end{itemize}
Any of these colors can be set to a new value with the \lstinline§\colorlet§ macro, for example
\begin{lstlisting}
\colorlet{causetEventColor}{purple}
\end{lstlisting}
redefines the event color to purple.
\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§standalone§ package.
For example, create a file named \lstinline§mycauset.tex§ in the subdirectory \lstinline§causets.standalone/§ with the following code:
\begin{lstlisting}
\documentclass[tikz]{standalone}
\usepackage{causets}
\begin{document}
\pcausetL{13,8,14,9,3,15,12,1,6,5,11,7,2,10,4}
\end{document}
\end{lstlisting}
The compiled version is then included with the macro \lstinline§\causetfile{mycauset}§.
This macro also accepts one optional argument \lstinline§[#1]§ and redirects the input to
\begin{lstlisting}
\includegraphics[#1]{\causetsDirectory/#2}
\end{lstlisting}
The macro \lstinline§\causetsDirectory§ is pre-defined to \lstinline§causets.standalone§, but may be renewed to any desired directory with
\begin{lstlisting}
\renewcommand{\causetsDirectory}{my_causet_directory}
\end{lstlisting}
The examples in \autoref{sec:TikZ} are show examples of standalone files that use the \lstinline§causets§ package.
To include these graphics into this document, the causets directory has been set to the same directory as the main tex file:
\begin{lstlisting}
\renewcommand{\causetsDirectory}{.}
\end{lstlisting}
\section{Advanced Style Changes}
The optional argument of the main commands is not restricted to baseline adjustments (as discussed in \autoref{sec:Modifiers}).
You may use TikZ options to change the output of the macros, for example:
\begin{lstlisting}
\usepackage{causets}
... % ... \begin{document} ...
A labeled causet with red-framed semi-transparent labels, \pcausetL[causet,causetLabels/.style={draw=red, fill=white, opacity=0.8, inner sep=1pt, scale=1.2}]{2,4,5,1,3}.
\end{lstlisting}
A labeled causet with red-framed semi-transparent labels, \pcausetL[causet,causetLabels/.style={draw=red, fill=white, opacity=0.8, inner sep=1pt, scale=1.2}]{2,4,5,1,3}.
In the same way, it is possible to modify the existing styles of all parts of the diagrams, which means that the default drawing styles are extended by the options passed to (in the order these parts are drawn)
\begin{enumerate}\itemsep0em
\item the occupied permutation tiles (\lstinline§causetTiles/.style={...}§),
\item the event nodes (graph vertices) (\lstinline§causetEvents/.style={...}§),
\item the permutation grid (\lstinline§causetGrid/.style={...}§),
\item the permutation region (\lstinline§causetRegion/.style={...}§),
\item the permutation $u$ labels (\lstinline§causetULabels/.style={...}§),
\item the permutation $v$ labels (\lstinline§causetVLabels/.style={...}§),
\item the links (graph edges) (\lstinline§causetLinks/.style={...}§),
\item the spacelike separations (\lstinline§causetSeparations/.style={...}§),
\item and the event labels (\lstinline§causetLabels/.style={...}§).
\end{enumerate}
In order to manually define the full style of the parts in the diagram - not extending, but \emph{overwriting all} drawing options - use the following style options (in the order these parts are drawn):
\begin{enumerate}\itemsep0em
\item the occupied permutation tiles (\lstinline§causetTilesStyle/.style={...}§),
\item the event nodes (graph vertices) (\lstinline§causetEventsStyle/.style={...}§),
\item the permutation grid (\lstinline§causetGridStyle/.style={...}§),
\item the permutation region (\lstinline§causetRegionStyle/.style={...}§),
\item the permutation $u$ labels (\lstinline§causetULabelsStyle/.style={...}§),
\item the permutation $v$ labels (\lstinline§causetVLabelsStyle/.style={...}§),
\item the links (graph edges) (\lstinline§causetLinksStyle/.style={...}§),
\item the spacelike separations (\lstinline§causetSeparationsStyle/.style={...}§),
\item and the event labels (\lstinline§causetLabelsStyle/.style={...}§).
\end{enumerate}
Of course, it is also possible to redefine any of these styles with a \lstinline§\tikzset{...}§ in the preamble of the document.
So for example
\begin{lstlisting}
\usepackage{causets}
\tikzset{causetEvents/.style={rectangle}}
... % ... \begin{document} ...
\pcauset{2,4,5,1,3}
\end{lstlisting}
will generate {\tikzset{causetEvents/.style={rectangle}}\pcauset{2,4,5,1,3}}.
\section{Using causets with TikZ}
\label{sec:TikZ}
Since the package is TikZ based, using a causet within a TikZ picture is simple.
Each of the three main commands is based on a draw command in TikZ that has the same name but starts with \lstinline§\draw...§.
The \lstinline§\draw§ macros, however, do not support an optional argument (since this can be specified directly in a TikZ picture) and they also do not have any short hand macros ending in \lstinline§P§, \lstinline§L§ or \lstinline§X§.
The two following examples are given by external (standalone) TikZ graphics and included with \lstinline§\causetfile{...}§.
More details on using causets in standalone files are given in \autoref{sec:Standalone}.
Note that the output of the \lstinline§\draw§ macros has the point (0,0) in the center, so to shift it, we can enclose it in a TikZ scope, for example:
\lstinputlisting{causet_tikz_example1.tex}
\causetfile{causet_tikz_example1}
Note that this example also shows how to use the event nodes that are generated by the \lstinline§\drawpcauset§ macro.
The green arrow points to the node of the second causet event \lstinline§(E5)§.
The causet events, event labels, $u$-axis labels, and $v$-axis lables are the nodes \lstinline§(Ei)§, \lstinline§(ELi)§, \lstinline§(EULi)§, and \lstinline§(EVLi)§, respectively, where $\smash{i \in [ 1, 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§\pcauset§ (\lstinline§\rcauset§ or \lstinline§\causet§) commands without the \lstinline§draw§ prefix again:
\lstinputlisting{causet_tikz_example2.tex}
\hspace{-3.0ex}\causetfile{causet_tikz_example2}
\clearpage
\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}
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, it is much appreciated if you do the following:
\begin{itemize}
\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}
|