Skip to content

Commit 4790426

Browse files
author
Martin Rykfors
committed
Include link to relative / ordinal diagram source
1 parent 1f611dc commit 4790426

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed

docs/user/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ We support several modifiers that allow you to refer to scopes relative to the i
185185
Here is a diagram of the possible relative / ordinal modifiers:
186186

187187
![Relative ordinal diagram](images/relative_ordinal.png)
188+
([Image source](images/relative_ordinal.tex))
188189

189190
And here is a table of the spoken forms:
190191

docs/user/images/relative_ordinal.png

3 Bytes
Loading

docs/user/images/relative_ordinal.tex

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
\documentclass[tikz]{standalone}
2+
\usepackage{tikz}
3+
\usetikzlibrary{decorations.pathreplacing}
4+
5+
% To build:
6+
% pdflatex relative_ordinal.tex
7+
% convert -density 300 relative_ordinal.pdf -quality 100 -background white -alpha remove relative_ordinal.png
8+
9+
\begin{document}
10+
\def\spacing{1.4cm}
11+
\newcommand{\abrace}[4]{
12+
\draw [decorate, decoration = {brace, amplitude=5pt}] (#2*\spacing, #1*0.8cm + 0.5cm) -- (#3*\spacing, #1*0.8cm + 0.5cm)
13+
node[above=5pt, pos=0.5, scale=0.8] {\texttt{"#4"}};
14+
}
15+
\newcommand{\bbrace}[4]{
16+
\draw [decorate, decoration ={brace, amplitude=5pt}] (#2*\spacing, #1*0.8cm + 0.5cm) -- (#3*\spacing, #1*0.8cm + 0.5cm)
17+
node[above=-20pt, pos=0.5, scale=0.8] {#4};
18+
}
19+
\newcommand{\funk}[2]{
20+
\draw[fill=black] (#1*\spacing,0) circle (0.1cm) node[below=3pt, text width=1cm,align=left,scale=0.7] (F#1)
21+
{\texttt{"#2"}};
22+
}
23+
\begin{tikzpicture}[ultra thick]
24+
25+
\funk{0}{first funk}
26+
\funk{1}{second funk}
27+
\funk{2}{third previous funk}
28+
\funk{3}{second previous funk}
29+
\funk{4}{previous funk}
30+
\funk{5}{funk}
31+
\funk{6}{next funk}
32+
\funk{7}{second next funk}
33+
\funk{8}{third next funk}
34+
\funk{9}{second last funk}
35+
\funk{10}{last funk}
36+
37+
\draw[latex-] (F5) -- +(0,-0.8cm) node[below=2pt,scale=0.8] {input target};
38+
39+
\abrace{0}{6}{8}{next three funks};
40+
\abrace{0}{2}{4}{previous three funks};
41+
\abrace{1}{5}{7}{three funks};
42+
\abrace{2}{3}{5}{three funks backward};
43+
\abrace{0}{0}{1}{first two funks};
44+
\abrace{0}{9}{10}{last two funks};
45+
\bbrace{-3}{10}{0}{iteration scope};
46+
\end{tikzpicture}
47+
48+
\end{document}

0 commit comments

Comments
 (0)