diff --git a/CHANGELOG.md b/CHANGELOG.md index e142fd4..6acf4ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ # Changelog + All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), @@ -8,10 +9,18 @@ Categories: Added, Changed, Deprecated, Removed, Fixed, and Security. ## [Unreleased] -### Added +### Todo * i18n option + +## Version [0.7.1] - 2022-06-02 + +### Changed + + * handeling color background and foreground with native xcolor alias "\colorlet{}{}" instead of pgf macro + + ## Version [0.7.0] - 2022-04-02 ### Added @@ -31,6 +40,7 @@ Categories: Added, Changed, Deprecated, Removed, Fixed, and Security. * foreground of sidetrack (alias) * PackageWarning Error in development mode + ## Version [0.6.3] - 2022-02-15 ### Added @@ -149,7 +159,8 @@ Categories: Added, Changed, Deprecated, Removed, Fixed, and Security. Basic concept of a library with railway topology symbols and some examples. -[Unreleased]: https://github.com/railtoolkit/tikz-trackschematic/compare/v0.7.0...master +[Unreleased]: https://github.com/railtoolkit/tikz-trackschematic/compare/v0.7.1...master +[0.7.1]: https://github.com/railtoolkit/tikz-trackschematic/compare/v0.7.0...v0.7.1 [0.7.0]: https://github.com/railtoolkit/tikz-trackschematic/compare/v0.6.3...v0.7.0 [0.6.3]: https://github.com/railtoolkit/tikz-trackschematic/compare/v0.6.2...v0.6.3 [0.6.2]: https://github.com/railtoolkit/tikz-trackschematic/compare/v0.6.1...v0.6.2 diff --git a/doc/examples/station_berg.tex b/doc/examples/station_berg.tex index b925392..bb7b9cf 100644 --- a/doc/examples/station_berg.tex +++ b/doc/examples/station_berg.tex @@ -9,7 +9,7 @@ \begin{document} \begin{tikzpicture}[font=\sffamily] { % station names - \tikzset{every node/.style={\foreground!50!\background}}; + \tikzset{every node/.style={foreground!50!background}}; \node[right,align=left] at ( 2,1.3) {to and from\\ Arnau}; \node at (21,3.3) {{\LARGE Bf Berg}}; \node[left,align=right] at (38,1.3) {to and from\\ Chamstadt}; diff --git a/doc/examples/station_chamstadt.tex b/doc/examples/station_chamstadt.tex index 1824785..79ba07c 100644 --- a/doc/examples/station_chamstadt.tex +++ b/doc/examples/station_chamstadt.tex @@ -9,7 +9,7 @@ \begin{document} \begin{tikzpicture}[font=\sffamily] { % station names - \tikzset{every node/.style={\foreground!50!\background}}; + \tikzset{every node/.style={foreground!50!background}}; \node[right,align=left] at ( 5,1.3) {to and from\\ Berg}; \node at (21,3.9) {{\LARGE Bf Chamstadt}}; \node[left,align=right] at (37.5,1.3) {to and from\\ Dornroda}; diff --git a/doc/manual.pdf b/doc/manual.pdf index 9f87d7b..bf16051 100644 Binary files a/doc/manual.pdf and b/doc/manual.pdf differ diff --git a/doc/manual.tex b/doc/manual.tex index d9cb725..e83eba0 100644 --- a/doc/manual.tex +++ b/doc/manual.tex @@ -262,8 +262,8 @@ \subsection{Colors: background and foreground}\label{sec:colors} - The two main colors \texttt{white} and \texttt{black} are set for the \texttt{background} and \texttt{foreground} keys by default. - If you want to change them, provide a new value for the keys. + The two main colors \texttt{background} and \texttt{foreground} are set as an alias to \texttt{white} and \texttt{black} by default. + If you want to change them, override them by defining a new alias. For example like this:\\ \begin{minipage}[c]{0.65\textwidth} \begin{lstlisting}[gobble=8] @@ -271,12 +271,13 @@ % load the library \usepackage{tikz-trackschematic} + + % set the colors + \colorlet{background}{lightgray} + \colorlet{foreground}{violet} \begin{document} \begin{tikzpicture} - % set the colors - \tikzset{background=lightgray,foreground=violet} - \maintrack (0,0) -- (6,0); \train[forward] at (5,0) label (grey train); \end{tikzpicture} @@ -286,7 +287,8 @@ \hfil \begin{minipage}[c]{0.34\textwidth} \begin{tikzpicture} - \tikzset{background=lightgray,foreground=violet} + \colorlet{background}{lightgray} + \colorlet{foreground}{violet} \path (-0.2,-1.6) rectangle (5.2,1.6); \coordinate (A) at (0 ,0); \coordinate (T) at (4.5,0); diff --git a/doc/versionhistory.tex b/doc/versionhistory.tex index bd8b882..4aa4481 100644 --- a/doc/versionhistory.tex +++ b/doc/versionhistory.tex @@ -39,4 +39,7 @@ \vhEntry{0.7.0}{2022-04-02}{MS|GW}{ revised symbol and syntax for balises; replaced "\textbackslash gettikzxy" with "\textbackslash path let" syntax; fixed PackageWarning Error in development mode; fixed foreground of sidetrack (alias) } + \vhEntry{0.7.1}{2022-06-02}{MS}{ + handeling color background and foreground with native xcolor alias "\textbackslash colorlet{}{}" instead of pgf macro + } \end{versionhistory} diff --git a/src/tikz-trackschematic.sty b/src/tikz-trackschematic.sty index fd6599d..21dfa8b 100644 --- a/src/tikz-trackschematic.sty +++ b/src/tikz-trackschematic.sty @@ -15,6 +15,9 @@ \DeclareOptionX{dev}[\settoggle{development}{false}]{\settoggle{development}{true}} \ProcessOptionsX % +% colors +\colorlet{background}{white} +\colorlet{foreground}{black} \iftoggle{development}{% \PackageInfo{tikz-trackschematic}{development mode}% diff --git a/src/tikzlibrarytrackschematic.code.tex b/src/tikzlibrarytrackschematic.code.tex index 4086959..0b86415 100644 --- a/src/tikzlibrarytrackschematic.code.tex +++ b/src/tikzlibrarytrackschematic.code.tex @@ -7,6 +7,9 @@ \ProvidesFileRCS{tikzlibrarytrackschematic.code.tex}% % \RequirePackage{tikz,etoolbox}% +% colors +\colorlet{background}{white} +\colorlet{foreground}{black} % %%%%%%%%%%%%%%% % loading sublibraries diff --git a/src/tikzlibrarytrackschematic.constructions.code.tex b/src/tikzlibrarytrackschematic.constructions.code.tex index c054206..285e05c 100644 --- a/src/tikzlibrarytrackschematic.constructions.code.tex +++ b/src/tikzlibrarytrackschematic.constructions.code.tex @@ -23,14 +23,6 @@ \pgfkeys{% /tikz/trackschematic/.is family,% /tikz/trackschematic/.cd,% - %% color foreground - foreground/.store in=\foreground,% - foreground=black,% DEFAULT - /tikz/foreground/.forward to=/tikz/trackschematic/foreground,% - %% color background - background/.store in=\background,% - background=white,% DEFAULT - /tikz/background/.forward to=/tikz/trackschematic/background,% %% length length/.store in=\objectlength,% default length 4cm /tikz/length/.forward to=/tikz/trackschematic/length,% @@ -84,7 +76,7 @@ }% }% end \ifdefstring{\side} %% platform shape - \tikzset{every path/.style={draw=\foreground,line width=0.75pt}};% + \tikzset{every path/.style={draw=foreground,line width=0.75pt}};% \ifdefstring{\side}{both}{% double side \path ($-0.5*(\objectlength,0) + (0, \objectwidth)$) --% ($-0.5*(\objectlength,0) + (0, 0.2)$) --% @@ -159,7 +151,7 @@ }% }% end \ifdefstring{\trafficpractice} %% symbol - \tikzset{every path/.style={draw=\foreground,line width=1pt}};% + \tikzset{every path/.style={draw=foreground,line width=1pt}};% \iftoggle{show_road}{% true \path ($0.5*(-\roadwidth,0) + (0,-0.1)$) --% ++($(0,-\objectwidth)$);% road part 1 @@ -172,18 +164,18 @@ }{}% END \iftoggle{show_road} \ifdefstring{\barrier}{full}{% full barrier \ifdefstring{\side}{both}{% - \filldraw[\foreground]% left barrier part 1 + \filldraw[foreground]% left barrier part 1 ($(-0.5\roadwidth,0)+(-0.2,0)+(0,0.35)$) circle (0.05);% - \filldraw[\foreground]% left barrier part 2 + \filldraw[foreground]% left barrier part 2 ($( 0.5\roadwidth,0)+( 0.2,0)+(0,0.35)$) circle (0.05);% \path ($(-0.5\roadwidth,0)+(-0.2,0)+(0,0.35)$) --% ++($( 0.45\roadwidth,0)+( 0.2,0)$);% left barrier part 3 \path ($( 0.5\roadwidth,0)+( 0.2,0)+(0,0.35)$) --% ++($(-0.45\roadwidth,0)+(-0.2,0)$);% left barrier part 4 % - \filldraw[\foreground]% right barrier part 1 + \filldraw[foreground]% right barrier part 1 ($( 0.5\roadwidth,0)+( 0.2,0)+(0,-0.35)$) circle (0.05);% - \filldraw[\foreground]% right barrier part 2 + \filldraw[foreground]% right barrier part 2 ($(-0.5\roadwidth,0)+(-0.2,0)+(0,-0.35)$) circle (0.05);% \path ($( 0.5\roadwidth,0)+( 0.2,0)+(0,-0.35)$) --% ++($(-0.45\roadwidth,0)+(-0.2,0)$);% right barrier part 3 @@ -191,9 +183,9 @@ ++($( 0.45\roadwidth,0)+( 0.2,0)$);% right barrier part 4 }{% \ifdefstring{\side}{left}{% - \filldraw[\foreground]% left barrier part 1 + \filldraw[foreground]% left barrier part 1 ($(-0.5\roadwidth,0)+(-0.2,0)+(0,0.35)$) circle (0.05);% - \filldraw[\foreground]% left barrier part 2 + \filldraw[foreground]% left barrier part 2 ($( 0.5\roadwidth,0)+( 0.2,0)+(0,0.35)$) circle (0.05);% \path ($(-0.5\roadwidth,0)+(-0.2,0)+(0,0.35)$) --% ++($( 0.45\roadwidth,0)+( 0.2,0)$);% left barrier part 3 @@ -201,9 +193,9 @@ ++($(-0.45\roadwidth,0)+(-0.2,0)$);% left barrier part 4 }{% \ifdefstring{\side}{right}{% - \filldraw[\foreground]% right barrier part 1 + \filldraw[foreground]% right barrier part 1 ($( 0.5\roadwidth,0)+( 0.2,0)+(0,-0.35)$) circle (0.05);% - \filldraw[\foreground]% right barrier part 2 + \filldraw[foreground]% right barrier part 2 ($(-0.5\roadwidth,0)+(-0.2,0)+(0,-0.35)$) circle (0.05);% \path ($( 0.5\roadwidth,0)+( 0.2,0)+(0,-0.35)$) --% ++($(-0.45\roadwidth,0)+(-0.2,0)$);% right barrier part 3 @@ -217,24 +209,24 @@ }{% \ifdefstring{\barrier}{semi}{% semi barrier \ifdefstring{\side}{both}{% - \filldraw[\foreground]% left barrier part 1 + \filldraw[foreground]% left barrier part 1 ($\trafficfactor*(-0.5\roadwidth,0)+\trafficfactor*(-0.2,0)+(0,0.35)$) circle (0.05);% \path ($\trafficfactor*(-0.5\roadwidth,0)+\trafficfactor*(-0.2,0)+(0,0.35)$) --% ++($\trafficfactor*(0.5\roadwidth,0)+\trafficfactor*(0.2,0)$);% left barrier part 2 % - \filldraw[\foreground]% right barrier part 1 + \filldraw[foreground]% right barrier part 1 ($\trafficfactor*(0.5\roadwidth,0)+\trafficfactor*(0.2,0)+(0,-0.35)$) circle (0.05);% \path ($\trafficfactor*(0.5\roadwidth,0)+\trafficfactor*(0.2,0)+(0,-0.35)$) --% ++($\trafficfactor*(-0.5\roadwidth,0)+\trafficfactor*(-0.2,0)$);% right barrier part 2 }{% \ifdefstring{\side}{left}{% - \filldraw[\foreground]% left barrier part 1 + \filldraw[foreground]% left barrier part 1 ($\trafficfactor*(-0.5\roadwidth,0)+\trafficfactor*(-0.2,0)+(0,0.35)$) circle (0.05);% \path ($\trafficfactor*(-0.5\roadwidth,0)+\trafficfactor*(-0.2,0)+(0,0.35)$) --% ++($\trafficfactor*(0.5\roadwidth,0)+\trafficfactor*(0.2,0)$);% left barrier part 2 }{% \ifdefstring{\side}{right}{% - \filldraw[\foreground]% right barrier part 1 + \filldraw[foreground]% right barrier part 1 ($\trafficfactor*(0.5\roadwidth,0)+\trafficfactor*(0.2,0)+(0,-0.35)$) circle (0.05);% \path ($\trafficfactor*(0.5\roadwidth,0)+\trafficfactor*(0.2,0)+(0,-0.35)$) --% ++($\trafficfactor*(-0.5\roadwidth,0)+\trafficfactor*(-0.2,0)$);% right barrier part 2 @@ -292,11 +284,11 @@ \def\coordcommand{#1} % beware of leading and tailing spaces! %% symbol \iftoggle{show_background}{% true - \fill[\background]% + \fill[background]% ($(-0.5\objectlength,\objectwidth)+(0,-0.1)$) rectangle% ($(0.5\objectlength,-\objectwidth)+(0,0.1)$);% }{}% - \tikzset{every path/.style={draw=\foreground,line width=0.75pt}};% + \tikzset{every path/.style={draw=foreground,line width=0.75pt}};% \ifdefstring{\side}{both}{% \path ($-0.5*(\objectlength,0)+(-0.1,0)+(\shiftleft,\objectwidth)$) --% ++($(0.1,-0.1)$) --% @@ -352,10 +344,10 @@ %% settings \def\coordcommand{#1} % beware of leading and tailing spaces! %% symbol - \tikzset{every path/.style={draw=\foreground,line width=1pt}};% + \tikzset{every path/.style={draw=foreground,line width=1pt}};% \path (-0.6,-0.4 ) rectangle ++(1.2,0.8); % building - \path[fill=\foreground] (-0.5,-0.3 ) rectangle ++(1.0,0.2); % table - \path[fill=\foreground] ( 0 , 0.15) circle (0.15); % human dot + \path[fill=foreground] (-0.5,-0.3 ) rectangle ++(1.0,0.2); % table + \path[fill=foreground] ( 0 , 0.15) circle (0.15); % human dot }},% END pics/interlocking/.style args={#1} % symbology entry symbology_interlocking/.pic = { @@ -384,7 +376,7 @@ %% settings \def\coordcommand{#1} % beware of leading and tailing spaces! %% symbol - \tikzset{every path/.style={draw=\foreground,line width=0.75pt}};% + \tikzset{every path/.style={draw=foreground,line width=0.75pt}};% % left side \path (-0.3, 0.1) -- ++(0,0.05); \path (-0.2, 0.1) -- ++(0,0.15); @@ -439,7 +431,7 @@ }% }% end \ifdefstring{\side} %% pylon shape - \tikzset{every path/.style={draw=\foreground,line width=0.5pt}};% + \tikzset{every path/.style={draw=foreground,line width=0.5pt}};% \ifdefstring{\side}{both}{% double side \path (0,-0.5) circle [radius=0.075];% part 1 \path (0, 0.5) circle [radius=0.075];% part 2 diff --git a/src/tikzlibrarytrackschematic.electrics.code.tex b/src/tikzlibrarytrackschematic.electrics.code.tex index d5565c5..16f51ad 100644 --- a/src/tikzlibrarytrackschematic.electrics.code.tex +++ b/src/tikzlibrarytrackschematic.electrics.code.tex @@ -19,14 +19,6 @@ \pgfkeys{% /tikz/trackschematic/.is family,% /tikz/trackschematic/.cd,% - %% color foreground - foreground/.store in=\foreground,% - foreground=black,% DEFAULT - /tikz/foreground/.forward to=/tikz/trackschematic/foreground,% - %% color background - background/.store in=\background,% - background=white,% DEFAULT - /tikz/background/.forward to=/tikz/trackschematic/background,% %% face face/.value required,% forward, backward OR bidirectional face/.store in=\face,% forward, backward OR bidirectional @@ -99,20 +91,20 @@ }% end \ifdefstring{\face} % %% signal pole - \path[draw=\foreground,line width=1pt] (0,0) -- ++($\trafficfactor*\facefactor*(0,-0.4)$) -- ++($\facefactor*(0.4,0)$);% signal pole + \path[draw=foreground,line width=1pt] (0,0) -- ++($\trafficfactor*\facefactor*(0,-0.4)$) -- ++($\facefactor*(0.4,0)$);% signal pole %% signal marker - \path[draw=\foreground,line width=0.1pt,double=\background,double distance=0.5pt,fill=\signalcolor,rounded corners=0.1pt]% + \path[draw=foreground,line width=0.1pt,double=background,double distance=0.5pt,fill=\signalcolor,rounded corners=0.1pt]% ($\trafficfactor*\facefactor*(0,-0.15) + \facefactor*( 0.4,0)$) --% ++($\trafficfactor*\facefactor*(0,-0.25) + \facefactor*(-0.25,0)$) --% ++($\trafficfactor*\facefactor*(0,-0.25) + \facefactor*( 0.25,0)$) --% ++($\trafficfactor*\facefactor*(0, 0.25) + \facefactor*( 0.25,0)$) -- cycle;% sign - \path[fill=\background]% + \path[fill=background]% ($\trafficfactor*\facefactor*(0,-0.3) + \facefactor*( 0.45,0)$) rectangle% ++($\trafficfactor*\facefactor*(0,-0.05) + \facefactor*(-0.1,0)$)% ($\trafficfactor*\facefactor*(0,-0.5) + \facefactor*( 0.45,0)$) rectangle% ++($\trafficfactor*\facefactor*(0, 0.05) + \facefactor*(-0.1,0)$);% symbol %% label - \tikzset{every node/.style={text=\foreground,inner sep=1pt}};% + \tikzset{every node/.style={text=foreground,inner sep=1pt}};% \ifdefstring{\labelcontent}{}{}{% label NOT empty \coordinate (label-coord) at ($\trafficfactor*\facefactor*(0,-0.4)$);% \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default @@ -171,14 +163,14 @@ }% end \ifdefstring{\face} % %% signal pole - \path[draw=\foreground,line width=1pt] (0,0) -- ++($\trafficfactor*\facefactor*(0,-0.4)$) -- ++($\facefactor*(0.4,0)$);% signal pole + \path[draw=foreground,line width=1pt] (0,0) -- ++($\trafficfactor*\facefactor*(0,-0.4)$) -- ++($\facefactor*(0.4,0)$);% signal pole %% signal marker - \path[draw=\foreground,line width=0.1pt,double=\background,double distance=0.5pt,fill=\signalcolor,rounded corners=0.1pt]% + \path[draw=foreground,line width=0.1pt,double=background,double distance=0.5pt,fill=\signalcolor,rounded corners=0.1pt]% ($\trafficfactor*\facefactor*(0,-0.15) + \facefactor*( 0.4,0)$) --% ++($\trafficfactor*\facefactor*(0,-0.25) + \facefactor*(-0.25,0)$) --% ++($\trafficfactor*\facefactor*(0,-0.25) + \facefactor*( 0.25,0)$) --% ++($\trafficfactor*\facefactor*(0, 0.25) + \facefactor*( 0.25,0)$) -- cycle;% sign - \path[fill=\background]% + \path[fill=background]% ($\trafficfactor*\facefactor*(0,-0.3) + \facefactor*( 0.5,0)$) rectangle% ++($\trafficfactor*\facefactor*(0,-0.05) + \facefactor*(-0.1,0)$)% ($\trafficfactor*\facefactor*(0,-0.5) + \facefactor*( 0.5,0)$) rectangle% @@ -186,7 +178,7 @@ ($\trafficfactor*\facefactor*(0,-0.3) + \facefactor*( 0.3,0)$) rectangle% ++($\trafficfactor*\facefactor*(0,-0.2) + \facefactor*( 0.05,0)$);% symbol %% label - \tikzset{every node/.style={text=\foreground,inner sep=1pt}};% + \tikzset{every node/.style={text=foreground,inner sep=1pt}};% \ifdefstring{\labelcontent}{}{}{% label NOT empty \coordinate (label-coord) at ($\trafficfactor*\facefactor*(0,-0.4)$);% \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default @@ -245,23 +237,23 @@ }% end \ifdefstring{\face} % %% signal pole - \path[draw=\foreground,line width=1pt] (0,0) -- ++($\trafficfactor*\facefactor*(0,-0.4)$) -- ++($\facefactor*(0.4,0)$);% signal pole + \path[draw=foreground,line width=1pt] (0,0) -- ++($\trafficfactor*\facefactor*(0,-0.4)$) -- ++($\facefactor*(0.4,0)$);% signal pole %% signal marker - \path[draw=\foreground,line width=0.1pt,double=\background,double distance=0.5pt,fill=\signalcolor,rounded corners=0.1pt]% + \path[draw=foreground,line width=0.1pt,double=background,double distance=0.5pt,fill=\signalcolor,rounded corners=0.1pt]% ($\trafficfactor*\facefactor*(0,-0.15) + \facefactor*( 0.4,0)$) --% ++($\trafficfactor*\facefactor*(0,-0.25) + \facefactor*(-0.25,0)$) --% ++($\trafficfactor*\facefactor*(0,-0.25) + \facefactor*( 0.25,0)$) --% ++($\trafficfactor*\facefactor*(0, 0.25) + \facefactor*( 0.25,0)$) -- cycle;% sign - \path[fill=\background]% + \path[fill=background]% ($\trafficfactor*\facefactor*(0,-0.3) + \facefactor*( 0.475,0)$) rectangle% ++($\trafficfactor*\facefactor*(0,-0.05) + \facefactor*(-0.11,0)$)% ($\trafficfactor*\facefactor*(0,-0.5) + \facefactor*( 0.475,0)$) rectangle% ++($\trafficfactor*\facefactor*(0, 0.05) + \facefactor*(-0.11,0)$);% symbol part1 - \path[fill=\background]% + \path[fill=background]% ($\trafficfactor*\facefactor*(0,-0.3) + \facefactor*( 0.325,0)$) rectangle% ++($\trafficfactor*\facefactor*(0,-0.2) + \facefactor*( 0.05,0)$);% symbol part2 %% label - \tikzset{every node/.style={text=\foreground,inner sep=1pt}};% + \tikzset{every node/.style={text=foreground,inner sep=1pt}};% \ifdefstring{\labelcontent}{}{}{% label NOT empty \coordinate (label-coord) at ($\trafficfactor*\facefactor*(0,-0.4)$);% \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default @@ -320,14 +312,14 @@ }% end \ifdefstring{\face} % %% signal pole - \path[draw=\foreground,line width=1pt] (0,0) -- ++($\trafficfactor*\facefactor*(0,-0.4)$) -- ++($\facefactor*(0.4,0)$);% signal pole + \path[draw=foreground,line width=1pt] (0,0) -- ++($\trafficfactor*\facefactor*(0,-0.4)$) -- ++($\facefactor*(0.4,0)$);% signal pole %% signal marker - \path[draw=\foreground,line width=0.1pt,double=\background,double distance=0.5pt,fill=\signalcolor,rounded corners=0.1pt]% + \path[draw=foreground,line width=0.1pt,double=background,double distance=0.5pt,fill=\signalcolor,rounded corners=0.1pt]% ($\trafficfactor*\facefactor*(0,-0.15) + \facefactor*( 0.4,0)$) --% ++($\trafficfactor*\facefactor*(0,-0.25) + \facefactor*(-0.25,0)$) --% ++($\trafficfactor*\facefactor*(0,-0.25) + \facefactor*( 0.25,0)$) --% ++($\trafficfactor*\facefactor*(0, 0.25) + \facefactor*( 0.25,0)$) -- cycle;% sign - \path[fill=\background]% + \path[fill=background]% ($\trafficfactor*\facefactor*(0,-0.23) + \facefactor*( 0.35,0)$) --% ++($\trafficfactor*\facefactor*(0,-0.2)$) -- ++($\facefactor*(-0.05,0)$) --% ++($\trafficfactor*\facefactor*(0, 0.15)$) -- cycle% @@ -335,7 +327,7 @@ ++($\trafficfactor*\facefactor*(0, 0.2)$) -- ++($\facefactor*(0.05,0)$) --% ++($\trafficfactor*\facefactor*(0,-0.15)$) -- cycle;% symbol %% label - \tikzset{every node/.style={text=\foreground,inner sep=1pt}};% + \tikzset{every node/.style={text=foreground,inner sep=1pt}};% \ifdefstring{\labelcontent}{}{}{% label NOT empty \coordinate (label-coord) at ($\trafficfactor*\facefactor*(0,-0.4)$);% \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default @@ -395,14 +387,14 @@ }% end \ifdefstring{\face} % %% signal pole - \path[draw=\foreground,line width=1pt] (0,0) -- ++($\trafficfactor*\facefactor*(0,-0.4)$) -- ++($\facefactor*(0.4,0)$);% signal pole + \path[draw=foreground,line width=1pt] (0,0) -- ++($\trafficfactor*\facefactor*(0,-0.4)$) -- ++($\facefactor*(0.4,0)$);% signal pole %% signal marker - \path[draw=\foreground,line width=0.1pt,double=\background,double distance=0.5pt,fill=\signalcolor,rounded corners=0.1pt]% + \path[draw=foreground,line width=0.1pt,double=background,double distance=0.5pt,fill=\signalcolor,rounded corners=0.1pt]% ($\trafficfactor*\facefactor*(0,-0.15) + \facefactor*( 0.4,0)$) --% ++($\trafficfactor*\facefactor*(0,-0.25) + \facefactor*(-0.25,0)$) --% ++($\trafficfactor*\facefactor*(0,-0.25) + \facefactor*( 0.25,0)$) --% ++($\trafficfactor*\facefactor*(0, 0.25) + \facefactor*( 0.25,0)$) -- cycle;% sign - \path[fill=\background]% + \path[fill=background]% ($\trafficfactor*\facefactor*(0,-0.18) + \facefactor*( 0.4 ,0)$) --% ++($\trafficfactor*\facefactor*(0,-0.03) + \facefactor*( 0.03,0)$) --% ++($\trafficfactor*\facefactor*(0,-0.38)$) --% @@ -410,7 +402,7 @@ ++($\trafficfactor*\facefactor*(0, 0.03) + \facefactor*(-0.03,0)$) --% ++($\trafficfactor*\facefactor*(0, 0.38)$) -- cycle;% symbol %% label - \tikzset{every node/.style={text=\foreground,inner sep=1pt}};% + \tikzset{every node/.style={text=foreground,inner sep=1pt}};% \ifdefstring{\labelcontent}{}{}{% label NOT empty \coordinate (label-coord) at ($\trafficfactor*\facefactor*(0,-0.4)$);% \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default @@ -470,14 +462,14 @@ }% end \ifdefstring{\face} % %% signal pole - \path[draw=\foreground,line width=1pt] (0,0) -- ++($\trafficfactor*\facefactor*(0,-0.4)$) -- ++($\facefactor*(0.4,0)$);% signal pole + \path[draw=foreground,line width=1pt] (0,0) -- ++($\trafficfactor*\facefactor*(0,-0.4)$) -- ++($\facefactor*(0.4,0)$);% signal pole %% signal marker - \path[draw=\foreground,line width=0.1pt,double=\background,double distance=0.5pt,fill=\signalcolor,rounded corners=0.1pt]% + \path[draw=foreground,line width=0.1pt,double=background,double distance=0.5pt,fill=\signalcolor,rounded corners=0.1pt]% ($\trafficfactor*\facefactor*(0,-0.15) + \facefactor*( 0.4,0)$) --% ++($\trafficfactor*\facefactor*(0,-0.25) + \facefactor*(-0.25,0)$) --% ++($\trafficfactor*\facefactor*(0,-0.25) + \facefactor*( 0.25,0)$) --% ++($\trafficfactor*\facefactor*(0, 0.25) + \facefactor*( 0.25,0)$) -- cycle;% sign - \path[fill=\background]% + \path[fill=background]% ($\trafficfactor*\facefactor*(0,-0.4 ) + \facefactor*( 0.62,0)$) --% ++($\trafficfactor*\facefactor*(0,-0.03) + \facefactor*(-0.03,0)$) --% ++($\facefactor*(-0.38,0)$) --% @@ -485,7 +477,7 @@ ++($\trafficfactor*\facefactor*(0, 0.03) + \facefactor*( 0.03,0)$) --% ++($\facefactor*( 0.38,0)$) -- cycle;% symbol %% label - \tikzset{every node/.style={text=\foreground,inner sep=1pt}};% + \tikzset{every node/.style={text=foreground,inner sep=1pt}};% \ifdefstring{\labelcontent}{}{}{% label NOT empty \coordinate (label-coord) at ($\trafficfactor*\facefactor*(0,-0.4)$);% \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default @@ -545,14 +537,14 @@ }% end \ifdefstring{\face} % %% signal pole - \path[draw=\foreground,line width=1pt] (0,0) -- ++($\trafficfactor*\facefactor*(0,-0.4)$) -- ++($\facefactor*(0.4,0)$);% signal pole + \path[draw=foreground,line width=1pt] (0,0) -- ++($\trafficfactor*\facefactor*(0,-0.4)$) -- ++($\facefactor*(0.4,0)$);% signal pole %% signal marker - \path[draw=\foreground,line width=0.1pt,double=\background,double distance=0.5pt,fill=\signalcolor,rounded corners=0.1pt]% + \path[draw=foreground,line width=0.1pt,double=background,double distance=0.5pt,fill=\signalcolor,rounded corners=0.1pt]% ($\trafficfactor*\facefactor*(0,-0.15) + \facefactor*( 0.4,0)$) --% ++($\trafficfactor*\facefactor*(0,-0.25) + \facefactor*(-0.25,0)$) --% ++($\trafficfactor*\facefactor*(0,-0.25) + \facefactor*( 0.25,0)$) --% ++($\trafficfactor*\facefactor*(0, 0.25) + \facefactor*( 0.25,0)$) -- cycle;% sign - \path[fill=\background]% + \path[fill=background]% ($\trafficfactor*\facefactor*(0,-0.25) + \facefactor*( 0.4 ,0)$) --% ++($\trafficfactor*\facefactor*(0,-0.15) + \facefactor*(-0.15,0)$) --% ++($\trafficfactor*\facefactor*(0,-0.15) + \facefactor*( 0.15,0)$) --% @@ -562,13 +554,13 @@ ++($\trafficfactor*\facefactor*(0,-0.1 ) + \facefactor*(-0.1 ,0)$) --% ++($\trafficfactor*\facefactor*(0,-0.1 ) + \facefactor*( 0.1 ,0)$) --% ++($\trafficfactor*\facefactor*(0, 0.1 ) + \facefactor*( 0.1 ,0)$) -- cycle;% symbol - \path[fill=\background]% + \path[fill=background]% ($\trafficfactor*\facefactor*(0,-0.35) + \facefactor*( 0.4 ,0)$) --% ++($\trafficfactor*\facefactor*(0,-0.05) + \facefactor*(-0.05,0)$) --% ++($\trafficfactor*\facefactor*(0,-0.05) + \facefactor*( 0.05,0)$) --% ++($\trafficfactor*\facefactor*(0, 0.05) + \facefactor*( 0.05,0)$) -- cycle;% symbol %% label - \tikzset{every node/.style={text=\foreground,inner sep=1pt}};% + \tikzset{every node/.style={text=foreground,inner sep=1pt}};% \ifdefstring{\labelcontent}{}{}{% label NOT empty \coordinate (label-coord) at ($\trafficfactor*\facefactor*(0,-0.4)$);% \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default diff --git a/src/tikzlibrarytrackschematic.measures.code.tex b/src/tikzlibrarytrackschematic.measures.code.tex index 4a80d5e..891d5c0 100644 --- a/src/tikzlibrarytrackschematic.measures.code.tex +++ b/src/tikzlibrarytrackschematic.measures.code.tex @@ -23,14 +23,6 @@ \pgfkeys{% /tikz/trackschematic/.is family,% /tikz/trackschematic/.cd,% - %% color foreground - foreground/.store in=\foreground,% - foreground=black,% DEFAULT - /tikz/foreground/.forward to=/tikz/trackschematic/foreground,% - %% color background - background/.store in=\background,% - background=white,% DEFAULT - /tikz/background/.forward to=/tikz/trackschematic/background,% %% face face/.value required,% forward, backward OR bidirectional face/.store in=\face,% forward, backward OR bidirectional @@ -59,7 +51,7 @@ /tikz/trackschematic/measures/.cd,% %% color hectometer color/.store in=\hectometercolor,% - color=\foreground!50!\background,% DEFAULT + color=foreground!50!background,% DEFAULT /tikz/hectometer color/.forward to=/tikz/trackschematic/measures/color,% }% %%%%%%%%%%%%%%%% @@ -104,7 +96,7 @@ }% }% end \ifdefstring{\trafficpractice} % - \tikzset{every path/.style={draw=\foreground,line width=0.75pt,line cap=round,dash pattern=on 0pt off 2.4\pgflinewidth}};% + \tikzset{every path/.style={draw=foreground,line width=0.75pt,line cap=round,dash pattern=on 0pt off 2.4\pgflinewidth}};% \path% berth shape forward ($-0.5*(\objectlength,0) + (-0.05,0) + \trafficfactor*\facefactor*(0,-0.25)$) --% ($-0.5*(\objectlength,0) + (-0.05,0) + \trafficfactor*\facefactor*(0,-0.35)$)% @@ -112,10 +104,10 @@ ($ 0.5*(\objectlength,0) + ( 0.05,0) + \trafficfactor*\facefactor*(0,-0.35)$)% ($ 0.5*(\objectlength,0) + ( 0.05,0) + \trafficfactor*\facefactor*(0,-0.25)$) --% ($ 0.5*(\objectlength,0) + ( 0.05,0) + \trafficfactor*\facefactor*(0,-0.35)$);% berth shape forward - \path[draw=none,fill=\foreground]% arrow front + \path[draw=none,fill=foreground]% arrow front ($\facefactor*0.5*(\objectlength,0) + \facefactor*(-0.1,0) + \trafficfactor*\facefactor*(0,-0.35)$) --% ++($(0,-0.04) + \facefactor*(-0.1,0)$) -- ++(0,0.08) -- cycle;% arrow - \path[draw=none,fill=\foreground]% arrow back + \path[draw=none,fill=foreground]% arrow back ($\facefactor*-0.5*(\objectlength,0) + \facefactor*(0.2,0) + \trafficfactor*\facefactor*(0,-0.35)$) --% ++($(0,-0.04) + \facefactor*(-0.1,0)$) -- ++(0,0.08) -- cycle;% arrow \ifdefstring{\face}{bidirectional}{% bidirectional @@ -127,19 +119,19 @@ ($ 0.5*(\objectlength,0) + ( 0.05,0) + \trafficfactor*\facefactor*(0,-0.35)$)% ($ 0.5*(\objectlength,0) + ( 0.05,0) + \trafficfactor*\facefactor*(0,-0.25)$) --% ($ 0.5*(\objectlength,0) + ( 0.05,0) + \trafficfactor*\facefactor*(0,-0.35)$);% berth shape forward - \path[draw=none,fill=\foreground]% arrow front + \path[draw=none,fill=foreground]% arrow front ($\facefactor*0.5*(\objectlength,0) + \facefactor*(-0.1,0) + \trafficfactor*\facefactor*(0,-0.35)$) --% ++($(0,-0.04) + \facefactor*(-0.1,0)$) -- ++(0,0.08) -- cycle;% arrow - \path[draw=none,fill=\foreground]% arrow back + \path[draw=none,fill=foreground]% arrow back ($\facefactor*-0.5*(\objectlength,0) + \facefactor*(0.2,0) + \trafficfactor*\facefactor*(0,-0.35)$) --% ++($(0,-0.04) + \facefactor*(-0.1,0)$) -- ++(0,0.08) -- cycle;% arrow }{}% %% label \ifdefstring{\labelcontent}{}{}{% label NOT empty - \node[fill=\background,text=\foreground,inner sep=1pt] at ($\facefactor*(0,-0.35)$) {\tiny \labelcontent};% + \node[fill=background,text=foreground,inner sep=1pt] at ($\facefactor*(0,-0.35)$) {\tiny \labelcontent};% \ifdefstring{\face}{bidirectional}{% bidirectional \pgfmathsetmacro{\facefactor}{1}% - \node[fill=\background,text=\foreground,inner sep=1pt] at ($\facefactor*(0,-0.35)$) {\tiny \labelcontent};% + \node[fill=background,text=foreground,inner sep=1pt] at ($\facefactor*(0,-0.35)$) {\tiny \labelcontent};% }{}% }% }},% END pics/train_berth/.style args={#1/#2/#3} @@ -157,8 +149,8 @@ %% command \newcommand\trackdistance{}% just for safety \def\trackdistance#1(#2)#3(#4)#5(#6){% \trackdistance between (coord1) and (coord2) distance (distance); - \path[draw=\background,<->,>={Stealth[\foreground,inset=0pt,angle=50:0.2cm]},shorten <=1pt,shorten >=1pt] (#2) -- (#4)% arrow tips - node[hectometer base=(current bounding box.center),text=\foreground,midway,sloped,rotate=90] {#6};% label + \path[draw=background,<->,>={Stealth[foreground,inset=0pt,angle=50:0.2cm]},shorten <=1pt,shorten >=1pt] (#2) -- (#4)% arrow tips + node[hectometer base=(current bounding box.center),text=foreground,midway,sloped,rotate=90] {#6};% label }% % symbology entry \tikzset{% @@ -230,7 +222,7 @@ (0,0) -- (ts-hm-b1) -- (ts-hm-b2) -- (ts-hm-l);% %% label \ifdefstring{\labelcontent}{}{}{% label NOT empty - \node[font=\sffamily,text=\hectometercolor,rotate=-90,\orientation,align=\align,fill=\background] at (ts-hm-l) {\labelcontent};% + \node[font=\sffamily,text=\hectometercolor,rotate=-90,\orientation,align=\align,fill=background] at (ts-hm-l) {\labelcontent};% }% }},% END % symbology entry diff --git a/src/tikzlibrarytrackschematic.topology.code.tex b/src/tikzlibrarytrackschematic.topology.code.tex index 4d98af5..c0e5f1a 100644 --- a/src/tikzlibrarytrackschematic.topology.code.tex +++ b/src/tikzlibrarytrackschematic.topology.code.tex @@ -18,14 +18,6 @@ \pgfkeys{% /tikz/trackschematic/.is family,% /tikz/trackschematic/.cd,% - %% color foreground - foreground/.store in=\foreground,% - foreground=black,% DEFAULT - /tikz/foreground/.forward to=/tikz/trackschematic/foreground,% - %% color background - background/.store in=\background,% - background=white,% DEFAULT - /tikz/background/.forward to=/tikz/trackschematic/background,% %% face face/.value required,% forward OR backward face/.store in=\face,% @@ -67,11 +59,11 @@ % % commands \newcommand\maintrack{}% just for safety -\def\maintrack{\path[draw=\foreground,MainTrack]}% \maintrack (coord1) -- (coord2); +\def\maintrack{\path[draw=foreground,MainTrack]}% \maintrack (coord1) -- (coord2); \newcommand\secondarytrack{}% just for safety -\def\secondarytrack{\path[draw=\foreground,SecondaryTrack]}% \secondarytrack (coord1) -- (coord2); +\def\secondarytrack{\path[draw=foreground,SecondaryTrack]}% \secondarytrack (coord1) -- (coord2); \newcommand\sidetrack{}% just for safety -\def\sidetrack{\path[draw=\foreground,SecondaryTrack]}% alias for \secondarytrack +\def\sidetrack{\path[draw=foreground,SecondaryTrack]}% alias for \secondarytrack % %% symbol definition \tikzset{% @@ -109,7 +101,7 @@ \def\labelcontent{#3} %% label \ifdefstring{\labelcontent}{}{}{% label NOT empty - \tikzset{every node/.style={fill=\background,text=\foreground}};% + \tikzset{every node/.style={fill=background,text=foreground}};% \coordinate (ts-tl-l) at (0,0);% \ifdefstring{\labelcoord}{(none)}{% default coord }{% initialize if NOT default @@ -163,12 +155,12 @@ }% end \ifdefstring{\face} %% symbol \ifdefstring{\friction}{none}{% none friction - \path[draw=\foreground, line width=1pt]% + \path[draw=foreground, line width=1pt]% ($\facefactor*(-0.1,0) + (0,0.2)$) -- ++($\facefactor*( 0.1,0)$) -- ++(0,-0.4) -- ++ ($\facefactor*(-0.1,0)$);% bufferstop marker }{% friction - \path[draw=\foreground, line width=1pt]% + \path[draw=foreground, line width=1pt]% ($\facefactor*(-\friction,0) + \facefactor*(-0.05,0) + (0,0.2)$) -- ++($\facefactor*(0.1,0)$) -- ++(0,-0.4) -- ++ ($\facefactor*(-0.1,0)$);% bufferstop marker - \fill[\foreground] (0,0) circle (0.06);% track closure indicator + \fill[foreground] (0,0) circle (0.06);% track closure indicator }% }},% END pics/bufferstop/.style args={#1} % @@ -200,8 +192,8 @@ %% settings \def\coordcommand{#1} % beware of leading and tailing spaces! %% - \fill[\foreground] (0,0) circle (0.06);% track closure indicator - % \path[fill=\foreground] (0.04,0.02) -- (0.04,-0.02) -- (0.02,-0.04) -- (-0.02,-0.04) -- (-0.04,-0.02) -- (-0.04,0.02) -- (-0.02,0.04) -- (0.02,0.04) -- cycle;% label + \fill[foreground] (0,0) circle (0.06);% track closure indicator + % \path[fill=foreground] (0.04,0.02) -- (0.04,-0.02) -- (0.02,-0.04) -- (-0.02,-0.04) -- (-0.04,-0.02) -- (-0.04,0.02) -- (-0.02,0.04) -- (0.02,0.04) -- cycle;% label }},% END pics/track_closure/.style args={#1} % % symbology entry @@ -272,13 +264,13 @@ \def\patterntype{north east lines}% }% }% - \path[draw=\foreground,pattern=\patterntype, pattern color=\foreground] (0,0) -- ++($\facefactor*(0.4,0)$) -- ++($\branchfactor*(0,0.4)$) -- cycle;% turnout marker + \path[draw=foreground,pattern=\patterntype, pattern color=foreground] (0,0) -- ++($\facefactor*(0.4,0)$) -- ++($\branchfactor*(0,0.4)$) -- cycle;% turnout marker }{% \ifdefstring{\operationmode}{remote}{% operation=remote - \path[fill=\foreground] (0,0) -- ++($\facefactor*(0.4,0)$) -- ++($\branchfactor*(0,0.4)$) -- cycle;% turnout marker + \path[fill=foreground] (0,0) -- ++($\facefactor*(0.4,0)$) -- ++($\branchfactor*(0,0.4)$) -- cycle;% turnout marker }{% \ifdefstring{\operationmode}{none}{ - \path[draw=\foreground] (0,0) -- ++($\facefactor*(0.4,0)$) -- ++($\branchfactor*(0,0.4)$) -- cycle;% turnout marker + \path[draw=foreground] (0,0) -- ++($\facefactor*(0.4,0)$) -- ++($\branchfactor*(0,0.4)$) -- cycle;% turnout marker }{% \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/operation}{“manual“, “remote“ OR “none“ as key required}}% }% @@ -287,7 +279,7 @@ % %% label \ifdefstring{\labelcontent}{}{}{% label NOT empty - \tikzset{every node/.style={text=\foreground}};% + \tikzset{every node/.style={text=foreground}};% \coordinate (ts-y-l) at ($\branchfactor*(0,-8pt)$);% \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default \path let \p1=\labelcoord in coordinate (ts-y-l) at ($(ts-y-l)+(\x1,\y1)$);% @@ -297,29 +289,29 @@ % %% fouling point indicator \iftoggle{fouling_point}{% - \path[draw=\foreground] ($\facefactor*(0.7,0)$) -- ++($\branchfactor*(0,0.7)$);% fouling point indicator + \path[draw=foreground] ($\facefactor*(0.7,0)$) -- ++($\branchfactor*(0,0.7)$);% fouling point indicator }{}% % %% points \ifdefstring{\points}{left}{% points left \ifdefstring{\branch}{left}{% - \path[draw=\foreground,line width=1.5pt] ($\facefactor*(-0.035,0)+(0,0.1)$) -- ++($\facefactor*(0.2,0)+(0,0.2)$);% + \path[draw=foreground,line width=1.5pt] ($\facefactor*(-0.035,0)+(0,0.1)$) -- ++($\facefactor*(0.2,0)+(0,0.2)$);% }{% - \path[draw=\foreground,line width=1.5pt] ($\facefactor*( 0.035,0)+(0,0.1)$) -- ++($\facefactor*( 0.265,0 )$);% + \path[draw=foreground,line width=1.5pt] ($\facefactor*( 0.035,0)+(0,0.1)$) -- ++($\facefactor*( 0.265,0 )$);% }% }{% \ifdefstring{\points}{right}{% points right \ifdefstring{\branch}{left}{% - \path[draw=\foreground,line width=1.5pt] ($\facefactor*( 0.035,0)+(0,-0.1)$) -- ++($\facefactor*( 0.265,0 )$);% + \path[draw=foreground,line width=1.5pt] ($\facefactor*( 0.035,0)+(0,-0.1)$) -- ++($\facefactor*( 0.265,0 )$);% }{% - \path[draw=\foreground,line width=1.5pt] ($\facefactor*(-0.035,0)+(0,-0.1)$) -- ++($\facefactor*(0.2,0)+(0,-0.2)$);% + \path[draw=foreground,line width=1.5pt] ($\facefactor*(-0.035,0)+(0,-0.1)$) -- ++($\facefactor*(0.2,0)+(0,-0.2)$);% }% }{% \ifdefstring{\points}{moving}{% moving points - \fill[\foreground] ($\facefactor*(0.075,0) + \branchfactor*(0,-0.1 )$) circle (0.05);% points indicator left - \fill[\foreground] ($\facefactor*(0.225,0) + \branchfactor*(0,-0.1 )$) circle (0.05);% points indicator left - \fill[\foreground] ($\facefactor*(0.015,0) + \branchfactor*(0, 0.15)$) circle (0.05);% points indicator right - \fill[\foreground] ($\facefactor*(0.115,0) + \branchfactor*(0, 0.25)$) circle (0.05);% points indicator right + \fill[foreground] ($\facefactor*(0.075,0) + \branchfactor*(0,-0.1 )$) circle (0.05);% points indicator left + \fill[foreground] ($\facefactor*(0.225,0) + \branchfactor*(0,-0.1 )$) circle (0.05);% points indicator left + \fill[foreground] ($\facefactor*(0.015,0) + \branchfactor*(0, 0.15)$) circle (0.05);% points indicator right + \fill[foreground] ($\facefactor*(0.115,0) + \branchfactor*(0, 0.25)$) circle (0.05);% points indicator right }{% error message \ifdefstring{\points}{none}{% }{% @@ -413,12 +405,12 @@ }{% \def\patterntype{north east lines}% }% - \path[draw,pattern=\patterntype, pattern color=\foreground] (0,0) -- ++($( 0.4,0)$) -- ++($\branchfactor*(0, 0.4)$) -- cycle;% turnout marker - \path[draw,pattern=\patterntype, pattern color=\foreground] (0,0) -- ++($(-0.4,0)$) -- ++($\branchfactor*(0,-0.4)$) -- cycle;% turnout marker + \path[draw,pattern=\patterntype, pattern color=foreground] (0,0) -- ++($( 0.4,0)$) -- ++($\branchfactor*(0, 0.4)$) -- cycle;% turnout marker + \path[draw,pattern=\patterntype, pattern color=foreground] (0,0) -- ++($(-0.4,0)$) -- ++($\branchfactor*(0,-0.4)$) -- cycle;% turnout marker }{% operated automaticly \ifdefstring{\operationmode}{remote}{% operation=remote - \path[fill=\foreground] (0,0) -- ++($( 0.4,0)$) -- ++($\branchfactor*(0, 0.4)$) -- cycle;% turnout marker - \path[fill=\foreground] (0,0) -- ++($(-0.4,0)$) -- ++($\branchfactor*(0,-0.4)$) -- cycle;% turnout marker + \path[fill=foreground] (0,0) -- ++($( 0.4,0)$) -- ++($\branchfactor*(0, 0.4)$) -- cycle;% turnout marker + \path[fill=foreground] (0,0) -- ++($(-0.4,0)$) -- ++($\branchfactor*(0,-0.4)$) -- cycle;% turnout marker }{% \ifdefstring{\operationmode}{none}{}{% \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/operation}{“manual“, “remote“ OR “none“ as key required}}% @@ -427,30 +419,30 @@ }% %% fouling point indicator \iftoggle{fouling_point}{% - \path[draw=\foreground] ( 0.7,0) -- ++($\branchfactor*(0, 0.7)$);% fouling point indicator - \path[draw=\foreground] (-0.7,0) -- ++($\branchfactor*(0,-0.7)$);% fouling point indicator + \path[draw=foreground] ( 0.7,0) -- ++($\branchfactor*(0, 0.7)$);% fouling point indicator + \path[draw=foreground] (-0.7,0) -- ++($\branchfactor*(0,-0.7)$);% fouling point indicator }{}% % %% points \ifdefstring{\forwardpoints}{left}{% points left \ifdefstring{\branch}{left}{% - \path[draw=\foreground,line width=1.5pt] (-0.035,0.1) -- ++(0.2,0.2);% + \path[draw=foreground,line width=1.5pt] (-0.035,0.1) -- ++(0.2,0.2);% }{% - \path[draw=\foreground,line width=1.5pt] ( 0.035,0.1) -- ++(0.265,0);% + \path[draw=foreground,line width=1.5pt] ( 0.035,0.1) -- ++(0.265,0);% }% }{% \ifdefstring{\forwardpoints}{right}{% points right \ifdefstring{\branch}{left}{% - \path[draw=\foreground,line width=1.5pt] ( 0.035,-0.1) -- ++(0.265,0); + \path[draw=foreground,line width=1.5pt] ( 0.035,-0.1) -- ++(0.265,0); }{% - \path[draw=\foreground,line width=1.5pt] (-0.035,-0.1) -- ++(0.2,-0.2);% + \path[draw=foreground,line width=1.5pt] (-0.035,-0.1) -- ++(0.2,-0.2);% }% }{% \ifdefstring{\forwardpoints}{moving}{% moving points - \fill[\foreground] ($(0.075,0) + \branchfactor*(0,-0.1 )$) circle (0.05);% points indicator left - \fill[\foreground] ($(0.225,0) + \branchfactor*(0,-0.1 )$) circle (0.05);% points indicator left - \fill[\foreground] ($(0.015,0) + \branchfactor*(0, 0.15)$) circle (0.05);% points indicator right - \fill[\foreground] ($(0.115,0) + \branchfactor*(0, 0.25)$) circle (0.05);% points indicator right + \fill[foreground] ($(0.075,0) + \branchfactor*(0,-0.1 )$) circle (0.05);% points indicator left + \fill[foreground] ($(0.225,0) + \branchfactor*(0,-0.1 )$) circle (0.05);% points indicator left + \fill[foreground] ($(0.015,0) + \branchfactor*(0, 0.15)$) circle (0.05);% points indicator right + \fill[foreground] ($(0.115,0) + \branchfactor*(0, 0.25)$) circle (0.05);% points indicator right }{% error message \ifdefstring{\forwardpoints}{none}{% }{% @@ -461,23 +453,23 @@ }% end of \ifdefstring{\forwardpoints} \ifdefstring{\backwardpoints}{left}{% points left \ifdefstring{\branch}{left}{% - \path[draw=\foreground,line width=1.5pt] (0.035,-0.1) -- ++(-0.2,-0.2);% + \path[draw=foreground,line width=1.5pt] (0.035,-0.1) -- ++(-0.2,-0.2);% }{% - \path[draw=\foreground,line width=1.5pt] (-0.035,-0.1) -- ++(-0.265,0);% + \path[draw=foreground,line width=1.5pt] (-0.035,-0.1) -- ++(-0.265,0);% }% }{% \ifdefstring{\backwardpoints}{right}{% points right \ifdefstring{\branch}{left}{% - \path[draw=\foreground,line width=1.5pt] (-0.035,0.1) -- ++(-0.265,0); + \path[draw=foreground,line width=1.5pt] (-0.035,0.1) -- ++(-0.265,0); }{% - \path[draw=\foreground,line width=1.5pt] (0.035,0.1) -- ++(-0.2,0.2);% + \path[draw=foreground,line width=1.5pt] (0.035,0.1) -- ++(-0.2,0.2);% }% }{% \ifdefstring{\backwardpoints}{moving}{% moving points - \fill[\foreground] ($(-0.075,0) + \branchfactor*(0, 0.1 )$) circle (0.05);% points indicator left - \fill[\foreground] ($(-0.225,0) + \branchfactor*(0, 0.1 )$) circle (0.05);% points indicator left - \fill[\foreground] ($(-0.015,0) + \branchfactor*(0,-0.15)$) circle (0.05);% points indicator right - \fill[\foreground] ($(-0.115,0) + \branchfactor*(0,-0.25)$) circle (0.05);% points indicator right + \fill[foreground] ($(-0.075,0) + \branchfactor*(0, 0.1 )$) circle (0.05);% points indicator left + \fill[foreground] ($(-0.225,0) + \branchfactor*(0, 0.1 )$) circle (0.05);% points indicator left + \fill[foreground] ($(-0.015,0) + \branchfactor*(0,-0.15)$) circle (0.05);% points indicator right + \fill[foreground] ($(-0.115,0) + \branchfactor*(0,-0.25)$) circle (0.05);% points indicator right }{% error message \ifdefstring{\backwardpoints}{none}{% }{% @@ -489,14 +481,14 @@ % %% slips \ifdefstring{\slip}{double}{% slip - \path[draw=\foreground,line width=0.75pt] ($\branchfactor*(-0.4,0) + (0, 0.1)$) -- ($\branchfactor*( 0.3,0) + (0, 0.4)$);% slip - \path[draw=\foreground,line width=0.75pt] ($\branchfactor*( 0.4,0) + (0,-0.1)$) -- ($\branchfactor*(-0.3,0) + (0,-0.4)$);% slip + \path[draw=foreground,line width=0.75pt] ($\branchfactor*(-0.4,0) + (0, 0.1)$) -- ($\branchfactor*( 0.3,0) + (0, 0.4)$);% slip + \path[draw=foreground,line width=0.75pt] ($\branchfactor*( 0.4,0) + (0,-0.1)$) -- ($\branchfactor*(-0.3,0) + (0,-0.4)$);% slip }{% \ifdefstring{\slip}{left}{% - \path[draw=\foreground,line width=0.75pt] ($\branchfactor*(-0.4,0) + (0,0.1)$) -- ($\branchfactor*(0.3,0) + (0,0.4)$);% slip + \path[draw=foreground,line width=0.75pt] ($\branchfactor*(-0.4,0) + (0,0.1)$) -- ($\branchfactor*(0.3,0) + (0,0.4)$);% slip }{% \ifdefstring{\slip}{right}{% - \path[draw=\foreground,line width=0.75pt] ($\branchfactor*(0.4,0) + (0,-0.1)$) -- ($\branchfactor*(-0.3,0) + (0,-0.4)$);% slip + \path[draw=foreground,line width=0.75pt] ($\branchfactor*(0.4,0) + (0,-0.1)$) -- ($\branchfactor*(-0.3,0) + (0,-0.4)$);% slip }{% \ifdefstring{\slip}{none}{% % @@ -508,7 +500,7 @@ }% % %% label - \tikzset{every node/.style={text=\foreground}};% + \tikzset{every node/.style={text=foreground}};% \ifdefstring{\labelcontentleft}{}{}{% label NOT empty \coordinate (ts-sy-l1) at ($(2pt,0) + \branchfactor*(0, 10pt)$);% \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default @@ -563,12 +555,12 @@ }% % %% crossing marker - \path[draw=\foreground] (0,0) -- ++( 0.4,0) -- ++($\branchfactor*(0, 0.4)$) -- cycle;% turnout marker - \path[draw=\foreground] (0,0) -- ++(-0.4,0) -- ++($\branchfactor*(0,-0.4)$) -- cycle;% turnout marker + \path[draw=foreground] (0,0) -- ++( 0.4,0) -- ++($\branchfactor*(0, 0.4)$) -- cycle;% turnout marker + \path[draw=foreground] (0,0) -- ++(-0.4,0) -- ++($\branchfactor*(0,-0.4)$) -- cycle;% turnout marker % %% label \ifdefstring{\labelcontent}{}{}{% label NOT empty - \tikzset{every node/.style={text=\foreground}};% + \tikzset{every node/.style={text=foreground}};% \coordinate (ts-x-l) at ($(2pt,0) + \branchfactor*(0,-9pt)$);% \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default \path let \p1=\labelcoord in coordinate (ts-x-l) at ($(ts-x-l)+(\x1,\y1)$);% @@ -578,8 +570,8 @@ % %% fouling point indicator \iftoggle{fouling_point}{% - \path[draw=\foreground] ( 0.7,0) -- ++($\branchfactor*(0, 0.7)$);% fouling point indicator - \path[draw=\foreground] (-0.7,0) -- ++($\branchfactor*(0,-0.7)$);% fouling point indicator + \path[draw=foreground] ( 0.7,0) -- ++($\branchfactor*(0, 0.7)$);% fouling point indicator + \path[draw=foreground] (-0.7,0) -- ++($\branchfactor*(0,-0.7)$);% fouling point indicator }{}% % }},% end of pics/crossing/.style args={#1/#2/#3} @@ -639,12 +631,12 @@ }% end \ifdefstring{\branch} % %% symbol - \path[draw=\foreground, line width=1pt] (0,0.1) -- ++(0,-0.2);% derailer marker - \path[draw=\foreground,->,>=latex,line width=1pt,dashed] (0,0) -- ++($\facefactor*(0.4,0) + \branchfactor*(0,0.4)$);% derailer arrow + \path[draw=foreground, line width=1pt] (0,0.1) -- ++(0,-0.2);% derailer marker + \path[draw=foreground,->,>=latex,line width=1pt,dashed] (0,0) -- ++($\facefactor*(0.4,0) + \branchfactor*(0,0.4)$);% derailer arrow % %% label \ifdefstring{\labelcontent}{}{}{% label NOT empty - \tikzset{every node/.style={text=\foreground}};% + \tikzset{every node/.style={text=foreground}};% \coordinate (ts-dr-l) at ($\branchfactor*(0,-0.3)$);% \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default \path let \p1=\labelcoord in coordinate (ts-dr-l) at ($(ts-dr-l)+(\x1,\y1)$);% diff --git a/src/tikzlibrarytrackschematic.trafficcontrol.code.tex b/src/tikzlibrarytrackschematic.trafficcontrol.code.tex index 253c5e2..8e6c99d 100644 --- a/src/tikzlibrarytrackschematic.trafficcontrol.code.tex +++ b/src/tikzlibrarytrackschematic.trafficcontrol.code.tex @@ -18,14 +18,6 @@ \pgfkeys{% /tikz/trackschematic/.is family,% /tikz/trackschematic/.cd,% - %% color \foreground - foreground/.store in=\foreground,% - foreground=black,% DEFAULT - /tikz/foreground/.forward to=/tikz/trackschematic/foreground,% - %% color \background - background/.store in=\background,% - background=white,% DEFAULT - /tikz/background/.forward to=/tikz/trackschematic/background,% %% face face/.value required,% forward OR backward face/.store in=\face,% forward OR backward @@ -189,8 +181,8 @@ \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/face}{“forward“ OR “backward“ as key required}}% }% }% end \ifdefstring{\face} - \tikzset{every path/.style={draw=\foreground,line width=1pt}};% - \tikzset{every node/.style={text=\foreground,inner sep=1pt}};% + \tikzset{every path/.style={draw=foreground,line width=1pt}};% + \tikzset{every node/.style={text=foreground,inner sep=1pt}};% %% signal pole \path (0,0) -- ++($\trafficfactor*\facefactor*(0,-0.4)$) -- ++($\facefactor*(0.7,0)$);% signal pole % @@ -202,7 +194,7 @@ }% \node[\align] at (ts-s-l) {\footnotesize \labelcontent};% }% - \tikzset{every path/.style={draw=\foreground,line width=1pt,fill=\background},rounded corners=0.1pt};% + \tikzset{every path/.style={draw=foreground,line width=1pt,fill=background},rounded corners=0.1pt};% %% signal marker \iftoggle{is_distant_type}{% marker for distant signal \path ($\trafficfactor*\facefactor*(0,-0.4) + \facefactor*(0.35,0)$) --% @@ -250,7 +242,7 @@ }{}% %% speed indicator \ifdefstring{\speed}{}{}{% speed NOT empty - \tikzset{every node/.style={font=\sffamily,text=\foreground}};% + \tikzset{every node/.style={font=\sffamily,text=foreground}};% \iftoggle{is_speed_type}{% marker for speed signal \node[rotate=\rotate] at ($\trafficfactor*\facefactor*(0,-0.4) + \facefactor*(0.85,0)$) {\speed};% }{% @@ -260,7 +252,7 @@ }% }% \ifdefstring{\distantspeed}{}{}{% distant speed NOT empty - \tikzset{every node/.style={font=\sffamily,text=\foreground,fill=\background,inner sep=0.5pt}};% + \tikzset{every node/.style={font=\sffamily,text=foreground,fill=background,inner sep=0.5pt}};% \node[rotate=\rotate] at ($\trafficfactor*\facefactor*(0,-0.4) + \facefactor*(0.2,0)$) {\distantspeed};% }% %% locked @@ -382,7 +374,7 @@ }{% default case \pgfmathsetmacro{\facefactor}{1}% }% end \ifdefstring{\face} - \tikzset{every path/.style={draw=\foreground,line width=1pt}};% + \tikzset{every path/.style={draw=foreground,line width=1pt}};% %% marker \path ($\trafficfactor*\facefactor*(0,-0.1)$) -- ++($\trafficfactor*\facefactor*(0,0.2)$);% marker %% sign @@ -400,7 +392,7 @@ }{}% %% label \ifdefstring{\labelcontent}{}{}{% label NOT empty - \tikzset{every node/.style={font=\sffamily,text=\foreground}};% + \tikzset{every node/.style={font=\sffamily,text=foreground}};% \coordinate (ts-cp-l) at ($\trafficfactor*\facefactor*(0,0.25)$);% \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default \path let \p1=\labelcoord in coordinate (ts-cp-l) at ($(ts-cp-l)+(\x1,\y1)$);% @@ -452,11 +444,11 @@ }% }% end \ifdefstring{\trafficpractice} %% marker - \tikzset{every path/.style={draw=\foreground}};% + \tikzset{every path/.style={draw=foreground}};% \path[line width=1pt] ($\trafficfactor*(0,-0.175)$) -- ++(-0.0625,-0.0625) -- ++(-0.2,0) -- ++(-0.125,0.125) -- ++(-0.1,0) -- ++(0,-0.125) -- ++(0.1,0) -- ++(0.125,0.125) -- ++(0.2,0) -- ++(0.125,-0.125) -- ++(0.2,0) -- ++(0.125,0.125) -- ++(0.1,0) -- ++(0,-0.125) -- ++(-0.1,0) -- ++(-0.125,0.125) -- ++(-0.2,0) -- cycle;% loop marker %% label \ifdefstring{\labelcontent}{}{}{% label NOT empty - \tikzset{every node/.style={font=\sffamily,text=\foreground}};% + \tikzset{every node/.style={font=\sffamily,text=foreground}};% \coordinate (ts-tm-l) at ($\trafficfactor*(0,0.25)$);% \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default \path let \p1=\labelcoord in coordinate (ts-tm-l) at ($(ts-tm-l)+(\x1,\y1)$);% @@ -567,54 +559,54 @@ %% %%%%%%%%%%%%%%%%%%%% %% 1. marker - \tikzset{every path/.style={draw=\foreground,line width=0.75pt,rounded corners=0.2pt}};% + \tikzset{every path/.style={draw=foreground,line width=0.75pt,rounded corners=0.2pt}};% %% \iftoggle{unnumberd}{% no number has been set %% marker for undefined balises - \path[fill=\background] ($(-0.3,0)$) rectangle ($\trafficfactor*\facefactor*(0,-0.25) + (0.3,0)$);% balise marker + \path[fill=background] ($(-0.3,0)$) rectangle ($\trafficfactor*\facefactor*(0,-0.25) + (0.3,0)$);% balise marker \iftoggle{switched}{% balises can be switched - \path[fill=\foreground] ($\trafficfactor*\facefactor*(0,-0.075) + (-0.225,0)$) rectangle% + \path[fill=foreground] ($\trafficfactor*\facefactor*(0,-0.075) + (-0.225,0)$) rectangle% ($\trafficfactor*\facefactor*(0,-0.175) + ( 0.225,0)$);% switch marker }{}% }{% a number has been set %% marker for numbered balises \ifdefstring{\along}{none}{}{ \foreach \n in \along{% - \path[fill=\background] ($\n*\facefactor*(0.2,0)$) rectangle% + \path[fill=background] ($\n*\facefactor*(0.2,0)$) rectangle% ($\n*\facefactor*(0.2,0) + (0.2 ,0) + \trafficfactor*\facefactor*(0,-0.25)$);% balise marker \iftoggle{index_number}{% - \node[text=\foreground] at ($\n*\facefactor*(0.2,0) + (0.1,0) + \trafficfactor*\facefactor*(0,-0.125)$) {\tiny\n};% + \node[text=foreground] at ($\n*\facefactor*(0.2,0) + (0.1,0) + \trafficfactor*\facefactor*(0,-0.125)$) {\tiny\n};% }{}% }% }% \ifdefstring{\oppose}{none}{}{ \foreach \n in \oppose{% - \path[fill=\background] ($\n*\facefactor*(0.2,0)$) rectangle% + \path[fill=background] ($\n*\facefactor*(0.2,0)$) rectangle% ($\n*\facefactor*(0.2,0) + (0.2 ,0) + \trafficfactor*\facefactor*(0,0.25)$);% balise marker \iftoggle{index_number}{% - \node[text=\foreground] at ($\n*\facefactor*(0.2,0) + (0.1,0) + \trafficfactor*\facefactor*(0,0.125)$) {\tiny\n};% + \node[text=foreground] at ($\n*\facefactor*(0.2,0) + (0.1,0) + \trafficfactor*\facefactor*(0,0.125)$) {\tiny\n};% }{}% }% }% \ifdefstring{\alongswitched}{none}{}{ \foreach \n in \alongswitched{% - \path[fill=\background] ($\n*\facefactor*(0.2,0)$) rectangle% + \path[fill=background] ($\n*\facefactor*(0.2,0)$) rectangle% ($\n*\facefactor*(0.2,0) + (0.2 ,0) + \trafficfactor*\facefactor*(0,-0.25)$);% balise marker - \path[fill=\foreground] ($\n*\facefactor*(0.2,0) + (0.05,0) + \trafficfactor*\facefactor*(0,-0.05)$) rectangle% + \path[fill=foreground] ($\n*\facefactor*(0.2,0) + (0.05,0) + \trafficfactor*\facefactor*(0,-0.05)$) rectangle% ($\n*\facefactor*(0.2,0) + (0.15,0) + \trafficfactor*\facefactor*(0,-0.2)$);% switch marker \iftoggle{index_number}{% - \node[text=\background] at ($\n*\facefactor*(0.2,0) + (0.1,0) + \trafficfactor*\facefactor*(0,-0.125)$) {\tiny\n};% + \node[text=background] at ($\n*\facefactor*(0.2,0) + (0.1,0) + \trafficfactor*\facefactor*(0,-0.125)$) {\tiny\n};% }{}% }% }% \ifdefstring{\opposeswitched}{none}{}{ \foreach \n in \opposeswitched{% - \path[fill=\background] ($\n*\facefactor*(0.2,0)$) rectangle% + \path[fill=background] ($\n*\facefactor*(0.2,0)$) rectangle% ($\n*\facefactor*(0.2,0) + (0.2 ,0) + \trafficfactor*\facefactor*(0,0.25)$);% balise marker - \path[fill=\foreground] ($\n*\facefactor*(0.2,0) + (0.05,0) + \trafficfactor*\facefactor*(0,0.05)$) rectangle% + \path[fill=foreground] ($\n*\facefactor*(0.2,0) + (0.05,0) + \trafficfactor*\facefactor*(0,0.05)$) rectangle% ($\n*\facefactor*(0.2,0) + (0.15,0) + \trafficfactor*\facefactor*(0,0.2)$);% switch marker \iftoggle{index_number}{% - \node[text=\background] at ($\n*\facefactor*(0.2,0) + (0.1,0) + \trafficfactor*\facefactor*(0,0.125)$) {\tiny\n};% + \node[text=background] at ($\n*\facefactor*(0.2,0) + (0.1,0) + \trafficfactor*\facefactor*(0,0.125)$) {\tiny\n};% }{}% }% }% @@ -633,7 +625,7 @@ \path let \p1=\labelcoord in coordinate (label-coord) at ($(label-coord)+(\x1,\y1)$);% }% %% label style - \tikzset{every node/.style={font=\sffamily,text=\foreground}};% + \tikzset{every node/.style={font=\sffamily,text=foreground}};% % \ifdefstring{\trafficpractice}{left}{% \tikzset{every node/.append style={left,align=right}};% @@ -695,11 +687,11 @@ }% }% end \ifdefstring{\trafficpractice} %% arrow - \path[draw=\foreground,<-,>=latex,line width=1pt]% + \path[draw=foreground,<-,>=latex,line width=1pt]% ($\facefactor*\trafficfactor*(0,-0.1)$) -- ++($\facefactor*\trafficfactor*(0,-0.3)$) -- ++($\facefactor*(0.2,0)$);% arrow %% eye - \filldraw[\foreground] ($\facefactor*(0.4,0) + \facefactor*\trafficfactor*(0,-0.4)$) circle (0.1);% pupil - \path[draw=\foreground, line width=1pt]% eye contour + \filldraw[foreground] ($\facefactor*(0.4,0) + \facefactor*\trafficfactor*(0,-0.4)$) circle (0.1);% pupil + \path[draw=foreground, line width=1pt]% eye contour ($\facefactor*(0.4, 0) + \facefactor*\trafficfactor*(0,-0.15)$) .. controls% ($\facefactor*(0.25,0) + \facefactor*\trafficfactor*(0,-0.25)$) and% ($\facefactor*(0.25,0) + \facefactor*\trafficfactor*(0,-0.55)$) ..% @@ -754,16 +746,16 @@ \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/face}{“forward“ OR “backward“ as key required}}% }% }% end \ifdefstring{\face} - \tikzset{every path/.style={draw=\foreground,line width=1pt}};% + \tikzset{every path/.style={draw=foreground,line width=1pt}};% %% marker \path ($\trafficfactor*\facefactor*(0,-0.55) + \facefactor*(0.3,0)$) rectangle% ++($\trafficfactor*\facefactor*(0, 0.3) + \facefactor*(0.3,0)$);% %% arrow - \path[draw=\foreground,<-,>=latex,line width=1pt]% + \path[draw=foreground,<-,>=latex,line width=1pt]% ($\facefactor*\trafficfactor*(0,-0.1)$) -- ++($\facefactor*\trafficfactor*(0,-0.3)$) -- ++($\facefactor*(0.2,0)$);% arrow %% label \ifdefstring{\labelcontent}{}{}{% label NOT empty - \tikzset{every node/.style={font=\sffamily,text=\foreground}};% + \tikzset{every node/.style={font=\sffamily,text=foreground}};% \coordinate (ts-ma-l) at ($\trafficfactor*\facefactor*(0,-0.6) + \facefactor*(0.3,0)$);% \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default \path let \p1=\labelcoord in coordinate (ts-ma-l) at ($(ts-ma-l)+(\x1,\y1)$);% @@ -817,17 +809,17 @@ \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/face}{“forward“ OR “backward“ as key required}}% }% }% end \ifdefstring{\face} - \tikzset{every path/.style={draw=\foreground,line width=1pt}};% + \tikzset{every path/.style={draw=foreground,line width=1pt}};% %% marker \path ($\trafficfactor*\facefactor*(0,-0.4) + \facefactor*(0.3,0)$) --% ++($\trafficfactor*\facefactor*(0,-0.15) + \facefactor*(0.25,0)$) --% ++($\trafficfactor*\facefactor*(0, 0.3)$) -- cycle;% signal marker %% arrow - \path[draw=\foreground,<-,>=latex,line width=1pt]% + \path[draw=foreground,<-,>=latex,line width=1pt]% ($\facefactor*\trafficfactor*(0,-0.1)$) -- ++($\facefactor*\trafficfactor*(0,-0.3)$) -- ++($\facefactor*(0.2,0)$);% arrow %% label \ifdefstring{\labelcontent}{}{}{% label NOT empty - \tikzset{every node/.style={font=\sffamily,text=\foreground}};% + \tikzset{every node/.style={font=\sffamily,text=foreground}};% \coordinate (ts-bp-l) at ($\trafficfactor*\facefactor*(0,-0.6) + \facefactor*(0.3,0)$);% \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default \path let \p1=\labelcoord in coordinate (ts-bp-l) at ($(ts-bp-l)+(\x1,\y1)$);% @@ -881,18 +873,18 @@ \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/face}{“forward“ OR “backward“ as key required}}% }% }% end \ifdefstring{\face} - \tikzset{every path/.style={draw=\foreground,line width=1pt}};% + \tikzset{every path/.style={draw=foreground,line width=1pt}};% %% marker \path ($\trafficfactor*\facefactor*(0,-0.4)$) --% ++($\trafficfactor*\facefactor*(0,-0.1) + \facefactor*(-0.1,0)$) --% ++($\trafficfactor*\facefactor*(0,-0.1) + \facefactor*( 0.1,0)$) --% ++($\trafficfactor*\facefactor*(0, 0.1) + \facefactor*( 0.1,0)$) -- cycle;% sign %% arrow - \path[draw=\foreground,<-,>=latex,line width=1pt]% + \path[draw=foreground,<-,>=latex,line width=1pt]% ($\facefactor*\trafficfactor*(0,-0.1)$) -- ++($\facefactor*\trafficfactor*(0,-0.25)$);% arrow %% label \ifdefstring{\labelcontent}{}{}{% label NOT empty - \tikzset{every node/.style={font=\sffamily,text=\foreground}};% + \tikzset{every node/.style={font=\sffamily,text=foreground}};% \coordinate (ts-dp-l) at ($\trafficfactor*\facefactor*(0,0.25)$);% \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default \path let \p1=\labelcoord in coordinate (ts-dp-l) at ($(ts-dp-l)+(\x1,\y1)$);% @@ -932,7 +924,7 @@ }% }% end \ifdefstring{\face} %% symbol - \fill[\foreground] ($\facefactor*(-0.175,0)+(0,-0.15)$) --% + \fill[foreground] ($\facefactor*(-0.175,0)+(0,-0.15)$) --% ($\facefactor*(-0.175,0)+(0, 0.15)$) --% ($\facefactor*( 0.175,0)+(0, 0 )$) -- cycle;% }},% END pics/route/.style args={#1} @@ -971,31 +963,31 @@ % %% face setup \ifdefstring{\face}{forward}{% face - \path[draw=\foreground,line width=0.5pt,densely dotted]% + \path[draw=foreground,line width=0.5pt,densely dotted]% ($\trafficfactor*(0,0.1) + (-0.0125,0)$) -- ($\trafficfactor*(0,0.25) + (-0.2125,0)$) -- ($\trafficfactor*(0,0.4) + (-0.0125,0)$) --% ($\trafficfactor*(0,0.325) + (-0.0125,0)$) -- ($\trafficfactor*(0,0.325) + (0.1875,0)$) -- ($\trafficfactor*(0,0.175) + (0.1875,0)$) --% ($\trafficfactor*(0,0.175) + (-0.0125,0)$) -- cycle;% arrow backward - \fill[\foreground]% + \fill[foreground]% ($\trafficfactor*(0,-0.1) + (0.0125,0)$) -- ($\trafficfactor*(0,-0.25) + (0.2125,0)$) -- ($\trafficfactor*(0,-0.4) + (0.0125,0)$) --% ($\trafficfactor*(0,-0.325) + (0.0125,0)$) -- ($\trafficfactor*(0,-0.325)+(-0.1875,0)$) -- ($\trafficfactor*(0,-0.175) + (-0.1875,0)$) --% ($\trafficfactor*(0,-0.175) + (0.0125,0)$) -- cycle;% arrow forward }{% \ifdefstring{\face}{backward}{% face - \fill[\foreground]% + \fill[foreground]% ($\trafficfactor*(0,0.1) + (-0.0125,0)$) -- ($\trafficfactor*(0,0.25) + (-0.2125,0)$) -- ($\trafficfactor*(0,0.4) + (-0.0125,0)$) --% ($\trafficfactor*(0,0.325) + (-0.0125,0)$) -- ($\trafficfactor*(0,0.325) + (0.1875,0)$) -- ($\trafficfactor*(0,0.175) + (0.1875,0)$) --% ($\trafficfactor*(0,0.175) + (-0.0125,0)$) -- cycle;% arrow backward - \path[draw=\foreground,line width=0.5pt,densely dotted]% + \path[draw=foreground,line width=0.5pt,densely dotted]% ($\trafficfactor*(0,-0.1) + (0.0125,0)$) -- ($\trafficfactor*(0,-0.25) + (0.2125,0)$) -- ($\trafficfactor*(0,-0.4) + (0.0125,0)$) --% ($\trafficfactor*(0,-0.325)+(0.0125,0)$) -- ($\trafficfactor*(0,-0.325)+(-0.1875,0)$) -- ($\trafficfactor*(0,-0.175) + (-0.1875,0)$) --% ($\trafficfactor*(0,-0.175) + (0.0125,0)$) -- cycle;% arrow forward }{ \ifdefstring{\face}{bidirectional}{% face - \path[draw=\foreground,line width=0.5pt]% + \path[draw=foreground,line width=0.5pt]% ($\trafficfactor*(0,0.1) + (-0.0125,0)$) -- ($\trafficfactor*(0,0.25) + (-0.2125,0)$) -- ($\trafficfactor*(0,0.4) + (-0.0125,0)$) --% ($\trafficfactor*(0,0.325) +(-0.0125,0)$) -- ($\trafficfactor*(0,0.325) +(0.1875,0)$) -- ($\trafficfactor*(0,0.175) + (0.1875,0)$) --% ($\trafficfactor*(0,0.175) + (-0.0125,0)$) -- cycle;% arrow backward - \path[draw=\foreground,line width=0.5pt]% + \path[draw=foreground,line width=0.5pt]% ($\trafficfactor*(0,-0.1) + (0.0125,0)$) -- ($\trafficfactor*(0,-0.25) + (0.2125,0)$) -- ($\trafficfactor*(0,-0.4) + (0.0125,0)$) --% ($\trafficfactor*(0,-0.325)+(0.0125,0)$) -- ($\trafficfactor*(0,-0.325)+(-0.1875,0)$) -- ($\trafficfactor*(0,-0.175)+(-0.1875,0)$) --% ($\trafficfactor*(0,-0.175) + (0.0125,0)$) -- cycle;% arrow forward @@ -1005,7 +997,7 @@ }% }% end \ifdefstring{\face} %% frame - % \path[draw=\foreground,line width=0.5pt]% + % \path[draw=foreground,line width=0.5pt]% % (-0.3, 0.1) -- (-0.3, 0.5) -- (0.3, 0.5) -- (0.3, 0.1) % (-0.3,-0.1) -- (-0.3,-0.5) -- (0.3,-0.5) -- (0.3,-0.1); }},% END pics/direction_control/.style args={#1} diff --git a/src/tikzlibrarytrackschematic.vehicles.code.tex b/src/tikzlibrarytrackschematic.vehicles.code.tex index bcf7ee4..cdb1c12 100644 --- a/src/tikzlibrarytrackschematic.vehicles.code.tex +++ b/src/tikzlibrarytrackschematic.vehicles.code.tex @@ -23,14 +23,6 @@ \pgfkeys{% /tikz/trackschematic/.is family,% /tikz/trackschematic/.cd,% - %% color foreground - foreground/.store in=\foreground,% - foreground=black,% DEFAULT - /tikz/foreground/.forward to=/tikz/trackschematic/foreground,% - %% color background - background/.store in=\background,% - background=white,% DEFAULT - /tikz/background/.forward to=/tikz/trackschematic/background,% %% face face/.value required,% forward OR backward face/.store in=\face,% @@ -274,12 +266,12 @@ %% 2. vehicle style \iftoggle{in_train_mode}{% train mode \iftoggle{train_is_a_ghost}{% ghost train - \tikzset{every path/.style={draw=\foreground, line width=0.8pt, dashed}};% + \tikzset{every path/.style={draw=foreground, line width=0.8pt, dashed}};% }{% normal train - \tikzset{every path/.style={draw=\foreground, line width=1pt, fill=\background}};% + \tikzset{every path/.style={draw=foreground, line width=1pt, fill=background}};% }% }{% shunting mode - \tikzset{every path/.style={draw=\foreground, double, double distance=0.5mm, line width=0.3pt, fill=\background}};% + \tikzset{every path/.style={draw=foreground, double, double distance=0.5mm, line width=0.3pt, fill=background}};% }% %% %%%%%%%%%%%%%%%%%%%% @@ -287,11 +279,11 @@ %% (order before vehicle shape due to background fill!) \iftoggle{is_shunting}{% arrow for shunting \iftoggle{in_shunting_mode}{% shunting mode - \fill[draw=none,fill=\background] ($\facefactor*(-0.3, 0.3)$) --% + \fill[draw=none,fill=background] ($\facefactor*(-0.3, 0.3)$) --% ($\facefactor*(-0.1, 0.3)$) --% ($\facefactor*( 0.2, 0 )$) --% ($\facefactor*(-0.1,-0.3)$) --% - ($\facefactor*(-0.3,-0.3)$) -- cycle;% \background fill + ($\facefactor*(-0.3,-0.3)$) -- cycle;% background fill \path[line cap=rect,fill=none] ($\facefactor*(-0.1, 0.3)$) --% ($\facefactor*( 0.2, 0 )$) --% ($\facefactor*(-0.1,-0.3)$);% arrow shape @@ -302,11 +294,11 @@ \ifdefstring{\trainrun}{none}{}{% DEFAULT no arrow for train \iftoggle{in_train_mode}{% train mode \ifdefstring{\trainrun}{slow}{% - \fill[draw=none,fill=\background] ($\facefactor*(-0.3, 0.3)$) --% + \fill[draw=none,fill=background] ($\facefactor*(-0.3, 0.3)$) --% ($\facefactor*(-0.1, 0.3)$) --% ($\facefactor*( 0.2, 0 )$) --% ($\facefactor*(-0.1,-0.3)$) --% - ($\facefactor*(-0.3,-0.3)$) -- cycle;% \background fill + ($\facefactor*(-0.3,-0.3)$) -- cycle;% background fill \path[fill=none] ($\facefactor*(-0.15, 0.3)$) --% ($\facefactor*(-0.1 , 0.3)$) --% ($\facefactor*( 0.2 , 0 )$) --% @@ -314,11 +306,11 @@ ($\facefactor*(-0.15,-0.3)$);% arrow shape }{% \ifdefstring{\trainrun}{normal}{% - \fill[draw=none,fill=\background] ($\facefactor*(-0.3, 0.3)$) --% + \fill[draw=none,fill=background] ($\facefactor*(-0.3, 0.3)$) --% ($\facefactor*( 0.1, 0.3)$) --% ($\facefactor*( 0.4, 0 )$) --% ($\facefactor*( 0.1,-0.3)$) --% - ($\facefactor*(-0.3,-0.3)$) -- cycle;% \background fill + ($\facefactor*(-0.3,-0.3)$) -- cycle;% background fill \path[fill=none] ($\facefactor*(-0.15, 0.3)$) --% ($\facefactor*(-0.1 , 0.3)$) --% ($\facefactor*( 0.2 , 0 )$) --% @@ -332,11 +324,11 @@ % }{% \ifdefstring{\trainrun}{fast}{% - \fill[draw=none,fill=\background] ($\facefactor*(-0.3, 0.3)$) --% + \fill[draw=none,fill=background] ($\facefactor*(-0.3, 0.3)$) --% ($\facefactor*( 0.3, 0.3)$) --% ($\facefactor*( 0.6, 0 )$) --% ($\facefactor*( 0.3,-0.3)$) --% - ($\facefactor*(-0.3,-0.3)$) -- cycle;% \background fill + ($\facefactor*(-0.3,-0.3)$) -- cycle;% background fill \path[fill=none] ($\facefactor*(-0.15, 0.3)$) --% ($\facefactor*(-0.1 , 0.3)$) --% ($\facefactor*( 0.2 , 0 )$) --% @@ -374,10 +366,10 @@ %% 5. operation mode \iftoggle{is_parked}{}{% vehicle NOT parked \ifdefstring{\operationmode}{manual}{% - \path[draw=none, fill=\foreground] ($\facefactor*(-0.4,0)$) circle (0.15);% dot + \path[draw=none, fill=foreground] ($\facefactor*(-0.4,0)$) circle (0.15);% dot }{ \ifdefstring{\operationmode}{automatic}{% - \path[draw=none, fill=\foreground] ($\facefactor*(-0.15,0)$) -- ++($\facefactor*(-0.15,0) +(0,0.15)$) -- ++(0,-0.3) -- cycle;% triangle + \path[draw=none, fill=foreground] ($\facefactor*(-0.15,0)$) -- ++($\facefactor*(-0.15,0) +(0,0.15)$) -- ++(0,-0.3) -- cycle;% triangle }{% \ifdefstring{\operationmode}{undefined}{}{% \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/operation}{“manual“, “automatic“ OR “undefined“ as key required}}% @@ -419,7 +411,7 @@ }% \ifdefstring{\labelalign}{right} }% \ifdefstring{\labelalign}{left} }% \ifdefstring{\labelalign}{center} - \node[text=\foreground,anchor=\labelanchor,align=\labelalign] at (ts-v-l) {\footnotesize \labelcontent};% label + \node[text=foreground,anchor=\labelanchor,align=\labelalign] at (ts-v-l) {\footnotesize \labelcontent};% label }% }},% END pics/vehicles/.style args={#1/#2/#3} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/test/a0_landscape_adjustbox.tex b/test/a0_landscape_adjustbox.tex index d8564e0..f6c9398 100644 --- a/test/a0_landscape_adjustbox.tex +++ b/test/a0_landscape_adjustbox.tex @@ -16,7 +16,7 @@ \begin{adjustbox}{width=\textwidth} \begin{tikzpicture} { % station names - \tikzset{every node/.style={\foreground!50!\background}}; + \tikzset{every node/.style={foreground!50!background}}; \node[right,align=left] at ( 2,1.3) {to and from\\ Arnau}; \node at (21,3.3) {{\LARGE Bf Berg}}; \node[left,align=right] at (38,1.3) {to and from\\ Chamstadt}; diff --git a/test/a0_landscape_native.tex b/test/a0_landscape_native.tex index 6a95e0d..eb47462 100644 --- a/test/a0_landscape_native.tex +++ b/test/a0_landscape_native.tex @@ -29,7 +29,7 @@ \begin{scaletikzpicturetowidth}{\textwidth} \begin{tikzpicture}[scale=\tikzscale,transform shape] { % station names - \tikzset{every node/.style={\foreground!50!\background}}; + \tikzset{every node/.style={foreground!50!background}}; \node[right,align=left] at ( 2,1.3) {to and from\\ Arnau}; \node at (21,3.3) {{\LARGE Bf Berg}}; \node[left,align=right] at (38,1.3) {to and from\\ Chamstadt}; diff --git a/test/a5_landscape_adjustbox.tex b/test/a5_landscape_adjustbox.tex index f56603f..1523fe9 100644 --- a/test/a5_landscape_adjustbox.tex +++ b/test/a5_landscape_adjustbox.tex @@ -16,7 +16,7 @@ \begin{adjustbox}{width=\textwidth} \begin{tikzpicture} { % station names - \tikzset{every node/.style={\foreground!50!\background}}; + \tikzset{every node/.style={foreground!50!background}}; \node[right,align=left] at ( 2,1.3) {to and from\\ Arnau}; \node at (21,3.3) {{\LARGE Bf Berg}}; \node[left,align=right] at (38,1.3) {to and from\\ Chamstadt}; diff --git a/test/a5_landscape_native.tex b/test/a5_landscape_native.tex index 78932de..601fe47 100644 --- a/test/a5_landscape_native.tex +++ b/test/a5_landscape_native.tex @@ -29,7 +29,7 @@ \begin{scaletikzpicturetowidth}{\textwidth} \begin{tikzpicture}[scale=\tikzscale,transform shape] { % station names - \tikzset{every node/.style={\foreground!50!\background}}; + \tikzset{every node/.style={foreground!50!background}}; \node[right,align=left] at ( 2,1.3) {to and from\\ Arnau}; \node at (21,3.3) {{\LARGE Bf Berg}}; \node[left,align=right] at (38,1.3) {to and from\\ Chamstadt};