Skip to content

Commit

Permalink
Include link to relative / ordinal diagram source
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Rykfors committed Feb 19, 2023
1 parent 1f611dc commit 4790426
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/user/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ We support several modifiers that allow you to refer to scopes relative to the i
Here is a diagram of the possible relative / ordinal modifiers:

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

And here is a table of the spoken forms:

Expand Down
Binary file modified docs/user/images/relative_ordinal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions docs/user/images/relative_ordinal.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
\documentclass[tikz]{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing}

% To build:
% pdflatex relative_ordinal.tex
% convert -density 300 relative_ordinal.pdf -quality 100 -background white -alpha remove relative_ordinal.png

\begin{document}
\def\spacing{1.4cm}
\newcommand{\abrace}[4]{
\draw [decorate, decoration = {brace, amplitude=5pt}] (#2*\spacing, #1*0.8cm + 0.5cm) -- (#3*\spacing, #1*0.8cm + 0.5cm)
node[above=5pt, pos=0.5, scale=0.8] {\texttt{"#4"}};
}
\newcommand{\bbrace}[4]{
\draw [decorate, decoration ={brace, amplitude=5pt}] (#2*\spacing, #1*0.8cm + 0.5cm) -- (#3*\spacing, #1*0.8cm + 0.5cm)
node[above=-20pt, pos=0.5, scale=0.8] {#4};
}
\newcommand{\funk}[2]{
\draw[fill=black] (#1*\spacing,0) circle (0.1cm) node[below=3pt, text width=1cm,align=left,scale=0.7] (F#1)
{\texttt{"#2"}};
}
\begin{tikzpicture}[ultra thick]

\funk{0}{first funk}
\funk{1}{second funk}
\funk{2}{third previous funk}
\funk{3}{second previous funk}
\funk{4}{previous funk}
\funk{5}{funk}
\funk{6}{next funk}
\funk{7}{second next funk}
\funk{8}{third next funk}
\funk{9}{second last funk}
\funk{10}{last funk}

\draw[latex-] (F5) -- +(0,-0.8cm) node[below=2pt,scale=0.8] {input target};

\abrace{0}{6}{8}{next three funks};
\abrace{0}{2}{4}{previous three funks};
\abrace{1}{5}{7}{three funks};
\abrace{2}{3}{5}{three funks backward};
\abrace{0}{0}{1}{first two funks};
\abrace{0}{9}{10}{last two funks};
\bbrace{-3}{10}{0}{iteration scope};
\end{tikzpicture}

\end{document}

0 comments on commit 4790426

Please sign in to comment.