tweaking + found a bug in foldoutcell...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2021-10-09 13:43:51 +03:00
parent 6b31d78a28
commit d2f54ee42a
2 changed files with 64 additions and 37 deletions

View File

@ -36,15 +36,20 @@
\edef\foldmarkoffset{-10mm} \edef\foldmarkoffset{-10mm}
%\foldmarksfalse %\foldmarksfalse
\begin{foldout}[10cm 10cm 10cm] \begin{foldout}[12cm 12cm 5cm]
\ImagePageFill{\PageInfo}{\TestImage} \ImagePageFill{\PageInfo}{\TestImage}
\end{foldout} \end{foldout}
\null
\newpage
\null
\newpage
\begin{foldout}[in out] \begin{foldout}[in out]
auto-calculate auto-calculate
\end{foldout} \end{foldout}
\begin{foldout}[3] \begin{foldout}[in in 10cm]
count count
\begin{foldoutcell}[2] \begin{foldoutcell}[2]
\lipsum \lipsum

View File

@ -701,6 +701,7 @@
%% \DescribeMacro{\clearance=<len>} %% \DescribeMacro{\clearance=<len>}
% %
%% Cell geometry. %% Cell geometry.
%%
%% For more details see the \nameref{subsec:Cells} section. %% For more details see the \nameref{subsec:Cells} section.
%% %%
%% These are set automatically by cells, thus it is not recommended to %% These are set automatically by cells, thus it is not recommended to
@ -723,6 +724,17 @@
\newlength\clearance \newlength\clearance
\setlength\clearance{0pt} \setlength\clearance{0pt}
%% \DescribeMacro{\paperfoldwidth}
%% \DescribeMacro{\clearfoldoutbinding}
%% \DescribeMacro{\clearfoldoutedge}
%% \DescribeMacro{\clearfoldoutfold}
%
%% Foldout geometry.
%%
% XXX add a proper link...
%% For more info see |foldout| env and friends.
%%
%---------------------------------------------------------------------- %----------------------------------------------------------------------
@ -2799,10 +2811,12 @@
%% \end{verbatim} %% \end{verbatim}
%% \end{minipage} %% \end{minipage}
%% %%
% XXX note that panel width includes right \clearfoldoutblock (???)
% XXX new cell parameters...
% XXX modes...
%% %%
%% \DescribeMacro{\paperfoldwidth}
%% \DescribeMacro{\clearfoldoutbinding}
%% \DescribeMacro{\clearfoldoutedge}
%% \DescribeMacro{\clearfoldoutfold}
%
%% Fold panel sizing for similar fold sequence: %% Fold panel sizing for similar fold sequence:
%% %%
%% \begin{minipage}{\textwidth} %% \begin{minipage}{\textwidth}
@ -2810,7 +2824,7 @@
%% %%
%% \clearfoldoutedge <-> %% \clearfoldoutedge <->
%% \clearfoldoutfold <-> %% \clearfoldoutfold <->
%% <--> \clearfoldoutblock %% <--> \clearfoldoutbinding
%% (3) /\ (2) %% (3) /\ (2)
%% +---------------------------------+ / \ %% +---------------------------------+ / \
%% +------------------------------- | / %% +------------------------------- | /
@ -2831,7 +2845,7 @@
%% \begin{verbatim} %% \begin{verbatim}
%% %%
%% \clearfoldoutedge <-> / %% \clearfoldoutedge <-> /
%% <--> \clearfoldoutblock (3) / %% <--> \clearfoldoutbinding (3) /
%% \ %% \
%% +---------------------------------- \ (2) %% +---------------------------------- \ (2)
%% +---------------------------------+ / %% +---------------------------------+ /
@ -2847,22 +2861,25 @@
%% The size of the paper fold is set by |\paperfoldwidth|. %% The size of the paper fold is set by |\paperfoldwidth|.
%% %%
% XXX order doc secions correctly... % XXX order doc secions correctly...
% XXX foldout modes:
% fold=in in,
% fold=in out,
% fold=in in out in,
% ...a mode is repeated if more panels than items are present, e.g.
% for fold=in out, and 6 panels the folds will be {in out in out in}
% ...calculate clearances according to fold direction...
% XXX add manual size mode -- list of lengths... % XXX add manual size mode -- list of lengths...
% XXX need to: % XXX need to:
% - create two pages -- DONE % - create two pages -- DONE
% - first odd, second even -- DONE % - first odd, second even -- DONE
% - fold marks % - fold marks -- DONE
% - cells for panels... % - cells for panels -- DONE
% - outer panel must be smaller than the inner panel by \clearfoldout -- DONE % - outer panel must be smaller than the inner panel by \clearfoldout -- DONE
% XXX move to globals... % XXX move to globals...
% XXX revise defaults... % XXX revise defaults...
\newlength\paperfoldwidth
\setlength\paperfoldwidth{0.5mm}
\newlength\clearfoldoutbinding
\setlength\clearfoldoutbinding{8mm}
\newlength\clearfoldoutfold
\setlength\clearfoldoutfold{5mm}
\newlength\clearfoldoutedge
\setlength\clearfoldoutedge{1mm}
\newlength\foldoutwidth \newlength\foldoutwidth
\setlength\foldoutwidth{\blockwidth} \setlength\foldoutwidth{\blockwidth}
@ -2872,20 +2889,6 @@
% default fold type... % default fold type...
\edef\foldoutfold{in} \edef\foldoutfold{in}
% width of paper consumed by a fold...
\newlength\paperfoldwidth
\setlength\paperfoldwidth{0.5mm}
\newlength\clearfoldoutblock
\setlength\clearfoldoutblock{0.5mm}
\newlength\clearfoldoutfold
\setlength\clearfoldoutfold{5mm}
% clear the foldout's first fold from block cut...
\newlength\clearfoldoutedge
\setlength\clearfoldoutedge{1mm}
\def\foldoutcellfolds{} \def\foldoutcellfolds{}
\def\foldoutcellwidths{} \def\foldoutcellwidths{}
@ -2975,12 +2978,28 @@
\edef\photobook@foldout@prevfold{in} \edef\photobook@foldout@prevfold{in}
% >> \photobook@foldout@pushpanel{<width>}{<fold>} % >> \photobook@foldout@pushpanel{<width>}{<fold>}
% XXX setup numbers... % XXX setup numbers in auto-width mode...
% XXX need to subract \clearfoldoutblock from the second maxpanelwidth... % panel 1 -> maxpanelwidth
% panel 2 -> maxpanelwidth - clearfoldoutbinding
% ...use \foldoutcellwidthslen to
\newcommand\photobook@foldout@pushpanel[2]{% \newcommand\photobook@foldout@pushpanel[2]{%
% initial max panel size...
\ifnum \thephotobook@foldoutpanel = 1%
\setlength\photobook@foldout@maxpanelwidth{%
\blockwidth
- \clearfoldoutedge}\fi%
\ifnum \thephotobook@foldoutpanel = 2%
% XXX
\fi%
% calculate widths... % calculate widths...
\ifdim #1 = 0pt% \ifdim #1 = 0pt%
\ifnum \thephotobook@foldoutpanel < 3%
% XXX
\else%
% XXX
\fi%
% double fold twice in same direction... % double fold twice in same direction...
% XXX this should not be done for panel 1 and 2...
\ifthenelse{\equal{#2}{\photobook@foldout@prevfold}}{% \ifthenelse{\equal{#2}{\photobook@foldout@prevfold}}{%
\setlength\photobook@foldout@panelwidth{% \setlength\photobook@foldout@panelwidth{%
\photobook@foldout@maxpanelwidth \photobook@foldout@maxpanelwidth
@ -3004,7 +3023,8 @@
\edef\foldoutcellfolds{% \edef\foldoutcellfolds{%
\foldoutcellfolds,#2}% \foldoutcellfolds,#2}%
\edef\foldoutcellwidths{% \edef\foldoutcellwidths{%
\foldoutcellwidths,\the\photobook@foldout@panelwidth}} \foldoutcellwidths,\the\photobook@foldout@panelwidth}%
\stepcounter{photobook@foldoutpanel}}
% XXX FOLDMARK... % XXX FOLDMARK...
% XXX also add this to jacket/cover... % XXX also add this to jacket/cover...
@ -3037,6 +3057,9 @@
\iffoldmarks% \iffoldmarks%
\photobook@showmarks\fi} \photobook@showmarks\fi}
\newcounter{photobook@foldoutpanel}
\setcounter{photobook@foldoutpanel}{1}
% XXX in/out branches are identical -- unify... % XXX in/out branches are identical -- unify...
\newenvironment{foldout}[1][\foldoutspec]{% \newenvironment{foldout}[1][\foldoutspec]{%
\begingroup% \begingroup%
@ -3044,12 +3067,9 @@
\readlist*\photobook@foldout@args{#1}% \readlist*\photobook@foldout@args{#1}%
% %
% defaults... % defaults...
\setcounter{photobook@foldoutpanel}{1}
\setlength\foldoutwidth{0pt}% \setlength\foldoutwidth{0pt}%
\edef\photobook@foldout@prevfold{\foldoutfold}% \edef\photobook@foldout@prevfold{\foldoutfold}%
% initial panel size...
\setlength\photobook@foldout@maxpanelwidth{%
\blockwidth
- \clearfoldoutedge}%
% %
% panel count... % panel count...
\ifnum \photobook@foldout@argslen = 1% \ifnum \photobook@foldout@argslen = 1%
@ -3158,6 +3178,8 @@
\edef\photobook@foldoutcell@from{% \edef\photobook@foldoutcell@from{%
\thefoldoutpanel}} \thefoldoutpanel}}
% XXX BUG: even (left) page panel sizes are in the same order as odd
% page -- should be reversed...
% XXX revise naming.... % XXX revise naming....
% foldoutcell - 1:1 (unclipped) % foldoutcell - 1:1 (unclipped)
% should be clipped to bleeds, i.e. should use % should be clipped to bleeds, i.e. should use