foldout panel done but broken -- textpos seems to messup page boxes...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2021-09-26 01:04:41 +03:00
parent e88ea08060
commit 503a7b8bfe
2 changed files with 50 additions and 58 deletions

View File

@ -34,35 +34,25 @@
\begin{document} \begin{document}
\setsepchar{-} \ImagePageFill{\PageInfo}{\TestImage}
\readlist*\lst{1-2}
item @1: \lst[1] \begin{foldout}[3]
\par \ImagePageFill{\PageInfo}{\TestImageV}%
len: \lstlen \ImagePageFill{\PageInfo}{\TestImage}
\end{foldout}
\par \ImagePage{Caption text}{\TestImage}
\ImagePage{Caption text}{\TestImageV}
\ifnum\lstlen<2 \begin{foldout}[3]
one item \ImagePageFill{\PageInfo}{\TestImage}
\else \end{foldout}
two or more items
\fi
\begin{foldout}[3]
%\ImagePageFill{\PageInfo}{\TestImage} \begin{foldoutcell}[2]
% moo
%\begin{foldout}[3] \end{foldoutcell}
% \ImagePageFill{\PageInfo}{\TestImageV}% \end{foldout}
% \ImagePageFill{\PageInfo}{\TestImage}
%\end{foldout}
%
%\ImagePage{Caption text}{\TestImage}
%\ImagePage{Caption text}{\TestImageV}
%
%\begin{foldout}[3]
% \ImagePageFill{\PageInfo}{\TestImage}
%\end{foldout}
\end{document} \end{document}

View File

