diff options
35 files changed, 781 insertions, 574 deletions
diff --git a/Master/texmf-dist/doc/latex/tikz-trackschematic/CHANGELOG.md b/Master/texmf-dist/doc/latex/tikz-trackschematic/CHANGELOG.md new file mode 100644 index 00000000000..e142fd40924 --- /dev/null +++ b/Master/texmf-dist/doc/latex/tikz-trackschematic/CHANGELOG.md @@ -0,0 +1,163 @@ +# 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/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +Categories: Added, Changed, Deprecated, Removed, Fixed, and Security. + +## [Unreleased] + +### Added + + * i18n option + +## Version [0.7.0] - 2022-04-02 + +### Added + + * unified build script for development + +### Changed + + * revised symbol and syntax for balises + * the track loop was separated from the balises + * replaced "\gettikzxy" with "\path let" syntax + * label placement for derailers + +### Fixed + + * wrong option for labels in vehicles + * foreground of sidetrack (alias) + * PackageWarning Error in development mode + +## Version [0.6.3] - 2022-02-15 + +### Added + + * anchor for SVG export + * automated testing and releasing + * separate changelog + +### Fixed + + * documented (slip-)turnout option: points=moving + * spelling error in documentation + * URL to signalschablone + + +## Version [0.6.2] - 2021-10-15 + +### Fixed + + * runaway argument + * developer mode always on + + +## Version [0.6.1] - 2021-09-30 + +### Added + + * added citation information + +### Removed + + * removed package requirement lmodern + +### Fixed + + * minor correction in manual + + +## Version [0.6] - 2021-01-02 + +### Added + + * created an encapsulating package for future flexibility + * added symbols for direction control, track marking, pylons and electric wiring + +### Changed + + * changed symbol for friction bufferstop; + * changed load command to \usepackage{tikz-trackschematic} + + +## Version [0.5.1] - 2020-02-10 + +### Added + + * added symbols "braking point" and "danger point" + +### Changed + + * modified symbol "end of movement authority" + + +## Version [0.5] - 2020-01-14 + +### Added + + * documentation + +### Changed + + * new improved syntax for topology + + +## Version [0.4] - 2019-07-21 + +### Added + + * added document for symbology + +### Changed + + * renamed overview to snippets + * reworked library for common tikz library layout + + +## Version [0.3] - 2019-04-04 + +### Added + + * added shunting movements + * added points to turnouts + * added moving trains + * defined and used color foreground and background + +### Changed + + * moved snippet folder to root folder + + +## Version [0.2] - 2018-12-19 + +### Added + + * added transmitters + +### Changed + + * reorganized src library + * minor improvements + + +## Version [0.1] - 2018-09-14 + +### Added + + Basic concept of a library with railway topology symbols and some examples. + + +[Unreleased]: https://github.com/railtoolkit/tikz-trackschematic/compare/v0.7.0...master +[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 +[0.6.1]: https://github.com/railtoolkit/tikz-trackschematic/compare/v0.6...v0.6.1 +[0.6]: https://github.com/railtoolkit/tikz-trackschematic/compare/v0.5.1...v0.6 +[0.5.1]: https://github.com/railtoolkit/tikz-trackschematic/compare/v0.5...v0.5.1 +[0.5]: https://github.com/railtoolkit/tikz-trackschematic/compare/v0.4...v0.5 +[0.4]: https://github.com/railtoolkit/tikz-trackschematic/compare/v0.3...v0.4 +[0.3]: https://github.com/railtoolkit/tikz-trackschematic/compare/v0.2...v0.3 +[0.2]: https://github.com/railtoolkit/tikz-trackschematic/compare/v0.1...v0.2 +[0.1]: https://github.com/railtoolkit/tikz-trackschematic/releases/tag/v0.1
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/tikz-trackschematic/CITATION.cff b/Master/texmf-dist/doc/latex/tikz-trackschematic/CITATION.cff new file mode 100644 index 00000000000..738afafa4c9 --- /dev/null +++ b/Master/texmf-dist/doc/latex/tikz-trackschematic/CITATION.cff @@ -0,0 +1,44 @@ +# YAML 1.2 +# This CITATION.cff file was generated with cffinit. +# Visit https://bit.ly/cffinit to generate yours today! +--- +cff-version: 1.2.0 +title: tikz-trackschematic +message: 'If you use this software, please cite it using these metadata.' +type: software +authors: + - given-names: Martin + family-names: Scheidt + email: m.scheidt@tu-bs.de + orcid: 'https://orcid.org/0000-0002-9384-8945' + affiliation: TU Braunschweig +identifiers: + - type: doi + value: 10.5281/zenodo.5539844 + description: 'Collection of archived snapshots of all versions of the library' + - type: doi + value: 10.5281/zenodo.6222186 + description: Current version +url: 'https://www.railtoolkit.org/projects/tikz-trackschematic/' +repository: 'https://github.com/railtoolkit/tikz-trackschematic' +repository-code: 'https://repository.ivev.bau.tu-bs.de/martin/tikz-trackschematic' +repository-artifact: 'https://ctan.org/pkg/tikz-trackschematic' +abstract: >- + A TikZ library for creating track diagrams inz + railways. The tikz-trackschematic library is a + toolbox of symbols geared primarily towards + creating track schematic for either research or + educational purposes. It provides a TikZ frontend + to some of the symbols which maybe needed to + describe situations and layouts in railway + operation. +keywords: + - tex + - tikz + - railway + - railroad + - tracks + - schematics +license: ISC +version: v0.6.3 +date-released: 2022-02-15 diff --git a/Master/texmf-dist/doc/latex/tikz-trackschematic/LICENSE b/Master/texmf-dist/doc/latex/tikz-trackschematic/LICENSE new file mode 100644 index 00000000000..b0dab7cee39 --- /dev/null +++ b/Master/texmf-dist/doc/latex/tikz-trackschematic/LICENSE @@ -0,0 +1,7 @@ +ISC License + +Copyright (c) 2018 - 2022, Martin Scheidt \<m.scheidt@tu-bs.de\> + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/tikz-trackschematic/README.md b/Master/texmf-dist/doc/latex/tikz-trackschematic/README.md index 93708e072de..ba15745277b 100644 --- a/Master/texmf-dist/doc/latex/tikz-trackschematic/README.md +++ b/Master/texmf-dist/doc/latex/tikz-trackschematic/README.md @@ -1,5 +1,7 @@ # TikZ-trackschematic +[![License: ISC](https://img.shields.io/badge/license-ISC-green.svg)](https://opensource.org/licenses/ISC) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5539844.svg)](https://doi.org/10.5281/zenodo.5539844) [![continuous integration test](https://github.com/railtoolkit/tikz-trackschematic/actions/workflows/testing.yml/badge.svg)](https://github.com/railtoolkit/tikz-trackschematic/actions/workflows/testing.yml) + ------------ # Installation @@ -12,6 +14,7 @@ The tikz library is contained in the files: * tikzlibrarytrackschematic.trafficcontrol.code.tex, * tikzlibrarytrackschematic.vehicles.code.tex, * tikzlibrarytrackschematic.constructions.code.tex, +* tikzlibrarytrackschematic.symbology.code.tex, * tikzlibrarytrackschematic.electrics.code.tex, and * tikzlibrarytrackschematic.measures.code.tex. @@ -60,7 +63,7 @@ results in: # Symbology and meaning -Please consult the [symbology table](https://github.com/railtoolkit/tikz-trackschematic/blob/master/doc/symbology_table.pdf) for further information regarding meaning of the symbols. +Please consult the [symbology table](https://github.com/railtoolkit/tikz-trackschematic/blob/master/doc/symbology-table.pdf) for further information regarding meaning of the symbols. ------------ @@ -68,7 +71,6 @@ Please consult the [symbology table](https://github.com/railtoolkit/tikz-tracksc * rethink syntax * provide option for internationalziation (i18n) - * replace "\gettikzxy" with "\path let" syntax * rewrite library with better coding skills * include support for glossaries package diff --git a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-documentation.sty b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-documentation.sty index b54f4b71a26..da150e4a8eb 100644 --- a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-documentation.sty +++ b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-documentation.sty @@ -6,51 +6,41 @@ \ProvidesPackage{tikz-trackschematic-documentation}[2020-12-30 Documentation Package for the tikz-trackschematic library] +% ---[ HTML ]--- +\usepackage{iftex} +\usepackage[ + HomeHTMLFilename=index, % Filename of the homepage. + % IndexLanguage=english, % Language for xindy index, glossary. + latexmk % Use latexmk to compile. +]{lwarp} % --------[ Coding and Language ]---------- -\RequirePackage{scrhack,marginnote} -\RequirePackage[utf8]{inputenc} -\RequirePackage[T1]{fontenc} +\ifPDFTeX + \RequirePackage{scrhack,marginnote} + \RequirePackage[utf8]{inputenc} + \RequirePackage[T1]{fontenc} +\fi \RequirePackage[main=english]{babel} % --------[ revision history ]---------- \RequirePackage[tocentry]{vhistory} % --------[ Layout ]----------- -\pretolerance=8000 -\tolerance=9500 -\hbadness=8000 -\vbadness=10000 -\displaywidowpenalty=10000 -\clubpenalty=10000 -\widowpenalty=10000 -\RequirePackage{lmodern,microtype,mathptmx,courier} -\RequirePackage[scaled=0.92]{helvet} -\RequirePackage[% - automark,% - headsepline,% - draft=false,% -]{scrlayer-scrpage}% -\pagestyle{scrheadings} +\ifPDFTeX + \pretolerance=8000 + \tolerance=9500 + \hbadness=8000 + \vbadness=10000 + \displaywidowpenalty=10000 + \clubpenalty=10000 + \widowpenalty=10000 + \RequirePackage{lmodern,microtype,mathptmx,courier} + \RequirePackage[scaled=0.92]{helvet} + \RequirePackage[% + automark,% + headsepline,% + draft=false,% + ]{scrlayer-scrpage}% + \pagestyle{scrheadings} +\fi \RequirePackage{multicol} -% -----------[ PDF linking ]---------------- -\RequirePackage{xr-hyper} -\RequirePackage[% - pdftex,% - pdfpagelabels, % modify PDF page labels - hyperindex,% - hyperfigures,% - bookmarksopen,% - bookmarksnumbered,% - draft=false,% - pageanchor=true, % Determines whether every page is given an implicit anchor at the top left corner - %pagebackref, % Adds backlink text to the end of each item in the bibliography, as a list of page numbers - %linktocpage, % make page number, not text, be link on TOC, LOF and LOT - breaklinks=true, % allow links to break over lines by making links over multiple lines into PDF links to the same target - colorlinks=true, % Colors the text of links and anchors - linkcolor=base01, % Color for normal internal links - urlcolor=blue, % Color for web links -]{hyperref} % PDF with a linked TableOfContent -\RequirePackage{bookmark} % Adding package bookmark improves bookmarks handling. -\RequirePackage{url} - % ----------[ display ]----------- \RequirePackage[prefix=]{xcolor-solarized} \RequirePackage[inline]{enumitem} @@ -79,22 +69,40 @@ frame = single,% }% -\RequirePackage{longtable,tikz,siunitx,adjustbox,rotating} -\sisetup{ - text-family-to-math = true, - text-series-to-math = true -} +\RequirePackage{longtable,tikz,adjustbox,rotating} +\RequirePackage{siunitx}[=v2] +% \sisetup{ +% text-family-to-math = true, +% text-series-to-math = true +% } \IfFileExists{tikz-trackschematic-dev.sty}{% \RequirePackage[dev]{tikz-trackschematic}% }{% \RequirePackage{tikz-trackschematic}% }% +% -----------[ linking ]---------------- +\RequirePackage{xr-hyper} +\RequirePackage[% + % pdftex,% + % pdfpagelabels, % modify PDF page labels + hyperindex,% + hyperfigures,% + bookmarksopen,% + bookmarksnumbered,% + draft=false,% + pageanchor=true, % Determines whether every page is given an implicit anchor at the top left corner + %pagebackref, % Adds backlink text to the end of each item in the bibliography, as a list of page numbers + %linktocpage, % make page number, not text, be link on TOC, LOF and LOT + breaklinks=true, % allow links to break over lines by making links over multiple lines into PDF links to the same target + colorlinks=true, % Colors the text of links and anchors + linkcolor=base01, % Color for normal internal links + urlcolor=blue, % Color for web links +]{hyperref} % PDF with a linked TableOfContent +\RequirePackage{url} -\usepackage[obeyDraft,textsize=footnotesize]{todonotes} -\newcommand{\TODO}{\todo[linecolor=orange,backgroundcolor=orange!20,bordercolor=orange,inline,]{\textcolor{orange}{Todo}}} -% \newcommand{\TODO}[1]{\todo[linecolor=orange,backgroundcolor=orange!20,bordercolor=orange,inline,]{\textcolor{orange}{Todo:~}#1}} +% -----------[ special commands ]---------------- \renewcommand{\symbol}[2][1.0]{% \adjustbox{valign=c}{\begin{tikzpicture}[scale=#1]% \input{./snippets/#2}% diff --git a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-examples/minimal_working_example.pdf b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-examples/minimal_working_example.pdf Binary files differindex fd1d562edf5..a07496e0369 100644 --- a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-examples/minimal_working_example.pdf +++ b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-examples/minimal_working_example.pdf diff --git a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-examples/minimal_working_example.png b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-examples/minimal_working_example.png Binary files differindex 68c63749395..c7202597652 100644 --- a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-examples/minimal_working_example.png +++ b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-examples/minimal_working_example.png diff --git a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-examples/minimal_working_example.tex b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-examples/minimal_working_example.tex index bd542a3005a..aa50de7a403 100644 --- a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-examples/minimal_working_example.tex +++ b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-examples/minimal_working_example.tex @@ -1,19 +1,16 @@ -\documentclass{standalone} % LaTeX -\usepackage{tikz-trackschematic} % loading the library +\documentclass{standalone} -\begin{document} - \begin{tikzpicture} +% loading the library +\usepackage{tikz-trackschematic} - % TikZ command: specify coordinates - \coordinate (A) at (0,0); - \coordinate (B) at (6,0); - \coordinate (T) at (5,0); +\begin{document} % LaTeX + \begin{tikzpicture} % TikZ - % draw a track - \maintrack (A) -- (B); + % draw a track with (x,y) coordinates + \maintrack (0,0) -- (6,0); % place a train on the track - \train[forward] at (T) label (); + \train[forward] at (5,0) label (); \end{tikzpicture} -\end{document} +\end{document}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-examples/station_berg.pdf b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-examples/station_berg.pdf Binary files differindex 2519a7d2b18..27bce31cd75 100644 --- a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-examples/station_berg.pdf +++ b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-examples/station_berg.pdf diff --git a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-examples/station_berg.png b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-examples/station_berg.png Binary files differnew file mode 100644 index 00000000000..3636700d4de --- /dev/null +++ b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-examples/station_berg.png diff --git a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-examples/station_chamstadt.pdf b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-examples/station_chamstadt.pdf Binary files differindex 7c5df6c682b..85b9c3b7579 100644 --- a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-examples/station_chamstadt.pdf +++ b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-examples/station_chamstadt.pdf diff --git a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-examples/station_chamstadt.png b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-examples/station_chamstadt.png Binary files differnew file mode 100644 index 00000000000..50474237f0c --- /dev/null +++ b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-examples/station_chamstadt.png diff --git a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets.pdf b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets.pdf Binary files differindex 3e56b32cc54..beaf4a5c7a8 100644 --- a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets.pdf +++ b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets.pdf diff --git a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets.tex b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets.tex index e7ddbcd76ef..4823dcba5bb 100644 --- a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets.tex +++ b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets.tex @@ -569,33 +569,33 @@ No. & Name & Clip & Code & Manual reference\\ %% transmitter %% \hline -\No & transmitter (right \& left) & -\symbol{transmitter.tikz} & \code{transmitter.tikz} & -\parbox[c]{4cm}{\centering\texttt{trafficcontrol} \\ Section \ref{sym:generictransmitter} p. \pageref{sym:generictransmitter}} \\ +\No & balise (forward \& backward) & +\symbol{balises.tikz} & \code{balises.tikz} & +\parbox[c]{4cm}{\centering\texttt{trafficcontrol} \\ Section \ref{sym:balise} p. \pageref{sym:balise}} \\ \hline -\No & \parbox[c]{5cm}{transmitter (right)\\with signal} & -\symbol{transmitter_right_with_signal.tikz} & \code{transmitter_right_with_signal.tikz} & -\parbox[c]{4cm}{\centering\texttt{trafficcontrol} \\ Section \ref{sym:generictransmitter} p. \pageref{sym:generictransmitter} \\ \& \\ Section \ref{sym:routesignal} p. \pageref{sym:routesignal}} \\ +\No & \parbox[c]{5cm}{balise (forward)\\with signal} & +\symbol{balise_forward_with_signal.tikz} & \code{balise_forward_with_signal.tikz} & +\parbox[c]{4cm}{\centering\texttt{trafficcontrol} \\ Section \ref{sym:balise} p. \pageref{sym:balise} \\ \& \\ Section \ref{sym:routesignal} p. \pageref{sym:routesignal}} \\ \hline -\No & \parbox[c]{5cm}{transmitter (right \& left)\\ effective forward} & -\symbol{transmitter_forward.tikz} & \code{transmitter_forward.tikz} & +\No & \parbox[c]{5cm}{balise (forward \& backward)\\ switched} & +\symbol{balise_switched.tikz} & \code{balise_switched.tikz} & \parbox[c]{4cm}{\centering\texttt{trafficcontrol} \\ Section \ref{sym:balise} p. \pageref{sym:balise}} \\ \hline -\No & \parbox[c]{5cm}{transmitter (right \& left)\\ effective backward} & -\symbol{transmitter_backward.tikz} & \code{transmitter_backward.tikz} & +\No & \parbox[c]{5cm}{individual balises\\ (forward \& backward)} & +\symbol{individual_balises.tikz} & \code{individual_balises.tikz} & \parbox[c]{4cm}{\centering\texttt{trafficcontrol} \\ Section \ref{sym:balise} p. \pageref{sym:balise}} \\ \hline -\No & \parbox[c]{5cm}{transmitter (right \& left)\\ effective bidirectional} & -\symbol{transmitter_bidirectional.tikz} & \code{transmitter_bidirectional.tikz} & +\No & \parbox[c]{5cm}{individual balises\\ (forward \& backward) mixed} & +\symbol{individual_balises_mixed.tikz} & \code{individual_balises_mixed.tikz} & \parbox[c]{4cm}{\centering\texttt{trafficcontrol} \\ Section \ref{sym:balise} p. \pageref{sym:balise}} \\ \hline -\No & loop transmitter& -\symbol{loop_transmitter.tikz} & \code{loop_transmitter.tikz} & +\No & track loop & +\symbol{trackloop.tikz} & \code{trackloop.tikz} & \parbox[c]{4cm}{\centering\texttt{trafficcontrol} \\ Section \ref{sym:loop} p. \pageref{sym:loop}} \\ %%%%%%%%%%%%%%%%%%%%% diff --git a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets/transmitter_right_with_signal.tikz b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets/balise_forward_with_signal.tikz index 167e599902c..5572146b6a8 100644 --- a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets/transmitter_right_with_signal.tikz +++ b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets/balise_forward_with_signal.tikz @@ -11,4 +11,4 @@ \maintrack (A) -- (B); \routesignal[forward] at (S) label (); -\balise[] at (S) label ();
\ No newline at end of file +\balise[forward] at (S) label ();
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets/transmitter_forward.tikz b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets/balise_switched.tikz index 9566fbb0ef4..567c8a34d38 100644 --- a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets/transmitter_forward.tikz +++ b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets/balise_switched.tikz @@ -11,5 +11,5 @@ \maintrack (A) -- (B); -\balise[forward] at (T1) label (); -\balise[forward,position=left] at (T2) label ();
\ No newline at end of file +\balise[forward,switched] at (T1) label (); +\balise[backward,switched] at (T2) label ();
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets/transmitter.tikz b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets/balises.tikz index 584611e8eaa..6626de1ce4a 100644 --- a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets/transmitter.tikz +++ b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets/balises.tikz @@ -11,5 +11,5 @@ \maintrack (A) -- (B); -\balise[] at (T1) label (); -\balise[position=left] at (T2) label ();
\ No newline at end of file +\balise[forward] at (T1) label (); +\balise[backward] at (T2) label ();
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets/transmitter_backward.tikz b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets/individual_balises.tikz index f60d08349eb..a2d53d07b90 100644 --- a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets/transmitter_backward.tikz +++ b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets/individual_balises.tikz @@ -11,5 +11,5 @@ \maintrack (A) -- (B); -\balise[backward] at (T1) label (); -\balise[backward,position=left] at (T2) label ();
\ No newline at end of file +\balise[forward,along={0,1,2,3}] at (T1) label (A); +\balise[backward,along={0,1,2,3}] at (T2) label (B);
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets/transmitter_bidirectional.tikz b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets/individual_balises_mixed.tikz index 6216a489a5c..e8004ac2852 100644 --- a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets/transmitter_bidirectional.tikz +++ b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets/individual_balises_mixed.tikz @@ -11,5 +11,17 @@ \maintrack (A) -- (B); -\balise[bidirectional] at (T1) label (); -\balise[bidirectional,position=left] at (T2) label ();
\ No newline at end of file +\balise[ + forward, + along={0,1,3}, + along switched={2}, + oppose={0,2}, +] at (T1) label (A); +\balise[ + backward, + along={0,1,3}, + along switched={2}, + oppose={0,2,3}, + oppose switched={1}, + index % show index number +] at (T2) label (B);
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets/loop_transmitter.tikz b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets/loop_transmitter.tikz deleted file mode 100644 index 65b490a4fff..00000000000 --- a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets/loop_transmitter.tikz +++ /dev/null @@ -1,13 +0,0 @@ -%!TEX TS-program = pdflatexmk -%!TEX root = ../snippets.tex - -% Copyright (c) 2018 - 2022, Martin Scheidt (ISC license) -% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -\coordinate (A) at (0,0); -\coordinate (B) at (6,0); -\coordinate (T) at (3,0); - -\maintrack (A) -- (B); - -\transmitter[type=loop] at (T) label ();
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets/transmitter_right.tikz b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets/trackloop.tikz index 683e435327a..e5b6be3eaf8 100644 --- a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets/transmitter_right.tikz +++ b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets/trackloop.tikz @@ -10,4 +10,4 @@ \maintrack (A) -- (B); -\balise[] at (T) label ();
\ No newline at end of file +\trackloop[] at (T) label ();
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets/transmitter_right_bidirectional.tikz b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets/transmitter_right_bidirectional.tikz deleted file mode 100644 index d0bd7dc2185..00000000000 --- a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets/transmitter_right_bidirectional.tikz +++ /dev/null @@ -1,13 +0,0 @@ -%!TEX TS-program = pdflatexmk -%!TEX root = ../snippets.tex - -% Copyright (c) 2018 - 2022, Martin Scheidt (ISC license) -% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -\coordinate (A) at (0,0); -\coordinate (B) at (6,0); -\coordinate (T) at (3,0); - -\maintrack (A) -- (B); - -\balise[bidirectional] at (T) label ();
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets/transmitter_right_forward.tikz b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets/transmitter_right_forward.tikz deleted file mode 100644 index df0a2fc6801..00000000000 --- a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-snippets/transmitter_right_forward.tikz +++ /dev/null @@ -1,13 +0,0 @@ -%!TEX TS-program = pdflatexmk -%!TEX root = ../snippets.tex - -% Copyright (c) 2018 - 2022, Martin Scheidt (ISC license) -% Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -\coordinate (A) at (0,0); -\coordinate (B) at (6,0); -\coordinate (T) at (3,0); - -\maintrack (A) -- (B); - -\balise[forward] at (T) label ();
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-symbology-table.pdf b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-symbology-table.pdf Binary files differindex 0b3b5a2387e..1d5169e23cd 100644 --- a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-symbology-table.pdf +++ b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic-symbology-table.pdf diff --git a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic.pdf b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic.pdf Binary files differindex d68ac8d496f..d4ac7644c85 100644 --- a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic.pdf +++ b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic.pdf diff --git a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic.tex b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic.tex index 9c85bc7c3fc..dfea410fc8b 100644 --- a/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic.tex +++ b/Master/texmf-dist/doc/latex/tikz-trackschematic/tikz-trackschematic.tex @@ -4,15 +4,7 @@ % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -\documentclass[ - paper=a4, - % version=3.25, - pagesize=pdftex, - twoside=false, - toc=listof, - BCOR=0pt, - DIV=15, -]{scrartcl} +\documentclass{scrartcl} \usepackage{tikz-trackschematic-documentation} @@ -21,7 +13,7 @@ %\newcommand{\initials}{fullname} \newcommand{\MS}{Martin Scheidt} \newcommand{\GW}{Gregor Wehrle} -\newcommand{\authorlist}{\MS, \GW} +\newcommand{\authorlist}{by the project contributors} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -35,7 +27,7 @@ \begin{document} -\title{\tikz\node[scale=1.2]{\color{gray}\Huge\sffamily \{\textcolor{black}{Ti\textcolor{orange}{\emph{k}}Z}-\textcolor{blue}{trackschematic}\}};} +\title{\color{gray}\Huge\sffamily \{\textcolor{black}{Ti\textcolor{orange}{\emph{k}}Z}-\textcolor{blue}{trackschematic}\}} \subtitle{A Ti\emph{k}Z library for track schematics} \author{\authorlist} \date{Version \vhCurrentVersion~ from \vhCurrentDate} @@ -49,19 +41,20 @@ \section{Introduction}\label{sec:intro} - \subsection[About]{About tikz-trackschematic} + \subsection{About tikz-trackschematic} The Ti\emph{k}Z-\emph{trackschematic} library is a toolbox of symbols geared primarily towards creating track schematic for either research or educational purposes. It provides a Ti\emph{k}Z frontend to some of the symbols which maybe needed to describe situations and layouts in railway operation. - The library is divided into four sublibraries: - \begin{itemize*}[label={}] + The library is divided into the following sublibraries: + \begin{itemize} \item \texttt{topology}, \item \texttt{trafficcontrol}, \item \texttt{vehicles}, \item \texttt{constructions}, + \item \texttt{symbology}, \item \texttt{electrics}, and \item \texttt{measures}. - \end{itemize*} + \end{itemize} \subsection{Acknowledgement} @@ -72,19 +65,19 @@ \subsection{Requirements}\label{sec:require} The library uses Ti\emph{k}Z and it is based the following packages: - \begin{itemize*}[label={}] + \begin{itemize} \item \texttt{tikz}, - \item \texttt{lmodern}, \item \texttt{xcolor}, and \item \texttt{etoolbox}. - \end{itemize*} + \end{itemize} + Further more it uses the following Ti\emph{k}Z libraries: - \begin{itemize*}[label={}] + \begin{itemize} \item \texttt{calc}, \item \texttt{intersections}, \item \texttt{patterns}, and \item \texttt{arrows.meta}. - \end{itemize*} + \end{itemize} \subsection{License} @@ -94,7 +87,7 @@ \subsection{Alternatives} - Apart from this library, there is also a \href{https://tu-dresden.de/bu/verkehr/ibv/vst/die-professur/mitarb/ulrich-maschek/signalschablone} with german (Deutsche Bahn) symbols for MS Visio. + Apart from this library, there is also the \href{https://tu-dresden.de/bu/verkehr/ibv/vst/die-professur/mitarb/ulrich-maschek/signalschablone}{Signalschablone} with german (Deutsche Bahn) symbols for MS Visio. % \newpage @@ -105,24 +98,7 @@ Here is a complete working minimal example which will produce a single PDF file with the figure on the right:\\ \begin{minipage}[c]{0.51\textwidth} \centering - \begin{lstlisting}[gobble=8] - \documentclass{standalone} - - % loading the library - \usepackage{tikz-trackschematic} - - \begin{document} - \begin{tikzpicture} - - % draw a track - \maintrack (0,0) -- (6,0); - - % place a train on the track - \train[forward] at (5,0) label (); - - \end{tikzpicture} - \end{document} - \end{lstlisting} + \lstinputlisting{examples/minimal_working_example.tex} \end{minipage} \hfil \begin{minipage}[c]{0.45\textwidth} @@ -167,7 +143,7 @@ \begin{minipage}[c]{0.68\textwidth} \begin{lstlisting}[gobble=6] - \train[face=forward ] at (coordinate) label (); + \train[face=forward] at (coordinate) label (); \end{lstlisting} \end{minipage} @@ -207,7 +183,7 @@ \begin{minipage}[c]{0.68\textwidth} \begin{lstlisting}[gobble=6] - \turnout[forward ,branch=right] at (coordinate) label (); + \turnout[forward,branch=right] at (coordinate) label (); \end{lstlisting} \end{minipage} @@ -218,7 +194,7 @@ \begin{minipage}[c]{0.68\textwidth} \begin{lstlisting}[gobble=6] - \turnout[backward,branch=left ] at (coordinate) label (); + \turnout[backward,branch=left] at (coordinate) label (); \end{lstlisting} \end{minipage} @@ -245,6 +221,7 @@ The default traffic practice for this library ist right-hand traffic. You can change it either globally or locally with the key \texttt{traffic practice=left}. There is also the alias \texttt{position} for single local entries. + \begin{minipage}[c]{0.65\textwidth} \begin{lstlisting}[gobble=8] \documentclass{standalone} @@ -550,7 +527,7 @@ values for \texttt{options} (comma seperated): \begin{itemize}[label={}] \item \texttt{length=\textit{length unit}} (optional, default 4cm) - \item \texttt{label at=\{\textit{(label-coord)}\}} (optional, default: \textit{center}) + \item \texttt{shift label=\{\textit{(label-coord)}\}} (optional, default: (0,0)) \item \texttt{label align=left} or \texttt{label align=right} (optional, default: center) \item \texttt{foreground=\textit{color}} (optional, default: \texttt{black}) \item \texttt{background=\textit{color}} (optional, default: \texttt{white}) @@ -578,7 +555,7 @@ \item \texttt{operation=manual} or \texttt{operation=automatic} (optional) % \texttt{operation=undefined} (default) \item \texttt{bend left at=\{\textit{(bend-coord)}\}} (optional, default: \textit{none}) \item \texttt{bend right at=\{\textit{(bend-coord)}\}} (optional, default: \textit{none}) - \item \texttt{label at=\{\textit{(label-coord)}\}} (optional, default: \textit{center}) + \item \texttt{shift label=\{\textit{(label-coord)}\}} (optional, default: (0,0)) \item \texttt{label align=left} or \texttt{label align=right} (optional, default: center) \item \texttt{foreground=\textit{color}} (optional, default: \texttt{black}) \item \texttt{background=\textit{color}} (optional, default: \texttt{white}) @@ -1049,46 +1026,40 @@ \subsubsection{Transmitters}\label{sec:transmitters} - \symboldescription{Generic transmitter command}\label{sym:generictransmitter} - \begin{lstlisting}[gobble=10] - \transmitter[options] at (coord) label (name); - \end{lstlisting} - values for \texttt{options} (comma seperated): - \begin{itemize}[label={}] - \item \texttt{type=balise} or \texttt{type=loop} (mandatory) - \item \texttt{forward}, \texttt{backward} or \texttt{bidirectional} (optional) - \item \texttt{position=left} or \texttt{position=right} (optional, default: \textit{traffic practice}) - \item \texttt{shift label=\{\textit{(label-coord)}\}} (optional, default: (0,0)) - \item \texttt{foreground=\textit{color}} (optional, default: \texttt{black}) - \end{itemize} - - \symboldescription{Balise}\label{sym:balise} - \tsSymbol{transmitter_forward} + \tsSymbol{balise_group} + \tsSymbol{balise_individual} \begin{lstlisting}[gobble=10] \balise[options] at (coord) label (name); \end{lstlisting} values for \texttt{options} (comma seperated): \begin{itemize}[label={}] - \item \texttt{forward}, \texttt{backward} or \texttt{bidirectional} (optional) + \item \texttt{forward}, or \texttt{backward} (mandatory) \item \texttt{position=left} or \texttt{position=right} (optional, default: \textit{traffic practice}) + \item \texttt{switched} (optional) \item \texttt{shift label=\{\textit{(label-coord)}\}} (optional, default: (0,0)) \item \texttt{foreground=\textit{color}} (optional, default: \texttt{black}) \end{itemize} - This command is equivalent to: - \begin{lstlisting}[gobble=10] - \transmitter[type=balise,options] at (coord) label (name); - \end{lstlisting} + The basic state is one in which the individual balises are not shown. The direction of the balises is the same as the direction of action. The direction of the balises is indicated by the orientation of the label. The \texttt{switched} option changes the symbol over the entire length. + \begin{itemize}[label={}] + \item \texttt{along=\{\textit{comma separated list of integers}\}} (optional) + \item \texttt{oppose=\{\textit{comma separated list of integers}\}} (optional) + \item \texttt{along switched=\{\textit{comma separated list of integers}\}} (optional) + \item \texttt{oppose switched=\{\textit{comma separated list of integers}\}} (optional) + \item \texttt{index} (optional) + \end{itemize} + If individual balises are to be shown, they are indicated via the \texttt{along} or \texttt{along switched} with the direction of the balise and with \texttt{oppose} or \texttt{oppose switched} against the balise. A list with integer values is passed to the parameter. The list starts with 0. For example, three individual balises are drawn with the list \{0,1,3\} and the balise at position 2 is left out. With the option \texttt{index}, the index number can also be displayed. If one of the options \texttt{along}, \texttt{along switched}, \texttt{oppose}, or \texttt{oppose switched} is set, the \texttt{switched} option is ignored. \mbox{}\\[0.2cm] Symbology entry as seen at top: \begin{lstlisting}[gobble=10] - \tsSymbol{transmitter_forward}% TeX environment + \tsSymbol{balise_group}% TeX environment + \tsSymbol{balise_individual}% TeX environment \end{lstlisting} \symboldescription{Loop}\label{sym:loop} - \tsSymbol{loop_transmitter} + \tsSymbol{trackloop} \begin{lstlisting}[gobble=10] \trackloop[options] at (coord) label (name); \end{lstlisting} @@ -1098,15 +1069,11 @@ \item \texttt{shift label=\{\textit{(label-coord)}\}} (optional, default: (0,0)) \item \texttt{foreground=\textit{color}} (optional, default: \texttt{black}) \end{itemize} - This command is equivalent to: - \begin{lstlisting}[gobble=10] - \transmitter[type=loop,options] at (coord) label (name); - \end{lstlisting} \mbox{}\\[0.2cm] Symbology entry as seen at top: \begin{lstlisting}[gobble=10] - \tsSymbol{loop_transmitter}% TeX environment + \tsSymbol{trackloop}% TeX environment \end{lstlisting} @@ -1402,7 +1369,7 @@ \end{lstlisting} - \subsection{Messures}\label{sec:measures} + \subsection{Measures}\label{sec:measures} \symboldescription{Track distance}\label{sym:trackdistance} \tsSymbol[2.0]{track_distance} @@ -1446,8 +1413,13 @@ \end{lstlisting} No \texttt{options} available.\\ This command is equivalent to: - \begin{lstlisting}[gobble=10] - \path[draw=foreground!50!background,dashed,shorten <=0.75cm,shorten >=0.75cm] (coord1) -- (coord2); + \begin{lstlisting}[gobble=8] + \path[ + draw=foreground!50!background, + dashed, + shorten <=0.75cm, + shorten >=0.75cm + ] (coord1) -- (coord2); \end{lstlisting} \mbox{}\\[0.2cm] @@ -1483,7 +1455,7 @@ \symboldescription{Track Marking}\label{sym:trackmarking} \tsSymbol{track_marking} - \begin{lstlisting}[gobble=10] + \begin{lstlisting}[gobble=8] \trackmarking[color] (coord1) -- (coord2); \end{lstlisting} \begin{itemize}[label={}] @@ -1614,13 +1586,11 @@ \hline \No & direction control & \tsSymbol{direction_control} & \ref{sec:routes} \\ \hline - \No & transmitter & \tsSymbol{transmitter} & \ref{sec:transmitters} \\ - \hline - \No & transmitter effective forward & \tsSymbol{transmitter_forward} & \ref{sec:transmitters} \\ + \No & balise group & \tsSymbol{balise_group} & \ref{sec:transmitters} \\ \hline - \No & transmitter bidirectional & \tsSymbol{transmitter_bidirectional} & \ref{sec:transmitters} \\ + \No & balise individual & \tsSymbol{balise_individual} & \ref{sec:transmitters} \\ \hline - \No & loop transmitter & \tsSymbol{loop_transmitter} & \ref{sec:transmitters} \\ + \No & track loop & \tsSymbol{trackloop} & \ref{sec:transmitters} \\ \hline \No & platform & \tsSymbol[1.4]{platform} & \ref{sec:constructions} \\ \hline diff --git a/Master/texmf-dist/tex/latex/tikz-trackschematic/tikz-trackschematic.sty b/Master/texmf-dist/tex/latex/tikz-trackschematic/tikz-trackschematic.sty index c0f38a1b90e..77822d409f6 100644 --- a/Master/texmf-dist/tex/latex/tikz-trackschematic/tikz-trackschematic.sty +++ b/Master/texmf-dist/tex/latex/tikz-trackschematic/tikz-trackschematic.sty @@ -5,7 +5,7 @@ % Permission to use, copy, modify, and/or distribute this file for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. % \NeedsTeXFormat{LaTeX2e}% -\ProvidesPackage{tikz-trackschematic}[2022-02-15 v0.6.3 tikz-trackschematic]% +\ProvidesPackage{tikz-trackschematic}[2022-04-02 v0.7.0 tikz-trackschematic]% %%%%%%%%%%%%%%% % Package options %%%%%%%%%%%%%%% @@ -28,8 +28,9 @@ \usetikzlibrary{trackschematic-dev.symbology}% \usetikzlibrary{trackschematic-dev}% }{% - \PackageWarning{tikz-trackschematic}{development mode not available}{execute the dev-install.sh script provided by the package repository}% - \PackageWarning{tikz-trackschematic}{development mode not available}{continuing in normal mode}% + \PackageWarning{tikz-trackschematic}{development mode not available}% + \PackageWarning{tikz-trackschematic}{execute the script './build.sh --install-dev' provided by the package repository}% + \PackageWarning{tikz-trackschematic}{continuing in normal mode}% \usetikzlibrary{trackschematic.topology}% \usetikzlibrary{trackschematic.trafficcontrol}% \usetikzlibrary{trackschematic.vehicles}% diff --git a/Master/texmf-dist/tex/latex/tikz-trackschematic/tikzlibrarytrackschematic.code.tex b/Master/texmf-dist/tex/latex/tikz-trackschematic/tikzlibrarytrackschematic.code.tex index d7b2a632182..408695925b0 100644 --- a/Master/texmf-dist/tex/latex/tikz-trackschematic/tikzlibrarytrackschematic.code.tex +++ b/Master/texmf-dist/tex/latex/tikz-trackschematic/tikzlibrarytrackschematic.code.tex @@ -45,8 +45,7 @@ % \ifdefstring{\labelcontent}{}{}{% label NOT empty % \coordinate (label-coord) at (coord);% % \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default -% \gettikzxy{\labelcoord}{\labelcoordX}{\labelcoordY}% -% \coordinate (label-coord) at ($(label-coord)+(\labelcoordX,\labelcoordY)$);% +% \path let \p1=\labelcoord in coordinate (label-coord) at ($(label-coord)+(\x1,\y1)$);% % }% % \node at (label-coord) {\footnotesize \labelcontent};% % }% diff --git a/Master/texmf-dist/tex/latex/tikz-trackschematic/tikzlibrarytrackschematic.constructions.code.tex b/Master/texmf-dist/tex/latex/tikz-trackschematic/tikzlibrarytrackschematic.constructions.code.tex index 8f6cc0b5358..c0542061228 100644 --- a/Master/texmf-dist/tex/latex/tikz-trackschematic/tikzlibrarytrackschematic.constructions.code.tex +++ b/Master/texmf-dist/tex/latex/tikz-trackschematic/tikzlibrarytrackschematic.constructions.code.tex @@ -1,6 +1,3 @@ -%!TEX TS-program = pdflatexmk -%!TEX root = ../test/test.tex -% %% symbol library for TikZ track schematics % % Copyright (c) 2018 - 2022, Martin Scheidt (ISC license) diff --git a/Master/texmf-dist/tex/latex/tikz-trackschematic/tikzlibrarytrackschematic.electrics.code.tex b/Master/texmf-dist/tex/latex/tikz-trackschematic/tikzlibrarytrackschematic.electrics.code.tex index 8269bea35ef..d5565c56edd 100644 --- a/Master/texmf-dist/tex/latex/tikz-trackschematic/tikzlibrarytrackschematic.electrics.code.tex +++ b/Master/texmf-dist/tex/latex/tikz-trackschematic/tikzlibrarytrackschematic.electrics.code.tex @@ -1,6 +1,3 @@ -%!TEX TS-program = pdflatexmk -%!TEX root = ../test/test.tex -% %% symbol library for TikZ track schematics % % Copyright (c) 2018 - 2022, Martin Scheidt (ISC license) @@ -15,13 +12,6 @@ \RequirePackage{tikz,etoolbox}% \usetikzlibrary{calc,intersections,arrows.meta}% % -% https://tex.stackexchange.com/questions/56353/extract-x-y-coordinate-of-an-arbitrary-point-on-curve-in-tikz -\providecommand{\gettikzxy}[3]{% - \tikz@scan@one@point\pgfutil@firstofone#1\relax% - \edef#2{\the\pgf@x}% - \edef#3{\the\pgf@y}% -}% -% %%%%%%%%%%%%%%% % tikz keys for multiple use %%%%%%%%%%%%%%% @@ -126,8 +116,7 @@ \ifdefstring{\labelcontent}{}{}{% label NOT empty \coordinate (label-coord) at ($\trafficfactor*\facefactor*(0,-0.4)$);% \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default - \gettikzxy{\labelcoord}{\labelcoordX}{\labelcoordY}% - \coordinate (label-coord) at ($(label-coord)+(\labelcoordX,\labelcoordY)$);% + \path let \p1=\labelcoord in coordinate (label-coord) at ($(label-coord)+(\x1,\y1)$);% }% \node[\align] at (label-coord) {\footnotesize \labelcontent};% }% @@ -201,8 +190,7 @@ \ifdefstring{\labelcontent}{}{}{% label NOT empty \coordinate (label-coord) at ($\trafficfactor*\facefactor*(0,-0.4)$);% \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default - \gettikzxy{\labelcoord}{\labelcoordX}{\labelcoordY}% - \coordinate (label-coord) at ($(label-coord)+(\labelcoordX,\labelcoordY)$);% + \path let \p1=\labelcoord in coordinate (label-coord) at ($(label-coord)+(\x1,\y1)$);% }% \node[\align] at (label-coord) {\footnotesize \labelcontent};% }% @@ -277,8 +265,7 @@ \ifdefstring{\labelcontent}{}{}{% label NOT empty \coordinate (label-coord) at ($\trafficfactor*\facefactor*(0,-0.4)$);% \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default - \gettikzxy{\labelcoord}{\labelcoordX}{\labelcoordY}% - \coordinate (label-coord) at ($(label-coord)+(\labelcoordX,\labelcoordY)$);% + \path let \p1=\labelcoord in coordinate (label-coord) at ($(label-coord)+(\x1,\y1)$);% }% \node[\align] at (label-coord) {\footnotesize \labelcontent};% }% @@ -352,8 +339,7 @@ \ifdefstring{\labelcontent}{}{}{% label NOT empty \coordinate (label-coord) at ($\trafficfactor*\facefactor*(0,-0.4)$);% \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default - \gettikzxy{\labelcoord}{\labelcoordX}{\labelcoordY}% - \coordinate (label-coord) at ($(label-coord)+(\labelcoordX,\labelcoordY)$);% + \path let \p1=\labelcoord in coordinate (label-coord) at ($(label-coord)+(\x1,\y1)$);% }% \node[\align] at (label-coord) {\footnotesize \labelcontent};% }% @@ -428,8 +414,7 @@ \ifdefstring{\labelcontent}{}{}{% label NOT empty \coordinate (label-coord) at ($\trafficfactor*\facefactor*(0,-0.4)$);% \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default - \gettikzxy{\labelcoord}{\labelcoordX}{\labelcoordY}% - \coordinate (label-coord) at ($(label-coord)+(\labelcoordX,\labelcoordY)$);% + \path let \p1=\labelcoord in coordinate (label-coord) at ($(label-coord)+(\x1,\y1)$);% }% \node[\align] at (label-coord) {\footnotesize \labelcontent};% }% @@ -504,8 +489,7 @@ \ifdefstring{\labelcontent}{}{}{% label NOT empty \coordinate (label-coord) at ($\trafficfactor*\facefactor*(0,-0.4)$);% \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default - \gettikzxy{\labelcoord}{\labelcoordX}{\labelcoordY}% - \coordinate (label-coord) at ($(label-coord)+(\labelcoordX,\labelcoordY)$);% + \path let \p1=\labelcoord in coordinate (label-coord) at ($(label-coord)+(\x1,\y1)$);% }% \node[\align] at (label-coord) {\footnotesize \labelcontent};% }% @@ -588,8 +572,7 @@ \ifdefstring{\labelcontent}{}{}{% label NOT empty \coordinate (label-coord) at ($\trafficfactor*\facefactor*(0,-0.4)$);% \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default - \gettikzxy{\labelcoord}{\labelcoordX}{\labelcoordY}% - \coordinate (label-coord) at ($(label-coord)+(\labelcoordX,\labelcoordY)$);% + \path let \p1=\labelcoord in coordinate (label-coord) at ($(label-coord)+(\x1,\y1)$);% }% \node[\align] at (label-coord) {\footnotesize \labelcontent};% }% diff --git a/Master/texmf-dist/tex/latex/tikz-trackschematic/tikzlibrarytrackschematic.measures.code.tex b/Master/texmf-dist/tex/latex/tikz-trackschematic/tikzlibrarytrackschematic.measures.code.tex index c551ed0142e..4a80d5e8fe1 100644 --- a/Master/texmf-dist/tex/latex/tikz-trackschematic/tikzlibrarytrackschematic.measures.code.tex +++ b/Master/texmf-dist/tex/latex/tikz-trackschematic/tikzlibrarytrackschematic.measures.code.tex @@ -1,6 +1,3 @@ -%!TEX TS-program = pdflatexmk -%!TEX root = ../test/test.tex -% %% symbol library for TikZ track schematics % % Copyright (c) 2018 - 2022, Martin Scheidt (ISC license) @@ -15,13 +12,6 @@ \RequirePackage{tikz,etoolbox}% \usetikzlibrary{calc,intersections,arrows.meta}% % -% https://tex.stackexchange.com/questions/56353/extract-x-y-coordinate-of-an-arbitrary-point-on-curve-in-tikz -\providecommand{\gettikzxy}[3]{% - \tikz@scan@one@point\pgfutil@firstofone#1\relax% - \edef#2{\the\pgf@x}% - \edef#3{\the\pgf@y}% -}% -% %%%%%%%%%%%%%%% % tikz keys for multiple use %%%%%%%%%%%%%%% @@ -210,10 +200,6 @@ \def\labelcommand{#2}% beware of leading and tailing spaces! \def\labelcontent{#3}% % - \gettikzxy{\basecoord}{\basecoordX}{\basecoordY}% - \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default - \gettikzxy{\labelcoord}{\labelcoordX}{\labelcoordY}% - } %% orientation setup \ifdefstring{\orientation}{left}{% orientation \def\align{right}% @@ -230,14 +216,14 @@ %% (0,0.75) (ts-hm-b1) (ts-hm-b2) %% (0,0)• • ------- • --------- • ----- •(ts-hm-l) label %% - \coordinate (ts-hm-l) at (0,\basecoordY);% + \path let \p1=\basecoord in coordinate (ts-hm-l) at (0,\y1);% \ifdefstring{\labelcoord}{(none)}{% \coordinate (ts-hm-b1) at (ts-hm-l);% \coordinate (ts-hm-b2) at (ts-hm-l);% }{% initialize if NOT default \coordinate (ts-hm-b1) at ($(ts-hm-l) + (0,0.5)$);% - \coordinate (ts-hm-b2) at ($(ts-hm-l) + (\labelcoordX,0.25)$);% - \coordinate (ts-hm-l) at ($(ts-hm-l) + (\labelcoordX,\labelcoordY)$);% + \path let \p1=\labelcoord in coordinate (ts-hm-b2) at ($(ts-hm-l) + (\x1,0.25)$);% + \path let \p1=\labelcoord in coordinate (ts-hm-l) at ($(ts-hm-l) + (\x1,\y1)$);% }% %% symbol \path[draw=\hectometercolor,dashed,shorten <=0.75cm]% diff --git a/Master/texmf-dist/tex/latex/tikz-trackschematic/tikzlibrarytrackschematic.symbology.code.tex b/Master/texmf-dist/tex/latex/tikz-trackschematic/tikzlibrarytrackschematic.symbology.code.tex index fa250629b94..7d70794f3f8 100644 --- a/Master/texmf-dist/tex/latex/tikz-trackschematic/tikzlibrarytrackschematic.symbology.code.tex +++ b/Master/texmf-dist/tex/latex/tikz-trackschematic/tikzlibrarytrackschematic.symbology.code.tex @@ -1,6 +1,3 @@ -%!TEX TS-program = pdflatexmk -%!TEX root = ../test/test.tex -% %% symbol library for TikZ track schematics % % Copyright (c) 2018 - 2022, Martin Scheidt (ISC license) @@ -97,10 +94,9 @@ \tsSymbol{clearing_point} & clearing point \\% \tsSymbol{block_clearing_point} & block clearing point \\% \tsSymbol{route_clearing_point} & route clearing point \\% - \tsSymbol{transmitter} & transmitter \\% - \tsSymbol{transmitter_forward} & transmitter effective forward \\% - \tsSymbol{transmitter_bidirectional}& transmitter bidirectional \\% - \tsSymbol{loop_transmitter} & loop transmitter \\% + \tsSymbol{balise_group} & unenumerated balise group (switchable) \\% + \tsSymbol{balise_individual} & individual balises (switchable) \\% + \tsSymbol{trackloop} & track loop transmitter \\% \tsSymbol{route} & route \\% \tsSymbol{direction_control} & direction control \\% \tsSymbol{platform} & platform \\% diff --git a/Master/texmf-dist/tex/latex/tikz-trackschematic/tikzlibrarytrackschematic.topology.code.tex b/Master/texmf-dist/tex/latex/tikz-trackschematic/tikzlibrarytrackschematic.topology.code.tex index 441964fb3b0..4d98af5fb19 100644 --- a/Master/texmf-dist/tex/latex/tikz-trackschematic/tikzlibrarytrackschematic.topology.code.tex +++ b/Master/texmf-dist/tex/latex/tikz-trackschematic/tikzlibrarytrackschematic.topology.code.tex @@ -1,6 +1,3 @@ -%!TEX TS-program = pdflatexmk -%!TEX root = ../test/test.tex -% %% symbol library for TikZ track schematics % % Copyright (c) 2018 - 2022, Martin Scheidt (ISC license) @@ -15,13 +12,6 @@ \RequirePackage{tikz,etoolbox}% \usetikzlibrary{calc,patterns}% % -% https://tex.stackexchange.com/questions/56353/extract-x-y-coordinate-of-an-arbitrary-point-on-curve-in-tikz -\providecommand{\gettikzxy}[3]{% - \tikz@scan@one@point\pgfutil@firstofone#1\relax% - \edef#2{\the\pgf@x}% - \edef#3{\the\pgf@y}% -}% -% %%%%%%%%%%%%%%% % tikz keys for multiple use %%%%%%%%%%%%%%% @@ -81,7 +71,7 @@ \newcommand\secondarytrack{}% just for safety \def\secondarytrack{\path[draw=\foreground,SecondaryTrack]}% \secondarytrack (coord1) -- (coord2); \newcommand\sidetrack{}% just for safety -\def\sidetrack{\path[draw,SecondaryTrack]}% alias for \secondarytrack +\def\sidetrack{\path[draw=\foreground,SecondaryTrack]}% alias for \secondarytrack % %% symbol definition \tikzset{% @@ -123,8 +113,7 @@ \coordinate (ts-tl-l) at (0,0);% \ifdefstring{\labelcoord}{(none)}{% default coord }{% initialize if NOT default - \gettikzxy{\labelcoord}{\labelcoordX}{\labelcoordY}% - \coordinate (ts-tl-l) at ($(ts-tl-l)+(\labelcoordX,\labelcoordY)$);% + \path let \p1=\labelcoord in coordinate (ts-tl-l) at ($(ts-tl-l)+(\x1,\y1)$);% }% \node at (ts-tl-l) {\labelcontent};% }% @@ -301,8 +290,7 @@ \tikzset{every node/.style={text=\foreground}};% \coordinate (ts-y-l) at ($\branchfactor*(0,-8pt)$);% \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default - \gettikzxy{\labelcoord}{\labelcoordX}{\labelcoordY}% - \coordinate (ts-y-l) at ($(ts-y-l)+(\labelcoordX,\labelcoordY)$);% + \path let \p1=\labelcoord in coordinate (ts-y-l) at ($(ts-y-l)+(\x1,\y1)$);% }% \node at (ts-y-l) {\footnotesize \labelcontent};% }% @@ -524,16 +512,14 @@ \ifdefstring{\labelcontentleft}{}{}{% label NOT empty \coordinate (ts-sy-l1) at ($(2pt,0) + \branchfactor*(0, 10pt)$);% \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default - \gettikzxy{\labelcoord}{\labelcoordX}{\labelcoordY}% - \coordinate (ts-sy-l1) at ($(ts-sy-l1)+(\labelcoordX,\labelcoordY)$);% + \path let \p1=\labelcoord in coordinate (ts-sy-l1) at ($(ts-sy-l1)+(\x1,\y1)$);% }% \node[left] at (ts-sy-l1) {\footnotesize \labelcontentleft};% }% \ifdefstring{\labelcontentright}{}{}{% label NOT empty \coordinate (ts-sy-l2) at ($(2pt,0) + \branchfactor*(0,-10pt)$);% \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default - \gettikzxy{\labelcoord}{\labelcoordX}{\labelcoordY}% - \coordinate (ts-sy-l2) at ($(ts-sy-l2)-(\labelcoordX,\labelcoordY)$);% + \path let \p1=\labelcoord in coordinate (ts-sy-l2) at ($(ts-sy-l2)+(\x1,\y1)$);% }% \node[right] at (ts-sy-l2) {\footnotesize \labelcontentright};% }% @@ -585,8 +571,7 @@ \tikzset{every node/.style={text=\foreground}};% \coordinate (ts-x-l) at ($(2pt,0) + \branchfactor*(0,-9pt)$);% \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default - \gettikzxy{\labelcoord}{\labelcoordX}{\labelcoordY}% - \coordinate (ts-x-l) at ($(ts-x-l)+(\labelcoordX,\labelcoordY)$);% + \path let \p1=\labelcoord in coordinate (ts-x-l) at ($(ts-x-l)+(\x1,\y1)$);% }% \node[right] at (ts-x-l) {\footnotesize \labelcontent};% }% @@ -660,12 +645,11 @@ %% label \ifdefstring{\labelcontent}{}{}{% label NOT empty \tikzset{every node/.style={text=\foreground}};% - \coordinate (ts-dr-l) at ($\branchfactor*(0,-10pt)$);% + \coordinate (ts-dr-l) at ($\branchfactor*(0,-0.3)$);% \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default - \gettikzxy{\labelcoord}{\labelcoordX}{\labelcoordY}% - \coordinate (ts-dr-l) at ($(ts-dr-l)+(\labelcoordX,\labelcoordY)$);% + \path let \p1=\labelcoord in coordinate (ts-dr-l) at ($(ts-dr-l)+(\x1,\y1)$);% }% - \node[right] at (ts-dr-l) {\footnotesize \labelcontent};% + \node at (ts-dr-l) {\footnotesize \labelcontent};% }% % }},% END pics/derailer/.style args={#1/#2/#3} @@ -678,4 +662,4 @@ % %%%%%%%%%%%%%%% \endinput% -%
\ No newline at end of file +% diff --git a/Master/texmf-dist/tex/latex/tikz-trackschematic/tikzlibrarytrackschematic.trafficcontrol.code.tex b/Master/texmf-dist/tex/latex/tikz-trackschematic/tikzlibrarytrackschematic.trafficcontrol.code.tex index 97978f5b072..253c5e21a97 100644 --- a/Master/texmf-dist/tex/latex/tikz-trackschematic/tikzlibrarytrackschematic.trafficcontrol.code.tex +++ b/Master/texmf-dist/tex/latex/tikz-trackschematic/tikzlibrarytrackschematic.trafficcontrol.code.tex @@ -1,6 +1,3 @@ -%!TEX TS-program = pdflatexmk -%!TEX root = ../test/test.tex -% %% symbol library for TikZ track schematics % % Copyright (c) 2018 - 2022, Martin Scheidt (ISC license) @@ -15,13 +12,6 @@ \RequirePackage{tikz,etoolbox}% \usetikzlibrary{calc}% % -% https://tex.stackexchange.com/questions/56353/extract-x-y-coordinate-of-an-arbitrary-point-on-curve-in-tikz -\providecommand{\gettikzxy}[3]{% - \tikz@scan@one@point\pgfutil@firstofone#1\relax% - \edef#2{\the\pgf@x}% - \edef#3{\the\pgf@y}% -}% -% %%%%%%%%%%%%%%% % tikz keys for multiple use %%%%%%%%%%%%%%% @@ -208,8 +198,7 @@ \ifdefstring{\labelcontent}{}{}{% label NOT empty \coordinate (ts-s-l) at ($\trafficfactor*\facefactor*(0,-0.4)$);% \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default - \gettikzxy{\labelcoord}{\labelcoordX}{\labelcoordY}% - \coordinate (ts-s-l) at ($(ts-s-l)+(\labelcoordX,\labelcoordY)$);% + \path let \p1=\labelcoord in coordinate (ts-s-l) at ($(ts-s-l)+(\x1,\y1)$);% }% \node[\align] at (ts-s-l) {\footnotesize \labelcontent};% }% @@ -414,8 +403,7 @@ \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 - \gettikzxy{\labelcoord}{\labelcoordX}{\labelcoordY}% - \coordinate (ts-cp-l) at ($(ts-cp-l)+(\labelcoordX,\labelcoordY)$);% + \path let \p1=\labelcoord in coordinate (ts-cp-l) at ($(ts-cp-l)+(\x1,\y1)$);% }% \node at (ts-cp-l) {\footnotesize \labelcontent};% }% @@ -438,25 +426,17 @@ }% % %%%%%%%%%%%%%%% -% symbol transmitter +% symbol trackloop %%%%%%%%%%%%%%% % command -\newcommand\transmitter{}% just for safety -\def\transmitter[#1]#2(#3)#4(#5){% \transmitter[options] at (coord) label (name); - \pic[#1] at (#3) {transmitter={#2/#4/#5}}% symbol -}% -\newcommand\balise{}% just for safety -\def\balise[#1]#2(#3)#4(#5){% \balise[options] at (coord) label (name); - \pic[type=balise,#1] at (#3) {transmitter={#2/#4/#5}}% symbol -}% \newcommand\trackloop{}% just for safety \def\trackloop[#1]#2(#3)#4(#5){% \trackloop[options] at (coord) label (name); - \pic[type=loop,#1] at (#3) {transmitter={#2/#4/#5}}% symbol + \pic[#1] at (#3) {trackloop={#2/#4/#5}}% symbol }% % symbol definition \tikzset{% - pics/transmitter/.default=,% - pics/transmitter/.style args={#1/#2/#3}{code={% + pics/trackloop/.default=,% + pics/trackloop/.style args={#1/#2/#3}{code={% %% settings \def\coordcommand{#1}% beware of leading and tailing spaces! \def\labelcommand{#2}% beware of leading and tailing spaces! @@ -473,62 +453,212 @@ }% end \ifdefstring{\trafficpractice} %% marker \tikzset{every path/.style={draw=\foreground}};% - \ifdefstring{\type}{balise}{% type balise - \path[line width=1pt,fill=\background] ($(-0.25,0)$) rectangle% - ($\trafficfactor*(0,-0.25) + (0.25,0)$);% balise marker - \ifdefstring{\face}{forward}{% face - \path ($\trafficfactor*(0,-0.05) + (0.1,0)$) -- ($\trafficfactor*(0,-0.125) + (0.2,0)$) --% - ($\trafficfactor*(0,-0.2) + (0.1,0)$) -- cycle;% arrow forward - }{% - \ifdefstring{\face}{backward}{% face - \path ($\trafficfactor*(0,-0.05) + (-0.1,0)$) -- ($\trafficfactor*(0,-0.125) + (-0.2,0)$) --% - ($\trafficfactor*(0,-0.2) + (-0.1,0)$) -- cycle;% arrow backward - }{ - \ifdefstring{\face}{bidirectional}{% face - \path ($\trafficfactor*(0,-0.05) + (0.1,0)$) -- ($\trafficfactor*(0,-0.125) + (0.2,0)$) --% - ($\trafficfactor*(0,-0.2) + (0.1,0)$) -- cycle;% arrow forward - \path ($\trafficfactor*(0,-0.05) + (-0.1,0)$) -- ($\trafficfactor*(0,-0.125) + (-0.2,0)$) --% - ($\trafficfactor*(0,-0.2) + (-0.1,0)$) -- cycle;% arrow backward - }{}% - }% - }% end \ifdefstring{\face} - }{% - \ifdefstring{\type}{loop}{% type loop - \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 - }{% error message - \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/trafficcontrol/transmitter/type}{“balise“ OR “loop“ as key required}}% - }% - }% end \ifdefstring{\type} + \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}};% \coordinate (ts-tm-l) at ($\trafficfactor*(0,0.25)$);% \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default - \gettikzxy{\labelcoord}{\labelcoordX}{\labelcoordY}% - \coordinate (ts-tm-l) at ($(ts-tm-l) + (\labelcoordX,\labelcoordY)$);% + \path let \p1=\labelcoord in coordinate (ts-tm-l) at ($(ts-tm-l)+(\x1,\y1)$);% }% \node at (ts-tm-l) {\footnotesize \labelcontent};% }% }},% end pics/transmitter/.style args={#1/#2/#3} % symbology entry - symbology_transmitter/.pic = {% - \maintrack (0,0) -- (6,0);% - \balise[] at (3,0) label ();% - },% - % symbology entry - symbology_transmitter_forward/.pic = {% + symbology_trackloop/.pic = {% \maintrack (0,0) -- (6,0);% - \balise[forward] at (3,0) label ();% + \trackloop[forward] at (3,0) label ();% },% +}% +% +%%%%%%%%%%%%%%% +% symbol balise +%%%%%%%%%%%%%%% +% command +\newcommand\balise{}% just for safety +\def\balise[#1]#2(#3)#4(#5){% \balise[options] at (coord) label (name); + \pic[#1] at (#3) {balise={#2/#4/#5}}% symbol +}% +\pgfkeys{% + /tikz/trackschematic/trafficcontrol/.is family,% + /tikz/trackschematic/trafficcontrol/.cd,% + %% route signal type + switched/.value forbidden,% + switched/.code={\settoggle{switched}{true}},% + /tikz/switched/.forward to=/tikz/trackschematic/trafficcontrol/switched,% + %% balises along the direction + along/.store in=\along,% array of integer + along=none,% DEFAULT + /tikz/along/.forward to=/tikz/trackschematic/trafficcontrol/along,% + %% balises oppose the direction + oppose/.store in=\oppose,% array of integer + oppose=none,% DEFAULT + /tikz/oppose/.forward to=/tikz/trackschematic/trafficcontrol/oppose,% + %% balises along the direction + along switched/.store in=\alongswitched,% array of integer + along switched=none,% DEFAULT + /tikz/along switched/.forward to=/tikz/trackschematic/trafficcontrol/along switched,% + %% balises oppose the direction + oppose switched/.store in=\opposeswitched,% array of integer + oppose switched=none,% DEFAULT + /tikz/oppose switched/.forward to=/tikz/trackschematic/trafficcontrol/oppose switched,% + %% display index number + index number/.value forbidden,% + index number/.code={\settoggle{index_number}{true}},% + /tikz/index/.forward to=/tikz/trackschematic/trafficcontrol/index number,% +}% +% options +\newtoggle{unnumberd}\settoggle{unnumberd}{true}% DEFAULT +\newtoggle{switched}\settoggle{switched}{false}% +\newtoggle{index_number}\settoggle{index_number}{false}% +% symbol definition +\tikzset{% + pics/balise/.default=,% + pics/balise/.style args={#1/#2/#3}{code={% + %% + %%%%%%%[steps]%%%%%% + %% 0. setup settings + %% 1. draw marker + %% 2. draw label + %%%%%%%%%%%%%%%%%%%% + %% 0. settings + \def\coordcommand{#1}% beware of leading and tailing spaces! + \def\labelcommand{#2}% beware of leading and tailing spaces! + \def\labelcontent{#3}% + %% + %% face setup + \ifdefstring{\face}{forward}{% face + \pgfmathsetmacro{\facefactor}{1}% + }{% + \ifdefstring{\face}{backward}{% face + \pgfmathsetmacro{\facefactor}{-1}% + }{% error message + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/face}{“forward“ OR “backward“ as key required}}% + }% + }% end \ifdefstring{\face} + %% + %% traffic practice setup + \ifdefstring{\trafficpractice}{left}{% branch + \pgfmathsetmacro{\trafficfactor}{-1}% + }{% + \ifdefstring{\trafficpractice}{right}{% branch + \pgfmathsetmacro{\trafficfactor}{1}% + }{% error message + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/trafficcontrol/traffic practice}{“left“ OR “right“ as key required}}% + }% + }% end \ifdefstring{\trafficpractice} + %% + %% number of balises known? + \ifdefstring{\along}{none}{}{% a number has been set + \settoggle{unnumberd}{false}% + }% + %% number of balises known? + \ifdefstring{\oppose}{none}{}{% a number has been set + \settoggle{unnumberd}{false}% + }% + %% number of balises known? + \ifdefstring{\alongswitched}{none}{}{% a number has been set + \settoggle{unnumberd}{false}% + }% + %% number of balises known? + \ifdefstring{\opposeswitched}{none}{}{% a number has been set + \settoggle{unnumberd}{false}% + }% + %% + %%%%%%%%%%%%%%%%%%%% + %% 1. marker + \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 + \iftoggle{switched}{% balises can be switched + \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% + ($\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};% + }{}% + }% + }% + \ifdefstring{\oppose}{none}{}{ + \foreach \n in \oppose{% + \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};% + }{}% + }% + }% + \ifdefstring{\alongswitched}{none}{}{ + \foreach \n in \alongswitched{% + \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% + ($\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};% + }{}% + }% + }% + \ifdefstring{\opposeswitched}{none}{}{ + \foreach \n in \opposeswitched{% + \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% + ($\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};% + }{}% + }% + }% + }% + %% + %%%%%%%%%%%%%%%%%%%% + %% 2. label + \ifdefstring{\labelcontent}{}{}{% label NOT empty + %% coord + \iftoggle{unnumberd}{% no number has been set + \coordinate (label-coord) at ($\trafficfactor*\facefactor*(0,-0.25)$);% + }{% + \coordinate (label-coord) at ($\trafficfactor*\facefactor*(0,-0.25) + (0.1,0)$);% + }% + \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default + \path let \p1=\labelcoord in coordinate (label-coord) at ($(label-coord)+(\x1,\y1)$);% + }% + %% label style + \tikzset{every node/.style={font=\sffamily,text=\foreground}};% + % + \ifdefstring{\trafficpractice}{left}{% + \tikzset{every node/.append style={left,align=right}};% + }{% + \tikzset{every node/.append style={right,align=left}};% + }% + \ifdefstring{\face}{forward}{% + \tikzset{every node/.append style={rotate=270}};% + }{% + \tikzset{every node/.append style={rotate=90}};% + }% + %% label + \node at (label-coord) {\footnotesize \labelcontent};% + }% + }},% end pics/balise/.style args={#1/#2/#3} % symbology entry - symbology_transmitter_bidirectional/.pic = {% + symbology_balise_group/.pic = {% \maintrack (0,0) -- (6,0);% - \balise[bidirectional] at (3,0) label ();% + \balise[forward] at (2,0) label (A);% + \balise[forward,switched] at (4,0) label (B);% },% - % symbology entry - symbology_loop_transmitter/.pic = {% + symbology_balise_individual/.pic = {% \maintrack (0,0) -- (6,0);% - \transmitter[type=loop] at (3,0) label ();% + \balise[forward,along={0,1,2}] at (2,0) label (A);% + \balise[forward,along switched={0,1,2}] at (4,0) label (B);% },% }% % @@ -636,8 +766,7 @@ \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 - \gettikzxy{\labelcoord}{\labelcoordX}{\labelcoordY}% - \coordinate (ts-ma-l) at ($(ts-ma-l) + (\labelcoordX,\labelcoordY)$);% + \path let \p1=\labelcoord in coordinate (ts-ma-l) at ($(ts-ma-l)+(\x1,\y1)$);% }% \node[\align] at (ts-ma-l) {\footnotesize \labelcontent};% }% @@ -701,8 +830,7 @@ \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 - \gettikzxy{\labelcoord}{\labelcoordX}{\labelcoordY}% - \coordinate (ts-bp-l) at ($(ts-bp-l) + (\labelcoordX,\labelcoordY)$);% + \path let \p1=\labelcoord in coordinate (ts-bp-l) at ($(ts-bp-l)+(\x1,\y1)$);% }% \node[\align] at (ts-bp-l) {\footnotesize \labelcontent};% }% @@ -767,8 +895,7 @@ \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 - \gettikzxy{\labelcoord}{\labelcoordX}{\labelcoordY}% - \coordinate (ts-dp-l) at ($(ts-dp-l)+(\labelcoordX,\labelcoordY)$);% + \path let \p1=\labelcoord in coordinate (ts-dp-l) at ($(ts-dp-l)+(\x1,\y1)$);% }% \node at (ts-dp-l) {\footnotesize \labelcontent};% }% diff --git a/Master/texmf-dist/tex/latex/tikz-trackschematic/tikzlibrarytrackschematic.vehicles.code.tex b/Master/texmf-dist/tex/latex/tikz-trackschematic/tikzlibrarytrackschematic.vehicles.code.tex index 46999714fb7..bcf7ee4a795 100644 --- a/Master/texmf-dist/tex/latex/tikz-trackschematic/tikzlibrarytrackschematic.vehicles.code.tex +++ b/Master/texmf-dist/tex/latex/tikz-trackschematic/tikzlibrarytrackschematic.vehicles.code.tex @@ -1,6 +1,3 @@ -%!TEX TS-program = pdflatexmk -%!TEX root = ../test/test.tex -% %% symbol library for TikZ track schematics % % Copyright (c) 2018 - 2022, Martin Scheidt (ISC license) @@ -15,13 +12,6 @@ \RequirePackage{tikz,etoolbox}% \usetikzlibrary{calc}% % -% https://tex.stackexchange.com/questions/56353/extract-x-y-coordinate-of-an-arbitrary-point-on-curve-in-tikz -\providecommand{\gettikzxy}[3]{% - \tikz@scan@one@point\pgfutil@firstofone#1\relax% - \edef#2{\the\pgf@x}% - \edef#3{\the\pgf@y}% -}% -% \ifdeflength{\objectlength}{}{% Not defined, so define it! \newlength{\objectlength}% }% @@ -68,7 +58,7 @@ %% command: parked vehicles \newcommand\parkedvehicles{}% just for safety \def\parkedvehicles[#1]#2(#3)#4(#5){% \parkedvehicles[options] at (coord) label (name); - \pic[parked,operation=undefined,#1] at (#3) {vehicles={#2/#4/#5}}% symbol + \pic[parked,operation=undefined,forward,#1] at (#3) {vehicles={#2/#4/#5}}% symbol }% %% command: shunting movements \newcommand\shunting{}% just for safety @@ -112,7 +102,7 @@ run=none,% DEFAULT /tikz/run/.forward to=/tikz/trackschematic/vehicles/run,% %% label - label align/.store in=\labelalign,% (coord) + label align/.store in=\labelalign,% left, right OR center label align=center,% DEFAULT /tikz/label align/.forward to=/tikz/trackschematic/vehicles/label align,% %% train bend @@ -129,7 +119,7 @@ \newtoggle{is_shunting}\settoggle{is_shunting}{false}% \newtoggle{in_train_mode}\settoggle{in_train_mode}{false}% \newtoggle{train_is_a_ghost}\settoggle{train_is_a_ghost}{false}% -\newtoggle{bend}\settoggle{bend}{false}% +\newtoggle{single_bend}\settoggle{single_bend}{false}% \newtoggle{double_bend}\settoggle{double_bend}{false}% % %%%%%%%%%%%%%%% @@ -139,211 +129,169 @@ \tikzset{% pics/vehicles/.default=,% pics/vehicles/.style args={#1/#2/#3}{code={% - %% settings + %% + %%%%%%%[steps]%%%%%% + %% + %% 0. setup settings + %% 1. calculate coordinates + %% - calculation of vehicle coordinates: + %% + %% rear bend front bend + %% (ts-b-r1) (ts-b-f1) + %% (ts-v-r1)•__________•_______•__________•(ts-v-f1) + %% | \ + %% | label•(ts-v-l) •(ts-v-f) front tip + %% |__________ _______ __________ / + %% (ts-v-r2)• • • •(ts-v-f2) + %% (ts-b-r2) (ts-b-f2) + %% + %% - the base coord is depend on usage + %% for parked: (ts-v-l) + %% else: (ts-v-f) + %% + %% 2. set style for line and background + %% 3. draw arrows for speed indication + %% 4. draw vehicle shape + %% 5. draw operation mode + %% 6. draw label + %% + %%%%%%%%%%%%%%%%%%%% + %% 0. settings \def\coordcommand{#1}% beware of leading and tailing spaces! \def\labelcommand{#2}% beware of leading and tailing spaces! \def\labelcontent{#3}% - %% bend - % determine number of bends and - % find front and back bend from head to tail - \ifdefstring{\bendrightcoord}{(none)}{}{% initialize if NOT default - \gettikzxy{\bendrightcoord}{\bendrightX}{\bendrightY}% - \settoggle{bend}{true}% - \ifdefstring{\face}{forward}{% - \pgfmathsetlengthmacro\forwardbendX{\bendrightX}% - \pgfmathsetlengthmacro\forwardbendY{\bendrightY}% - \pgfmathsetlengthmacro\bendlength{\objectlength + \bendrightX}% - \pgfmathsetmacro\forwardbendTYPE{1}% - }{% face backward - \pgfmathsetlengthmacro\backwardbendX{\bendrightX}% - \pgfmathsetlengthmacro\backwardbendY{\bendrightY}% - \pgfmathsetlengthmacro\bendlength{\objectlength - \bendrightX}% - \pgfmathsetmacro\backwardbendTYPE{1}% - }% END \ifdefstring{\face}{forward} + %% face setup + \ifdefstring{\face}{forward}{% face + \pgfmathsetmacro{\facefactor}{1}% + }{% + \ifdefstring{\face}{backward}{% face + \pgfmathsetmacro{\facefactor}{-1}% + }{% error message + \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/face}{“forward“ OR “backward“ as key required}}% + }% + }% end \ifdefstring{\face} + %% bend setup + % determine number of bends and find front and rear bend from left to right + \ifdefstring{\bendleftcoord}{(none)}{}{% NOT default + \settoggle{single_bend}{true}% + \path \bendleftcoord;\pgfgetlastxy{\bendX}{\bendY}% absolut coord + \pgfmathsetmacro\bendfactor{1}% }% - \ifdefstring{\bendleftcoord}{(none)}{}{% initialize if NOT default - \gettikzxy{\bendleftcoord}{\bendleftX}{\bendleftY}% - \iftoggle{bend}{% + \ifdefstring{\bendrightcoord}{(none)}{}{% NOT default + \iftoggle{single_bend}{% \settoggle{double_bend}{true}% - \ifdefstring{\face}{forward}{% - \ifdimcomp{\bendrightX}{>}{\bendleftX}{% - \pgfmathsetlengthmacro\forwardbendX{\bendrightX}% - \pgfmathsetmacro\forwardbendTYPE{1}% - \pgfmathsetlengthmacro\backwardbendX{\bendleftX}% - \pgfmathsetlengthmacro\backwardbendY{\bendleftY}% - \pgfmathsetmacro\backwardbendTYPE{-1}% - }{% {\bendrightX}{<}{\bendleftX} - \pgfmathsetlengthmacro\forwardbendX{\bendleftX}% - \pgfmathsetmacro\forwardbendTYPE{-1}% - \pgfmathsetlengthmacro\backwardbendX{\bendrightX}% - \pgfmathsetlengthmacro\backwardbendY{\bendrightY}% - \pgfmathsetmacro\backwardbendTYPE{1} + \settoggle{single_bend}{false}% + \path \bendrightcoord;\pgfgetlastxy{\bendrightX}{\bendrightY} + \ifdimcomp{\bendrightX}{>}{\bendX}{% which one comes first? + \ifdefstring{\face}{forward}{% + \pgfmathsetmacro\frontBendfactor{1}% + \pgfmathsetmacro\rearBendfactor{-1}% + \pgfmathsetlengthmacro\frontBendX{\bendrightX}% + \pgfmathsetlengthmacro\rearBendX{\bendX}% + \pgfmathsetlengthmacro\rearBendY{\bendY}% + }{% face backward + \pgfmathsetmacro\frontBendfactor{-1}% + \pgfmathsetmacro\rearBendfactor{1}% + \pgfmathsetlengthmacro\frontBendX{\bendX}% + \pgfmathsetlengthmacro\rearBendX{\bendrightX}% + \pgfmathsetlengthmacro\rearBendY{\bendrightY}% }% - }{% face backward - \ifdimcomp{\bendrightX}{<}{\bendleftX}{% - \pgfmathsetlengthmacro\backwardbendX{\bendrightX}% - \pgfmathsetmacro\backwardbendTYPE{-1}% - \pgfmathsetlengthmacro\forwardbendX{\bendleftX}% - \pgfmathsetlengthmacro\forwardbendY{\bendleftY}% - \pgfmathsetmacro\forwardbendTYPE{1}% - }{% {\bendrightX}{>}{\bendleftX} - \pgfmathsetlengthmacro\backwardbendX{\bendleftX}% - \pgfmathsetmacro\backwardbendTYPE{1}% - \pgfmathsetlengthmacro\forwardbendX{\bendrightX}% - \pgfmathsetlengthmacro\forwardbendY{\bendrightY}% - \pgfmathsetmacro\forwardbendTYPE{-1}% + }{% {\bendrightX}{<}{\bendleftX}% + \ifdefstring{\face}{forward}{% + \pgfmathsetmacro\frontBendfactor{-1}% + \pgfmathsetmacro\rearBendfactor{1}% + \pgfmathsetlengthmacro\frontBendX{\bendX}% + \pgfmathsetlengthmacro\rearBendX{\bendrightX}% + \pgfmathsetlengthmacro\rearBendY{\bendrightY}% + }{% face backward + \pgfmathsetmacro\frontBendfactor{1}% + \pgfmathsetmacro\rearBendfactor{-1}% + \pgfmathsetlengthmacro\frontBendX{\bendrightX}% + \pgfmathsetlengthmacro\rearBendX{\bendX}% + \pgfmathsetlengthmacro\rearBendY{\bendY}% }% }% }{% NOT double bend - \settoggle{bend}{true}% - \ifdefstring{\face}{forward}{% - \pgfmathsetlengthmacro\forwardbendX{\bendleftX}% - \pgfmathsetlengthmacro\forwardbendY{\bendleftY}% - \pgfmathsetlengthmacro\bendlength{\objectlength + \bendleftX}% - \pgfmathsetmacro\forwardbendTYPE{-1}% - }{% face backward - \pgfmathsetlengthmacro\backwardbendX{\bendleftX}% - \pgfmathsetlengthmacro\backwardbendY{\bendleftY}% - \pgfmathsetlengthmacro\bendlength{\objectlength - \bendleftX}% - \pgfmathsetmacro\backwardbendTYPE{-1}% - }% END \ifdefstring{\face}{forward} + \settoggle{single_bend}{true}% + \path \bendrightcoord;\pgfgetlastxy{\bendX}{\bendY}% absolut coord + \pgfmathsetmacro\bendfactor{-1}% }% }% - %% - %% calculation of vehicle coordinates - %% - %% backward bend forward bend - %% (ts-b-b1) (ts-b-f1) - %% (ts-v-4)•_______•_______•_______•(ts-v-1) - %% / \ - %% backward (ts-v-r)• label•(ts-v-l) •(ts-v-f) forward - %% \_______ _______ _______/ - %% (ts-v-3)• • • •(ts-v-2) - %% (ts-b-b2) (ts-b-f2) - %% - \iftoggle{is_parked}{% vehicle parked - \coordinate (ts-v-1) at ($ 0.5*(\objectlength,0) + (0, 0.3)$);% - \coordinate (ts-v-2) at ($ 0.5*(\objectlength,0) + (0,-0.3)$);% - \coordinate (ts-v-3) at ($-0.5*(\objectlength,0) + (0,-0.3)$);% - \coordinate (ts-v-4) at ($-0.5*(\objectlength,0) + (0, 0.3)$);% + %%%%%%%%%%%%%%%%%%%% + %% 1. coordinate calculations + %% basic coords for corners + \iftoggle{is_parked}{% + \coordinate (ts-v-f1) at ($ 0.5*(\objectlength,0) + (0, 0.3)$);% + \coordinate (ts-v-f2) at ($ 0.5*(\objectlength,0) + (0,-0.3)$);% + \coordinate (ts-v-r1) at ($-0.5*(\objectlength,0) + (0, 0.3)$);% + \coordinate (ts-v-r2) at ($-0.5*(\objectlength,0) + (0,-0.3)$);% + }{% + \coordinate (ts-v-f1) at ($\facefactor*(-0.3,0) + (0, 0.3)$);% + \coordinate (ts-v-f2) at ($\facefactor*(-0.3,0) + (0,-0.3)$);% + \coordinate (ts-v-r1) at ($\facefactor*(-\objectlength,0) + (0, 0.3)$);% + \coordinate (ts-v-r2) at ($\facefactor*(-\objectlength,0) + (0,-0.3)$);% + }% + %% front tip for traveling direction + \iftoggle{is_parked}{% \coordinate (ts-v-f) at ($ 0.5*(\objectlength,0) + (0, 0 )$);% - \coordinate (ts-v-r) at ($-0.5*(\objectlength,0) + (0, 0 )$);% - \iftoggle{bend}{% currently not supported for parked vehicles - % \coordinate (ts-b-f1) at (ts-v-1);% - % \coordinate (ts-b-f2) at (ts-v-2);% - % \coordinate (ts-b-b1) at (ts-v-4);% - % \coordinate (ts-b-b2) at (ts-v-3);% - }{% NOT bend - \coordinate (ts-b-f1) at (ts-v-1);% - \coordinate (ts-b-f2) at (ts-v-2);% - \coordinate (ts-b-b1) at (ts-v-4);% - \coordinate (ts-b-b2) at (ts-v-3);% - }% - \ifdefstring{\labelcoord}{(none)}{% - \coordinate (ts-v-l) at (0,0);% - }{% initialize if NOT default - \gettikzxy{\labelcoord}{\labelcoordX}{\labelcoordY}% - \coordinate (ts-v-l) at (\labelcoordX,\labelcoordY);% - }% - }{% vehicle NOT parked - \ifdefstring{\face}{forward}{% face - \pgfmathsetmacro{\facefactor}{1}% - \coordinate (ts-v-1) at (-0.3, 0.3);% - \coordinate (ts-v-2) at (-0.3,-0.3);% - \coordinate (ts-v-f) at (0,0);% - \iftoggle{double_bend}{% - \coordinate (ts-v-3) at ($(-\objectlength,-0.3) + (0,\backwardbendY)$);% - \coordinate (ts-v-4) at ($(-\objectlength, 0.3) + (0,\backwardbendY)$);% - \coordinate (ts-v-r) at ($(-\objectlength, 0 ) + (0,\backwardbendY)$);% - \coordinate (ts-b-f1) at ($( \forwardbendX, 0.3) + \forwardbendTYPE*(-0.1,0)$);% - \coordinate (ts-b-f2) at ($( \forwardbendX,-0.3) + \forwardbendTYPE*( 0.1,0)$);% - \coordinate (ts-b-b1) at ($(\backwardbendX, 0.3) + \backwardbendTYPE*( 0.1,0) + (0,\backwardbendY)$);% - \coordinate (ts-b-b2) at ($(\backwardbendX,-0.3) + \backwardbendTYPE*(-0.1,0) + (0,\backwardbendY)$);% - }{% NOT double bend - \iftoggle{bend}{% - \coordinate (ts-b-f1) at ($( \forwardbendX, 0.3) + \forwardbendTYPE*(-0.1,0)$);% - \coordinate (ts-b-f2) at ($( \forwardbendX,-0.3) + \forwardbendTYPE*( 0.1,0)$);% - \coordinate (ts-b-b1) at (ts-b-f1);% - \coordinate (ts-b-b2) at (ts-b-f2);% - \coordinate (ts-v-3) at ($(-\objectlength,-0.2) + \forwardbendTYPE*(0,-\bendlength) + \forwardbendTYPE*( 0.2,0)$);% - \coordinate (ts-v-4) at ($(-\objectlength, 0.2) + \forwardbendTYPE*(0,-\bendlength) + \forwardbendTYPE*(-0.2,0)$);% - \coordinate (ts-v-r) at ($(-\objectlength, 0 ) + \forwardbendTYPE*(0,-\bendlength)$);% - }{% NOT bend - \coordinate (ts-b-f1) at (ts-v-1);% - \coordinate (ts-b-f2) at (ts-v-2);% - \coordinate (ts-v-3) at ($(-\objectlength,0) + (0,-0.3)$);% - \coordinate (ts-v-4) at ($(-\objectlength,0) + (0, 0.3)$);% - \coordinate (ts-b-b1) at (ts-v-4);% - \coordinate (ts-b-b2) at (ts-v-3);% - \coordinate (ts-v-r) at ($(-\objectlength,0)$);% - }% - }% - }{% - \ifdefstring{\face}{backward}{% face - \pgfmathsetmacro{\facefactor}{-1}% - \coordinate (ts-v-3) at (0.3,-0.3);% - \coordinate (ts-v-4) at (0.3, 0.3);% - \coordinate (ts-v-r) at (0,0);% - \iftoggle{double_bend}{% - \coordinate (ts-v-1) at ($( \objectlength, 0.3) + (0,\forwardbendY)$);% - \coordinate (ts-v-2) at ($( \objectlength,-0.3) + (0,\forwardbendY)$);% - \coordinate (ts-v-f) at ($( \objectlength, 0 ) + (0,\forwardbendY)$);% - \coordinate (ts-b-f1) at ($( \forwardbendX, 0.3) + \forwardbendTYPE*( 0.1,0) + (0,\forwardbendY)$);% - \coordinate (ts-b-f2) at ($( \forwardbendX,-0.3) + \forwardbendTYPE*(-0.1,0) + (0,\forwardbendY)$);% - \coordinate (ts-b-b1) at ($(\backwardbendX, 0.3) + \backwardbendTYPE*(-0.1,0)$);% - \coordinate (ts-b-b2) at ($(\backwardbendX,-0.3) + \backwardbendTYPE*( 0.1,0)$);% - }{% NOT double bend - \iftoggle{bend}{% - \coordinate (ts-b-b1) at ($( \backwardbendX, 0.3) + \backwardbendTYPE*( 0.1,0)$);% - \coordinate (ts-b-b2) at ($( \backwardbendX,-0.3) + \backwardbendTYPE*(-0.1,0)$);% - \coordinate (ts-b-f1) at (ts-b-b1);% - \coordinate (ts-b-f2) at (ts-b-b2);% - \coordinate (ts-v-1) at ($( \objectlength, 0.2) + \backwardbendTYPE*(0,-\bendlength) + \backwardbendTYPE*( 0.2,0)$);% - \coordinate (ts-v-2) at ($( \objectlength,-0.2) + \backwardbendTYPE*(0,-\bendlength) + \backwardbendTYPE*(-0.2,0)$);% - \coordinate (ts-v-f) at ($( \objectlength, 0 ) + \backwardbendTYPE*(0,-\bendlength)$);% - }{% NOT bend - \coordinate (ts-b-b1) at (ts-v-4);% - \coordinate (ts-b-b2) at (ts-v-3);% - \coordinate (ts-v-1) at ($(\objectlength,0) + (0, 0.3)$);% - \coordinate (ts-v-2) at ($(\objectlength,0) + (0,-0.3)$);% - \coordinate (ts-b-f1) at (ts-v-1);% - \coordinate (ts-b-f2) at (ts-v-2);% - \coordinate (ts-v-f) at ($(\objectlength,0)$);% - }% - }% - }{% error message - \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/face}{“forward“ OR “backward“ as key required}}% - }% - }% end \ifdefstring{\face} - %% label coord for NOT parked - \ifdefstring{\labelcoord}{(none)}{% - \coordinate (ts-v-l) at ($\facefactor*-0.5*(\objectlength,0) + (0,0)$);% - }{% initialize if NOT default - \gettikzxy{\labelcoord}{\labelcoordX}{\labelcoordY}% - \coordinate (ts-v-l) at (\labelcoordX,\labelcoordY);% - }% + }{% + \coordinate (ts-v-f) at (0,0);% }% + %% bend - DEFAULT: no bend + \coordinate (ts-b-f1) at (ts-v-f1);% + \coordinate (ts-b-f2) at (ts-v-f2);% + \coordinate (ts-b-r1) at (ts-v-r1);% + \coordinate (ts-b-r2) at (ts-v-r2);% % - %% vehicle style + \iftoggle{single_bend}{% + % \bendX is a absolut coordinate + % make them relative to base + \path (0,0);\pgfgetlastxy{\baseX}{\baseY}% absolut coord + % calc bend position + \coordinate (ts-b-r1) at ($(-\baseX,0) + (\bendX, 0.3) + \facefactor*\bendfactor*( 0.1,0)$);% + \coordinate (ts-b-r2) at ($(-\baseX,0) + (\bendX,-0.3) + \facefactor*\bendfactor*(-0.1,0)$);% + % calc length from bend to end with factor ~0.7071 at 45 degree to a projected length + \pgfmathsetlengthmacro\bendlength{(\facefactor*\objectlength - \baseX + \bendX)*0.7071}% + \coordinate (ts-v-r1) at ($(ts-b-r1) + (-\bendlength,0) + \facefactor*\bendfactor*( 0.1,\bendlength) + (0,-0.1)$);% + \coordinate (ts-v-r2) at ($(ts-b-r2) + (-\bendlength,0) + \facefactor*\bendfactor*(-0.1,\bendlength) + (0, 0.1)$);% + }{}% + \iftoggle{double_bend}{% + % \bendX and \bendY are absolut coords + % make them relative to base + \path (0,0);\pgfgetlastxy{\baseX}{\baseY}% absolut coord + % calc bend position + \coordinate (ts-b-f1) at ($(-\baseX,0) + (\frontBendX, 0.3) + \facefactor*\frontBendfactor*(-0.1,0)$);% + \coordinate (ts-b-f2) at ($(-\baseX,0) + (\frontBendX,-0.3) + \facefactor*\frontBendfactor*( 0.1,0)$);% + \coordinate (ts-b-r1) at ($(-\baseX,0) + (\rearBendX, 0.3) + (0,-\baseY) + (0,\rearBendY) + \facefactor*\rearBendfactor*( 0.1,0)$);% + \coordinate (ts-b-r2) at ($(-\baseX,0) + (\rearBendX,-0.3) + (0,-\baseY) + (0,\rearBendY) + \facefactor*\rearBendfactor*(-0.1,0)$);% + % calc length from bend to end with factor ~1.4142 at 45 degree to a projected length + \pgfmathsetlengthmacro\bendlength{\facefactor*\objectlength - (\frontBendX - \rearBendX)*1.4142 - (\baseX - \frontBendX)}% + \coordinate (ts-v-r1) at ($(ts-b-r1) + (-\bendlength,0) + \facefactor*\rearBendfactor*(-0.1,0)$);% + \coordinate (ts-v-r2) at ($(ts-b-r2) + (-\bendlength,0) + \facefactor*\rearBendfactor*( 0.1,0)$);% + }{}% + %% + %%%%%%%%%%%%%%%%%%%% + %% 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}};% - \coordinate (ts-v-l) at ($(ts-v-l) + (0,0.16)$);% }{% normal train \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}};% }% - % - %% arrow shapes + %% + %%%%%%%%%%%%%%%%%%%% + %% 3. arrow shapes + %% (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)$) --% - ($\facefactor*(-0.1, 0.3)$) --% - ($\facefactor*( 0.2, 0 )$) --% - ($\facefactor*(-0.1,-0.3)$) --% - ($\facefactor*(-0.3,-0.3)$) -- cycle;% \background fill + ($\facefactor*(-0.1, 0.3)$) --% + ($\facefactor*( 0.2, 0 )$) --% + ($\facefactor*(-0.1,-0.3)$) --% + ($\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 @@ -351,14 +299,14 @@ \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/vehicle/movement}{movement can only be combined with shunting}}% }% }{}% end \iftoggle{shunting_movement} - \ifdefstring{\trainrun}{none}{}{% arrow for train + \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)$) --% - ($\facefactor*(-0.1, 0.3)$) --% - ($\facefactor*( 0.2, 0 )$) --% - ($\facefactor*(-0.1,-0.3)$) --% - ($\facefactor*(-0.3,-0.3)$) -- cycle;% \background fill + ($\facefactor*(-0.1, 0.3)$) --% + ($\facefactor*( 0.2, 0 )$) --% + ($\facefactor*(-0.1,-0.3)$) --% + ($\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 )$) --% @@ -367,10 +315,10 @@ }{% \ifdefstring{\trainrun}{normal}{% \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.1, 0.3)$) --% + ($\facefactor*( 0.4, 0 )$) --% + ($\facefactor*( 0.1,-0.3)$) --% + ($\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 )$) --% @@ -385,10 +333,10 @@ }{% \ifdefstring{\trainrun}{fast}{% \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)$) --% + ($\facefactor*( 0.6, 0 )$) --% + ($\facefactor*( 0.3,-0.3)$) --% + ($\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 )$) --% @@ -414,19 +362,22 @@ \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/vehicle/run}{run can only be combined with train}}% }% end \iftoggle{in_train_mode} }% end \ifdefstring{\trainrun}{none} % end arrow shapes - % - %% vehicle shape - \path (ts-v-1) -- (ts-v-f) -- (ts-v-2) -- (ts-b-f2) -- (ts-b-b2) -- (ts-v-3) -- (ts-v-r) -- (ts-v-4) -- (ts-b-b1) -- (ts-b-f1) -- cycle;% vehicle shape - % - %% operated + %% + %%%%%%%%%%%%%%%%%%%% + %% 4. vehicle shape + \path (ts-v-f)% + -- (ts-v-f1) -- (ts-b-f1) -- (ts-b-r1) -- (ts-v-r1)% + -- (ts-v-r2) -- (ts-b-r2) -- (ts-b-f2) -- (ts-v-f2)% + -- cycle;% vehicle shape + %% + %%%%%%%%%%%%%%%%%%%% + %% 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 - \coordinate (ts-v-l) at ($(ts-v-l) + \facefactor*(-0.25,0)$);% }{ \ifdefstring{\operationmode}{automatic}{% \path[draw=none, fill=\foreground] ($\facefactor*(-0.15,0)$) -- ++($\facefactor*(-0.15,0) +(0,0.15)$) -- ++(0,-0.3) -- cycle;% triangle - \coordinate (ts-v-l) at ($(ts-v-l) + \facefactor*(-0.15,0)$);% }{% \ifdefstring{\operationmode}{undefined}{}{% \pgfkeys{/errors/unknown choice value={/tikz/trackschematic/operation}{“manual“, “automatic“ OR “undefined“ as key required}}% @@ -434,10 +385,28 @@ }% end automatically_operated }% end manually_operated }% - % - %% label + %% + %%%%%%%%%%%%%%%%%%%% + %% 6. label + \iftoggle{is_parked}{% + \coordinate (ts-v-l) at (0,0);% DEFAULT center + }{% + \coordinate (ts-v-l) at ($\facefactor*-0.5*(\objectlength,0)$);% DEFAULT center + }% + \iftoggle{train_is_a_ghost}{% ghost train + \coordinate (ts-v-l) at ($(ts-v-l) + (0,0.16)$);% + }{}% + \ifdefstring{\operationmode}{manual}{% + \coordinate (ts-v-l) at ($(ts-v-l) + \facefactor*(-0.25,0)$);% + }{}% + \ifdefstring{\operationmode}{automatic}{% + \coordinate (ts-v-l) at ($(ts-v-l) + \facefactor*(-0.15,0)$);% + }{}% + \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default + \path let \p1=\labelcoord in coordinate (ts-v-l) at ($(ts-v-l)+(\x1,\y1)$);% + }% \ifdefstring{\labelcontent}{}{}{% label NOT empty - \ifdefstring{\labelalign}{center}{% label align default + \ifdefstring{\labelalign}{center}{% DEFAULT label align center \def\labelanchor{center} }{% label align NOT default \ifdefstring{\labelalign}{left}{% label align left @@ -450,9 +419,10 @@ }% \ifdefstring{\labelalign}{right} }% \ifdefstring{\labelalign}{left} }% \ifdefstring{\labelalign}{center} - \node[text=\foreground,anchor=\labelanchor,align=\labelalign] at (ts-v-l) {\footnotesize\emph{\labelcontent}};% label + \node[text=\foreground,anchor=\labelanchor,align=\labelalign] at (ts-v-l) {\footnotesize \labelcontent};% label }% }},% END pics/vehicles/.style args={#1/#2/#3} + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % symbology entry symbology_parked_vehicles/.pic = {% \secondarytrack (0,0) -- (6,0);% |