111 lines
3.7 KiB
TeX
111 lines
3.7 KiB
TeX
%% symbol library for TikZ track schematics
|
||
%
|
||
% Copyright 2018,2019 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{doc}[2019-09-30 Doc Package]
|
||
|
||
% --------[ Coding and Language ]----------
|
||
\RequirePackage{scrhack,marginnote}
|
||
\RequirePackage[utf8]{inputenc}
|
||
\RequirePackage[T1]{fontenc}
|
||
\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}
|
||
\RequirePackage{multicol}
|
||
% -----------[ PDF linking ]----------------
|
||
\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}
|
||
|
||
\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,siunitx,adjustbox,rotating}
|
||
\sisetup{math-rm=\mathsf}
|
||
|
||
\IfFileExists{tikzlibrarytrackschematic-dev.code.tex}{%
|
||
\usetikzlibrary{trackschematic-dev.topology}%
|
||
\usetikzlibrary{trackschematic-dev.trafficcontrol}%
|
||
\usetikzlibrary{trackschematic-dev.vehicles}%
|
||
\usetikzlibrary{trackschematic-dev.constructions}%
|
||
\usetikzlibrary{trackschematic-dev.messures}%
|
||
}{%
|
||
\usetikzlibrary{trackschematic}%
|
||
}%
|
||
|
||
\def\rootTrackschematic{.}
|
||
|
||
\renewcommand{\symbol}[2][1.0]{%
|
||
\adjustbox{valign=c}{\begin{tikzpicture}[scale=#1]%
|
||
\input{\rootTrackschematic/snippets/#2}%
|
||
\path (-0.1,-1.1) rectangle (6.1,1.1); % background rectangle to unify every cell containing a symbol
|
||
\end{tikzpicture}}%
|
||
}%
|
||
|
||
\newcommand{\symboldescription}[1]{\paragraph*{#1}\marginnote{\tikz{\fill (-0.4,0.15)--(-0.4,-0.15)--(0,0)--cycle;}}\mbox{}\\}%
|
||
|
||
\newcommand{\code}[1]{\lstinputlisting[firstline=7]{\rootTrackschematic/snippets/#1}}%
|
||
|
||
\newcounter{symbolNo}%
|
||
\def\No{\stepcounter{symbolNo}\arabic{symbolNo}}%
|
||
|
||
\setlength{\parindent}{0cm}
|
||
\reversemarginpar |