Debian Codegraph @

texmf-dist/doc/latex/tikz-cookingsymbols/tikz-cookingsymbols-doc.tex

raw
1 % --------------------------------------------------------------------------
2 % the tikz-cookingsymbols package - doc
3 % --------------------------------------------------------------------------
4 % Fabian Matischok
5 % E-Mail: [email protected]
6 % --------------------------------------------------------------------------
7 % Copyright 2025 Fabian Matischok
8 %
9 % This work may be distributed and/or modified under the
10 % conditions of the LaTeX Project Public License, either version 1.3
11 % of this license or (at your option) any later version.
12 % The latest version of this license is in
13 % http://www.latex-project.org/lppl.txt
14 % and version 1.3 or later is part of all distributions of LaTeX
15 % version 2005/12/01 or later.
16 \DocumentMetadata{
17 lang=en,
18 pdfversion=2.0,
19 pdfstandard=ua-2,
20 pdfstandard=a-4f,
21 %testphase={phase-III,
22 % firstaid
23 %},
24 }
25 \documentclass[paper=a4,fontsize=12pt]{scrartcl}
26 \usepackage[english]{babel}
27 \usepackage[hmargin=20mm,top=20mm,bottom=10mm,includefoot]{geometry}
28 \usepackage{graphicx}
29 \usepackage{multicol}
30 \usepackage[documentation,breakable]{tcolorbox}
31 \usepackage{tikz-cookingsymbols}
32 \usepackage{csquotes}
33 \usepackage{tabularray}
34 \usepackage{hologo}
35 \usepackage{zref-vario}
36 \usepackage{microtype}
37 \usepackage{hyperref}
38 \hypersetup{colorlinks=true,
39 pdftitle={Manual for the tikz-cookingsymbols package},
40 pdfauthor={Fabian Matischok},
41 pdfsubject={cookingsymbols},
42 pdfkeywords={cookingsymbols, LaTeX examples, tikz}
43 }
44 %\tcbset{index format=pgfsection}
45 %\indexsetup{level=\section,toclevel=section,noclearpage}
46
47 \makeindex
48 \begin{document}
49 \begin{tcolorbox}[enhanced,center,drop lifted shadow,halign=center,width=0.75\linewidth]
50 {\huge tikz-cookingsymbols -- v2.0}\medskip
51
52 {\Large Fabian Matischok\smallskip
53
54 \href{mailto:f\[email protected]}{f\[email protected]}}\medskip
55
56 {\large 2025/06/02}
57 \end{tcolorbox}
58
59 \begin{multicols}{2}
60 \tableofcontents
61 \end{multicols}
62
63 \section{Prolog}
64 \subsection{Licence and Requirements}
65 Permission is granted to copy, distribute and/or modify this software under the terms of the \LaTeX\ Project Public License,
66 version 1.3 or later (\url{http://www.latex-project.org/lppl.txt}).
67
68 \texttt{tikz-cookingsymbols} loads the package \refPkg[pgf]{tikz} with the libraries \refPkg[pgf]{calc},\linebreak
69 \refPkg[pgf]{topaths} and \refPkg[pgf]{bending}.
70 Furthermore the package \refPkg{calc} is loaded.
71
72 \subsection{Motivation}
73 This package was written for my own recipe book. I did not want to use \refPkg{cookingsymbols}
74 any more, but use symbols based on the more modern \refPkg{tikz}-package.
75
76 Furthermore the symbols are using the font size as their height.
77
78 \subsection{Some words about \TeX-engines}
79 This package was tested with \hologo{LuaLaTeX}, but there should not be any issues
80 if \hologo{pdfLaTeX} or \hologo{XeLaTeX} is used.
81
82 \section{Changes from version 1}
83 \subsection{Problems of v1.0}\zlabel{issues}
84 \subsubsection{Houston, we have a problem -- An issue with \texttt{knots}-library}\zlabel{knots}
85 For drawing the \cs{AirFryer}-Symbol the \refPkg[spath3]{knots}-library is used. The issue could be
86 seen if and only if the symbol is not enough scaled. The following example shows the issue.
87 In the default size, there is no gap between crossing lines. In the scaled version (here 10 times),
88 the needed gap is present. The output is here magnified for better viewing.
89 Moreover you can see the color issue with the \texttt{knots}-library.
90 \begin{center}
91 \includegraphics[width=\linewidth]{tikz-cookingsymbols-oldissue.1}
92 \end{center}
93 I tried to make it work in the unscaled version, but could not do it. This problem was solved by
94 user \href{https://tex.stackexchange.com/users/132405/quark67}{quark67}. We will look closer at this in \zcref{sec:needed-adjustments}.
95 \subsubsection{Adapting to actual font size}\label{fontsize}
96 The original version did not adapt to the actual font size. This means, that the symbols had the same size where
97 it did not matter if there where any command like \verb|\large| or \verb|\small| or so. This problem was also solved by \href{https://tex.stackexchange.com/users/132405/quark67}{quark67}.
98
99 \subsection{Needed adjustments}\zlabel{sec:needed-adjustments}
100 To corrrect the described issues in \zcref{issues} some code had to be rewritten. This was done by \href{https://tex.stackexchange.com/users/132405/quark67}{quark67}
101 and solved both of the issues described in \zcref{knots} and \zcref{fontsize}.
102
103 For solving the font size issue the code was rewritten, that the font size is grabbed with
104 \begin{tcblisting}{listing only}
105 \AtBeginDocument{
106 \begingroup
107 \normalsize
108 \pgfmathparse{\f@size / 1pt} % Conversion to numerical value (ex: 10)
109 \xdef\tikzCS@basefontsize{\pgfmathresult}
110 \endgroup
111 }
112 \end{tcblisting}
113 The usage of \verb|\AtBeginDocument| should be known to possibly prevent any interference.
114
115 For solving the issue with \refPkg[spath3]{knots}-library first some more effort was necessary.
116 But due to other issues the \texttt{knots}-library was completely discarded and the \texttt{bending}-library
117 is used. Since the code was rewritten, there are only two options left, scale and color (see \zcref{opt.arg}).
118
119 Yet, the \verb|\AirFryer| command gives this output in default and scaled version:
120 \begin{center}
121 \AirFryer\ \AirFryer[scale=8]
122 \end{center}
123 In version 1, the commands defined in this package could take any \refPkg[pgf]{tikz} option that is sent to the
124 drawing command. If you need more than scale and color, please let me know.
125
126 \section{Defined commands}
127 \subsection{General aspects}
128 %\subsubsection{First remarks}
129 This package defines two sets of commands for drawing the symbols.
130 One set in English an one set in German. Three commands are used in both languages, because
131 there names are the same.
132
133 Additionally their are \sarg-versions of the commands. We will see the difference in \zvref{diff}.
134
135 All of the commands are of the form
136 \begin{docCommand*}{commandname}{\sarg\oarg{options}}
137 where \texttt{commandname} has to be exchanged with a concrete symbol (see \zcref{sec:overview-of-all-commands}) and the
138 \meta{options} are described in \zcref{opt.arg}.
139 \end{docCommand*}
140
141 \subsection{Difference of \sarg-version}\zlabel{diff}
142 The height of the symbols is set to the height of letters and depends on the font size. Compare the following examples:
143 \begin{dispExample*}{sidebyside}
144 see\TopHeat\ and try\TopHeat*
145 \end{dispExample*}
146 As we can see the \sarg-version uses the font size above the baseline
147 and the \sarg-version adds the depth that is below the baseline.
148
149 \subsection{Optional argument}\zlabel{opt.arg}
150 The optional arguments are passed to the underlying \cs{tikz}-command. In this way you could e.\,g.
151 change the color of the symbol.
152
153 With the changes described in \zcref{sec:needed-adjustments} only two keys are left for the optional argument:
154
155 \begin{docKey}[tikzCScmd]{scale}{=\meta{factor}}{default 1}
156 Scale the symbol with an \meta{factor}.
157 \end{docKey}
158 \begin{docKey}[tikzCScmd]{color}{=\meta{color}}{default black}
159 Change the color of the symbol to \meta{color}.
160 \end{docKey}
161 For both keys some examples are given:
162 \begin{dispExample*}{sidebyside}
163 \TopBottomHeat[color=red]
164 \end{dispExample*}
165 \begin{dispExample*}{sidebyside}
166 \TopBottomHeat\par
167 \TopBottomHeat[scale=2]
168 \end{dispExample*}
169
170 And some examples for the adaption to font size:
171 \begin{dispExample*}{sidebyside,righthand width=5cm}
172 Text\TopBottomHeat\TopBottomHeat*\par
173 {\tiny Text\TopBottomHeat\TopBottomHeat*}\par
174 {\Large Text\TopBottomHeat\TopBottomHeat*}\par
175 \end{dispExample*}
176 \subsection{Overview of all commands}\zlabel{sec:overview-of-all-commands}
177 In the following table all commands are listed.
178 \begin{center}
179 \begin{tblr}{colspec={cccc},row{1}={font={\bfseries\sffamily},valign=m},
180 cell{7}{1}={c=2}{c},cell{9}{1}={c=2}{c},cell{10}{1}={c=2}{c},
181 hline{1,2,Z}={0.8pt},hline{3-Y}={0.4pt}}
182 English command&German command&{output\\(default size)}&{output\\(starred and \texttt{Large} size)}\\
183 \docAuxCommand{TopBottomHeat}&\docAuxCommand{OberUnterHitze}&\OberUnterHitze&{\Large\OberUnterHitze*}\\
184 \docAuxCommand{TopHeat}&\docAuxCommand{OberHitze}&\OberHitze&{\Large\OberHitze*}\\
185 \docAuxCommand{BottomHeat}&\docAuxCommand{UnterHitze}&\UnterHitze&{\Large\UnterHitze*}\\
186 \docAuxCommand{ConvectionOven}&\docAuxCommand{Umluft}&\Umluft&{\Large\Umluft*}\\
187 \docAuxCommand{ConvectionOvenAlt}&\docAuxCommand{UmluftAlt}&\UmluftAlt&{\Large\UmluftAlt*}\\
188 \docAuxCommand{Grill}&&\Grill&{\Large\Grill*}\\
189 \docAuxCommand{ConvectionOvenGrill}&\docAuxCommand{UmluftGrill}&\UmluftGrill&{\Large\UmluftGrill*}\\
190 \docAuxCommand{AirFryer}&&\AirFryer&{\Large\AirFryer*}\\
191 \docAuxCommand{Pizza}&&\Pizza&{\Large\Pizza*}\\
192 \docAuxCommand{Microwave}&\docAuxCommand{Microwelle}&\Microwave&{\Large\Microwave*}
193 \end{tblr}
194 \end{center}
195
196 \printindex
197 \end{document}