now page templates use paper cells making them more compatible with different layouts + some refactoring.

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2023-09-11 18:53:49 +03:00
parent ca2bb256ac
commit 5568a6d6b8
4 changed files with 25 additions and 22 deletions

View File

@ -74,9 +74,6 @@
\end{inlinecell*}}% \end{inlinecell*}}%
\end{page}% \end{page}%
\begin{page}%
\end{page}%
\end{document} %------------------------------------------------------- \end{document} %-------------------------------------------------------
% vim:set ts=4 sw=4 : % vim:set ts=4 sw=4 :

View File

@ -51,13 +51,11 @@
\end{cliptocell} \end{cliptocell}
\end{backcover} \end{backcover}
% comment these out to remove the cover template outlines...
\textblockrulecolour{white} \textblockrulecolour{white}
\textcolor{white} \textcolor{white}
\GenerateTemplate \GenerateTemplate
\end{page} \end{page}
\end{document} \end{document}

View File

@ -38,11 +38,10 @@
% XXX ignores layoutmode=endpaper....
\begin{page} \begin{page}
\begin{pagecell} \begin{papercell}
\imagecell[fill]{}{DSC00403-2} \imagecell[fill]{}{DSC00403-2}
\end{pagecell} \end{papercell}
\end{page} \end{page}

View File

@ -93,7 +93,7 @@
%%% NOTE: \def\<module-name>@[A-Z]+ macros will be visible to both the %%% NOTE: \def\<module-name>@[A-Z]+ macros will be visible to both the
%%% code and the generated docs... %%% code and the generated docs...
\edef\photobook@FILEVERSION{v0.1.26} \edef\photobook@FILEVERSION{v0.1.27}
\edef\photobook@FILEDATE{2023-08-24} \edef\photobook@FILEDATE{2023-08-24}
@ -2013,7 +2013,7 @@
%% \DescribeEnv{cliptocell} %% \DescribeEnv{cliptocell}
%% \DescribeEnv{cliptocellbleeds} %% \DescribeEnv{setcliptocellbleeds}
% %
%% Clip content to parent cell. %% Clip content to parent cell.
%% %%
@ -2046,24 +2046,27 @@
\setlength\photobook@cliptocell@right{0mm}% \setlength\photobook@cliptocell@right{0mm}%
\newlength\photobook@cliptocell@bottom \newlength\photobook@cliptocell@bottom
\setlength\photobook@cliptocell@bottom{0mm}% \setlength\photobook@cliptocell@bottom{0mm}%
\def\cliptocellbleeds{{0mm} {0mm} {0mm} {0mm}}%
\def\cliptocellclearances{{0mm} {0mm} {0mm} {0mm}}% \def\cliptocellclearances{{0mm} {0mm} {0mm} {0mm}}%
%% Set the default bleeds for |cliptocell| environments %% Set the default bleeds for |cliptocell| environments
%% %%
%% >> \cliptocellbleeds{<size>} %% >> \setcliptocellbleeds{<size>}
%% >> \cliptocellbleeds{<horizontal> <vertical>} %% >> \setcliptocellbleeds{<horizontal> <vertical>}
%% >> \cliptocellbleeds{<left> <bottom> <right> <top>} %% >> \setcliptocellbleeds{<left> <bottom> <right> <top>}
%% %%
%% This will only affect |cliptocell| environments on the same level, %% This will only affect |cliptocell| environments on the same level,
%% without affecting the nested |cliptocell|s. %% without affecting the nested |cliptocell|s.
%% %%
%%% \DescribeEnv{cliptocellbleeds=<left> <bottom> <right> <top>}
%%% \DescribeEnv{cliptocellclearances=<left> <bottom> <right> <top>} %%% \DescribeEnv{cliptocellclearances=<left> <bottom> <right> <top>}
%%% %%%
%%% Set by |\cliptocellbleeds{..}| and contains clearances (negative %%% Set by |\setcliptocellbleeds{..}| and contain bleeds and clearances (negative
%%% clipping bleeds) usable by imagecell. %%% clipping bleeds) respectively, usable by imagecell and others.
%%% %%%
%%% XXX still testing.... %%% XXX still testing....
\newcommand\cliptocellbleeds[1]{ \newcommand\setcliptocellbleeds[1]{
\setsepchar{ }% \setsepchar{ }%
\readlist*\photobook@cliptocell@bleeds{#1}% \readlist*\photobook@cliptocell@bleeds{#1}%
\setsepchar{,}% \setsepchar{,}%
@ -2100,6 +2103,11 @@
% NOTE: trailing spaces here are significant... % NOTE: trailing spaces here are significant...
% XXX should we use \the here? % XXX should we use \the here?
% ...it makes things printable... % ...it makes things printable...
\def\cliptocellbleeds{%
{\the\photobook@cliptocell@left} %
{\the\photobook@cliptocell@bottom} %
{\the\photobook@cliptocell@right} %
{\the\photobook@cliptocell@top}}
\def\cliptocellclearances{% \def\cliptocellclearances{%
{-\the\photobook@cliptocell@left} % {-\the\photobook@cliptocell@left} %
{-\the\photobook@cliptocell@bottom} % {-\the\photobook@cliptocell@bottom} %
@ -2109,7 +2117,7 @@
% XXX use \cliptocellclearances as default... % XXX use \cliptocellclearances as default...
\newenvironment{cliptocell}[1][0mm]{% \newenvironment{cliptocell}[1][0mm]{%
\begingroup% \begingroup%
\cliptocellbleeds{#1} \setcliptocellbleeds{#1}
% NOTE: the spaces at the end of each line here are significant!! % NOTE: the spaces at the end of each line here are significant!!
\begin{trimbox}{{\photobook@cliptocell@left} % \begin{trimbox}{{\photobook@cliptocell@left} %
{\photobook@cliptocell@bottom} % {\photobook@cliptocell@bottom} %
@ -2120,7 +2128,7 @@
{\cellwidth + \photobook@cliptocell@right} % {\cellwidth + \photobook@cliptocell@right} %
{\height + \photobook@cliptocell@top}}% {\height + \photobook@cliptocell@top}}%
% set defaults for nested cells... % set defaults for nested cells...
\cliptocellbleeds{0mm}% \setcliptocellbleeds{0mm}%
\begin{minipage}[t][\cellheight][t]{\cellwidth}% \begin{minipage}[t][\cellheight][t]{\cellwidth}%
\ignorespaces% \ignorespaces%
}{% }{%
@ -4079,7 +4087,7 @@
% XXX EXPERIMENTAL % XXX EXPERIMENTAL
\newenvironment{leftside*}{% \newenvironment{leftside*}{%
\begin{leftside}% \begin{leftside}%
\cliptocellbleeds{{\bleed} {\bleed} 0mm {\bleed}}% \setcliptocellbleeds{{\bleed} {\bleed} 0mm {\bleed}}%
}{% }{%
\end{leftside}} \end{leftside}}
@ -4092,7 +4100,7 @@
% XXX EXPERIMENTAL % XXX EXPERIMENTAL
\newenvironment{rightside*}{% \newenvironment{rightside*}{%
\begin{rightside}% \begin{rightside}%
\cliptocellbleeds{0mm {\bleed} {\bleed} {\bleed}}% \setcliptocellbleeds{0mm {\bleed} {\bleed} {\bleed}}%
}{% }{%
\end{rightside}} \end{rightside}}
@ -4872,7 +4880,8 @@
%\clearpage% %\clearpage%
\begin{page}% \begin{page}%
% NOTE: this does not account for \bindingoffset... % NOTE: this does not account for \bindingoffset...
\begin{pagecell}% % XXX should this be a page or a paper cell???
\begin{papercell}%
\imagecell[% \imagecell[%
center, center,
clearance=-\bleed, clearance=-\bleed,
@ -4881,7 +4890,7 @@
offsetleft=\imageoffsetleft, offsetleft=\imageoffsetleft,
captionclearparent=\captionclearpage, captionclearparent=\captionclearpage,
#1]{#2}{#3}% #1]{#2}{#3}%
\end{pagecell}% \end{papercell}%
\end{page}% \end{page}%
% special case: centered vertical image -> account for \bindingoffset... % special case: centered vertical image -> account for \bindingoffset...
\else% \else%