summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/wargame/source/hex/paths.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/wargame/source/hex/paths.dtx')
-rw-r--r--macros/latex/contrib/wargame/source/hex/paths.dtx100
1 files changed, 72 insertions, 28 deletions
diff --git a/macros/latex/contrib/wargame/source/hex/paths.dtx b/macros/latex/contrib/wargame/source/hex/paths.dtx
index 833a4a245a..813ab869fa 100644
--- a/macros/latex/contrib/wargame/source/hex/paths.dtx
+++ b/macros/latex/contrib/wargame/source/hex/paths.dtx
@@ -45,19 +45,45 @@
}
}%
}%
-
+% \end{macrocode}
+%
+% A decoration to make a fortification line
+%
+% \begin{macrocode}
+\pgfdeclaredecoration{fortification}{initial}
+{
+ \state{initial}[width=4\pgflinewidth]
+ {
+ \pgfpathlineto{\pgfpoint{2\pgflinewidth}{0}}
+ \pgfpathlineto{\pgfpoint{2\pgflinewidth}{2\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{4\pgflinewidth}{2\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{4\pgflinewidth}{0}}
+ }
+ \state{final}
+ {
+ \pgfpathlineto{\pgfpointdecoratedpathlast}
+ }
+}
+% \end{macrocode}
+%
+% Roads, railroads, rivers, borders.
+%
+% \begin{macrocode}
\tikzset{
hex/road/.style={
rounded corners=3\pgflinewidth,% .25cm,
color=black,
transform shape,
scale line widths,
- thick},
+ thick,
+ every hex road/.try,
+ },
hex/railroad/.style={
%scale line widths,
rounded corners=.25cm,
color=gray!50!black,
transform shape,
+ every hex railroad/.try,
postaction={draw,decorate},
decoration={ticks,
segment length=9\pgflinewidth,
@@ -67,29 +93,42 @@
hex/river/.style={
color=blue,
scale line widths,
+ scale rounded corners,
line width=3pt,
transform shape,
+ every hex river/.try,
decorate,
decoration={random steps,
- segment length=.3cm,
- amplitude=.15cm,
+ segment length=3\pgflinewidth,
+ amplitude=1.5\pgflinewidth,
pre=lineto,
post=lineto,
- pre length=.05cm,
- post length=.05cm},
- rounded corners=.08cm},
+ pre length=.5\pgflinewidth,
+ post length=.5\pgflinewidth},
+ rounded corners=.75\pgflinewidth},
hex/border/.style={
color=gray,
- rounded corners=3pt,
dashed,
transform shape,
scale line widths,
- very thick
+ very thick,
+ rounded corners=3\pgflinewidth,
+ every hex border/.try
},
- every river/.style={},
- every road/.style={},
- every railroad/.style={},
- every border/.style={},
+ %
+ % Fortification line
+ %
+ hex/fortified line/.style={
+ draw=brown!50!black,
+ scale line widths,
+ line width=2pt,
+ every hex fortification line/.try,
+ decoration={fortification,raise=-2\pgflinewidth},
+ decorate},
+ % every river/.style={},
+ % every road/.style={},
+ % every railroad/.style={},
+ % every border/.style={},
}
% \end{macrocode}
%
@@ -97,25 +136,30 @@
%
% \begin{macrocode}
\def\road{%
- \hex@dbg{3}{Road}
+ %\hex@dbg{3}{Road}
\@ifnextchar[{\road@}{\road@[]}%]
}
\def\road@[#1]{\draw[hex/road,every hex road/.try,#1]}
\def\railroad{%
- \hex@dbg{3}{Rail road}
+ %\hex@dbg{3}{Rail road}
\@ifnextchar[{\railroad@}{\railroad@[]}%]
}
\def\railroad@[#1]{\draw[hex/railroad,every hex railroad/.try,#1]}
\def\river{%
- \hex@dbg{3}{River}
+ %\hex@dbg{3}{River}
\@ifnextchar[{\river@}{\river@[]}%]
}
-\def\river@[#1]{\draw[hex/river,every hex river/.try,#1]}
+\def\river@[#1]{\draw[hex/river,#1]}
\def\border{%
\hex@dbg{3}{Border}
\@ifnextchar[{\border@}{\border@[]}%]
}
\def\border@[#1]{\draw[hex/border,every hex border/.try,#1]}
+\def\fortifiedline{%
+ \@ifnextchar[{\fortifiedline@}{\fortifiedline@[]}%]
+}%
+\def\fortifiedline@[#1]{%
+ \draw[hex/fortified line,every hex fortified line/.try,#1]}
% \end{macrocode}
% \end{Macro}
%
@@ -209,10 +253,10 @@
markings,
mark=between positions 0 and 1 step 0.75*\hex@scale*\hex@dy with {
\node [single arrow,
- single arrow head extend=3pt,
+ single arrow head extend=.1*\hex@scale*\hex@dy,
fill=#1,
- inner sep=\hex@scale*.5mm,
- minimum width=\hex@scale*2mm,
+ inner sep=0.05*\hex@scale*\hex@dy,
+ minimum width=0.02*\hex@scale*\hex@dy,
minimum height=\hex@scale*\hex@dy/2,
transform shape]{};
}
@@ -236,10 +280,10 @@
markings,
mark=between positions 0 and 1 step 0.5*\hex@scale*\hex@dy with {
\node [single arrow,
- single arrow head extend=3pt,
+ single arrow head extend=.1*\hex@scale*\hex@dy,
fill=#1,
- inner sep=\hex@scale*.5mm,
- minimum width=\hex@scale*2mm,
+ inner sep=0.05*\hex@scale*\hex@dy,
+ minimum width=0.02*\hex@scale*\hex@dy,
minimum height=\hex@scale*\hex@dy/3,
transform shape]{};
}
@@ -270,7 +314,7 @@
anchor=west,
inner sep=\hex@scale*.25mm,
outer sep=.3*\hex@scale*\hex@dy,
- minimum width=\hex@scale*2mm,
+ minimum width=0.02*\hex@scale*\hex@dy,
minimum height=1.4*\hex@scale*\hex@dy,
transform shape]{};
}
@@ -300,10 +344,10 @@
transform shape] {};},
mark=between positions 0 and 1 step 0.75*\hex@scale*\hex@dy with {
\node [single arrow,
- single arrow head extend=\hex@scale*3pt,
+ single arrow head extend=.1*\hex@scale*\hex@dy,
fill=#1,
- inner sep=\hex@scale*1mm,
- minimum width=\hex@scale*3mm,
+ inner sep=0.05*\hex@scale*\hex@dy,
+ minimum width=0.02*\hex@scale*\hex@dy,
minimum height=\hex@scale*\hex@dy/2,
transform shape]{};
}
@@ -331,7 +375,7 @@
fill=#2,
transform shape,
text=#1,
- font=\sffamily\bfseries\Large},
+ font=\sffamily\bfseries\fontsize{14.4}{17}\selectfont},
hex/move cost/.default={black}{none},
% Argument is fill colour
% \end{macrocode}