diff options
Diffstat (limited to 'macros/latex/contrib/wargame/source/chit/elements.dtx')
-rw-r--r-- | macros/latex/contrib/wargame/source/chit/elements.dtx | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/macros/latex/contrib/wargame/source/chit/elements.dtx b/macros/latex/contrib/wargame/source/chit/elements.dtx new file mode 100644 index 0000000000..8708ca2a15 --- /dev/null +++ b/macros/latex/contrib/wargame/source/chit/elements.dtx @@ -0,0 +1,105 @@ +% \iffalse +% -------------------------------------------------------------------- +%<*chit> +% \fi +% +% \subsubsection{Predefined \texttt{chit} element pictures} +% +% \begin{TikzKey}{/tikz/pics/chit/1 factor, +% /tikz/pics/chit/2 factors, +% /tikz/pics/chit/2 factors artillery, +% /tikz/pics/chit/3 factors, +% /tikz/pics/chit/4 factors, +% /tikz/pics/chit/identifier, +% /tikz/pics/chit/small identifier, +% /tikz/pics/chit/identifier macro} +% +% These pictures can be used as the value of \texttt{chit} keys. +% +% \begin{macrocode} +\tikzset{% + chit/1 factor/.pic={ + \chit@dbg{4}{ Chit 1 factor: #1}% + \node[chit/factor,chit/1 factor,pic actions]{#1};}, + pics/chit/2 factors/.style args={#1,#2}{% + code={% + \chit@dbg{4}{ Chit 2 factors: #1 and #2}% + \node[chit/factor,chit/2 factors,pic actions]{#1--#2};}}, + pics/chit/2 factors artillery/.style args={#1,#2,#3}{% + code={ + \chit@dbg{4}{ Chit 2 factors w/artillery: `#1' `#2' `#3'}% + \node[chit/factor,chit/2 factors,pic actions]{% + #1$\overset{\text{\scriptsize #3}}{\text{--}}$#2};}}, + pics/chit/3 factors/.style args={#1,#2,#3}{% + code={ + \chit@dbg{4}{ Chit 3 factors: `#1' `#2' `#3'}% + \node[chit/factor,chit/3 factors,pic actions]{#1-#2-#3};}}, + pics/chit/4 factors/.style args={#1,#2,#3,#4}{% + code={ + \chit@dbg{4}{ Chit 3 factors: `#1' `#2' `#3' `#4'}% + \node[chit/factor,chit/4 factors,pic actions]{#1-#2-#3-#4};}}, + chit/identifier/.pic={ + \chit@dbg{4}{ Chit identifier: `#1'}% + \node[chit/identifier,pic actions]{#1}; + }, + chit/small identifier/.pic={ + \chit@dbg{4}{ Chit small identifier: `#1'}% + \node[chit/small identifier,pic actions]{#1}; + }, + chit/identifier macro/.pic={% + \chit@dbg{4}{ Chit identifier macro: \meaning#1} + \edef\chit@i@tmp{#1} + \node[chit/identifier,pic actions]{\chit@i@tmp};}, +} +% \end{macrocode} +% \end{TikzKey} +% +% \begin{TikzKey}{/tikz/chit/factor, +% /tikz/chit/1 factor, +% /tikz/chit/2 factors, +% /tikz/chit/3 factors, +% /tikz/chit/4 factors, +% /tikz/chit/identifier, +% /tikz/chit/small identifier} +% +% Styles used by the above pictures. Users can change these as they +% see fit. +% +% \begin{macrocode} +\tikzset{% + chit/factor/.style={ + shape=rectangle, + font=\sffamily\bfseries\large, + anchor=base, + inner sep=0, + %text=pgfstrokecolor, + draw=none, + fill=none, + }, + chit/1 factor/.style={}, + chit/2 factors/.style={}, + chit/3 factors/.style={}, + chit/4 factors/.style={text/.append style=\small}, + chit/identifier/.style={ + shape=rectangle, + font=\sffamily\bfseries\scriptsize, + inner sep=0, + % text=pgfstrokecolor, + draw=none, + fill=none, + }, + chit/small identifier/.style={ + shape=rectangle, + font=\sffamily\bfseries\tiny, + inner sep=0, + % text=pgfstrokecolor, + draw=none, + fill=none, + }, +} +% \end{macrocode} +% \end{TikzKey} +% \iffalse +%</chit> +% -------------------------------------------------------------------- +% \fi |