Debian Codegraph @

texmf-dist/source/latex/wargame/wargame.dtx

raw
1 % \iffalse
2 %<*driver>
3 % This is the preamp used in various documents
4 \documentclass{ltxdoc}
5 %<symbols>\usepackage[noterrainpic]{wgdoc}
6 %<!symbols>\usepackage{wgdoc}
7 %</driver>
8 %\fi
9 %\iffalse
10 %<*doc>
11 % This is for the main documentation
12 \usepackage{wgdoc}
13 \input{testmap}
14 \input{testchits}
15 \usetikzlibrary{external}
16 \tikzexternalize[prefix=cache/]
17 \CodelineIndex
18 \EnableCrossrefs
19 \DisableCrossrefs
20 \DoNotIndex{\a,\advance,\args,\bfseries,\breakforeach,\cc,\ccc,
21 \divide,\def,\h,\filldraw,\node,\path,\RequirePackage,\ProvidesPackage,
22 \Large,\large,\huge,\Huge,\normalsize,\tiny,
23 \long,\n,\mc,\o,\p,
24 \usetikzlibrary,\draw,\foreach,\fv,\tikzinputsegmentfirst,
25 \tikzinputsegmentsupporta,\tikzinputsegmentsupportb,
26 \tikzinputsegmentlast,\pgfmathparse,\pgfpoint,\edef,\pgfmathresult,
27 \relax,\ifx,\else,\fi,\definecolor,\tikz,\tikzset,\tikzstyle,
28 \maxdimen,\pgfseteorule,\message,\global,\clip,\let,\end,\begin,
29 \sffamily,\selectfont,\fontsize,\DeclareTextFontCommand,
30 \selectfont,\define@key,\pgf@x,\pgf@y,\xdef,\expandafter,\@ifundefined,
31 \pgfpointxy,\csname,\endcsname,\pgfpointadd,\fill,\@empty,\@ifnextchar,
32 \@undefined,\@undefinedb,\arrow,\b,\c,\color,\fontfamily,\fontseries,
33 \gdef,\i,\k,\m,\newcommand,\newcount,\newif,\newlength
34 \pgf@pathmaxx,\pgf@pathminx,\pgf@pathmaxy,\pgf@pathminy,
35 \pgf@picmaxx,\pgf@picminx,\pgf@picmaxy,\pgf@picminy,
36 \pgf@relevantforpicturesizefalse,\pgf@relevantforpicturesizetrue,
37 \pic,\r,\setkeys,\setlength,\show,\t,\temp,\the,
38 \tikzdeclarecoordinatesystem,\tmp@x,\tmp@y,\v,\x,\y}
39 %% \OnlyDescription
40 \def\PrintMacroName#1{}
41 \def\PrintEnvName#1{}
42 \title{The \textsf{wargame} package}
43 \author{Christian Holm Christensen}
44 \date{\today}
45 \begin{document}
46 \maketitle
47 \begin{center}
48 \begin{tikzpicture}
49 \wargamelogo
50 \end{tikzpicture}
51 \end{center}
52 \begin{abstract}
53 This package provides tools to typesetting manuals, board, and
54 counters for wargames using \LaTeX{}.
55
56 Licensed under
57 \href{http://creativecommons.org/licenses/by-sa/4.0}{Creative
58 Commons Attribution-ShareAlike International License, version 4}
59 \tikz[scale=.2,transform shape]{\pic{cc by sa};}.
60 \end{abstract}
61 \tableofcontents
62 \wargamedbglvl=0
63 \hexdbglvl=0
64 \chitdbglvl=0
65 \natoappdbglvl=0
66 % To avoid: Package multicol Error: Error saving partial page.
67 \setlength{\IndexMin}{100pt}
68 \DocInput{wargame.dtx}
69 \end{document}
70 %</doc>
71 %\fi
72 %
73 % \iffalse
74 % ====================================================================
75 %
76 % Documentation
77 %
78 % ====================================================================
79 % \fi
80 %
81 % \newif\ifShowSymbols\ShowSymbolsfalse
82 % \newif\ifShowCompat\ShowCompatfalse
83 %
84 % \iffalse
85 % --------------------------------------------------------------------
86 %
87 % Introduction
88 %
89 % --------------------------------------------------------------------
90 % \fi
91 %
92 % \section{Introduction}
93 %
94 % This package provides tools for typesetting classic, hex-based
95 % wargames. The package allows an author to design a board, or map,
96 % comprised of hex, using a relatively simple interface. Units are
97 % typeset using a similar interface. Unit types are identified using
98 % the NATO Joint Military Symbology \cite{app6c} standard.
99 %
100 % This document is meant as a reference manual (although far from
101 % complete). A separate tutorial is available, and may be the best
102 % starting point.
103 %
104 % \iffalse
105 % --------------------------------------------------------------------
106 %
107 % Hexes
108 %
109 % --------------------------------------------------------------------
110 % \fi
111 %
112 % \section{Hex Boards}
113 %
114 % The package provides a number of facilities to set-up a board
115 % comprised of hexagon fields (``hexes'').
116 %
117 % \subsection{Placing hexes}
118 %
119 % A hex can be added to the current \texttt{tikzpicture} using the
120 % macro \cs{hex}. It takes up to 4 arguments
121 %
122 % \begin{MacroSyntax}{\hex}
123 % \cs{hex}\oarg{key-value-pairs}\parg{location}\parg{name}
124 % \end{MacroSyntax}
125 %
126 % The \meta{key-value-pairs} specify the hex. Valid options are
127 % \begin{description}
128 % \item[\keyval{terrain}{\meta{terrain-keys}}] specifies the terrain
129 % of the hex. More on in this in
130 % \sectionname~\ref{sec:hex:terrain}.
131 % \item[\keyval{ridges}{\meta{ridges-keys}}] specifies where ridges
132 % are drawn in the hex. \sectionname~\ref{sec:hex:ridges}.
133 % \item[\keyval{label}{\meta{label-keys}}] specifies the how to output
134 % the hex label, if any. This is expanded upon in
135 % \sectionname~\ref{sec:hex:label}.
136 % \item[\keyval{town}{\meta{town-keys}}] specifies that a town (or
137 % similar) is present in the hex. The various keys are described in
138 % \sectionname~\ref{sec:hex:town}.
139 % \item[\keyval{bevel}{\meta{bevel-keys}}] specifies that a bevel
140 % should be added to the hex. The various keys are described in
141 % \sectionname~\ref{sec:hex:bevel}.
142 % \item[\keyval{extra}{\meta{extra-keyx}} \textrm{and} \keyval{extra
143 % clipped}{\meta{extra-keyx}}] allows the user to put custom
144 % graphics in the hexes. See also \sectionname~\ref{sec:hex:extra}
145 % for more.
146 % \item[\keyval{row}{\meta{row}} \textrm{and}
147 % \keyval{column}{\meta{column}}] Keys to set hex coordinates.
148 % Mainly used when using \cs{node} rather than \cs{hex}. These
149 % coordinates should be specified in the \spec{hex cs} coordinate
150 % system (\sectionname~\ref{sec:hex:cs}).
151 % \item any style key defined for \TikZ{} pictures.
152 % \end{description}
153 %
154 % The \meta{location} argument specifies the coordinates, in the hex
155 % coordinate system where to put the hex. More about the coordinate
156 % system is given in \sectionname~\ref{sec:hex:cs}. Note, the numbers
157 % by default starts from the lower--left corner, but can be changed
158 % via options.
159 %
160 % The elements are rendered in the following order
161 % \begin{enumerate}
162 % \item The terrain, clipped to the hex shape.
163 % \item The hex, including circumference and fill
164 % \item The ridges, if any
165 % \item The label, if any
166 % \item Extra graphics clipped to the hex
167 % \item Bevel if selected
168 % \item Town, if any
169 % \item Extra graphics which may extend beyond the confines of the
170 % hex.
171 % \end{enumerate}
172 %
173 % \figurename~\ref{fig:hex:parts} illustrates some of the components
174 % of a hex. The hexes are 2 unit lengths wide. Typically, the unit
175 % length is one centimetre, which means the hexes are roughly
176 % $2\,\text{cm}\times 1.86\,\text{cmm}$ --- or roughly $3/4"\times
177 % 3/4"$ --- big. This allows the hexes to fit chits (see
178 % Section~\ref{sec:chit}) of size $12\,\mathrm{mm}\times12\,\mathrm{mm}$
179 % --- or roughly $1/2"\times1/2"$ --- nicely. If one wants larger
180 % chits or hexes one should take care to scale both by a similar
181 % amount.
182 %
183 % {\makeatletter\global\let\hexyy\hex@yy}
184 % \tikzset{wg arrow/.style={red!50!black,thick,<-}}
185 % \begin{figure}[htbp]
186 % \centering
187 % \begin{tikzpicture}[scale=2]
188 % \hex[terrain={woods},label={text=A1},color=blue](r=0,c=0)
189 % \draw[red]($(hex cs:e=N)-(0,.2)$)
190 % ellipse [x radius=.8, y radius=.4] node(label){};
191 % \draw[wg arrow] (label)--(1.3,1.2)
192 % node[align=right,anchor=south]{\texttt{label=\{text=A1\}}};
193 % \draw[wg arrow] (0,0)--(-2,-1)node[align=right,anchor=base east]{
194 % \texttt{terrain=\{woods\}}};
195 % \pic[draw,transform shape]{wg/x axis={-1,1, -1.2,{0},}};
196 % \pic[draw,transform shape]{wg/y axis={1.2, -1,1, {0},{-\hexyy,\hexyy}}};
197 % \end{tikzpicture}
198 % \caption{Hex parts. The bar on the bottom and to the right
199 % indicate two units of length.}
200 % \label{fig:hex:parts}
201 % \end{figure}
202 %
203 % Note that the macro \cs{hex} is really a short hand for \TikZ{}'s
204 % \cs{node} macro, but with preset options. An alternative to using
205 % the \cs{hex} macro is to do
206 %
207 % \begin{MacroSyntax}{\hex}
208 % \cs{node}[hex=\marg{key-value-pairs}] \parg{name} at \parg{location};
209 % \end{MacroSyntax}
210 %
211 % This can be useful when placing explanatory graphics or the like.
212 % The main difference between using \cs{hex} and the raw
213 % \cs{node}\texttt{[hex=\textellipsis]} is that the former can
214 % automatically generate labels and set shape coordinates in the
215 % picture. If you want that for your board, it is recommended to use
216 % \cs{hex}. For example, if one does
217 %
218 % \begin{verbatim}
219 % \begin{tikzpicture}[
220 % every hex={label={auto=alpha column}},
221 % hex/labels is name=true]
222 % \hex(c=1,r=1);
223 % \end{tikzpicture}
224 % \end{verbatim}
225 %
226 % then one can refer to the location of the hex by its label i.e.,
227 % \texttt{(A1)}. Since the hex is really a \TikZ{} \texttt{node}, we
228 % can also use anchors defined for \texttt{hex} node shape, such as
229 % \texttt{(A1.west)}, \texttt{(A1.north edge)}, and so on. This is
230 % not possible if one uses the \cs{node} macro.
231 %
232 % \subsection{Hex bevels}
233 % \label{sec:hex:bevel}
234 %
235 % A bevel (or ``shadow-effect'') can be added to hexes using the key
236 % \spec{bevel}, with a value that specifies where the light comes from
237 % (e.g., north west or NW). The percentage of the half width of a
238 % chit of the bevel can be specified by the key \spec{bevel fraction}
239 % (default 10\%).
240 %
241 %
242 % \subsection{Styling hexes}
243 %
244 % Typical \TikZ{} options can be passed to the \cs{hex} macro. For
245 % example, if you want to draw the hex borders in red, simply pass
246 % \spec{draw=red} in the \oarg{optional} arguments to
247 % \cs{hex}. Individual parts of the hexes can be styled separately.
248 % the default style used by \cs{hex} is \spec{tikz/hex/hex}. Users
249 % can redefine this style to suit their needs. If one does not want
250 % to change the default style, or pass the same argument to all
251 % \cs{hex}s one can define the style \spec{tikz/every hex}. For example,
252 % if one wants to auto label all hexes, one can do
253 %
254 % \begin{verbatim}
255 % \begin{tikzpicture}
256 % \begin{scope}[every hex/.style={label=auto}]
257 % % Hexes
258 % \end{scope}
259 % \end{tikzpicture}
260 % \end{verbatim}
261 %
262 % For example, to render only the corners of the hexes, as popular
263 % among some designers, one can do
264 %
265 % \begin{verbatim}
266 % every hex/.style={
267 % dash pattern=on .2cm off .6cm on .2cm off 0cm
268 % },
269 % \end{verbatim}
270 % Note that the dash pattern should be 1cm long and the last element
271 % should be \spec{off 0cm} so the dash pattern is started afresh on
272 % each hex edge.
273 %
274 % \subsection{Hex coordinate system}
275 % \label{sec:hex:cs}
276 %
277 % The package defines a coordinate system based on hexes. The centre
278 % of a hex is specified as \meta{column}-\meta{row} pairs, while
279 % vertexes and mid-point on edges can be specified separately. The
280 % syntax of the coordinates is
281 %
282 % \begin{Syntax}
283 % (hex cs:row=\meta{hex-row},column=\meta{hex-column},vertex=\meta{vertex},edge=\meta{edge})
284 % \end{Syntax}
285 %
286 % where \meta{vertex} and \meta{edge} are optional. The hex row and
287 % column defaults both to 0 and can be decimal numbers. The
288 % \spec{row}, \spec{column}, \spec{vertex}, and \spec{edge} keywords
289 % may be shortened to \spec{r}, \spec{c}, \spec{v}, and \spec{e},
290 % respectively. Possible vertexes and edges are listed in
291 % \tablename~\ref{tab:hex:ve}.
292 %
293 % \begin{table}[htbp]
294 % \centering
295 % \begin{tabular}{m{.3\linewidth}m{.65\linewidth}}
296 % \begin{tikzpicture}
297 % \hex(r=0,c=0)
298 % \foreach \v in {E,NE,NW,W,SW,SE}{
299 % \fill(hex cs:v=\v) circle(0.05);
300 % \node[inner sep=2pt] (v\v) at ($1.6*(hex cs:v=\v)$){\spec{v=\v}};
301 % \draw[<-](hex cs:v=\v)--(v\v); }
302 % \foreach \e in {NE,N,NW,SW,S,SE}{
303 % \fill(hex cs:e=\e) circle(0.05);
304 % \node[inner sep=2pt] (e\e) at ($1.6*(hex cs:e=\e)$) {\spec{e=\e}};
305 % \draw[<-](hex cs:e=\e) -- (e\e);}
306 % \end{tikzpicture}
307 % &
308 % \begin{tabular}{|ccr|ccr|}
309 % \hline
310 % \rowcolor{headbg}
311 % \multicolumn{2}{c}{\color{headfg}\spec{vertex=}}
312 % & {\color{headfg}\textbf{Angle}}
313 % & \multicolumn{2}{c}{\color{headfg}\spec{edge=}}
314 % & {\color{headfg}\textbf{Angle}}
315 % \\
316 % \hline
317 % \rowcolor{white}
318 % \spec{east} & \spec{E} & $ 0^{\circ}$ &
319 % \spec{north east} & \spec{NE} & $ 30^{\circ}$\\
320 % \spec{north east} & \spec{NE} & $ 60^{\circ}$ &
321 % \spec{north} & \spec{N} & $ 90^{\circ}$\\
322 % \spec{north west} & \spec{NW} & $120^{\circ}$ &
323 % \spec{north west} & \spec{NW} & $150^{\circ}$\\
324 % \spec{west} & \spec{W} & $180^{\circ}$ &
325 % \spec{south west} & \spec{SW} & $210^{\circ}$\\
326 % \spec{south west} & \spec{SW} & $240^{\circ}$ &
327 % \spec{south} & \spec{S} & $270^{\circ}$\\
328 % \spec{south east} & \spec{SE} & $300^{\circ}$ &
329 % \spec{south east} & \spec{SE} & $330^{\circ}$\\
330 % \hline
331 % \end{tabular}
332 % \end{tabular}
333 % \caption{Vertex and edge positions}
334 % \label{tab:hex:ve}
335 % \end{table}
336 %
337 % In \figurename~\ref{fig:hex:cs} is an example of a picture drawn in
338 % this coordinate system.
339 %
340 % \begin{figure}[htbp]
341 % \begin{tabular}{m{.3\linewidth}m{.65\linewidth}}
342 % \begin{tikzpicture}[]
343 % \hex[color=lightgray](r=0,c=0)
344 % \hex[color=lightgray](r=0,c=1)
345 % \hex[color=lightgray](r=1,c=0)
346 % \hex[color=lightgray](r=1,c=1)
347 % \draw[blue!50!black] (hex cs:r=0,c=0) -- (hex cs:r=1,c=1);
348 % \draw[red!50!black] (hex cs:r=0,c=0,vertex=E) --
349 % (hex cs:r=1,c=1,edge=north west);
350 % \fill (hex cs:r=0,c=0) circle(.1)
351 % node[color=gray,anchor=north] {\spec{(r=0,c=0)}};
352 % \fill (hex cs:r=1,c=1) circle(.1)
353 % node[color=gray,anchor=west] {\spec{(r=1,c=1)}};
354 % \fill (hex cs:r=0,c=0,v=east) circle(.1)
355 % node[color=gray,anchor=north west]{\spec{(r=0,c=0,v=E)}};
356 % \fill (hex cs:r=1,c=1,e=north west) circle(.1)
357 % node[color=gray,anchor=south]{
358 % \spec{(r=1,c=1,e=NW)}};
359 % \fill[lightgray](hex cs:r= .3,c= .3) circle(0.1)
360 % node[anchor=south,inner sep=0]{(0.3,0.3)};
361 % \fill[lightgray](hex cs:r=1.3,c= .3) circle(0.1)
362 % node[anchor=south,inner sep=0]{(1.3,0.3)};
363 % \fill[lightgray](hex cs:r=0.3,c=1.3) circle(0.1)
364 % node[anchor=south,inner sep=0]{(0.3,1.3)};
365 % \fill[lightgray](hex cs:r=1.3,c=1.3) circle(0.1)
366 % node[anchor=south,inner sep=0]{(1.3,1.3)};
367 % \end{tikzpicture}
368 % &
369 % Hexes and lines drawn with
370 % \begin{verbatim}
371 % \hex(0,0)\hex(0,1)\hex(1,0)\hex(1,1)
372 % \draw[blue!50!black] (hex cs:r=0,c=0) --
373 % (hex cs:r=1,c=1);
374 % \draw[red!50!black] (hex cs:r=0,c=0,vertex=E) --
375 % (hex cs:r=1,c=1,edge=NW);
376 % \fill[lightgray](hex cs:r= .3,c= .3) circle(0.1);
377 % \fill[lightgray](hex cs:r=1.3,c= .3) circle(0.1);
378 % \fill[lightgray](hex cs:r=0.3,c=1.3) circle(0.1);
379 % \fill[lightgray](hex cs:r=1.3,c=1.3) circle(0.1);
380 % \end{verbatim}
381 % \end{tabular}
382 % \caption{Hex coordinate system}
383 % \label{fig:hex:cs}
384 % \end{figure}
385 %
386 %
387 % \textbf{Important}: When the horizontal distance to the centre of a
388 % hex becomes less than $-\cos60^{\circ}$ or larger than
389 % $b-\cos60^{\circ}$ we effectively have a new hex column, and the
390 % coordinates are shifted upward or downward for smaller or larger
391 % numbers. Figure~\ref{fig:hex:coord:nb} illustrates. this. This can
392 % make it a little hard to specify coordinates relative to a hex
393 % centre. Alternatively one may use vertex or edge specifications
394 % together with a relative offset in those directions. If one
395 % require even more flexibility, one can use the \TikZ{} library
396 % \spec{calc} to add arbitrary offsets, e.g.,
397 %
398 % \begin{verbatim}
399 % \coordinate at ($(hex cs:c=1,r=10)+(.2,.2)$);
400 % \end{verbatim}
401 %
402 % \begin{figure}
403 % \centering
404 % \begin{tikzpicture}
405 % \begin{scope}[scale=2,every node/.style={inner sep=0}]
406 % \hex
407 %
408 % \begin{scope}[red,fill]
409 % \draw[anchor=south east](hex cs:c=-0.66,r=-0.67)circle(.01)node{(-2/3,-2/3)};
410 % \draw[anchor=south east](hex cs:c=-0.67,r=-0.33)circle(.01)node{(-2/3,-1/3)};
411 % \draw[anchor=south east](hex cs:c=-0.67,r=0)circle(.01)node{(-2/3,0)};
412 % \draw[anchor=south east](hex cs:c=-0.67,r=0.33)circle(.01)node{(-2/3,1/3)};
413 % \draw[anchor=north](hex cs:c=-0.33,r=-0.67)circle(.01)node{(-1/3,-2/3)};
414 % \draw[anchor=north](hex cs:c=-0.33,r=-0.33)circle(.01)node{(-1/3,-1/3)};
415 % \draw[anchor=south](hex cs:c=-0.33,r=0.33)circle(.01)node{(-1/3,1/3)};
416 % \draw[anchor=south](hex cs:c=-0.33,r=0.67)circle(.01)node{(-1/3,2/3)};
417 % \draw[anchor=south](hex cs:c=0.33,r=-0.67)circle(.01)node{(1/3,-2/3)};
418 % \draw[anchor=south](hex cs:c=0.33,r=-0.33)circle(.01)node{(1/3,-1/3)};
419 % \draw[anchor=north](hex cs:c=0.33,r=0.33)circle(.01)node{(1/3,1/3)};
420 % \draw[anchor=north](hex cs:c=0.33,r=0.67)circle(.01)node{(1/3,2/3)};
421 % \draw[anchor=north west](hex cs:c=0.67,r=-0.33)circle(.01)node{(2/3,-1/3)};
422 % \draw[anchor=north west](hex cs:c=0.67,r=0)circle(.01)node{(2/3,0)};
423 % \draw[anchor=north west](hex cs:c=0.67,r=0.33)circle(.01)node{(2/3,1/3)};
424 % \draw[anchor=north west](hex cs:c=0.67,r=0.67)circle(.01)node{(2/3,2/3)};
425 % \end{scope}
426 %
427 % \hex(c=2)
428 % \begin{scope}[blue,fill]
429 % \draw[anchor=south west](hex cs:c=2,v=NE,o=0.5)circle(.01)node{NE by 1/2};
430 % \draw[anchor=south west](hex cs:c=2,v=NE,o=1.0)circle(.01)node{NE by 1};
431 % \draw[anchor=south west](hex cs:c=2,v=NE,o=1.5)circle(.01)node{NE by 3/2};
432 % \draw[anchor=south east](hex cs:c=2,v=NW,o=0.5)circle(.01)node{NW by 1/2};
433 % \draw[anchor=south east](hex cs:c=2,v=NW,o=1.0)circle(.01)node{NW by 1};
434 % \draw[anchor=south east](hex cs:c=2,v=NW,o=1.5)circle(.01)node{NW by 3/2};
435 % \draw[anchor=north](hex cs:c=2,v=W,o=0.5)circle(.01)node{W by 1/2};
436 % \draw[anchor=south](hex cs:c=2,v=W,o=1.0)circle(.01)node{W by 1};
437 % \draw[anchor=north](hex cs:c=2,v=W,o=1.5)circle(.01)node{W by 3/2};
438 % \draw[anchor=north east](hex cs:c=2,v=SW,o=0.5)circle(.01)node{SW by 1/2};
439 % \draw[anchor=north east](hex cs:c=2,v=SW,o=1.0)circle(.01)node{SW by 1};
440 % \draw[anchor=north east](hex cs:c=2,v=SW,o=1.5)circle(.01)node{SW by 3/2};
441 % \draw[anchor=north west](hex cs:c=2,v=SE,o=0.5)circle(.01)node{SE by 1/2};
442 % \draw[anchor=north west](hex cs:c=2,v=SE,o=1.0)circle(.01)node{SE by 1};
443 % \draw[anchor=north west](hex cs:c=2,v=SE,o=1.5)circle(.01)node{SE by 3/2};
444 % \draw[anchor=north](hex cs:c=2,v=E,o=0.5)circle(.01)node{E by 1/2};
445 % \draw[anchor=south](hex cs:c=2,v=E,o=1.0)circle(.01)node{E by 1};
446 % \draw[anchor=north](hex cs:c=2,v=E,o=1.5)circle(.01)node{E by 3/2};
447 % \end{scope}
448 % \end{scope}
449 % \end{tikzpicture}
450 % \caption{Relative coordinates}
451 % \label{fig:hex:coords:nb}
452 % \end{figure}
453 % \subsection{Terrains}
454 % \label{sec:hex:terrain}
455 %
456 % Terrains are rendered using tile images or \TikZ{}
457 % \texttt{pic}tures. The available terrains are shown in
458 % \tablename{}s~\ref{tab:hex:terrain:image}
459 % and~\ref{tab:hex:terrain:pic}. Users can provide their own tile
460 % images and select those via \texttt{terrain=\{image=\meta{image}\}}
461 % or defined \TikZ{} \texttt{pic}tures and select those via
462 % \texttt{terrain=\{pic=\meta{pic-name}\}}. In all cases, the terrain
463 % graphics is clipped to the hex.
464 %
465 % The terrain of a hex is selected via the multi-valued key
466 % \spec{terrain}. Sub-keys of this key are
467 %
468 % \begin{description}
469 % \item[\spec{image=}\meta{graphics-file}] Specifies terrain tile
470 % image \meta{graphics-file}.
471 % \item[\spec{pic=}\meta{picture-key}] Specifies terrain tile \TikZ{}
472 % \spec{pic}ture.
473 % \item[\spec{code=}\meta{tikz-code}] Any valid \TikZ{} code
474 % \item[\spec{clip=}\meta{path(s)}] \TikZ{} path specification to clip
475 % the terrain within the hex.
476 % \item[\spec{random rotation}] Applies a random rotation to the
477 % terrain image or picture. This will create an effect where the
478 % hexes look less alike.
479 % \item[\spec{rotate}=\meta{angle}] Applies a rotation by \meta{angle}
480 % to the terrain image or picture. Note that the \meta{angle}
481 % should most likely be multiples of $60^{\circ}$.
482 % \end{description}
483 %
484 % \begin{table}[htbp]
485 % \centering
486 % \begin{tabular}{|m{2cm}|ll|m{2cm}|ll|}
487 % \hline
488 % \rowcolor{headbg}
489 % {\color{headfg}\textbf{Symbol}}
490 % & {\color{headfg}\textbf{Name}}
491 % & {\color{headfg}\texttt{terrain=\{image=\meta{image}\}}}
492 % & {\color{headfg}\textbf{Symbol}}
493 % & {\color{headfg}\textbf{Name}}
494 % & {\color{headfg}\texttt{terrain=\{image=\meta{image}\}}}\\
495 % \hline
496 % &&&&&\\[-1ex]
497 % \tikz{\hex[](r=0,c=0) }
498 % & Clear
499 % & \texttt{}
500 % & \tikz{\hex[terrain={image=wargame.beach}](r=0,c=0) }
501 % & Beach
502 % & \texttt{\{beach\}}\\
503 % \tikz{\hex[terrain={image=wargame.light_woods}](r=0,c=0) }
504 % & Light woods
505 % & \texttt{\{light\_woods\}}
506 % & \tikz{\hex[terrain={image=wargame.woods}](r=0,c=0)}
507 % & Woods
508 % & \texttt{\{woods\}}\\
509 % \tikz{\hex[terrain={image=wargame.rough}](r=0,c=0) }
510 % & Rough
511 % & \texttt{\{rough\}}
512 % & \tikz{\hex[terrain={image=wargame.swamp}](r=0,c=0) }
513 % & Swamp
514 % & \texttt{\{swamp\}}\\
515 % \tikz{\hex[terrain={image=wargame.mountains}](r=0,c=0) }
516 % & Mountains
517 % & \texttt{\{mountains\}}
518 % & \tikz{\hex[fill=blue!40!white](r=0,c=0) }
519 % & Sea
520 % & \texttt{\{sea\}}\\
521 % \tikz{\hex[terrain={image=wargame.fields},fill=yellow](r=0,c=0) }
522 % & Fields
523 % & \texttt{\{fields\},fill=yellow}
524 % &\tikz{\hex[terrain={image=wargame.speckle},fill=hostile!25!white](r=0,c=0) }
525 % & Fields
526 % & \texttt{\{speckle\},fill=hostile}\\
527 % \hline
528 % \end{tabular}
529 % \caption{Terrains specified via tile images}
530 % \label{tab:hex:terrain:image}
531 % \end{table}
532 %
533 % \begin{table}[htbp]
534 % \centering
535 % \begin{tabular}{|m{2cm}|l|l|}
536 % \hline
537 % \rowcolor{headbg}
538 % {\color{headfg}\textbf{Symbol}}
539 % & {\color{headfg}\textbf{Name}}
540 % & {\color{headfg}\texttt{terrain=\{pic=\meta{image}\}}}\\
541 % \hline
542 % &&\\[-1ex]
543 % \tikz{\hex[terrain={pic=hex/terrain/mountain,line width=3pt}](r=0,c=0) }
544 % & Mountains
545 % & \texttt{\{pic=hex/terrain/mountain,line width=3pt\}}\\
546 % \hline
547 % \end{tabular}
548 % \caption{Terrains specified via \TikZ{} \spec{pic}tures}
549 % \label{tab:hex:terrain:pic}
550 % \end{table}
551 %
552 % The terrain can be clipped by the sub-key \spec{clip}. This can be
553 % useful if the game specifies movement costs in terms of hex-edge
554 % crossing, for example \emph{First Blood}~\cite{fb}. In that case, a
555 % hex may be, for example, a jungle hex, but some edges a clear. Thus
556 % movements across such an edge would count as moving into clear
557 % territory while moving over other edges will count as moving into a
558 % jungle. This is, of course, not how most games count movement
559 % costs, but this package nonetheless facilitates such rules.
560 % \tablename~\ref{tab:hex:terrain:clip} shows a few examples of
561 % predefined clippings of terrain.
562 %
563 % Users can define \TikZ{} \spec{pic}tures that specify clipping paths
564 % as needed. For example, one could add clipping to the terrain to
565 % ensure that other graphics in the hex stands out.
566 %
567 % \begin{table}[htbp]
568 % \centering
569 % \begin{tabular}{|m{2cm}m{.3\linewidth}|m{2cm}m{.3\linewidth}|}
570 % \hline
571 % \rowcolor{headbg}
572 % {\color{headfg}\textbf{Symbol}}
573 % & {\color{headfg}\texttt{terrain=\{clip=,...\}}}
574 % & {\color{headfg}\textbf{Symbol}}
575 % & {\color{headfg}\texttt{terrain=\{clip=,...\}}}\\
576 % \hline
577 % &&&\\
578 % \tikz{\hex[terrain={woods,
579 % clip={hex/sextant=NE}}](r=0,c=0) }
580 % & \spec{\{hex/sextant=NE\}}
581 % & \tikz{\hex[terrain={woods,
582 % clip={
583 % hex/large sextant=NE,
584 % hex/large sextant=N}}](r=0,c=0) }
585 % & \spec{\{hex/large sextant=NE,hex/large sextant=N\}}\\
586 % \hline
587 % \tikz{\hex[terrain={woods,
588 % clip={hex/sextant=N}}](r=0,c=0) }
589 % & \spec{\{hex/sextant=N\}}
590 % & \tikz{\hex[terrain={woods,
591 % clip={hex/sextant=NE,
592 % hex/sextant=N,
593 % hex/sextant=NW}}](r=0,c=0) }
594 % & \spec{\{hex/sextant=NE,
595 % hex/sextant=N,
596 % hex/sextant=NW\}}\\
597 % \hline
598 % \tikz{\hex[terrain={woods,
599 % clip={hex/sextant=NW}}](r=0,c=0) }
600 % & \spec{\{hex/sextant=NW\}}
601 % & \tikz{\hex[terrain={woods,
602 % clip={hex/sextant=NE,
603 % hex/sextant=N,
604 % hex/sextant=NW,
605 % hex/sextant=SW}}](r=0,c=0) }
606 % & \spec{\{hex/sextant=NE,
607 % hex/sextant=N,
608 % hex/sextant=NW,
609 % hex/sextant=SW\}}\\
610 % \hline
611 % \tikz{\hex[terrain={woods,
612 % clip={hex/sextant=SW}}](r=0,c=0) }
613 % & \spec{\{hex/sextant=SW\}}
614 % & \tikz{\hex[terrain={woods,
615 % clip={hex/sextant=NE,
616 % hex/sextant=N,
617 % hex/sextant=NW,
618 % hex/sextant=SW,
619 % hex/sextant=S}}](r=0,c=0) }
620 % & \spec{\{hex/sextant=NE,
621 % hex/sextant=N,
622 % hex/sextant=NW,
623 % hex/sextant=SW,
624 % hex/sextant=S\}}\\
625 % \hline
626 % \tikz{\hex[terrain={woods,
627 % clip={hex/sextant=S}}](r=0,c=0) }
628 % & \spec{\{hex/sextant=S\}}
629 % & \tikz{\hex[terrain={woods,
630 % clip={hex/sextant=NE,
631 % hex/sextant=N,
632 % hex/sextant=NW,
633 % hex/sextant=SW,
634 % hex/sextant=S,
635 % hex/sextant=SE}}](r=0,c=0) }
636 % & \spec{\{hex/sextant=NE,
637 % hex/sextant=N,
638 % hex/sextant=NW,
639 % hex/sextant=SW,
640 % hex/sextant=S,
641 % hex/sextant=SE\}}\\
642 % \hline
643 % \tikz{\hex[terrain={woods,
644 % clip={hex/sextant=SE}}](r=0,c=0) }
645 % & \spec{\{hex/sextant=SE\}}
646 % & \tikz{\hex[terrain={woods,
647 % clip={hex/sextant=NE,
648 % hex/sextant=N,
649 % hex/sextant=NW,
650 % hex/sextant=SW,
651 % hex/sextant=S,
652 % hex/sextant=SE,
653 % hex/sextant=C}}](r=0,c=0) }
654 % & \spec{\{hex/sextant=NE,
655 % hex/sextant=N,
656 % hex/sextant=NW,
657 % hex/sextant=SW,
658 % hex/sextant=S,
659 % hex/sextant=SE,
660 % hex/sextant=C\}}\\
661 % \hline
662 % \tikz{\hex[terrain={woods,
663 % clip={hex/sextant=C}}](r=0,c=0) }
664 % & \spec{\{hex/sextant=C\}}
665 % & \tikz{\hex[terrain={woods,
666 % clip={hex/sextant=NE,
667 % hex/sextant=N,
668 % hex/sextant=S,
669 % hex/sextant=SE,
670 % hex/sextant=C}}](r=0,c=0) }
671 % & \spec{\{hex/sextant=NE,
672 % hex/sextant=N,
673 % hex/sextant=S,
674 % hex/sextant=SE,
675 % hex/sextant=C\}}\\
676 % \hline
677 % \end{tabular}
678 % \caption{Terrain clipped via \spec{clip} sub-key}
679 % \label{tab:hex:terrain:clip}
680 % \end{table}
681 %
682 % \subsubsection{Styling terrains}
683 %
684 % Terrains use the key \spec{tikz/hex/terrain} to render the
685 % terrains. This is mainly useful for terrains made from \TikZ{}
686 % \spec{pic}tures.
687 %
688 % \subsection{Ridges}
689 % \label{sec:hex:ridges}
690 %
691 % Ridges, or hill or mountain slopes, can be added to a hex via the
692 % keyword \spec{ridges}. The keyword takes a list of hex edges and
693 % generates symbology for the ridge on the chosen edges. Note that
694 % the edges does not have to be continuous, as illustrated in the
695 % bottom right of \tablename~\ref{tab:hex:ridges}, nor in any
696 % particular order. The edges are specified as compass direction
697 %
698 % \begin{Syntax}
699 % north east, north, north west, south west, south, south east.\\
700 % NE, N, NW, SW, S, SE
701 % \end{Syntax}
702 %
703 % \tablename~\ref{tab:hex:ridges} shows some examples.
704 %
705 % \begin{table}[htbp]
706 % \centering
707 % \begin{tabular}{|m{2cm}|c|m{2cm}|c|}
708 % \hline
709 % \rowcolor{headbg}
710 % {\color{headfg}\textbf{Symbol}}
711 % & {\color{headfg}\spec{ridges=}}
712 % & {\color{headfg}\textbf{Symbol}}
713 % & {\color{headfg}\spec{ridges=}}\\
714 % \hline
715 % &&&\\[-1ex]
716 % \tikz{\hex[ridges=NE]}
717 % & \spec{NE}
718 % & \tikz{\hex[ridges={NE,N}]}
719 % & \spec{NE,N}\\
720 % \tikz{\hex[ridges=N]}
721 % & \spec{N}
722 % & \tikz{\hex[ridges={NE,N,NW}]}
723 % & \spec{NE,N,NW}\\
724 % \tikz{\hex[ridges=NW]}
725 % & \spec{NW}
726 % & \tikz{\hex[ridges={NE,N,NW,SW}]}
727 % & \spec{NE,N,NW,SW}\\
728 % \tikz{\hex[ridges=SW]}
729 % & \spec{SW}
730 % & \tikz{\hex[ridges={NE,N,NW,SW,S,line width=3pt}]}
731 % & \spec{NE,N,NW,SW,S,line width=3pt}\\
732 % \tikz{\hex[ridges=S]}
733 % & \spec{S}
734 % & \tikz{\hex[ridges={NE,N,NW,SW,S,SE,color=brown!70!black}]}
735 % & \spec{NE,N,NW,SW,S,SE,color=brown!70!black}\\
736 % \tikz{\hex[ridges=SE]}
737 % & \spec{SE}
738 % & \tikz{\hex[ridges={N,S,NW,SE},terrain={rough}]}
739 % & \spec{N,S,NW,SE}\\
740 % \hline
741 % \end{tabular}
742 % \caption{Ridges}
743 % \label{tab:hex:ridges}
744 % \end{table}
745 %
746 % \subsubsection{Styling ridges}
747 %
748 % Every ridge is drawn with the style \spec{tikz/hex/ridges}. Users
749 % can customise this style. The default is to draw thin black wave
750 % lines (\TikZ{} decoration \spec{waves}). The default style also
751 % takes care to auto scale line widths.
752 %
753 % \subsection{Labels}
754 % \label{sec:hex:label}
755 %
756 % Labels can be placed on the hexes via the keyword \spec{label}. The
757 % label can either be auto-generated or given explicitly.
758 % \tablename~\ref{tab:hex:label} shows the various choices.
759 %
760 % \begin{table}[htbp]
761 % \centering
762 % \begin{tabular}{|m{2cm}|l|c|m{6cm}|}
763 % \hline
764 % \rowcolor{headbg}
765 % {\color{headfg}\textbf{Symbol}}
766 % & {\color{headfg}\textbf{Name}}
767 % & {\color{headfg}\textbf{Column/Row}}
768 % & {\color{headfg}\spec{label=}}\\
769 % \hline
770 % &&&\\[-1ex]
771 % \tikz{\hex[label=none](r=0,c=0) }
772 % & No label
773 % & n/a
774 % & \spec{none}\\
775 % \tikz{\hex[label={text=B10}](r=0,c=0) }
776 % & User specified
777 % & n/a
778 % & \spec{text=B10}\\
779 % \tikz{\hex[label={color=blue,text=A1}](r=0,c=0) }
780 % & User specified
781 % & n/a
782 % & \spec{\{color=blue,text=A1\}}\\
783 % \tikz{\hex[label=auto](r=3,c=9) }
784 % & Two-digit, zero padded numbers
785 % & 9/3
786 % & \spec{auto}\\
787 % \tikz{\hex[label={auto=alpha column,font=\noexpand\rmfamily}](r=3,c=2)}
788 % & Column letter, number row
789 % & 2/3
790 % & \spec{\{auto=alpha column,font=\cs{noexpand}\cs{rmfamily}\}}
791 % \textsuperscript{$\dag$}\\
792 % \tikz{\hex[label={auto=alpha 2 column,anchor=north east}](r=24,c=6) }
793 % & Two letter column, two digit row
794 % & 6/24
795 % & \spec{\{auto=alpha 2 column,anchor=north east\}}\\
796 % \hline
797 % \end{tabular}
798 % \caption{Labels\newline
799 % \textsuperscript{$\dag$}When specifying macros as key values in
800 % the options, for example the value \cs{rmfamily} for the key
801 % \spec{font} above, we have to put a \cs{noexpand} in front if the
802 % macro. This is to prevent early expansion of the macro, which
803 % would cause errors. A minor nuisance.}
804 % \label{tab:hex:label}
805 % \end{table}
806 %
807 % The option \spec{auto=inv y x plus 1} will label the rows
808 % inversely, and add one to the column number. This requires that the
809 % key \spec{tikz/max hex row} has been set to the largest row number
810 % used.
811 %
812 % In addition to the sub-keys \spec{none}, \spec{auto}, and
813 % \spec{text}, one can also specify the following keys
814 %
815 % \begin{description}
816 % \item[\keyval{place}{\meta{coordinates}}] specifies the Location of
817 % label within the hex. The anchor point of the text will be placed
818 % at this point.
819 % \item[\oarg[options]] at the start of the option (but inside braces
820 % \spec{\{\textellipsis\}}) can be used to give additional style
821 % options.
822 % \end{description}
823 %
824 % \subsubsection{Styling labels}
825 %
826 % All labels use the style \spec{tikz/hex/label}. By default, this
827 % places the label at the top of the hex, and renders the text as gray
828 % script sized text. Users can customise this style. If a user does
829 % not want to change the default style, or want to pass the same
830 % option to all labels, then one can set the key \spec{tikz/every
831 % label} to those options.
832 %
833 %
834 % \subsection{Towns}
835 % \label{sec:hex:town}
836 %
837 % Towns in hexes are made via the key \spec{town}. This key takes
838 % several sub-keys, as illustrated in \tablename~\ref{tab:hex:town}
839 %
840 %
841 % \begin{table}[htbp]
842 % \centering
843 % \begin{tabular}{|m{2cm}l|m{2cm}l|}
844 % \hline
845 % \rowcolor{headbg}
846 % {\color{headfg}\textbf{Symbol}}
847 % & {\color{headfg}\spec{town=}}
848 % & {\color{headfg}\textbf{Symbol}}
849 % & {\color{headfg}\spec{town=}}\\
850 % \hline
851 % &&&\\[-1ex]
852 % \tikz{\hex[town](r=0,c=0) }
853 % & \spec{}
854 % & \tikz{\hex[town={name=Copenhagen}](r=0,c=0) }
855 % & \spec{\{name=Copenhagen\}}\\
856 % \tikz{\hex[town={pic=hex/town/city}](r=0,c=0) }
857 % & \spec{\{pic=hex/town/city\}}
858 % & \tikz{\hex[town={red,pic=hex/town/city}](r=0,c=0) }
859 % & \spec{\{red,pic=hex/town/city\}}\\
860 % \tikz{\hex[town={fill=red}](r=0,c=0) }
861 % & \spec{\{fill=red\}}
862 % & \tikz{\hex[town={pic=hex/town/city,name=London}](r=0,c=0) }
863 % & \spec{\{name=London\}}\\
864 % \tikz{\hex[town={color=red,name=Paris}](r=0,c=0) }
865 % & \spec{\{red,name=Paris\}}
866 % &\tikz{\hex[town={above=0.8,name=Berlin}](r=0,c=0) }
867 % & \spec{\{above=0.8,name=Berlin\}}\\
868 % \tikz{\hex[town={place={(.2,.2)}}](r=0,c=0) }
869 % & \spec{\{place=\{(.2,.2)\}\}}
870 % &\tikz{\hex[town={font=\noexpand\itshape,name=Amsterdam}](r=0,c=0) }
871 % & \spec{\{font=\cs{noexpand}\cs{itshape},name=Amsterdam\}}
872 % \textsuperscript{$\dag$}\\
873 % \hline
874 % \end{tabular}
875 % \caption{Towns\newline
876 % \textsuperscript{$\dag$}When specifying macros as key values in
877 % the options, for example the value \cs{rmfamily} for the key
878 % \spec{font} above, we have to put a \cs{noexpand} in front if the
879 % macro. This is to prevent early expansion of the macro, which
880 % would cause errors. A minor nuisance.}
881 % \label{tab:hex:town}
882 % \end{table}
883 %
884 % The sub-keys available for the \spec{town} key are
885 %
886 % \begin{description}
887 % \item[\keyval{pic}{\meta{town-pic}}] The name of a \TikZ{}
888 % \spec{pic}ture. Currently defined are \spec{hex/town/town} and
889 % \spec{hex/town/city}. Users can provide alternate definitions or new types
890 % by defining \TikZ{} \spec{pic}tures.
891 % \item[\keyval{place}{\meta{coordinates}}] Location of label within
892 % the hex. The anchor point of the text will be placed at this
893 % point.
894 % \item[\keyval{name}{\meta{name}}] Name of town
895 % \end{description}
896 %
897 % \subsubsection{Styling towns}
898 %
899 % Towns uses two styles: \spec{tikz/hex/town} for the town graphics,
900 % and \spec{tikz/hex/town name} for the name of the town. In addition,
901 % a user may set the key \spec{tikz/every hex town} to contain options
902 % to be passed to all towns.
903 %
904 % \subsection{Extra graphics for hexes}
905 % \label{sec:hex:extra}
906 %
907 % Additional graphics for hexes can be added by the two keys
908 % \spec{extra} and \spec{extra clipped}. The difference between the
909 % two are that graphics specified by \spec{extra clipped} are clipped
910 % (restricted) to the hex, while graphics given by \spec{extra} may
911 % extend beyond the hex. Both keys accept a comma separated list of
912 % arguments, where each element has the syntax
913 %
914 % \begin{Syntax}
915 % \oarg{options}\parg{placement}\meta{picture}
916 % \end{Syntax}
917 %
918 % Both \meta{options} and \meta{placement} are optional, and specifies
919 % keys to draw \meta{picture} with and the relative location in the
920 % hex, respectively. The required argument \meta{picture} must name a
921 % \TikZ{} \spec{pic}ture, for example \spec{hex/fortress}. This can
922 % be useful for marking hexes on the board. For example to mark a
923 % set-up hex for one faction of the game.
924 %
925 % One could for example define the following pictures to define set-up
926 % points for a Sovjet and German faction
927 %
928 % \tikzset{
929 % setup/sovjet/.pic={
930 % \path[fill=red,draw=yellow,pic actions]
931 % ( 90:.4)--(126:.15)--
932 % (162:.4)--(198:.15)--
933 % (234:.4)--(270:.15)--
934 % (306:.4)--(342:.15)--
935 % ( 18:.4)--( 54:.15)--cycle;},
936 % setup/german/.pic={
937 % \path[fill,pic actions]
938 % (-.4, -.1) rectangle(.4,.1)
939 % (-.1, -.4) rectangle(.1,.4);
940 % \path[draw,pic actions]
941 % (-.4,-.2) -- (-.2,-.2) -- (-.2,-.4)
942 % (-.4, .2) -- (-.2, .2) -- (-.2, .4)
943 % ( .4, .2) -- ( .2, .2) -- ( .2, .4)
944 % ( .4,-.2) -- ( .2,-.2) -- ( .2,-.4);},
945 % foo/large/.pic={
946 % \path[fill=gray,pic actions] (-1,-.5) rectangle(1,.5);},
947 % }
948 % \begin{verbatim}
949 % setup/sovjet/.pic={
950 % \path[fill=red,draw=yellow,pic actions]
951 % ( 90:.4)--(126:.15)--
952 % (162:.4)--(198:.15)--
953 % (234:.4)--(270:.15)--
954 % (306:.4)--(342:.15)--
955 % ( 18:.4)--( 54:.15)--cycle;},
956 % setup/german/.pic={
957 % \path[fill,pic actions]
958 % (-.4, -.1) rectangle(.4,.1)
959 % (-.1, -.4) rectangle(.1,.4);
960 % \path[draw,pic actions]
961 % (-.4,-.2) -- (-.2,-.2) -- (-.2,-.4)
962 % (-.4, .2) -- (-.2, .2) -- (-.2, .4)
963 % ( .4, .2) -- ( .2, .2) -- ( .2, .4)
964 % ( .4,-.2) -- ( .2,-.2) -- ( .2,-.4);}
965 % foo/large/.pic={
966 % \path[fill=gray,pic actions] (-1,-.5) rectangle(1,.5);},
967 % }
968 % \end{verbatim}
969 %
970 % We can place extra graphics in hexes as shown in
971 % \tablename~\ref{tab:hex:extra}.
972 %
973 % \begin{table}[htbp]
974 % \centering
975 % \begin{tabular}{|m{2cm}l|}
976 % \hline
977 % \rowcolor{headbg}
978 % {\color{headfg}\textbf{Symbol}}
979 % & {\color{headfg}\spec{extra=}}\\
980 % \hline
981 % &\\[-1ex]
982 % \tikz{\hex[extra=hex/fortress](r=0,c=0) }
983 % & \spec{hex/fortress}\\
984 % \tikz{\hex[extra=setup/sovjet](r=0,c=0) }
985 % & \spec{setup/sovjet}\\
986 % \tikz{\hex[extra=setup/german](r=0,c=0) }
987 % & \spec{setup/german}\\
988 % \tikz{\hex[extra={setup/german,hex/fortress}](r=0,c=0) }
989 % & \spec{\{setup/german,hex/fortress\}}\textsuperscript{$\dag$}\\
990 % \tikz{\hex[extra={[{line width=2pt,color=brown}]hex/fortress 2}](r=0,c=0) }
991 % & \spec{\{[\{line width=2pt,brown\}]
992 % fortress 2\}}\textsuperscript{$\ddag$}\\
993 % \tikz{\hex[extra={[shift={(.2,.2)}]setup/sovjet}](r=0,c=0) }
994 % & \spec{\{[shift=\{(.2,.2)\}]setup/sovjet\}}\textsuperscript{$\ddag$}\\
995 % \tikz{\hex[extra={[{shift={(.2,.2)},scale=.5,color=gray}]setup/german}](r=0,c=0) }
996 % & \spec{\{[\{shift=\{(.2,.2)\},scale=.5,color=gray\}]
997 % setup/german\}}\textsuperscript{$\ddag$}\\
998 % \tikz{\hex[extra=foo/large]} & \spec{foo/large}\\
999 % \rowcolor{headbg}
1000 % {\color{headfg}\textbf{Symbol}}
1001 % & {\color{headfg}\spec{extra clipped=}}\\
1002 % \hline
1003 % &\\[-1ex]
1004 % \iftrue
1005 % \tikz{\hex[extra clipped=foo/large]} & \spec{foo/large}\\
1006 % \fi
1007 % \hline
1008 % \end{tabular}
1009 % \caption{Hex extra graphics. Note that in the last line we use
1010 % the graphics \spec{foo/large} with \spec{extra clipped} (compare
1011 % to line just above) to restrict the graphics to the hex.\newline%
1012 % \textsuperscript{$\dag$}When specifying more than one item, the
1013 % list must be enclosed in braces
1014 % (\spec{\{\textellipsis\}})\newline%
1015 % \textsuperscript{$\ddag$}When an item in the list of \spec{extra}
1016 % contains a comma (\spec{,}), for example in a list of graphics
1017 % options, then we need to enclose the inner list \emph{and} the
1018 % whole list in braces (\spec{\{\textellipsis\}}) to protect against
1019 % unwanted expansion.}
1020 % \label{tab:hex:extra}
1021 % \end{table}
1022 %
1023 % To finish off this part on hexes and what we can do with those, we
1024 % generate a map in \figurename~\ref{fig:hex:placing}.
1025 %
1026 % \begin{figure}[htbp]
1027 % \centering
1028 % \begin{tabular}{m{.3\linewidth}m{.68\linewidth}}
1029 % \begin{tikzpicture}[scale=.8]
1030 % \hex[town={pic=hex/town/city,name=Berlin}](r=0,c=0)
1031 % \hex[] (r=0,c=1)
1032 % \hex[] (r=0,c=2)
1033 % \hex[terrain={swamp},label=auto] (r=0,c=3)
1034 % \hex[] (r=1,c=0)
1035 % \hex[terrain={light woods}] (r=1,c=1)
1036 % \hex[terrain={woods}] (r=1,c=2)
1037 % \hex[terrain={swamp}] (r=1,c=3)
1038 % \hex[town={name=Freiburg},extra=hex/fortress](r=2,c=0)
1039 % \hex[extra=hex/fortress] (r=2,c=1)
1040 % \hex[terrain={rough}] (r=2,c=2)
1041 % \hex[] (r=2,c=3)
1042 % \hex[terrain={mountains}] (r=3,c=0)
1043 % \hex[terrain={mountains}] (r=3,c=1)
1044 % \hex[terrain={mountains}] (r=3,c=2)
1045 % \hex[] (r=3,c=3)
1046 % \end{tikzpicture}
1047 % &
1048 % \begin{verbatim}
1049 % \hex[town={pic=hex/town/city,name=Berlin}] (r=0,c=0)
1050 % \hex[] (r=0,c=1)
1051 % \hex[] (r=0,c=2)
1052 % \hex[terrain={swamp},label=auto] (r=0,c=3)
1053 % \hex[] (r=1,c=0)
1054 % \hex[terrain={light woods}] (r=1,c=1)
1055 % \hex[terrain={woods}] (r=1,c=2)
1056 % \hex[terrain={swamp}] (r=1,c=3)
1057 % \hex[town={name=Freiburg},extra=hex/fortress](r=2,c=0)
1058 % \hex[extra=hex/fortress] (r=2,c=1)
1059 % \hex[terrain={rough}] (r=2,c=2)
1060 % \hex[] (r=2,c=3)
1061 % \hex[terrain={mountains}] (r=3,c=0)
1062 % \hex[terrain={mountains}] (r=3,c=1)
1063 % \hex[terrain={mountains}] (r=3,c=2)
1064 % \hex[] (r=3,c=3)
1065 % \end{verbatim}
1066 % \end{tabular}
1067 % \caption{Placing hexes}
1068 % \label{fig:hex:placing}
1069 % \end{figure}
1070 %
1071 % \subsection{Rivers, borders, and roads}
1072 %
1073 % Rivers and borders follow the hex sides and are added to the current
1074 % \spec{tikkzpicture} using \cs{river} and \cs{border} macros
1075 % respectively. They are specified as regular \TikZ{} paths. It is
1076 % useful to utilise the hex coordinate system for this.
1077 %
1078 % \begin{MacroSyntax}{\river,\border}
1079 % \cs{river}\oarg{options} \meta{path};\\
1080 % \cs{border}\oarg{options} \meta{path};
1081 % \end{MacroSyntax}
1082 %
1083 % Rivers are essentially borders, but are randomized to giver a more
1084 % aesthetically pleasing output.
1085 %
1086 % Roads and railroads typically go from hex--center to hex--center,
1087 % and are added using the macro \cs{road}. The road or railroad is
1088 % specified via a regular \TikZ{} path.
1089 %
1090 % \begin{MacroSyntax}{\addriver}
1091 % \cs{road}\oarg{options} \meta{path};\\
1092 % \cs{railroad}\oarg{options} \meta{path};
1093 % \end{MacroSyntax}
1094 %
1095 % Towns and cities conveniently serve as places to split up a road at.
1096 %
1097 % \begin{figure}[htbp]
1098 % \centering
1099 % \begin{tikzpicture}
1100 % \testmap
1101 % \end{tikzpicture}
1102 % \caption{Adding rivers, boarders, and roads}
1103 % \end{figure}
1104 %
1105 % \subsubsection{Styling paths}
1106 %
1107 % Rivers, roads, railroads, and borders are styled by
1108 % \spec{hex/river}, \spec{hex/road}, \spec{hex/railroad}, and
1109 % \spec{border}, respectively, and the keys \spec{every hex river},
1110 % \spec{every hex road}, \spec{every hex railroad}, and \spec{every
1111 % hex border} will also be applied. The latter can be defined by the
1112 % user.
1113 %
1114 % \subsection{Board clipping and frame}
1115 %
1116 % In the river, border, and road example above, the roads extend beyond
1117 % the hexes, which does not look very nice. One way to deal with this,
1118 % is to draw a clipping box around the hexes
1119 %
1120 % \begin{figure}[htbp]
1121 % \centering
1122 % \begin{tabular}{m{.\linewidth}m{.\linewidth}}
1123 % \begin{tikzpicture}
1124 % \draw[clip](-.5,-.5) rectangle (5,5);
1125 % \testmap
1126 % \end{tikzpicture}
1127 % &
1128 % \begin{verbatim}
1129 % \draw[clip](-.5,-.5) rectangle (5,5);
1130 % \testmap
1131 % \end{verbatim}
1132 % \end{tabular}
1133 % \caption{Clipping for a manual using a \TikZ{}
1134 % \cs{draw}\spec{[clip]} command.}
1135 % \label{fig:hex:boxclip}
1136 % \end{figure}
1137 %
1138 % This technique works fine for examples in a manual, it has a
1139 % somewhat displeasing effect for a full board. The package therefor
1140 % defines the macro \cs{boardclip} which clips the graphics
1141 % according to the defined hexes.
1142 %
1143 % \begin{MacroSyntax}{\boardclip}
1144 % \cs{boardclip}\parg{lower-left}\parg{upper-right}\marg{options}
1145 % \end{MacroSyntax}
1146 %
1147 % A clipping path of that spans from the hex at \meta{lower-lest} to
1148 % \meta{upper-right}. Note, that both of these arguments should only
1149 % specify the column and row keys. If \meta{options} is non-empty,
1150 % then the clipping path is drawn with those options.
1151 %
1152 % \begin{figure}[htbp]
1153 % \centering
1154 % \begin{tabular}{m{.4\linewidth}m{.4\linewidth}}
1155 % \begin{tikzpicture}
1156 % \begin{scope}
1157 % \boardclip(c=0,r=0)(c=3,r=3){}
1158 % \testmap
1159 % \end{scope}
1160 % \end{tikzpicture}
1161 % &
1162 % \begin{verbatim}
1163 % \begin{scope}
1164 % \boardclip(c=0,r=0)(c=3,r=3){}
1165 % \testmap
1166 % \end{scope}
1167 % \end{verbatim}
1168 % \end{tabular}
1169 % \caption{Snug--fit clipping of board using the macro \cs{boardclip}}
1170 % \label{fig:hex:clip}
1171 % \end{figure}
1172 %
1173 % This is particularly useful together with the \cs{boardframe} macro.
1174 % This macro will put a frame around the board, optionally with a
1175 % margin.
1176 %
1177 % \begin{MacroSyntax}{\boardframe}
1178 % \cs{boardframe}\oarg{margin}\parg{lower-left}{upper-right}
1179 % \end{MacroSyntax}
1180 %
1181 % where \meta{lower-left} and \meta{upper-right} are as for
1182 % \cs{boardclip}. The \meta{margin} must be a number, and specifies an
1183 % optional margin around the hexes, The argument \meta{options}
1184 % specifies how the frame is drawn. The idea is to first draw the
1185 % frame, then the clipping shape, and then the hexes. One should take
1186 % care to use the \meta{options} argument to \cs{boardclip} to specify
1187 % a default background color. The frame is drawn with the style
1188 % \spec{hex/board frame}
1189 %
1190 % \begin{figure}[htbp]
1191 % \centering
1192 % \begin{tabular}{m{4.\linewidth}m{4.\linewidth}}
1193 % \begin{tikzpicture}[hex/border/.append style={color=red},
1194 % hex/board frame/.style={fill=Tan}]
1195 % \begin{scope}[every hex/.style={label=auto}]
1196 % \boardframe[0.5](c=0,r=0)(c=3,r=3){0.5}
1197 % \boardclip(c=0,r=0)(c=3,r=3){fill=white}
1198 % \testmap{}
1199 % \end{scope}
1200 % \end{tikzpicture}
1201 % &
1202 % \begin{verbatim}
1203 % \begin{scope}[every hex/.style={label=auto}]
1204 % \boardframe[0.5](c=0,r=0)(c=3,r=3)
1205 % \boardclip(c=0,r=0)(c=3,r=3){fill=white}
1206 % \testmap{}
1207 % \end{scope}
1208 % \end{verbatim}
1209 % \end{tabular}
1210 % \caption{Combining a frame and clipping}
1211 % \label{fig:hex:frame}
1212 % \end{figure}
1213 %
1214 % The \cs{boardframe} macro prints the position of the rectangle to
1215 % the log output, if one needs to do some more stuff around the board.
1216 %
1217 % \subsection{Constructing the physical board}
1218 %
1219 % If the board is not too large, so that it may fit on a paper format
1220 % that can easily be printed (say A4, A3, Letter, or Tabloid), one can
1221 % simply print the board and glue it onto a sturdy surface (say
1222 % 1\textonehalf\,mm poster carton). However, if the board is large,
1223 % meaning it does not fit on a piece of printable paper, then one has
1224 % two options.
1225 % \begin{description}
1226 % \item[\textit{Either}] scale the board down so that it fits. Use
1227 % the \TikZ{} key \spec{scale=}\meta{factor} as an argument to the
1228 % \spec{tikzpicture} environment in which you create the board. In
1229 % this case, you should make sure you also scale the chits by the
1230 % same \meta{factor}, again via the \spec{scale} key.
1231 % \item[\textit{Or}] you can split the board over several pages. The
1232 % package provides a number of tools to help with this.
1233 % \end{description}
1234 %
1235 % \subsubsection{Split the board over multiple sheets}
1236 %
1237 % First, make sure you produce a standalone PDF of the board only.
1238 %
1239 % \begin{verbatim}
1240 % \documentclass{standalone}
1241 % \usepackage{wargame}
1242 % \begin{tikzpicture}[scale=SCALE]
1243 % % Define the board here.
1244 % \end{tikzpicture}
1245 % \end{verbatim}
1246 %
1247 % and that you have created this PDF --- say \texttt{board.pdf}.
1248 %
1249 % Next, prepare another document in which we will do the calculations.
1250 % For example
1251 %
1252 % \begin{verbatim}
1253 % \documentclass[11pt]{standalone}
1254 % \usepackage{wargame}
1255 % \begin{document}
1256 % \splitboard{paper=letter,margin=.7,ncol=2,nrow=2,overlap=1}
1257 % \end{document}
1258 % \end{verbatim}
1259 %
1260 % to calculate the split of \spec{board.pdf} over $2\times2$ letter
1261 % paper sheets, with a non-printable margin of 7mm, and an overlap
1262 % between the segments of 1cm.
1263 %
1264 % The possible keys for the \cs{splitboard} macro are
1265 %
1266 % \begin{itemize}
1267 % \item \spec{paper}=\meta{format}: Specifies the paper format. One
1268 % of \spec{a4}, \spec{a3}, \spec{letter}, \spec{tabloid}. Default
1269 % is \spec{a4}.
1270 % \item \spec{landscape}: Sets the paper format to be in landscape
1271 % mode (default is portrait).
1272 % \item \spec{margin}=\meta{size in centimetres}: Size of margins on
1273 % each sheet in centimetres \emph{without} unit. That is put
1274 % \spec{0.6} for 6mm, \emph{not} \spec{6mm}. Default is \spec{0.6}.
1275 % This should be \emph{slightly} larger (by roughly 5\%) than the
1276 % \emph{least} margin required by the printer used. \emph{Must} be
1277 % given \emph{before} \spec{paper} to have any effect.
1278 % \item \spec{ncol}=\meta{number of columns}: Sets the number of
1279 % columns of sheets.
1280 % \item \spec{nrow}=\meta{number of rows}: Set the number of rows of
1281 % sheets.
1282 % \item \spec{overlap}=\meta{size in centimetres}: Sets the size of
1283 % the overlap between sheets in centimetres \emph{without} unit.
1284 % That is put \spec{2} for 2cm, \emph{not} \spec{2cm}. Default is
1285 % \spec{2}.
1286 % \item \spec{image}=\meta{image file name}: File name of the board
1287 % image (a PDF). Default is \spec{board}
1288 % \item \spec{output}=\meta{output file name}: File name (without
1289 % \spec{.tex} ending) to write calculated split to.
1290 % \item \spec{standalone}: Boolean flag. If true, then output file
1291 % will be a standalone document (i.e., has a \cs{documentclass}).
1292 % \item \spec{scale}=\meta{scale}: Set scale of board.
1293 % \end{itemize}
1294 %
1295 % The macro will produce a file named \meta{output file
1296 % name}\spec{.tex} which can be included in another document to
1297 % generate the split board PDF. Crop marks will be added to the
1298 % board segments to make it easier to align the parts.
1299 %
1300 % \subsubsection{Foldable board}
1301 %
1302 % To make a fold-able board use for example the below template to
1303 % create grooves and cuts.
1304 %
1305 % \begin{tikzpicture}[
1306 % cut/.style={red!50!black,thick},
1307 % front groove/.style={green!50!black,dashed,thick},
1308 % back groove/.style={blue!50!black,dash dot,thick},
1309 % ]
1310 % \node[minimum width=8.4cm,
1311 % minimum height=5.9cm,
1312 % inner sep=0pt,
1313 % draw,
1314 % thick] (a) {};
1315 % \coordinate (middle) at (a);
1316 % \coordinate (top) at (a.north);
1317 % \coordinate (top left) at ($(a.north west)!.5!(a.north)$);
1318 % \coordinate (middle left) at ($(a.west)!.5!(a)$);
1319 % \coordinate (bottom left) at ($(a.south west)!.5!(a.south)$);
1320 % \coordinate (top right) at ($(a.north)!.5!(a.north east)$);
1321 % \coordinate (middle right) at ($(a)!.5!(a.east)$);
1322 % \coordinate (bottom right) at ($(a.south)!.5!(a.south east)$);
1323 % \coordinate (bottom) at (a.south);
1324 % \draw[cut] (middle)--(bottom);
1325 % \draw[cut] (top left)--(middle left);
1326 % \draw[cut] (top right)--(middle right);
1327 % \draw[back groove] (middle)--(top);
1328 % \draw[back groove] (bottom left)--(middle left);
1329 % \draw[back groove] (bottom right)--(middle right);
1330 % \draw[front groove] (a.west)--(a.east);
1331 %
1332 % \draw[cut] ($(a.south west)+(0,-1)$)--++(2,0) node[anchor=west]{%
1333 % Cut through carton};
1334 % \draw[back groove] ($(a.south west)+(0,-1.5)$)--++(2,0) node[anchor=west]{%
1335 % Cut groove (\textonehalf{} through) in carton on \emph{back} side};
1336 % \draw[front groove] ($(a.south west)+(0,-2)$)--++(2,0) node[anchor=west]{%
1337 % Cut groove (\textonehalf{} through) in carton on \emph{front} side};
1338 % \end{tikzpicture}
1339 %
1340 % This will fold the board down to a fourth of the size of the full
1341 % map. For example, if the board is A1
1342 % ($84\,\mathrm{cm}\times59.4\,\mathrm{cm}$) it will fold down to A4
1343 % ($21\,\mathrm{cm}\times29.7\,\mathrm{cm}$) for easier storage.
1344 %
1345 % \iffalse
1346 % --------------------------------------------------------------------
1347 %
1348 % Chits
1349 %
1350 % --------------------------------------------------------------------
1351 % \fi
1352 %
1353 % \cleardoublepage
1354 % \section{Chits}
1355 %
1356 % Chits, or playing counters\footnote{Since \TeX{} has the concept of
1357 % counters as in `\cs{count}' and \LaTeX{}'s `\cs{newcounter}', we
1358 % choose the name `chit' for playing pieces instead.}, can be made
1359 % with the macro \cs{chit}. The syntax for rendering a chit is
1360 %
1361 % \begin{MacroSyntax}{\chit}
1362 % \cs{chit}\oarg{key-value-pairs}\parg{location}\parg{name}
1363 % \end{MacroSyntax}
1364 %
1365 % \figurename~\ref{fig:chit:overview} shows an example of a chit.
1366 %
1367 % \begin{figure}[htbp]
1368 % \centering
1369 % \begin{tikzpicture}[scale=2]
1370 % \firstchit
1371 % \pic[draw,transform shape]{wg/x axis={-1,1, -1.2,{0},{-.6,.6}}};
1372 % \pic[draw,transform shape]{wg/y axis={1.2,-1,1, {0},{-.6,.6}}};
1373 % \draw[wg arrow] (-.2,-.4)--(-0.9,-.6)
1374 % node[anchor=east]{\spec{factors=\{chit/2 factors=\{4,8\}\}}};
1375 % \draw[wg arrow] (-.5,.2)--(-1.1,.6)
1376 % node[anchor=east]{\spec{left=\{chit/identifier=\{1\}\}}};
1377 % \draw[wg arrow] (.5,.2)--(.7,1.2)
1378 % node[anchor=south west]{\spec{right=\{chit/identifier=\{2\}\}}};
1379 % \draw[wg arrow] (-.2,.4)--(-1,1)
1380 % node[anchor=east]{\spec{symbol=\{\meta{nato app 6(c) spec}\}}};
1381 % \end{tikzpicture}
1382 % \caption{An example of a chit. The lines below and to the right
1383 % shows two unit lengths. Other global options used are
1384 % \spec{color=white} to set the foreground colour, \spec{fill=blue}
1385 % for the background, and \spec{text=yellow} to set the font colour
1386 % to yellow. The \spec{symbol} key also contains
1387 % \spec{frame=\{fill=yellow!50!black} to set the frame fill colour,
1388 % and \spec{ultra thick} to set the line width of the NATO App6(C)
1389 % symbol. Note that the line width is automatically scaled.}
1390 % \label{fig:chit:overview}
1391 % \end{figure}
1392 %
1393 %
1394 % The example in \figurename~\ref{fig:chit:overview} shows an infantry
1395 % mountaineer army unit with attack factor 4, and movement factor 8.
1396 % The NATO App6(c) symbol is given in terms of keywords for the
1397 % \cs{natoapp} macro (see \sectionname~\ref{sec:nateoapp6c}). The
1398 % other parts of the chit (\spec{factors}, \spec{left}, \spec{right},
1399 % and \spec{below}) are rendered onto the chit via \TikZ{}
1400 % \spec{pic}tures. This allows for a great deal of flexibility in
1401 % generating chits. For example, above we use the \spec{pic}tures
1402 % \spec{chit/identifier} and \spec{chit/2 factors} to render the left-
1403 % and right-hand identifiers, and the factors, respectively.
1404 %
1405 % Full frame chits --- that is chits which are not typically
1406 % designating units or faction specific chits, e.g., a turn marker ---
1407 % can be made by using the key \spec{full}. In that case, all other
1408 % keys (\spec{symbol}, \spec{factors}, \spec{left}, \spec{right},
1409 % and \spec{below}) are ignored. \figurename~\ref{fig:chit:full} shows
1410 % such an example.
1411 %
1412 % \begin{figure}[tbp]
1413 % \centering
1414 % \begin{tabular}{m{.45\linewidth}m{.45\linewidth}}
1415 % \begin{tikzpicture}[scale=2]
1416 % \turnchit
1417 % \end{tikzpicture}
1418 % &
1419 % chit made with
1420 % \begin{verbatim}
1421 % \tikzset{
1422 % wg/big text/.pic={
1423 % \node[font=\sffamily\fontsize{18}{0}%
1424 % \selectfont]{#1};}}
1425 % \tikz{
1426 % \chit[full={wg/big text={Turn}},
1427 % black,fill=yellow!20!white](0,0)}
1428 % \end{tikzpicture}
1429 % \end{verbatim}
1430 % \end{tabular}
1431 % \caption{An example of a full-frame chit. }
1432 % \label{fig:chit:full}
1433 % \end{figure}
1434 %
1435 % The size of the chits are $1.2\times1.2$ unit lengths squared. This
1436 % is tuned so that the chits will fit within the hexes produced by the
1437 % \cs{hex} command (see \sectionname~\label{sec:hex}). In
1438 % \figurename~\ref{fig:chit:hex} we illustrate this. Typically the
1439 % unit is one centimetre. which means the chits are
1440 % $12\,\text{mm}\times12\,\text{mm}$ --- or roughly $1/2"\times1/2"$,
1441 % which is a fairly good size for most games.
1442 %
1443 % \begin{figure}[tbp]
1444 % \centering
1445 % \begin{tikzpicture}
1446 % \hex
1447 % \firstchit(hex cs:r=0,c=0)
1448 % \hex(c=1,r=0)
1449 % \secondchit(hex cs:r=0,c=1)
1450 % \hex(c=2,r=0)
1451 % \thirdchit(hex cs:r=0,c=2)
1452 % \end{tikzpicture}
1453 % \caption{Example of chits fit within hexes. }
1454 % \label{fig:chit:hex}
1455 % \end{figure}
1456 %
1457 % Just as \cs{hex} is really a wrapper around \TikZ{}'s \cs{node}
1458 % macro, so it is with \cs{chit}. This means that an alternative way
1459 % of making a chit is to do
1460 %
1461 % \begin{MacroSyntax}{\chit}
1462 % \cs{node}[chit=\marg{key-value-pairs}] \parg{name} at \parg{location};
1463 % \end{MacroSyntax}
1464 %
1465 % Since chits are really \TikZ{} \texttt{node}s we can use anchors
1466 % on the chit. Unlike for \cs{hex} where there are additional
1467 % features available when using the dedicated macro, there really
1468 % isn't much difference between \cs{chit} and
1469 % \cs{node}\texttt{[chit=\textellipsis]}.
1470 %
1471 %
1472 % \subsection{Styling chits}
1473 %
1474 % Typical \TikZ{} options can be passed to the \cs{chit} macro. For
1475 % example, if you want to draw the chit with a red foreground, simply pass
1476 % \spec{draw=red} in the \oarg{optional} arguments to
1477 % \cs{chits}. Individual parts of the hexes can be styled separately.
1478 %
1479 % \paragraph{Important:} To set the colours of the various elements,
1480 %
1481 % one should use
1482 % \begin{description}
1483 % \item[\spec{color}=\meta{foreground and text}] Selects the
1484 % foreground colour of lines, text, and so on, including for the
1485 % NATO App6(C) symbol.
1486 % \item[\spec{fill}=\meta{background}] Selects the background colour
1487 % of the full chit. By default this is transparent.
1488 % \item[\spec{text}=\meta{text foreground}] Selects the colour used
1489 % for text in the chit. This overrides \spec{color} for text.
1490 % \item[\spec{draw}=\meta{foreground}] This sets the colour for
1491 % foreground elements, excluding text.
1492 % \end{description}
1493 % \TikZ{} allows one to pass a \meta{colour} as arguments for drawing
1494 % and understands that as giving the foreground and text colours.
1495 % However, that key is \emph{deprecated} for this library, as it does
1496 % not properly propagate through\footnote{The colour
1497 % \spec{pgfstrokecolor} is not modified by that.}.
1498 %
1499 % The styles used by the \spec{left}, \spec{right}, \spec{setup},
1500 % \spec{factors}, and \spec{symbol} elements are
1501 % \spec{tikz/chit/left}, \spec{tikz/chit/right}, \spec{tikz/setup},
1502 % \spec{tikz/factors}, and \spec{tikz/symbol} respectively. A user can
1503 % redefine these to change the appearance of the chits. For example,
1504 % one could make the symbol larger by setting a different
1505 % \spec{scale}, move the factors to the side by changing \spec{shift},
1506 % and so on.
1507 %
1508 % Pictures used by these elements are also styled by
1509 % similar keys. For example, the picture \spec{chit/identifier} is
1510 % styled by \spec{tikz/chit/identifier}.
1511 %
1512 %
1513 % A bevel (or ``shadow-effect'') can be added to chits using the key
1514 % \spec{bevel}, with a value that specifies where the light comes from
1515 % (e.g., north west or NW). The percentage of the half width of a
1516 % chit of the bevel can be specified by the key \spec{bevel fraction}
1517 % (default 10\%). This can be used for both symbol or full chits.
1518 %
1519 % In addition, one can define the key \spec{tikz/every chit} to be the
1520 % default options for all chits.
1521 %
1522 % By default, the outer ``frame'' of a chit is drawn with the same
1523 % graphics options as the chit it self (i.e., same fill and stroke
1524 % colour). To change that, one can pass \spec{frame}=\marg{options}
1525 % as part of the chit options.
1526 %
1527 % \subsection{Defining preset chit types}
1528 %
1529 % One can conveniently pre-define some chit styles. For example,
1530 % given the style definition
1531 %
1532 % \begin{verbatim}
1533 % \tikzset{
1534 % my chit/.style={/chit/symbol={[
1535 % faction=friendly,
1536 % command=land,
1537 % main=armoured]},
1538 % /chit/left={chit/identifier={Mine}},
1539 % /chit/factors={chit/2 factors={2,4}}}}
1540 % \end{verbatim}
1541 %
1542 % We can use that to make different chits with some commonalities
1543 % defined by that style. For example
1544 %
1545 % \begin{tikzpicture}
1546 % \chit[my chit](0,-2)
1547 % \chit[my chit,color=white,fill=red,right={chit/identifier=1}](2,-2)
1548 % \end{tikzpicture}
1549 %
1550 % where, in the second example, we have passed additional options to
1551 % \cs{chit}. Note that we \emph{must} give the full path to the
1552 % \spec{chit} keys when defining a style like this.
1553 %
1554 % \subsection{Kriegspiel chits}
1555 %
1556 % By passing the option \texttt{kriegspiel} to the \cs{chit} command
1557 % or in a \texttt{chit} node, the shape of the chits will be changed
1558 % from square to rectangular.
1559 %
1560 % \paragraph{Important} Not all NATO symbols have been adapted to
1561 % facilitate that shape.
1562 %
1563 % Here are some examples
1564 %
1565 % \begin{tikzpicture}[
1566 % chit/factor/.append style={font=\sffamily\bfseries\small},
1567 % /chit/.cd,
1568 % hex/.style={lower right={#1}},
1569 % turn/.style={lower left={#1}}]
1570 % \chit[symbol={
1571 % main=infantry,
1572 % echelon=corps,
1573 % faction=friendly,
1574 % command=land},
1575 % factors={chit/2 factors={4,3}},
1576 % parent={chit/small identifier={II}},
1577 % unique={chit/small identifier={4}},
1578 % turn={chit/small identifier={2}},
1579 % hex={chit/small identifier={0120}},
1580 % kriegspiel,
1581 % color=black,
1582 % fill=hostile](0,0);
1583 % \chit[symbol={
1584 % main={[fill=pgfstrokecolor]artillery},%
1585 % echelon=corps,
1586 % faction=friendly,
1587 % command=land},
1588 % factors={chit/2 factors artillery={4,3,2}},
1589 % parent={chit/small identifier={II}},
1590 % unique={chit/small identifier={4}},
1591 % turn={chit/small identifier={2}},
1592 % hex={chit/small identifier={0120}},
1593 % kriegspiel,
1594 % color=black,
1595 % fill=friendly,
1596 % kriegspiel
1597 % ](2.5,0);
1598 % \chit[
1599 % frame={black},
1600 % symbol={
1601 % main=reconnaissance,
1602 % echelon=corps,
1603 % command=land,
1604 % faction=friendly,
1605 % color=black,
1606 % fill=hostile,
1607 % },
1608 % factors={chit/2 factors={4,3}},
1609 % parent={chit/small identifier={II}},
1610 % unique={chit/small identifier={4}},
1611 % turn={chit/small identifier={2}},
1612 % hex={chit/small identifier={0120}},
1613 % color=white,
1614 % fill=unknown!50!black,
1615 % kriegspiel](5,0);
1616 % \chit[
1617 % frame={black},
1618 % symbol={
1619 % main={reconnaissance artillery},
1620 % echelon=corps,
1621 % command=land,
1622 % faction=friendly,
1623 % fill=friendly,
1624 % },
1625 % factors={chit/2 factors artillery={4,3,2}},
1626 % parent={chit/small identifier={II}},
1627 % unique={chit/small identifier={4}},
1628 % turn={chit/small identifier={2}},
1629 % color=white,
1630 % fill=neutral!50!black,
1631 % kriegspiel](7.5,0);
1632 % \end{tikzpicture}
1633 %
1634 %
1635 % These are produced by
1636 %
1637 % \begin{verbatim}
1638 % \begin{tikzpicture}[
1639 % chit/factor/.append style={font=\sffamily\bfseries\small},
1640 % /chit/.cd,
1641 % hex/.style={lower right={#1}},
1642 % turn/.style={lower left={#1}}]
1643 % \chit[symbol={main=infantry,echelon=corps,faction=friendly,command=land},
1644 % factors={chit/2 factors={4,3}},
1645 % parent={chit/small identifier={II}},
1646 % unique={chit/small identifier={4}},
1647 % turn={chit/small identifier={2}},
1648 % hex={chit/small identifier={0120}},
1649 % kriegspiel,
1650 % color=black,
1651 % fill=hostile](0,0);
1652 % \chit[symbol={
1653 % main={[fill=pgfstrokecolor]artillery},%
1654 % echelon=corps,faction=friendly,command=land},
1655 % factors={chit/2 factors artillery={4,3,2}},
1656 % parent={chit/small identifier={II}},
1657 % unique={chit/small identifier={4}},
1658 % turn={chit/small identifier={2}},
1659 % hex={chit/small identifier={0120}},
1660 % kriegspiel,
1661 % color=black,
1662 % fill=friendly,
1663 % kriegspiel
1664 % ](2.5,0);
1665 % \chit[
1666 % frame={black},
1667 % symbol={
1668 % main=reconnaissance, echelon=corps,command=land,faction=friendly,
1669 % color=black,
1670 % fill=hostile,
1671 % },
1672 % factors={chit/2 factors={4,3}},
1673 % parent={chit/small identifier={II}},
1674 % unique={chit/small identifier={4}},
1675 % turn={chit/small identifier={2}},
1676 % hex={chit/small identifier={0120}},
1677 % color=white,
1678 % fill=unknown!50!black,
1679 % kriegspiel](5,0);
1680 % \chit[
1681 % frame={black},
1682 % symbol={
1683 % main={reconnaissance artillery},
1684 % echelon=corps,command=land,faction=friendly,fill=friendly,
1685 % },
1686 % factors={chit/2 factors artillery={4,3,2}},
1687 % parent={chit/small identifier={II}},
1688 % unique={chit/small identifier={4}},
1689 % turn={chit/small identifier={2}},
1690 % color=white,
1691 % fill=neutral!50!black,
1692 % kriegspiel](7.5,0);
1693 % \end{tikzpicture}
1694 % \end{verbatim}
1695 %
1696 % \iffalse
1697 % --------------------------------------------------------------------
1698 %
1699 % NATO App6(c) symbols
1700 %
1701 % --------------------------------------------------------------------
1702 % \fi
1703 %
1704 % \cleardoublepage
1705 % \section{NATO App 6(c) symbols}
1706 % \label{sec:nateoapp6c}
1707 %
1708 % The NATO markers are designed to fit within the template shown in
1709 % \figurename~\ref{fig:natoapp:template}. The template is serves as a
1710 % placement guide of the the various parts of the NATO marker as
1711 % illustrated in \figurename~\ref{fig:natoapp:usage}.
1712 %
1713 % \begin{figure}[htbp]
1714 % \centering
1715 % \begin{tikzpicture}[scale=2]
1716 % \node[natoapp6c={command=base}] {};
1717 % \end{tikzpicture}
1718 % \caption{Template for NATO symbols}
1719 % \label{fig:natoapp:template}
1720 % \end{figure}
1721 %
1722 % \begin{MacroSyntax}{\natoapp}
1723 % \cs{natoapp}\oarg{key-value-pairs}\parg{location}\parg{name}
1724 % \end{MacroSyntax}
1725 %
1726 % where all arguments are optional.
1727 % Keys are defined to fill in the various parts of the markers. These
1728 % keys are
1729 % \begin{description}
1730 % \item[\keyval{faction}{\meta{faction}}] Selects the faction used for
1731 % the symbol. See also
1732 % \sectionname~\ref{sec:natoapp:faction:command}.
1733 % \item[\keyval{command}{\meta{command}}] Selects the command used for
1734 % the symbol. See also
1735 % \sectionname~\ref{sec:natoapp:faction:command}.
1736 % \item[\keyval{main}{\meta{mains}}] Specifies the main symbol(s).
1737 % This can be a comma separated list of specifiers (delimited by
1738 % braces \marg{first,second,\textellipsis}), and each symbol can be
1739 % preceeded by an optional argument to shift, scale, rotate, etc.,
1740 % the individual symbols. \ifShowSymbols See also
1741 % \sectionname~\ref{sec:natoapp:mains}\fi.
1742 % \item[\keyval{left}{\meta{lefts}}, \keyval{right}{\meta{rights}},
1743 % \keyval{top}{\meta{tops}}, \keyval{bottom}{\meta{bottoms}},
1744 % \keyval{below}{\meta{belows}}] Specifies the left-, right-hand,
1745 % top, bottom, and lower symbol(s). The format of the arguments
1746 % \meta{lefts}, \meta{rights}, \meta{tops}, \meta{bottoms}, and
1747 % \meta{belows} has the same format as \meta{mains}.
1748 % \end{description}
1749 %
1750 % \begin{figure}[htbp]
1751 % \begin{tabular}{m{.45\linewidth}m{.45\linewidth}}
1752 % \begin{center}
1753 % \begin{tikzpicture}[scale=2]
1754 % \natoapp[
1755 % faction=none,
1756 % command=base,
1757 % echelon=army,
1758 % main={text=M},
1759 % top={text=T},
1760 % bottom={text=B},
1761 % left={text=L},
1762 % right={text=R},
1763 % below={text=V}]
1764 % \pic[draw,transform shape]{wg/x axis={-.5,.5,-.7,,}};
1765 % \pic[draw,transform shape]{wg/y axis={.7,-.62,.74,,{-.5,.5,-.2,.2}}};
1766 % \end{tikzpicture}
1767 % \end{center}
1768 % & The figure is typeset by
1769 % \begin{verbatim}
1770 % \natoapp[faction=none,
1771 % command=base,
1772 % echelon=army,
1773 % main={text=M},
1774 % top={text=T},
1775 % bottom={text=B},
1776 % left={text=L},
1777 % right={text=R},
1778 % below={text=V}]
1779 % \end{verbatim}
1780 % \end{tabular}
1781 % \caption{Main keys of \cs{natoapp}. The bottom and right hand
1782 % bars indicate one unit of length.}
1783 % \label{fig:natoapp:usage}
1784 % \end{figure}
1785 %
1786 % Other keys are available to further customise the appearance of the
1787 % symbols
1788 %
1789 % \begin{description}
1790 % \item[\keyval{echelon}{\meta{size}}] The size of the unit described.
1791 % Possible values are \spec{team}, \spec{squad}, \spec{section},
1792 % \spec{platoon}, \spec{company}, \spec{battalion}, \spec{regiment},
1793 % \spec{brigade}, \spec{division}, \spec{corps}, \spec{army},
1794 % \spec{army group}, \spec{theatre}, and \spec{command}.
1795 % \item[\keyval{frame}{\meta{keys}}] Extra keys for frame.
1796 % \end{description}
1797 %
1798 % \subsection{Faction and Command Selection}
1799 % \label{sec:natoapp:faction:command}
1800 %
1801 % Table~\ref{tab:frames} shows the various bases used for the various
1802 % {\ttfamily{\itshape faction}/{\itshape command}} combinations. Also
1803 % shown in the table is the base template for main identifiers.
1804 %
1805 % \makeatletter
1806 % \def\tabledata{}
1807 % \foreach \c in {air,land,equipment,installation,sea surface,sub surface,space,activity,dismounted}{%
1808 % \protected@xappto\tabledata{\spec{\c}}
1809 % \foreach \f in {friendly,hostile,neutral,unknown}{%
1810 % \protected@xappto\tabledata{
1811 % &\noexpand\tikz[scale=.8]{%
1812 % \noexpand\path (-.75,-.75) rectangle (.75,.75);
1813 % \noexpand\node[natoapp6c={faction=\f,command=\c},fill=\f]{};
1814 % \noexpand\node[natoapp6c={command=base},draw=lightgray]{};
1815 % }}}
1816 % \protected@xappto\tabledata{\\ \noexpand\hline}}
1817 % \makeatother
1818 %
1819 % \begin{table}[htbp]
1820 % \centering
1821 % \begin{tabular}{|l|m{2cm}m{2cm}m{2cm}m{2cm}|}
1822 % \hline
1823 % \rowcolor{headbg}
1824 % & \multicolumn{4}{c|}{{\color{headfg}\meta{faction}}}\\
1825 % \rowcolor{headbg}
1826 % {\color{headfg}\meta{command}}
1827 % & {\color{headfg}\spec{friendly}}
1828 % & {\color{headfg}\spec{hostile}}
1829 % & {\color{headfg}\spec{neutral}}
1830 % & {\color{headfg}\spec{unknown}}
1831 % \\
1832 % \hline
1833 % \tabledata
1834 % \end{tabular}
1835 % \caption{Frames for various combinations of \meta{faction} and
1836 % \meta{command} combinations. These are drawn with the
1837 % \spec{pic} given by
1838 % \spec{natoapp6c/\meta{faction}/\meta{command}} with the options
1839 % \spec{draw=blue,fill=\meta{faction}}. If no \spec{fill} is
1840 % specified, then the background will be transparent. Note, the
1841 % template for main identifiers is also shown on top of each frame.}
1842 % \label{tab:frames}
1843 % \end{table}
1844 %
1845 % The fill color of the frame is set by the key \spec{frame}. If
1846 % this is or contains the special value \spec{faction}, then the
1847 % frame fill colour will be the standard for the faction as
1848 % illustrated in figure~\ref{fig:faction:color}.
1849 %
1850 % \begin{figure}[htbp]
1851 % \centering
1852 % \begin{tikzpicture}
1853 % \foreach[count=\i] \f in {friendly,hostile,neutral,unknown}{
1854 % \natoapp[frame=faction,faction=\f,
1855 % command=space,main={infantry}](2*\i-2,0)}
1856 % \end{tikzpicture}
1857 % \caption{Illustration of using the special value \spec{faction}
1858 % for the \spec{frame} key}
1859 % \label{fig:faction:color}
1860 % \end{figure}
1861 %
1862 % Elements of the frame can be controlled by the key \spec{frame}.
1863 % \begin{description}
1864 % \item[\keyval{frame}{\meta{keys}}] Additional keys to pass to the
1865 % frame drawing. The special option \spec{faction} will make the
1866 % frame be filled with the standard faction color.
1867 % \end{description}
1868 %
1869 % \tablename~\ref{tab:frame:color} illustrates this.
1870 % \begin{table}[htbp]
1871 % \centering
1872 % \begin{tabular}{|c|cccc|}
1873 % \hline
1874 % \rowcolor{headbg}
1875 % {\color{headfg}\textbf{Example}}
1876 % & {\color{headfg}\textbf{\spec{frame=\{color,...\}}}}
1877 % & {\color{headfg}\textbf{\spec{frame=\{fill,...\}}}}
1878 % & {\color{headfg}\textbf{\spec{frame=\{draw,...\}}}}
1879 % & {\color{headfg}\textbf{\spec{frame=\{line width,...\}}}}
1880 % \\
1881 % \hline
1882 % \cellcolor{white}
1883 % \tikz{\natoapp[main={fixed wing},command=air]}
1884 % &
1885 % &
1886 % &
1887 % &
1888 % \\
1889 % \hline
1890 % \rowcolor{altcol}
1891 % \cellcolor{white}
1892 % \tikz{\natoapp[main={fixed wing},command=air,color=red,
1893 % frame={line width=2pt}]}
1894 % & \spec{red}
1895 % &
1896 % &
1897 % & \spec{thick}
1898 % \\
1899 % \hline
1900 % \cellcolor{white}
1901 % \tikz{\natoapp[main={fixed wing},command=air,
1902 % frame={fill=yellow,line width=.5pt}]}
1903 % &
1904 % & \spec{yellow}
1905 % &
1906 % & \spec{thin}
1907 % \\
1908 % \hline
1909 % \rowcolor{altcol}
1910 % \cellcolor{white}
1911 % \tikz{\natoapp[main={fixed wing},command=air,frame={blue}]}
1912 % &
1913 % &
1914 % & \spec{blue}
1915 % &
1916 % \\
1917 % \hline
1918 % \cellcolor{white}
1919 % \tikz{\natoapp[main={fixed wing},command=air,frame={fill=pink,magenta}]}
1920 % &
1921 % & \spec{pink}
1922 % & \spec{magenta}
1923 % &
1924 % \\
1925 % \hline
1926 % \rowcolor{altcol}
1927 % \cellcolor{white}
1928 % \tikz{\natoapp[main={fixed wing},command=air,color=red,
1929 % frame={fill=green,draw=blue,line width=3pt}]}
1930 % & \spec{red}
1931 % & \spec{green}
1932 % & \spec{blue}
1933 % & \spec{ultra thick}
1934 % \\
1935 % \hline
1936 % \end{tabular}
1937 % \caption{Illustration of frame colour choices}
1938 % \label{tab:frame:color}
1939 % \end{table}
1940 %
1941 % \subsection{Unit Size (\spec{echelon})}
1942 %
1943 % The size of a unit a marker represents is given by the
1944 % \spec{echelon} keyword. \tablename~\ref{tab:natoapp6c:echelon}
1945 % shows the various markers and approximate unit sizes.
1946 %
1947 % \let\foo\empty
1948 % \begin{table}[htbp]
1949 % \centering
1950 % \begin{tabular}{|m{1.2cm}|cr@{--}lm{.27\linewidth}m{.27\linewidth}|}
1951 % \hline
1952 % \rowcolor{headbg}
1953 % {\color{headfg}\textbf{Example}}
1954 % & {\color{headfg}\spec{echelon}}
1955 % & \multicolumn{2}{c}{{\color{headfg}\textbf{Approx.~size}}}
1956 % & \foo{} {\color{headfg}\textbf{Sub-units}}
1957 % & \foo{} {\color{headfg}\textbf{Officer}}
1958 % \\
1959 % \hline
1960 % \tikz[scale=.8]{\natoapp[command=land,faction=friendly,main=infantry,echelon=team,lower=airborne]}
1961 % & \spec{team}
1962 % & 3
1963 % & 5
1964 % & \foo{} none
1965 % & \foo{} Corporal or Sergeant
1966 % \\
1967 % \hline
1968 % \rowcolor{altcol}
1969 % \tikz[scale=.8]{\natoapp[command=land,faction=friendly,main=infantry,echelon=squad]}
1970 % & \spec{squad}
1971 % & 5
1972 % & 10
1973 % & \foo{} 1--2 teams
1974 % & \foo{} Sergeant
1975 % \\
1976 % \hline
1977 % \tikz[scale=.8]{\natoapp[command=land,faction=friendly,main=infantry,echelon=section]}
1978 % & \spec{section}
1979 % & 7
1980 % & 13
1981 % & \foo{} 2--3 teams
1982 % & \foo{} Sergeant
1983 % \\
1984 % \hline
1985 % \rowcolor{altcol}
1986 % \tikz[scale=.8]{\natoapp[command=land,faction=friendly,main=infantry,echelon=platoon]}
1987 % & \spec{platoon}
1988 % & $25$
1989 % & $40$
1990 % & \foo{} Several squads/sections
1991 % & \foo{} Second Lieutenant
1992 % \\
1993 % \hline\tikz[scale=.8]{\natoapp[command=land,faction=friendly,main=infantry,echelon=company]}
1994 % & \spec{company}
1995 % & $60$
1996 % & $250$
1997 % & \foo{} Several platoons
1998 % & \foo{} Captain
1999 % \\
2000 % \hline
2001 % \rowcolor{altcol}
2002 % \tikz[scale=.8]{\natoapp[command=land,faction=friendly,main=infantry,echelon=battalion]}
2003 % & \spec{battalion}
2004 % & $300$
2005 % & $1\,000$
2006 % & \foo{} 2--6 companies
2007 % & \foo{} Lieutenant colonel
2008 % \\
2009 % \hline
2010 % \tikz[scale=.8]{\natoapp[command=land,faction=friendly,main=infantry,echelon=regiment]}
2011 % & \spec{regiment}
2012 % & $500$
2013 % & $2\,000$
2014 % & \foo{} 3--7 battalions
2015 % & \foo{} Colonel
2016 % \\
2017 % \hline
2018 % \rowcolor{altcol}
2019 % \tikz[scale=.8]{\natoapp[command=land,faction=friendly,main=infantry,echelon=brigade]}
2020 % & \spec{brigade}
2021 % & $2\,000$
2022 % & $5\,000$
2023 % & \foo{} Several battalions
2024 % & \foo{} Colonel
2025 % \\
2026 % \hline
2027 % \tikz[scale=.8]{\natoapp[command=land,faction=friendly,main=infantry,echelon=division]}
2028 % & \spec{division}
2029 % & $10\,000$
2030 % & $20\,000$
2031 % & \foo{} Several brigades/regiments
2032 % & \foo{} Major General
2033 % \\
2034 % \hline
2035 % \rowcolor{altcol}
2036 % \tikz[scale=.8]{\natoapp[command=land,faction=friendly,main=infantry,echelon=corps]}
2037 % & \spec{corps}
2038 % & $30\,000$
2039 % & $60\,000$
2040 % & \foo{} Several divisions
2041 % & \foo{} Lieutenant General
2042 % \\
2043 % \hline
2044 % \tikz[scale=.8]{\natoapp[command=land,faction=friendly,main=infantry,echelon=army]}
2045 % & \spec{army}
2046 % & \multicolumn{2}{c}{$100\,000$}
2047 % & \foo{} Several corps (5--10 divisions)
2048 % & \foo{} General
2049 % \\
2050 % \hline
2051 % \rowcolor{altcol}
2052 % \tikz[scale=.8]{\natoapp[command=land,faction=friendly,main=infantry,echelon=army group]}
2053 % & \spec{army group}
2054 % & $120\,000$
2055 % & $500\,000$
2056 % & \foo{} Several armies
2057 % & \foo{} Field Marshal
2058 % \\
2059 % \hline
2060 % \tikz[scale=.8]{\natoapp[command=land,faction=friendly,main=infantry,echelon=theatre]}
2061 % & \spec{theatre}
2062 % & \multicolumn{2}{c}{$250\,000+$}
2063 % & \foo{} Several army groups
2064 % & \foo{} Field Marshal
2065 % \\
2066 % \hline
2067 % \rowcolor{altcol}
2068 % \tikz[scale=.8]{\natoapp[command=land,faction=friendly,main=infantry,echelon=command]}
2069 % & \spec{command}
2070 % & \multicolumn{4}{c|}{Not a unit size, but designator}
2071 % \\
2072 % \hline
2073 % \end{tabular}
2074 % \caption{Illustration of echelon values. Approximate sizes and
2075 % command officer titles are typical modern day United States of
2076 % America army values and identifiers. Historically the unit
2077 % sizes have changed, as has officer titles. Furthermore, both
2078 % the unit sizes, names, and command officer titles may vary from
2079 % country to country, even across command.}
2080 % \label{tab:natoapp6c:echelon}
2081 % \end{table}
2082 %
2083 % \subsection{Unit type identification}
2084 %
2085 %
2086 % See \tablename~\ref{tab:natoapp6c:abbr}.
2087 %
2088 % \begin{table}
2089 % \centering%
2090 % \def\typemark#1{%
2091 % \tikz[scale=.3]{\natoapp[faction=friendly,command=land,#1]}}
2092 % \def\sizemark#1{%
2093 % \tikz[scale=.2]{\pic{natoapp6c/s/echelon=#1};}}
2094 % \begin{tabular}{|clc|}
2095 % \rowcolor{headbg}
2096 % {\color{headfg}\textbf{Symbol}}
2097 % & \multicolumn{2}{c|}{\color{headfg}\textbf{Type \& Abbreviation}}
2098 % \\
2099 % \hline
2100 % \typemark{upper=air assault}
2101 % & Air assault
2102 % & AA\\
2103 % \rowcolor{altcol}
2104 % \typemark{upper=air defence}
2105 % & Air defence
2106 % & ADA\\
2107 % \typemark{lower=airborne}
2108 % & Airborne
2109 % & AB\\
2110 % \rowcolor{altcol}
2111 % \typemark{lower=amphibious}
2112 % & Amphibious
2113 % & AM\\
2114 % \typemark{main=anti tank anti armour}
2115 % & Anti tank/armoured
2116 % & AT\\
2117 % \rowcolor{altcol}
2118 % \typemark{main=armoured}
2119 % & Armoured
2120 % & AR\\
2121 % \typemark{main=chemical biological radiological nuclear}
2122 % & Chemical biological radiological nuclear
2123 % & CB\\
2124 % \rowcolor{altcol}
2125 % \typemark{main=combined arms}
2126 % & Combined arms
2127 % & CAR\\
2128 % \typemark{main=engineer}
2129 % & Engineer
2130 % & ENG\\
2131 % \rowcolor{altcol}
2132 % \typemark{main={[fill=pgfstrokecolor]artillery}}
2133 % & Field artillery
2134 % & FA\\
2135 % \typemark{main=infantry}
2136 % & Infantry
2137 % & IN\footnote{Sometimes just `I'}\\
2138 % \rowcolor{altcol}
2139 % \typemark{main={infantry,armoured}}
2140 % & Mechanised infantry
2141 % & M\\
2142 % \typemark{lower=mountain}
2143 % & Mountaineer
2144 % & MTN\\
2145 % \rowcolor{altcol}
2146 % \typemark{upper=naval}
2147 % & Naval
2148 % & N\\
2149 % \typemark{main=reconnaissance}
2150 % & Reconnaissance
2151 % & REC\\
2152 % \rowcolor{altcol}
2153 % \typemark{main={text=sof}}
2154 % & Special Operations Forces
2155 % & SOF\\
2156 % \hline
2157 % \rowcolor{headbg}
2158 % {\color{headfg}\textbf{Symbol}}
2159 % & \multicolumn{2}{c|}{\color{headfg}\textbf{Echelon \& Abbreviation}}
2160 % \\
2161 % \hline
2162 % \sizemark{army group}
2163 % & Army group
2164 % & AG\\
2165 % \rowcolor{altcol}
2166 % \sizemark{army}
2167 % & Army
2168 % & A\\
2169 % \sizemark{corps}
2170 % & Corps
2171 % & -\\
2172 % \rowcolor{altcol}
2173 % \sizemark{division}
2174 % & Division
2175 % & D\footnote{Sometimes `DIV'}\\
2176 % \sizemark{brigade}
2177 % & Brigade
2178 % & BD\\
2179 % \rowcolor{altcol}
2180 % \sizemark{regiment}
2181 % & Regiment
2182 % & REGT\\
2183 % \sizemark{battalion}
2184 % & Battalion
2185 % & BN\\
2186 % \rowcolor{altcol}
2187 % \sizemark{company}
2188 % & Company
2189 % & COY\\
2190 % \sizemark{platoon}
2191 % & Platoon
2192 % & PLT\\
2193 % \rowcolor{altcol}
2194 % \sizemark{section}
2195 % & Section
2196 % & \\
2197 % \sizemark{squad}
2198 % & Squad
2199 % & \\
2200 % \hline
2201 % \end{tabular}
2202 % \caption{Some abbreviations of unit type identifications}
2203 % \label{tab:natoapp6c:abbr}
2204 % \end{table}
2205 %
2206 %
2207 % \ifShowSymbols
2208 % \subsection{Symbols Available}
2209 % \label{sec:natoapp:mains}
2210 %
2211 % \tablename~\ref{tab:natoapp6c:main:symbols} lists all the symbols
2212 % defined. Note, these do \emph{not} correspond to \emph{all} the
2213 % symbols defined in NATO APP-6(C) \cite{app6c}. However, using
2214 % combinations of these symbols one can construct \emph{all} of
2215 % those symbols (and so more if so desired).
2216 %
2217 % \ifShowCompat
2218 % See also
2219 % Appendix~\ref{app:natoapp6c:compat} for compatibility charts
2220 % between this library and \textsf{milsymb} \cite{milsymb}.
2221 % \fi
2222 %
2223 % {\makeatletter\SymbolTable{land}{\n@to@pp@s@ll}}
2224 % \fi
2225 %
2226 % \begin{thebibliography}{99}
2227 % \bibitem{fb} Hanover,C., Hendrix,C.E., \& Llewelyn,S.,
2228 % \textit{First Blood}, 1997, \url{https://grognard.com/fb/}. See
2229 % also implementation using this package at
2230 % \url{https://gitlab.com/wargames_tex/firstblood_tex}.
2231 % \bibitem{app6c} \textit{NATO Joint Military Symbology}, APP-6(C),
2232 % May 2011,
2233 % \url{https://en.wikipedia.org/wiki/NATO_Joint_Military_Symbology}.
2234 % \bibitem{app6d} \textit{NATO Joint Military Symbology}, APP-6(D),
2235 % October 2017,
2236 % \url{https://nso.nato.int/nso/nsdd/main/standards/ap-details/1912/EN}
2237 % \bibitem{milsymb} \textsf{milsymb} package,
2238 % \url{https://www.ctan.org/pkg/MilSymb}.
2239 % \end{thebibliography}
2240 %
2241 % \StopEventually{}
2242 %
2243 %
2244 % \iffalse
2245 % ====================================================================
2246 %
2247 % Implementation
2248 %
2249 % ====================================================================
2250 %
2251 % The wargame main package
2252 %
2253 % --------------------------------------------------------------------
2254 % \fi
2255 %
2256 % \section{Implementation}
2257 % \label{sec:impl}
2258 %
2259 % \input{package.dtx}
2260 % \input{util/core.dtx}
2261 % \input{hex/core.dtx}
2262 % \input{chit/core.dtx}
2263 % \input{natoapp6c/core.dtx}
2264 %
2265 % \appendix
2266 %
2267 % \iffalse
2268 % ====================================================================
2269 %
2270 % Appendices
2271 %
2272 % ====================================================================
2273 %
2274 % Compat tables
2275 %
2276 % --------------------------------------------------------------------
2277 % \fi
2278 %
2279 % \ifShowCompat
2280 % \section{Compatibility tables}
2281 % \label{app:natoapp6c:compat}
2282 %
2283 % The following tables provides compatibility with the the
2284 % \textsf{milsymb} package available from CTAN.
2285 %
2286 % \let\CompatSection\subsection
2287 % \let\CompatSubSection\subsubsection
2288 % \input{cmp_air}
2289 % \input{cmp_missile}
2290 % \input{cmp_land}
2291 % \input{cmp_equipment}
2292 % \input{cmp_installation}
2293 % \input{cmp_seasurface}
2294 % \input{cmp_subsurface}
2295 % \input{cmp_seamine}
2296 % \input{cmp_space}
2297 % \input{cmp_activity}
2298 % \fi
2299 %
2300 % \iffalse
2301 % ====================================================================
2302 %
2303 % Draft VASSAL module
2304 %
2305 % --------------------------------------------------------------------
2306 % \fi
2307 % \section{Generate draft VASSAL module}
2308 % \label{app:vassal}
2309 %
2310 % We can use the code you wrote for your game pieces (counters, maps,
2311 % tables), to generate a draft VASSAL module. To that end, use the
2312 % document class \textsf{wgexport}, and some simple macros to export
2313 % your graphics to a single PDF. A provided Python script then
2314 % processes this to generate the draft VASSAL module.
2315 %
2316 % The generated VASSAL module is not the final thing, but it is a good
2317 % start.
2318 %
2319 % \subsection{Example}
2320 %
2321 % Suppose we have defined counters and markers like
2322 % \begin{verbatim}
2323 % allied 1 id axis 1 ad out of supply
2324 % allied 2 ad axis 2 ad game turn
2325 % allied 3 abid axis 3 ic
2326 % \end{verbatim}
2327 % via Tikz styles. Also assume that we have macros
2328 % \begin{verbatim}
2329 % \board \oob \charts \front
2330 % \end{verbatim}
2331 % which produces \textsf{tikzpicture}s to the board, OOBs, charts, and
2332 % cover, respectively. All this is defined in our package
2333 % \texttt{mygame}. Of course that we have our rules in the file
2334 % \texttt{game.pdf}.
2335 %
2336 % We prepare a simple \LaTeX{} source file
2337 %
2338 % \begin{verbatim}
2339 % \documentclass{wgexport}
2340 % \usepackage{mygame}
2341 % \begin{document}
2342 % \begin{imagelist} %% Records image meta info
2343 % \chitimages{{%
2344 % {allied 1 id,allied 2 ad,allied 3 abid}/Allied,%
2345 % {axis 1 ad,axis 2 ad,axis 3 ic}/Axis,%
2346 % {out of supply, game turn}/Markers}}
2347 % \info{Board}{board}{} \board
2348 % \info{OOB}{oob}{} \oob
2349 % \info{Charts}{chart}{}\chart
2350 % \info{Cover}{front}{} \front
2351 % \end{imagelist}
2352 % \end{document}
2353 % \end{verbatim}
2354 %
2355 % When we run \LaTeX{} on this, we will get a PDF where each page is a
2356 % separate image and the page is cropped to image. \emph{In addition}
2357 % we will get a CSV (comma-separated-values) file \texttt{export.csv}
2358 % which contains some meta information about each page. In
2359 % particular, it identifies the name of each page, the category, and
2360 % sub category of the image.
2361 %
2362 % For chits, the name of the image is the style name (e.g., \texttt{game
2363 % turn}). For other images, it is the first argument to \cs{info}
2364 % above.
2365 %
2366 % The category is for chits is always \texttt{counter}. For other
2367 % images, it is the second argument to the \cs{info} macro (e.g.,
2368 % \texttt{board}).
2369 %
2370 % The category of an image is important later on when we generate the
2371 % VASSAL module. Recognised categories are
2372 %
2373 % \begin{itemize}
2374 % \item \texttt{counter} for counter images. Such an image will
2375 % trigger the creation of a VASSAL game piece.
2376 % \item \texttt{board} for board images. Images of this kind will
2377 % result in VASSAL board (or Map) elements.
2378 % \item \texttt{oob} for Order of Battle tables. This will also
2379 % result in a VASSAL map being created, but one that is displayed as
2380 % a pop-up and with a rectangular grid. This is useful for placing
2381 % units in an Order of Battle chart.
2382 % \item \texttt{chart} for charts. These images will be made VASSAL
2383 % charts --- i.e., pop-up windows which contains some graphics for the
2384 % players reference.
2385 % \item \texttt{front} for the cover image. This will become the
2386 % module splash image. Only one such image (the first) will be used.
2387 % \end{itemize}
2388 %
2389 % Other categories may be used, and the corresponding image will be
2390 % added to the VASSAL module. However, they will no be processed in
2391 % any specific way.
2392 %
2393 % The \emph{sub-category} is mainly used for counters. Above, we gave
2394 % the sub-categories \texttt{Allied}, \texttt{Axis}, and
2395 % \texttt{Markers}. The sub-categories will help to identify the
2396 % factions of the game, and counter prototypes will be made for each
2397 % category. The sub-categories of \texttt{board}, \texttt{charts},
2398 % \texttt{oob}, and \texttt{front} has no or little effect.
2399 %
2400 % One we have processed the file above to generate our PDF (Say
2401 % \texttt{export.pdf}), then we can process it (and the CSV file) with
2402 % a Python script to make our draft VASSAL module
2403 %
2404 % \begin{verbatim}
2405 % export.py export.pdf export.csv -o Game.vmod -t Game -v 0.1 \
2406 % -d "My game" -r rules.pdf
2407 % \end{verbatim}
2408 %
2409 % This will generate the draft module \texttt{Game.vmod}. Note that
2410 % we add the rules (\texttt{-r rules.pdf}) to the module so that the
2411 % module is complete.
2412 %
2413 % Once the module has been generated, one can open it in the VASSAL
2414 % editor and further customise it. For example, the grids used in
2415 % the boards needs to be adjusted, and one may want to make initial
2416 % set-ups or add all counters to the OOB.
2417 %
2418 % Of course, running the Python script will overwrite all changes, so
2419 % perhaps it is a good idea to work on a copy of the output file.
2420 %
2421 % \iffalse
2422 % This is the package used by the documentation
2423 %<*docsty>
2424 \ProvidesPackage{wgdoc}
2425 \DeclareOption{noterrainpic}{%
2426 \PassOptionsToPackage{noterrainpic}{wargame}}
2427 \ProcessOptions\relax
2428 %
2429 \RequirePackage{etoolbox}
2430 \RequirePackage{wargame}
2431 \RequirePackage{longtable}
2432 \RequirePackage{colortbl}
2433 \RequirePackage{hyperref}
2434 \RequirePackage{textcomp}
2435 \RequirePackage{float}
2436 \RequirePackage[a4paper,right=1cm,left=2cm]{geometry}
2437 %
2438 \usetikzlibrary{external}
2439 \tikzexternalize[mode=graphics if exists,prefix=.cache-]
2440 %
2441 \newcommand\TikZ{{\mdseries Ti{\itshape k}Z}}
2442 \newcommand\sectionname{Section}
2443 \let\subsubsubsection\paragraph
2444 %
2445 \colorlet{headbg}{LightSlateGrey!50}
2446 \colorlet{headfg}{black}
2447 \colorlet{altcol}{LightSteelBlue!50}
2448 \newcommand\spec[1]{{\obeyspaces\ttfamily #1}}
2449 \newcommand\tspec[1]{{\ttfamily\footnotesize\obeyspaces #1}}
2450 \newcommand\keyval[2]{\spec{#1}=#2}
2451 %
2452 \setlength{\parindent}{0pt}
2453 \setlength{\parskip}{1ex}
2454 \setlength\hfuzz{15pt}
2455 \hbadness=7000
2456 %
2457 \tikzset{
2458 cc name/.pic={
2459 \draw[fill=pgfstrokecolor,draw=none,even odd rule]
2460 (0,0) circle(.5) circle(.41)
2461 node[fill=none,transform shape,
2462 font=\sffamily\bfseries\fontsize{16}{0}\selectfont] {cc}
2463 ;
2464 },
2465 cc by/.pic={
2466 \draw[fill=pgfstrokecolor,draw=none,even odd rule]
2467 (0,0) circle(.5) circle(.41) (0,.26) circle(.07)
2468 (0,.15)
2469 --++(.11,0)
2470 to[bend left] ++(.02,-.02)
2471 --++(0,-.20)
2472 --++(-.05,0)
2473 --++(0,-.25)
2474 --++(-.15,0)
2475 --++(0,.25)
2476 --++(-.05,0)
2477 --++(0,.2)
2478 to[bend left] ++(.02,.02)
2479 --cycle
2480 ;
2481 },
2482 cc sa/.pic={
2483 \draw[fill=pgfstrokecolor,draw=none,even odd rule]
2484 (0,0) circle(.5) circle(.41)
2485 (-.22,-.08)
2486 to[bend right=40] ++(.23,-.20)
2487 to[bend right=40] ++(.23, .20)
2488 to[bend right=10] ++(0, .16)
2489 to[bend right=40] ++(-.23, .20)
2490 to[bend right=40] ++(-.23, -.20)
2491 --++(-.05,0)
2492 --++(-45:.15)
2493 --++( 45:.15)
2494 --++(-.05,0)
2495 to[bend left=40] ++(.12, .1)
2496 to[bend left=40] ++(.12, -.1)
2497 to[bend left=10] ++(0, -.16)
2498 to[bend left=40] ++(-.12, -.1)
2499 to[bend left=40] ++(-.12, .1)
2500 --cycle
2501 ;
2502 },
2503 cc by sa/.pic={
2504 \pic at(-1,0) {cc name};
2505 \pic at( 0,0) {cc by};
2506 \pic at( 1,0) {cc sa};
2507 }
2508 }
2509
2510 %
2511 \newcommand\Continued[1]{\multicolumn{#1}{c}{%
2512 \textit{\small continued from previous page}}\\}
2513 \newcommand\Continues[1]{\multicolumn{#1}{c}{%
2514 \textit{\small continues on next page}}\\}
2515 \newcommand\SymbolTable[3][]{%
2516 \setlength{\LTcapwidth}{\linewidth}
2517 \def\tabledata{}
2518 \foreach \m in #3{%
2519 \protected@xappto\tabledata{\spec{\m}}
2520 \foreach \f in {friendly,hostile,neutral,unknown}{%
2521 \protected@xappto\tabledata{
2522 &\noexpand\tikz[scale=.8]{%
2523 \noexpand\natoapp[faction=\f,%
2524 command=#2,%
2525 main={\m},%
2526 frame={faction},%
2527 #1]}}}
2528 \protected@xappto\tabledata{\\ \noexpand\hline}}
2529 \def\colheaders{%
2530 \hline%
2531 & \multicolumn{4}{c|}{\meta{faction}}\\%
2532 \meta{symbol}%
2533 & \spec{friendly}%
2534 & \spec{hostile}%
2535 & \spec{neutral}%
2536 & \spec{unknown}%
2537 \\%
2538 \hline}
2539 \begin{longtable}{|l|
2540 m{.1\linewidth}
2541 m{.1\linewidth}
2542 m{.1\linewidth}
2543 m{.1\linewidth}|}
2544 \caption{Symbols\label{tab:natoapp6c:main:symbols}}\\
2545 \colheaders
2546 \endfirsthead
2547 \Continued{5}
2548 \colheaders
2549 \endhead
2550 \Continues{5}
2551 \endfoot
2552 \endlastfoot
2553 \tabledata
2554 \end{longtable}
2555 }
2556 %
2557 \def\CompatSection#1{}
2558 \def\CompatSubSection#1{}
2559 \newcommand\CompatTable[3]{% command, where, list
2560 \CompatSubSection{\spec{#2}}
2561 \setlength{\LTcapwidth}{\linewidth}
2562 \def\tabledata{}
2563 \foreach \m/\s in #3{%
2564 \n@to@pp@dbg{2}{Compatibility: `\m' -> `\s'}
2565 \protected@xappto\tabledata{\tspec{\m} & \tspec{\s}}
2566 \foreach \f in {{none,frame={draw=lightgray}},%
2567 friendly,hostile,neutral,unknown}{%
2568 \protected@xappto\tabledata{
2569 &\noexpand\tikz[scale=.5]{%
2570 \noexpand\natoapp[faction=\f,command=#1,\s,frame={faction}]}}}
2571 \protected@xappto\tabledata{\\ \noexpand\hline}}
2572 \def\colheaders{%
2573 \hline%
2574 &
2575 & \multicolumn{5}{c|}{\meta{faction}}\\%
2576 \textsf{milsymb}%
2577 &\textsf{wargame}%
2578 & \spec{none}%
2579 & \spec{friendly}%
2580 & \spec{hostile}%
2581 & \spec{neutral}%
2582 & \spec{unknown}%
2583 \\%
2584 \hline}
2585 \begin{longtable}{|
2586 m{.15\linewidth}|
2587 m{.20\linewidth}|
2588 m{.08\linewidth}
2589 m{.08\linewidth}
2590 m{.08\linewidth}
2591 m{.08\linewidth}
2592 m{.08\linewidth}|}
2593 \caption{Compatibility with \textsf{milsymb} \spec{#1},\spec{#2}
2594 symbols\label{tab:compat:#1:#2}}\\
2595 \colheaders
2596 \endfirsthead
2597 \Continues{7}
2598 \colheaders
2599 \endhead
2600 \Continues{7}
2601 \endfoot
2602 \endlastfoot
2603 \tabledata
2604 \end{longtable}
2605 }
2606 %
2607 \newenvironment{Syntax}{%
2608 \par
2609 \vspace{1ex}
2610 \hspace*{-1cm}
2611 \ttfamily
2612 \begin{tabular}{|>{\columncolor{altcol}}p{.8\textwidth}|}
2613 \hline}{\\\hline\end{tabular}\par\vskip 1ex}
2614 \def\MacroSyntax{%
2615 \leavevmode\begingroup%
2616 %\catcode`\\12
2617 \MakePrivateLetters\M@croSyntax}
2618 \def\M@croSyntax#1{\endgroup%
2619 \foreach \k in {#1}{\expandafter\Special@Usage@Index\k}
2620 \Syntax}
2621 \let\endMacroSyntax\endSyntax
2622 %
2623 \@ifundefined{SpecialIndex@}{
2624 \gdef\SpecialIndex@#1#2{%
2625 \@SpecialIndexHelper@#1\@nil
2626 \def\@tempb{ }%
2627 \ifcat \@tempb\@gtempa
2628 \special@index{\quotechar\space\actualchar
2629 \string\verb\quotechar*\verbatimchar
2630 \quotechar\bslash\quotechar\space\verbatimchar#2}%
2631 \else
2632 \def\@tempb##1##2\relax{\ifx\relax##2\relax
2633 \def\@tempc{\special@index{\quotechar##1\actualchar
2634 \string\verb\quotechar*\verbatimchar
2635 \quotechar\bslash\quotechar##1\verbatimchar#2}}%
2636 \else
2637 \def\@tempc{\special@index{##1##2\actualchar
2638 \string\verb\quotechar*\verbatimchar
2639 \bslash##1##2\verbatimchar#2}}%
2640 \fi}%
2641 \expandafter\@tempb\@gtempa\relax
2642 \@tempc
2643 \fi}}{}
2644 %
2645 \def\Special@Usage@Index#1{\@bsphack
2646 {\let\special@index\index\SpecialIndex@{#1}{}}%
2647 \@esphack}
2648 %
2649 \def\Speci@lIndex#1#2#3#4{%
2650 \@bsphack\special@index{%
2651 #1\actualchar
2652 {\string\ttfamily\space#1}
2653 (#3)%
2654 \encapchar main}%
2655 \special@index{#4:\levelchar#2\actualchar{%
2656 \string\ttfamily\space#2}\encapchar main}\@esphack}
2657 %
2658 \def\SpecialHexKeyIndex#1#2{\Speci@lIndex{#1}{#2}{key}{Hex keys}}
2659 \def\SpecialNatoSymbolIndex#1#2{%
2660 \Speci@lIndex{#1}{#2}{symbol}{NATO App6(c) symbols}}
2661 \def\SpecialNatoFrameIndex#1#2{\Speci@lIndex{#1}{#2}{frame}{NATO App6(c) frame}}
2662 \def\SpecialNatoKeyIndex#1#2{\Speci@lIndex{#1}{#2}{key}{NATO App6(c) keys}}
2663 \def\SpecialKeyIndex#1{\Speci@lIndex{#1}{#1}{key}{TikZ keys}}
2664 %
2665 \def\get@third #1/#2/#3/{\gdef\curr@third{#3}}
2666 \def\get@second #1/#2/#3/{\gdef\curr@second{#2}}
2667 %
2668 \def\KeyT@ble#1#2{
2669 \leavevmode
2670 \par
2671 \vspace{1ex}
2672 \hspace*{-1cm}
2673 \begin{tabular}{#1}
2674 \hline
2675 #2
2676 \hline
2677 \end{tabular}\par}
2678 %
2679 \def\ShowKeyT@ble#1{
2680 \KeyT@ble{|p{.1\textwidth}|>{\columncolor{altcol}}p{.7\textwidth}|}{#1}}
2681 %
2682 \def\Macro{%
2683 \begingroup%
2684 \catcode`\\12
2685 \MakePrivateLetters\M@cro}
2686 %
2687 \def\M@cro#1{%
2688 \endgroup
2689 \def\tabledata{}
2690 \foreach \k in {#1}{%
2691 \protected@xappto\tabledata{%
2692 \noexpand\spec{\noexpand\string\k}\noexpand\SpecialMainIndex{\k}\\}}
2693 \KeyT@ble{|>{\columncolor{altcol}}p{.8\textwidth}|}{\noexpand\tabledata}}
2694 \def\endMacro{}
2695 %
2696 \newenvironment{NatoAppSymbol}[1]{%
2697 \def\tabledata{}
2698 \foreach \k in {#1}{%
2699 \expandafter\get@third\k/
2700 \protected@xappto\tabledata{%
2701 \noexpand\tikz[scale=.5]{\noexpand\natoapp[main=\curr@third,
2702 faction=none,command=base,frame={draw=lightgray}]}
2703 &\noexpand\spec{\k}
2704 \noexpand\SpecialNatoSymbolIndex{\k}{\curr@third}\\}}
2705 \ShowKeyT@ble{\tabledata}}{}
2706 \newenvironment{NatoAppFrame}[1]{%
2707 \def\tabledata{}
2708 \foreach \k in {#1}{%
2709 %\expandafter\get@third\k/
2710 %\expandafter\get@second\k/
2711 \protected@xappto\tabledata{%
2712 \noexpand\tikz[scale=.5]{\noexpand\node[shape=\k] {};}
2713 &\noexpand\spec{\k}
2714 \noexpand\SpecialNatoFrameIndex{\k}{\k}\\}}
2715 \ShowKeyT@ble{\tabledata}}{}
2716 \newenvironment{NatoAppKey}[1]{%
2717 \def\tabledata{}
2718 \foreach \k in {#1}{%
2719 \expandafter\get@second\k//
2720 \protected@xappto\tabledata{%
2721 \noexpand\spec{\k}\noexpand\SpecialNatoKeyIndex{\k}{\curr@second}\\}}
2722 \KeyT@ble{|>{\columncolor{altcol}}p{.8\textwidth}|}{\tabledata}}{}
2723 %
2724 \newenvironment{HexKey}[1]{%
2725 \def\tabledata{}
2726 \foreach \k in {#1}{%
2727 \expandafter\get@second\k//
2728 \protected@xappto\tabledata{%
2729 \noexpand\spec{\k}\noexpand\SpecialHexKeyIndex{\k}{\curr@second}\\}}
2730 \KeyT@ble{|>{\columncolor{altcol}}p{.8\textwidth}|}{\tabledata}}{}
2731 \newenvironment{HexKey*}[1]{%
2732 \def\tabledata{}
2733 \foreach \k in {#1}{%
2734 \expandafter\get@second\k/
2735 \expandafter\get@third\k/
2736 \protected@xappto\tabledata{%
2737 \noexpand\spec{\k}\noexpand\SpecialHexKeyIndex{\k}{\curr@second/\curr@third}\\}}
2738 \KeyT@ble{|>{\columncolor{altcol}}p{.8\textwidth}|}{\tabledata}}{}
2739 %
2740 \newenvironment{TikzKey}[1]{%
2741 \def\tabledata{}
2742 \foreach \k in {#1}{%
2743 \protected@xappto\tabledata{%
2744 \noexpand\spec{\k}\noexpand\SpecialKeyIndex{\k}\\}}
2745 \KeyT@ble{|>{\columncolor{altcol}}p{.8\textwidth}|}{\tabledata}}{}
2746 %
2747 \tikzset{
2748 pics/wg/x axis/.style args={#1,#2,#3,#4,#5}{
2749 code={
2750 \begin{scope}[/pgf/number format/.cd,fixed,precision=2]
2751 \path[pic actions] (#1,#3)--(#2,#3)
2752 \foreach \t in {#1,#2,#4}{
2753 \ifx\t\@empty\else
2754 (\t,#3)--++(0,-.2)
2755 node[anchor=north]{$\pgfmathprintnumber{\t}$}\fi}
2756 \foreach \t in {#5}{
2757 \ifx\t\@empty\else
2758 (\t,#3)--++(0,-.1)
2759 node[anchor=north,font=\small]{$\pgfmathprintnumber{\t}$}\fi};
2760 \end{scope}}},
2761 pics/wg/y axis/.style args={#1,#2,#3,#4,#5}{
2762 code={
2763 \begin{scope}[/pgf/number format/.cd,fixed,precision=2]
2764 \path[pic actions] (#1,#2)--(#1,#3)
2765 \foreach \t in {#2,#3,#4}{
2766 \ifx\t\@empty\else
2767 (#1,\t)--++(.2,0)
2768 node[anchor=west]{$\pgfmathprintnumber{\t}$}\fi}
2769 \foreach \t in {#5}{
2770 \ifx\t\@empty\else
2771 (#1,\t)--++(.1,0)
2772 node[anchor=west,font=\small]{$\pgfmathprintnumber{\t}$}\fi};
2773 \end{scope}}},
2774 pics/wg/xaxis/.style args={#1,#2,#3,#4}{%
2775 code={
2776 \pic[draw]{wg/x axis={-#1,#1,#2,#3,#4}};}},
2777 pics/wg/yaxis/.style args={#1,#2,#3,#4}{%
2778 code={
2779 \pic[draw]{wg/y axis={#1,-#2,#2,#3,#4}};}},
2780 }
2781 %</docsty>
2782 %
2783 % \iffalse
2784 % --------------------------------------------------------------------
2785 %
2786 % Symbols documentation driver
2787 %
2788 % --------------------------------------------------------------------
2789 % \fi
2790 %
2791 % Driver for symbols only document
2792 %<*symbols>
2793 \title{The \textsf{wargame} package\\
2794 Symbols}
2795 \author{Christian Holm Christensen}
2796 \date{\today}
2797 \begin{document}
2798 \maketitle
2799 % \natoappdbglvl=3
2800 {\makeatletter\SymbolTable{land}{\n@to@pp@s@ll}}
2801 \end{document}
2802 %</symbols>
2803 %
2804 %
2805 %
2806 %
2807 %
2808 % \iffalse
2809 % --------------------------------------------------------------------
2810 %
2811 % Compatibility documentation driver
2812 %
2813 % --------------------------------------------------------------------
2814 % \fi
2815 %
2816 %
2817 %<*compat>
2818 % Driver for compatibility only document
2819 \title{The \textsf{wargame} package\\
2820 \textsf{milsymb} Compatibility}
2821 \author{Christian Holm Christensen}
2822 \date{\today}
2823 \begin{document}
2824 \newgeometry{margin=1cm}
2825 \maketitle
2826 % \natoappdbglvl=1
2827 \let\CompatSection\section
2828 \let\CompatSubSection\subsection
2829 \input{cmp_air}
2830 \input{cmp_missile}
2831 \input{cmp_land}
2832 \input{cmp_equipment}
2833 \input{cmp_installation}
2834 \input{cmp_seasurface}
2835 \input{cmp_subsurface}
2836 \input{cmp_seamine}
2837 \input{cmp_space}
2838 \input{cmp_activity}
2839 \restoregeometry
2840 \end{document}
2841 %</compat>
2842 % \fi
2843 %
2844 % \PrintIndex
2845 % \Finale
2846 %
2847 %
2848 %
2849 % \iffalse
2850 % EOF
2851 % Local Variables:
2852 % TeX-command-extra-options: "-shell-escape"
2853 % End:
2854 % \fi
2855
2856