@ -483,6 +483,7 @@
\RequirePackage{ifthen} \RequirePackage{ifthen}
\RequirePackage{iftex} \RequirePackage{iftex}
\RequirePackage{pgffor} \RequirePackage{pgffor}
\RequirePackage{xint}
\RequirePackage{xinttools} \RequirePackage{xinttools}
\RequirePackage{listofitems} \RequirePackage{listofitems}
\RequirePackage{xkeyval} \RequirePackage{xkeyval}
@ -1434,6 +1435,7 @@
% XXX SYNTAX: place the second arg in braces... % XXX SYNTAX: place the second arg in braces...
% \begin{cell*}(<left>, <top>){<width>}{<height>} % \begin{cell*}(<left>, <top>){<width>}{<height>}
\newenvironment{cell*}[3]{% \newenvironment{cell*}[3]{%
\setsepchar{,}%
\readlist*\photobook@cell@offset{#1}% \readlist*\photobook@cell@offset{#1}%
% %
\begin{textblock*}{#2}(#1)% \begin{textblock*}{#2}(#1)%
@ -1545,6 +1547,7 @@
% cell content... % cell content...
% NOTE: this is not intended for direct use -- depends closure/context... % NOTE: this is not intended for direct use -- depends closure/context...
\def\photobook@usecell@placecell#1(#2){% \def\photobook@usecell@placecell#1(#2){%
\setsepchar{,}%
\readlist*\photobook@usecell@offset{#2}% \readlist*\photobook@usecell@offset{#2}%
% XXX how we align things feels a bit odd... % XXX how we align things feels a bit odd...
\vspace{-\dimexpr \photobook@usecell@offset[1] \relax}% \vspace{-\dimexpr \photobook@usecell@offset[1] \relax}%
@ -2538,7 +2541,7 @@
%% Like |papercell| but includes bleeds. %% Like |papercell| but includes bleeds.
%% %%
\newenvironment{paperbleedcell}{% \newenvironment{paperbleedcell}{%
\begin{cell*}{0, 0}{\bleedblockwidth}{\bleedblockheight}% \begin{cell*}{0pt, 0pt}{\bleedblockwidth}{\bleedblockheight}%
}{% }{%
\end{cell*}} \end{cell*}}
@ -2590,8 +2593,8 @@
\newenvironment{pagecell*}{% \newenvironment{pagecell*}{%
\begin{cell*}{% \begin{cell*}{%
\bleed + \ifnumodd{\thepage}{\bindingoffset}{0pt}% \bleed + \ifnumodd{\thepage}{\bindingoffset}{0pt},%
,\bleed}% \bleed}%
{\pageblockwidth - \bindingoffset}% {\pageblockwidth - \bindingoffset}%
{\pageblockheight}% {\pageblockheight}%
}{% }{%
@ -2623,7 +2626,7 @@
%% Note that as with |pagecell| this is not affected by |layoutmode|. %% Note that as with |pagecell| this is not affected by |layoutmode|.
%% %%
\newenvironment{pagebleedcell}{% \newenvironment{pagebleedcell}{%
\begin{cell*}{0mm, 0mm}{\bleedblockwidth}{\bleedblockheight}% \begin{cell*}{0pt, 0pt}{\bleedblockwidth}{\bleedblockheight}%
}{% }{%
\end{cell*}} \end{cell*}}
@ -2827,25 +2830,19 @@
\def\foldoutcellwidths{} \def\foldoutcellwidths{}
\newlength\photobook@foldoutoffset@sum % >> \photobook@setfoldoutoffset{<name>}{<from>}{<to>}
\setlength\photobook@foldoutoffset@sum{0pt}
% >> \photobook@foldoutoffset{<from>}{<to>}
% %
% XXX doc [from, to[ % XXX doc [from, to[
% XXX this can't be used outside of a foldout... % XXX this can't be used outside of a foldout...
\newcommand\photobook@foldoutoffset[2]{% \newcommand\photobook@setfoldoutoffset[3]{%
\begingroup% \expandafter\setlength\csname #1\endcsname{0pt}%
\ifnum #1 < #2% \ifnum \numexpr #2 \relax < \numexpr #3 \relax%
% XXX account for even/odd pages... % XXX account for even/odd pages...
\xintFor* ##1 in {% \xintFor* ##1 in {%
\xintSeq{ #1 }{ \xintiiMin{#2}{\foldoutcellwidthslen} - 1 }} \do {% \xintSeq{#2}{\xintiiMin{#3}{\foldoutcellwidthslen + 1} - 1}} \do {%
\setlength\photobook@foldoutoffset@sum{% \expandafter\setlength\csname #1\endcsname{%
\photobook@foldoutoffset@sum% \csname #1\endcsname%
+ \foldoutcellwidths[##1]}}\fi% + \foldoutcellwidths[##1]}}\fi}
%
\the\photobook@foldoutoffset@sum%
\endgroup}
\newlength\photobook@foldoutcell@left \newlength\photobook@foldoutcell@left
@ -2853,6 +2850,8 @@
\newlength\photobook@foldoutcell@width \newlength\photobook@foldoutcell@width
\setlength\photobook@foldoutcell@width{0pt} \setlength\photobook@foldoutcell@width{0pt}
% XXX doc [from, to]
% XXX if no args are given, should this auto-advance???
% XXX need to clip left/right of all but first/last panels... % XXX need to clip left/right of all but first/last panels...
% XXX this can't be used outside of a foldout... % XXX this can't be used outside of a foldout...
\newenvironment{foldoutcell}[1][1]{% \newenvironment{foldoutcell}[1][1]{%
@ -2860,25 +2859,27 @@
\setsepchar{-}% \setsepchar{-}%
\readlist*\photobook@foldoutcell@panels{#1}% \readlist*\photobook@foldoutcell@panels{#1}%
% left offset... % left offset...
\setlength\photobook@foldoutcell@left{% \photobook@setfoldoutoffset{photobook@foldoutcell@left}{%
\photobook@foldoutoffset{1}{\photobook@foldoutcell@panels[1]}}% 1
}{%
\photobook@foldoutcell@panels[1]}%
% panel width... % panel width...
\ifnum \photobook@foldoutcell@panelslen > 1% \ifnum \photobook@foldoutcell@panelslen > 1%
\setlength\photobook@foldoutcell@width{% \photobook@setfoldoutoffset{photobook@foldoutcell@width}{%
\photobook@foldoutoffset{ \photobook@foldoutcell@panels[1]%
\photobook@foldoutcell@panels[1]% }{%
}{% \photobook@foldoutcell@panels[2] + 1}%
% XXX do we add 1 here???
\photobook@foldoutcell@panels[2] + 1}}%
\else% \else%
\setlength\photobook@foldoutcell@width{% \setlength\photobook@foldoutcell@width{%
\foldoutcellwidths[ \foldoutcellwidths[{\photobook@foldoutcell@panels[1]}]}\fi%
\photobook@foldoutcell@panels[1]]}\fi%
% %
% XXX need to trim bleeds on left (except panel 1) and right (except panel -1)... % XXX need to trim bleeds on left (except panel 1) and right (except panel -1)...
\begin{cell*}% % XXX this (textpos) breaks page size...
{\photobook@foldoutcell@left, \bleed}% \begin{cell*}{%
{\photobook@foldoutcell@width}{\pageblockheight}% \photobook@foldoutcell@left,%
\bleed}%
{\photobook@foldoutcell@width}%
{\pageblockheight}%
}{% }{%
\end{cell*}% \end{cell*}%
\endgroup} \endgroup}
@ -3625,6 +3626,7 @@
\ImagePageTemplate{ImagePageFit}{% \ImagePageTemplate{ImagePageFit}{%
\begingroup% \begingroup%
% see if default alignment is overridden... % see if default alignment is overridden...
\setsepchar{,}%
\ignoreemptyitems% \ignoreemptyitems%
\readlist*\photobook@ImagePageFit@args{moo, #1}% \readlist*\photobook@ImagePageFit@args{moo, #1}%
\foreachitem\photobook@ImagePageFit@opt\in\photobook@ImagePageFit@args{% \foreachitem\photobook@ImagePageFit@opt\in\photobook@ImagePageFit@args{%