-
-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include link to relative / ordinal diagram source
- Loading branch information
Martin Rykfors
committed
Feb 19, 2023
1 parent
1f611dc
commit 4790426
Showing
3 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |