summaryrefslogtreecommitdiff
path: root/graphics/pgf/contrib/tikz-trackschematic/tikz-trackschematic-documentation.sty
blob: da150e4a8ebea02192057f960a2fa7d6c1ca15a4 (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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
%% 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.

\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  ]----------
\ifPDFTeX
  \RequirePackage{scrhack,marginnote}
  \RequirePackage[utf8]{inputenc}
  \RequirePackage[T1]{fontenc}
\fi
\RequirePackage[main=english]{babel}
% --------[   revision history    ]----------
\RequirePackage[tocentry]{vhistory}
% --------[ Layout  ]-----------
\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}
% ----------[ display ]-----------
\RequirePackage[prefix=]{xcolor-solarized}
\RequirePackage[inline]{enumitem}

\RequirePackage[final]{listings}
\lstdefinelanguage{tikz}{%
  keywordsprefix = \\,
  alsoletter     = \\,%
  morekeywords   = {},%
  sensitive      = true,%
  morecomment    = [l]\%,%
  morestring=[s][\bfseries\color{magenta}]{\[}{\]},%
  morestring=[s][\bfseries\color{violet}]{\{}{\}},%
  morestring=[s][\bfseries\color{violet}]{(}{)},%
}[keywords,comments,strings]%

\lstset{%
  language         = tikz,%
  basicstyle       = \scriptsize\ttfamily,%
  keywordstyle     = \bfseries\color{blue},%
  commentstyle     = \itshape\color{green},%
  backgroundcolor  = \color{base3},%
  showstringspaces = false,%
  columns          = fullflexible,%
  breaklines       = true,%
  frame            = single,%
}%

\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}


% -----------[ special commands ]----------------
\renewcommand{\symbol}[2][1.0]{%
  \adjustbox{valign=c}{\begin{tikzpicture}[scale=#1]%
    \input{./snippets/#2}%
    \path (-0.1,-1.1) rectangle (6.1,1.1); % background rectangle to unify every cell containing a symbol
  \end{tikzpicture}}%
}%

\newcommand{\code}[1]{\lstinputlisting[firstline=7]{./snippets/#1}}%

\newcounter{symbolNo}%
\def\No{\stepcounter{symbolNo}\arabic{symbolNo}}%

\newcommand{\symboldescription}[1]{\paragraph*{#1}\marginnote{\tikz{\fill (-0.4,0.15)--(-0.4,-0.15)--(0,0)--cycle;}}\mbox{}\\}%

\setlength{\parindent}{0cm}
\reversemarginpar
%%%%%%%%%%%%%%%
\endinput%
%