some refactoring...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2021-10-29 23:27:21 +03:00
parent c75608c2b1
commit cbc5a1fa32

View File

@ -714,8 +714,8 @@
%% %%
% XXX this behaves in an odd way on bottom markers if size is smaller than 6mm... % XXX this behaves in an odd way on bottom markers if size is smaller than 6mm...
% XXX rename if we are using sboxes for marks... % XXX rename if we are using sboxes for marks...
\newlength\foldmarksize \newlength\photobook@foldmarklen
\setlength\foldmarksize{\photobook@foldmarksize} \setlength\photobook@foldmarklen{\photobook@foldmarksize}
%\setlength\foldmarksize{6mm} %\setlength\foldmarksize{6mm}
%% \DescribeMacro{\iffoldmarks} %% \DescribeMacro{\iffoldmarks}
@ -3065,55 +3065,55 @@
\newcommand\ResetFoldMarks{% \newcommand\ResetFoldMarks{%
\sbox{\photobook@foldinmark}{% \sbox{\photobook@foldinmark}{%
% XXX MARKOFFSET % XXX MARKOFFSET
%\vspace{0.5\foldmarksize}% %\vspace{0.5\photobook@foldmarklen}%
\smash{\makebox[0pt][l]{% \smash{\makebox[0pt][l]{%
% size-agnostic centering... % size-agnostic centering...
\hspace{-5mm}{\makebox[1cm][c]{% \hspace{-5mm}{\makebox[1cm][c]{%
\begin{tikzpicture}% \begin{tikzpicture}%
\draw[white, ultra thick] \draw[white, ultra thick]
(-0.3333\foldmarksize,0.3333\foldmarksize) (-0.3333\photobook@foldmarklen,0.3333\photobook@foldmarklen)
-- (0,0) -- (0,0)
-- (0.3333\foldmarksize,0.3333\foldmarksize); -- (0.3333\photobook@foldmarklen,0.3333\photobook@foldmarklen);
\draw[white, ultra thick] \draw[white, ultra thick]
(0,0.6666\foldmarksize) (0,0.6666\photobook@foldmarklen)
-- (0,-0.3333\foldmarksize); -- (0,-0.3333\photobook@foldmarklen);
\draw[black, thin] \draw[black, thin]
(-0.3333\foldmarksize,0.3333\foldmarksize) (-0.3333\photobook@foldmarklen,0.3333\photobook@foldmarklen)
-- (0,0) -- (0,0)
-- (0.3333\foldmarksize,0.3333\foldmarksize); -- (0.3333\photobook@foldmarklen,0.3333\photobook@foldmarklen);
\draw[black, thin] \draw[black, thin]
(0,0.6666\foldmarksize) (0,0.6666\photobook@foldmarklen)
-- (0,-0.3333\foldmarksize); -- (0,-0.3333\photobook@foldmarklen);
\end{tikzpicture}}}}}} \end{tikzpicture}}}}}}
\sbox{\photobook@foldoutmark}{% \sbox{\photobook@foldoutmark}{%
% XXX MARKOFFSET % XXX MARKOFFSET
%\vspace{0.5\foldmarksize}% %\vspace{0.5\photobook@foldmarklen}%
\smash{\makebox[0pt][l]{% \smash{\makebox[0pt][l]{%
% size-agnostic centering... % size-agnostic centering...
\hspace{-5mm}{\makebox[1cm][c]{% \hspace{-5mm}{\makebox[1cm][c]{%
\begin{tikzpicture}% \begin{tikzpicture}%
\draw[white, ultra thick] \draw[white, ultra thick]
(-0.3333\foldmarksize,0) (-0.3333\photobook@foldmarklen,0)
-- (0,0.3333\foldmarksize) -- (0,0.3333\photobook@foldmarklen)
-- (0.3333\foldmarksize,0); -- (0.3333\photobook@foldmarklen,0);
\draw[white, ultra thick] \draw[white, ultra thick]
(0,0.6666\foldmarksize) (0,0.6666\photobook@foldmarklen)
-- (0,-0.3333\foldmarksize); -- (0,-0.3333\photobook@foldmarklen);
\draw[black, thin] \draw[black, thin]
(-0.3333\foldmarksize,0) (-0.3333\photobook@foldmarklen,0)
-- (0,0.3333\foldmarksize) -- (0,0.3333\photobook@foldmarklen)
-- (0.3333\foldmarksize,0); -- (0.3333\photobook@foldmarklen,0);
\draw[black, thin] \draw[black, thin]
(0,0.6666\foldmarksize) (0,0.6666\photobook@foldmarklen)
-- (0,-0.3333\foldmarksize); -- (0,-0.3333\photobook@foldmarklen);
\end{tikzpicture}}}}}}} \end{tikzpicture}}}}}}}
\ResetFoldMarks \ResetFoldMarks
% XXX EXPERIMENTAL... % XXX EXPERIMENTAL...
% ...if used, make \foldmarksize private... % ...if used, make \foldmarksize private...
\newcommand\setfoldmarksize[1][6mm]{% \newcommand\setfoldmarksize[1][6mm]{%
\setlength\foldmarksize{#1}% \setlength\photobook@foldmarklen{#1}%
%\edef\photobook@foldmarksize{#1}% %\edef\photobook@foldmarklen{#1}%
\ResetFoldMarks} \ResetFoldMarks}
% >> \foldinmark[<baseline>] % >> \foldinmark[<baseline>]
@ -3121,14 +3121,14 @@
% XXX MARKOFFSET for some reason splitting this (#1 kept here while \foldmarksize % XXX MARKOFFSET for some reason splitting this (#1 kept here while \foldmarksize
% is in fold*mark) breaks alignment... % is in fold*mark) breaks alignment...
%\vspace{#1}% %\vspace{#1}%
\vspace{\dimexpr 0.5\foldmarksize + #1 \relax}% \vspace{\dimexpr 0.5\photobook@foldmarklen + #1 \relax}%
\usebox\photobook@foldinmark} \usebox\photobook@foldinmark}
% >> \foldoutmark[<baseline>] % >> \foldoutmark[<baseline>]
\newcommand\foldoutmark[1][0pt]{ \newcommand\foldoutmark[1][0pt]{
% XXX MARKOFFSET for some reason splitting this (#1 kept here while \foldmarksize % XXX MARKOFFSET for some reason splitting this (#1 kept here while \foldmarksize
% is in fold*mark) breaks alignment... % is in fold*mark) breaks alignment...
%\vspace{#1}% %\vspace{#1}%
\vspace{\dimexpr 0.5\foldmarksize + #1 \relax}% \vspace{\dimexpr 0.5\photobook@foldmarklen + #1 \relax}%
\usebox\photobook@foldoutmark} \usebox\photobook@foldoutmark}
% >> \photobook@foldmark[<baseline>]{<type>}{<left>, <top>} % >> \photobook@foldmark[<baseline>]{<type>}{<left>, <top>}
@ -3150,9 +3150,9 @@
\end{textblock*}% \end{textblock*}%
\endgroup} \endgroup}
\newcommand\photobook@topfoldmark[2][in]{% \newcommand\photobook@topfoldmark[2][in]{%
\photobook@foldmark[-0.5\foldmarksize]{#1}{#2}} \photobook@foldmark[-0.5\photobook@foldmarklen]{#1}{#2}}
\newcommand\photobook@bottomfoldmark[2][in]{% \newcommand\photobook@bottomfoldmark[2][in]{%
\photobook@foldmark[0.5\foldmarksize]{#1}{#2}} \photobook@foldmark[0.5\photobook@foldmarklen]{#1}{#2}}
% >> \photobook@markfold[<fold>]{<offset>} % >> \photobook@markfold[<fold>]{<offset>}
\newcommand\photobook@markfold[2][in]{% \newcommand\photobook@markfold[2][in]{%
\photobook@topfoldmark[#1]{ \photobook@topfoldmark[#1]{