summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/tikz-trackschematic/tikzlibrarytrackschematic.code.tex
blob: 408695925b0a2ca1a1884edfec8ffcd265bdb515 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
%% symbol library for TikZ track schematics
%
% 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.
%
\ProvidesFileRCS{tikzlibrarytrackschematic.code.tex}%
%
\RequirePackage{tikz,etoolbox}%
%
%%%%%%%%%%%%%%%
% loading sublibraries
%%%%%%%%%%%%%%%
% \usetikzlibrary{trackschematic.topology}%
% \usetikzlibrary{trackschematic.trafficcontrol}%
% \usetikzlibrary{trackschematic.vehicles}%
% \usetikzlibrary{trackschematic.constructions}%
% \usetikzlibrary{trackschematic.electrics}%
% \usetikzlibrary{trackschematic.measures}%
% \usetikzlibrary{trackschematic.symbology}%
%%%%%%%%%%%%%%%
%% template for new symbol definitions
%%%%%%%%%%%%%%%
% %
% \newcommand\XXXX{}% just for safety
% \def\XXXX[#1]#2(#3)#4(#5){% \XXXX[options] at (coord) label (name);
%   \pic[#1] at (#3) {XXXX={#2/#4/#5}}% symbol
% }%
% % tikz keys
% \pgfkeys{%
%   /tikz/trackschematic/.is family,%
%   /tikz/trackschematic//.cd,%
% }%
% % symbol definition
% \tikzset{%
%   pics/XXXX/.default=,%
%   pics/XXXX/.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!
%     \def\labelcontent{#3}%
%     %% symbol marker
%     %
%     %% label
%     \ifdefstring{\labelcontent}{}{}{% label NOT empty
%       \coordinate (label-coord) at (coord);%
%       \ifdefstring{\labelcoord}{(none)}{}{% initialize if NOT default
%         \path let \p1=\labelcoord in coordinate (label-coord) at ($(label-coord)+(\x1,\y1)$);%
%       }%
%       \node at (label-coord) {\footnotesize \labelcontent};%
%     }%
%   }},% END of  pics/XXXX/.style args={#1/#2/#3}
%   % symbology entry
%   symbology_XXXX/.pic = {%
%     \maintrack (0,0) -- (6,0);%
%     \XXXX at (3,0);%
%   },%
% }%
% %
%%%%%%%%%%%%%%%
% anchor are used in converting a symbol to .svg for further import in different tools
%%%%%%%%%%%%%%%
\newcommand\anchor{}% just for safety
\def\anchor#1(#2){% \anchor at (coord);
  \pic at (#2) {anchor}% symbol
}%
% symbol definition
\tikzset{%
  anchor/.pic={\fill[magenta] (0,0) circle (0.004);};%
}%
%
%%%%%%%%%%%%%%%
\endinput%
%