% --------------------------------------------------------------------------
% the tikz-cookingsymbols package - doc
% --------------------------------------------------------------------------
% Fabian Matischok
% E-Mail: f_matischok@t-online.de
% --------------------------------------------------------------------------
% Copyright 2025 Fabian Matischok
% 
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
\DocumentMetadata{
  lang=en,
  pdfversion=2.0,
  pdfstandard=ua-2,
  pdfstandard=a-4f,
  %testphase={phase-III,
  %  firstaid
  %},
}
\documentclass[paper=a4,fontsize=12pt]{scrartcl}
\usepackage[english]{babel}
\usepackage[hmargin=20mm,top=20mm,bottom=10mm,includefoot]{geometry}
\usepackage{graphicx}
\usepackage{multicol}
\usepackage[documentation,breakable]{tcolorbox}
\usepackage{tikz-cookingsymbols}
\usepackage{csquotes}
\usepackage{tabularray}
\usepackage{hologo}
\usepackage{zref-vario}
\usepackage{microtype}
\usepackage{hyperref}
\hypersetup{colorlinks=true,
	pdftitle={Manual for the tikz-cookingsymbols package},
	pdfauthor={Fabian Matischok},
	pdfsubject={cookingsymbols},
	pdfkeywords={cookingsymbols, LaTeX examples, tikz}
}
%\tcbset{index format=pgfsection}
%\indexsetup{level=\section,toclevel=section,noclearpage}

\makeindex
\begin{document}
\begin{tcolorbox}[enhanced,center,drop lifted shadow,halign=center,width=0.75\linewidth]
{\huge tikz-cookingsymbols -- v2.0}\medskip

{\Large Fabian Matischok\smallskip

\href{mailto:f\_matischok@t-online.de}{f\_matischok@t-online.de}}\medskip

{\large 2025/06/02}
\end{tcolorbox}

\begin{multicols}{2}
\tableofcontents
\end{multicols}

\section{Prolog}
\subsection{Licence and Requirements}
Permission is granted to copy, distribute and/or modify this software under the terms of the \LaTeX\ Project Public License,
version 1.3 or later (\url{http://www.latex-project.org/lppl.txt}).

\texttt{tikz-cookingsymbols} loads the package \refPkg[pgf]{tikz} with the libraries \refPkg[pgf]{calc},\linebreak
\refPkg[pgf]{topaths} and \refPkg[pgf]{bending}.
Furthermore the package \refPkg{calc} is loaded.

\subsection{Motivation}
This package was written for my own recipe book. I did not want to use \refPkg{cookingsymbols}
any more, but use symbols based on the more modern \refPkg{tikz}-package.

Furthermore the symbols are using the font size as their height.
       
\subsection{Some words about \TeX-engines}
This package was tested with \hologo{LuaLaTeX}, but there should not be any issues
if \hologo{pdfLaTeX} or \hologo{XeLaTeX} is used.

\section{Changes from version 1}
\subsection{Problems of v1.0}\zlabel{issues}
\subsubsection{Houston, we have a problem -- An issue with \texttt{knots}-library}\zlabel{knots}
For drawing the \cs{AirFryer}-Symbol the \refPkg[spath3]{knots}-library is used. The issue could be
seen if and only if the symbol is not enough scaled. The following example shows the issue.
In the default size, there is no gap between crossing lines. In the scaled version (here 10 times),
the needed gap is present. The output is here magnified for better viewing.
Moreover you can see the color issue with the \texttt{knots}-library.
\begin{center}
	\includegraphics[width=\linewidth]{tikz-cookingsymbols-oldissue.1}
\end{center}
I tried to make it work in the unscaled version, but could not do it. This problem was solved by
user \href{https://tex.stackexchange.com/users/132405/quark67}{quark67}. We will look closer at this in \zcref{sec:needed-adjustments}.
\subsubsection{Adapting to actual font size}\label{fontsize}
The original version did not adapt to the actual font size. This means, that the symbols had the same size where
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}.

\subsection{Needed adjustments}\zlabel{sec:needed-adjustments}
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}
and solved both of the issues described in \zcref{knots} and \zcref{fontsize}.

For solving the font size issue the code was rewritten, that the font size is grabbed with
\begin{tcblisting}{listing only}
\AtBeginDocument{
	\begingroup
	\normalsize
	\pgfmathparse{\f@size / 1pt} % Conversion to numerical value (ex: 10)
	\xdef\tikzCS@basefontsize{\pgfmathresult}
	\endgroup
}
\end{tcblisting}
The usage of \verb|\AtBeginDocument| should be known to possibly prevent any interference.

For solving the issue with \refPkg[spath3]{knots}-library first some more effort was necessary.
But due to other issues the \texttt{knots}-library was completely discarded and the \texttt{bending}-library
is used. Since the code was rewritten, there are only two options left, scale and color (see \zcref{opt.arg}).

Yet, the \verb|\AirFryer| command gives this output in default and scaled version:
\begin{center}
	\AirFryer\ \AirFryer[scale=8]
\end{center}
In version 1, the commands defined in this package could take any \refPkg[pgf]{tikz} option that is sent to the
drawing command. If you need more than scale and color, please let me know.

\section{Defined commands}
\subsection{General aspects}
%\subsubsection{First remarks}
This package defines two sets of commands for drawing the symbols.
One set in English an one set in German. Three commands are used in both languages, because
there names are the same.

Additionally their are \sarg-versions of the commands. We will see the difference in \zvref{diff}.

All of the commands are of the form
\begin{docCommand*}{commandname}{\sarg\oarg{options}}
where \texttt{commandname} has to be exchanged with a concrete symbol (see \zcref{sec:overview-of-all-commands}) and the
\meta{options} are described in \zcref{opt.arg}.
\end{docCommand*}

\subsection{Difference of \sarg-version}\zlabel{diff}
The height of the symbols is set to the height of letters and depends on the font size. Compare the following examples:
\begin{dispExample*}{sidebyside}
see\TopHeat\ and try\TopHeat*
\end{dispExample*}
As we can see the \sarg-version uses the font size above the baseline
and the \sarg-version adds the depth that is below the baseline.

\subsection{Optional argument}\zlabel{opt.arg}
The optional arguments are passed to the underlying \cs{tikz}-command. In this way you could e.\,g.
change the color of the symbol.

With the changes described in \zcref{sec:needed-adjustments} only two keys are left for the optional argument:

\begin{docKey}[tikzCScmd]{scale}{=\meta{factor}}{default 1}
	Scale the symbol with an \meta{factor}.
\end{docKey}
\begin{docKey}[tikzCScmd]{color}{=\meta{color}}{default black}
	Change the color of the symbol to \meta{color}.
\end{docKey}
For both keys some examples are given:
\begin{dispExample*}{sidebyside}
\TopBottomHeat[color=red]
\end{dispExample*}
\begin{dispExample*}{sidebyside}
\TopBottomHeat\par
\TopBottomHeat[scale=2]
\end{dispExample*}

And some examples for the adaption to font size:
\begin{dispExample*}{sidebyside,righthand width=5cm}
Text\TopBottomHeat\TopBottomHeat*\par
{\tiny Text\TopBottomHeat\TopBottomHeat*}\par
{\Large Text\TopBottomHeat\TopBottomHeat*}\par
\end{dispExample*}
\subsection{Overview of all commands}\zlabel{sec:overview-of-all-commands}
In the following table all commands are listed.
\begin{center}
\begin{tblr}{colspec={cccc},row{1}={font={\bfseries\sffamily},valign=m},
cell{7}{1}={c=2}{c},cell{9}{1}={c=2}{c},cell{10}{1}={c=2}{c},
hline{1,2,Z}={0.8pt},hline{3-Y}={0.4pt}}
English command&German command&{output\\(default size)}&{output\\(starred and \texttt{Large} size)}\\
\docAuxCommand{TopBottomHeat}&\docAuxCommand{OberUnterHitze}&\OberUnterHitze&{\Large\OberUnterHitze*}\\
\docAuxCommand{TopHeat}&\docAuxCommand{OberHitze}&\OberHitze&{\Large\OberHitze*}\\
\docAuxCommand{BottomHeat}&\docAuxCommand{UnterHitze}&\UnterHitze&{\Large\UnterHitze*}\\
\docAuxCommand{ConvectionOven}&\docAuxCommand{Umluft}&\Umluft&{\Large\Umluft*}\\
\docAuxCommand{ConvectionOvenAlt}&\docAuxCommand{UmluftAlt}&\UmluftAlt&{\Large\UmluftAlt*}\\
\docAuxCommand{Grill}&&\Grill&{\Large\Grill*}\\
\docAuxCommand{ConvectionOvenGrill}&\docAuxCommand{UmluftGrill}&\UmluftGrill&{\Large\UmluftGrill*}\\
\docAuxCommand{AirFryer}&&\AirFryer&{\Large\AirFryer*}\\
\docAuxCommand{Pizza}&&\Pizza&{\Large\Pizza*}\\
\docAuxCommand{Microwave}&\docAuxCommand{Microwelle}&\Microwave&{\Large\Microwave*}
\end{tblr}
\end{center}

\printindex
\end{document}