mirror of
https://github.com/flynx/photobook.git
synced 2025-10-29 02:10:08 +00:00
almost done with foldouts, only panel width offsets left...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
ee49355fde
commit
4e0919c332
@ -46,11 +46,38 @@
|
||||
|
||||
\begin{foldout}[3]
|
||||
count
|
||||
\begin{foldoutcell}[2]
|
||||
\lipsum
|
||||
\lipsum
|
||||
\lipsum
|
||||
\end{foldoutcell}
|
||||
\newpage
|
||||
\begin{foldoutcell*}[1]
|
||||
\lipsum
|
||||
\lipsum
|
||||
\lipsum
|
||||
\end{foldoutcell*}
|
||||
\begin{foldoutcell*}[2]
|
||||
\begin{cliptocell}
|
||||
\begin{bottomup}
|
||||
\lipsum
|
||||
\lipsum
|
||||
\lipsum
|
||||
\end{bottomup}
|
||||
\end{cliptocell}
|
||||
\end{foldoutcell*}
|
||||
% XXX too much goes into right bleed...
|
||||
\begin{foldoutcell*}[3]
|
||||
\lipsum
|
||||
\lipsum
|
||||
\lipsum
|
||||
\end{foldoutcell*}
|
||||
\end{foldout}
|
||||
|
||||
\begin{foldout}[in]
|
||||
in
|
||||
\end{foldout}
|
||||
|
||||
%
|
||||
%\ImagePageFill{\PageInfo}{\TestImage}
|
||||
%
|
||||
|
||||
212
photobook.cls
212
photobook.cls
@ -2873,6 +2873,7 @@
|
||||
\newlength\clearfoldoutedge
|
||||
\setlength\clearfoldoutedge{1mm}
|
||||
|
||||
\def\foldoutcellfolds{}
|
||||
\def\foldoutcellwidths{}
|
||||
|
||||
% XXX length or command???
|
||||
@ -2882,51 +2883,60 @@
|
||||
\foldmarkstrue
|
||||
|
||||
|
||||
% XXX make this a box... (???)
|
||||
% XXX make this a tikz... (???)
|
||||
% XXX should we replace in/out text with something like v and ^ ???
|
||||
\newif\ifphotobook@foldmark@in
|
||||
\newcommand\photobook@foldmark[3][\foldoutfold]{%
|
||||
\begin{textblock*}{0pt}(#3)%
|
||||
\setlength{\unitlength}{1mm}%
|
||||
\begin{picture}(0, 0)(0,0)%
|
||||
\thicklines
|
||||
\color{white}
|
||||
\put(0,0){\line(0,#2){4}}
|
||||
\ifnumodd{\thepage}{%
|
||||
\begingroup%
|
||||
\ifnumodd{\thepage}{%
|
||||
\ifthenelse{\equal{#1}{in}}{%
|
||||
\photobook@foldmark@intrue}{%
|
||||
\photobook@foldmark@infalse}}{%
|
||||
\ifthenelse{\equal{#1}{in}}{%
|
||||
\photobook@foldmark@infalse}{%
|
||||
\photobook@foldmark@intrue}}%
|
||||
\begin{textblock*}{0pt}(#3)%
|
||||
\setlength{\unitlength}{1mm}%
|
||||
\begin{picture}(0, 0)(0,0)%
|
||||
\color{white}
|
||||
\thicklines
|
||||
\put(0,0){\line(0,#2){4}}
|
||||
\put(0, \numexpr #2 / 2 \relax){%
|
||||
\ifthenelse{\equal{#1}{in}}{%
|
||||
\circle{1.5}
|
||||
}{%
|
||||
\circle*{1.5}}}
|
||||
\put(1.5, \numexpr #2 / 2 - 1 \relax){#1}}{}
|
||||
\thinlines
|
||||
\color{black}
|
||||
\put(0,0){\line(0,#2){4}}
|
||||
\ifnumodd{\thepage}{%
|
||||
\circle*{1.5}}
|
||||
\ifphotobook@foldmark@in
|
||||
\put(1.5, \numexpr #2 / 2 - 1 \relax){\vee}
|
||||
\else
|
||||
\put(1.5, \numexpr #2 / 2 - 1 \relax){\wedge}\fi
|
||||
\color{black}
|
||||
\thinlines
|
||||
\put(0,0){\line(0,#2){4}}
|
||||
\put(0, \numexpr #2 / 2 \relax){%
|
||||
\ifthenelse{\equal{#1}{in}}{%
|
||||
\ifphotobook@foldmark@in
|
||||
\circle{1.5}
|
||||
}{%
|
||||
\circle*{1.5}}}
|
||||
\put(1.5,\numexpr #2 / 2 - 1 \relax){#1}}{}
|
||||
\end{picture}
|
||||
\end{textblock*}}
|
||||
\else
|
||||
\circle*{1.5}\fi}
|
||||
\ifphotobook@foldmark@in
|
||||
\put(1.5, \numexpr #2 / 2 - 1 \relax){\vee}
|
||||
\else
|
||||
\put(1.5, \numexpr #2 / 2 - 1 \relax){\wedge}\fi
|
||||
\end{picture}
|
||||
\end{textblock*}%
|
||||
\endgroup}
|
||||
\newcommand\photobook@topfoldmark[2][in]{%
|
||||
\photobook@foldmark[#1]{3}{#2}}
|
||||
\newcommand\photobook@bottomfoldmark[2][in]{%
|
||||
\photobook@foldmark[#1]{-3}{#2}}
|
||||
% XXX also add this to jacket/cover...
|
||||
% XXX test position correctness...
|
||||
% >> \photobook@markfold[<fold>]{<offset>}
|
||||
\newcommand\photobook@markfold[2][in]{%
|
||||
\iffoldmarks%
|
||||
\photobook@topfoldmark[#1]{
|
||||
#2,
|
||||
\bleed
|
||||
- \foldmarkoffset}%
|
||||
\photobook@bottomfoldmark[#1]{
|
||||
#2,
|
||||
\blockheight
|
||||
+ \bleed
|
||||
+ \foldmarkoffset}\fi}
|
||||
\photobook@topfoldmark[#1]{
|
||||
#2,
|
||||
\bleed
|
||||
- \foldmarkoffset}%
|
||||
\photobook@bottomfoldmark[#1]{
|
||||
#2,
|
||||
\blockheight
|
||||
+ \bleed
|
||||
+ \foldmarkoffset}}
|
||||
|
||||
% >> \photobook@setfoldoutoffset{<name>}{<from>}{<to>}
|
||||
% XXX doc [from, to[
|
||||
@ -2944,11 +2954,6 @@
|
||||
\csname #1\endcsname%
|
||||
+ \foldoutcellwidths[##1]}}\fi}
|
||||
|
||||
% XXX new arg syntax:
|
||||
% <num> -- number of panels
|
||||
% in|out ... -- fold direction
|
||||
% <dim> in|out <dim> ...
|
||||
% -- fold direction with panel widths
|
||||
\newlength\photobook@foldout@panelwidth
|
||||
\setlength\photobook@foldout@panelwidth{0pt}
|
||||
\newlength\photobook@foldout@maxpanelwidth
|
||||
@ -2956,6 +2961,7 @@
|
||||
\edef\photobook@foldout@count{}
|
||||
\edef\photobook@foldout@prevfold{in}
|
||||
|
||||
% >> \photobook@foldout@pushpanel{<width>}{<fold>}
|
||||
% XXX setup numbers...
|
||||
\newcommand\photobook@foldout@pushpanel[2]{%
|
||||
% use default width....
|
||||
@ -2981,26 +2987,43 @@
|
||||
\setlength\foldoutwidth{
|
||||
\foldoutwidth
|
||||
+ \photobook@foldout@panelwidth}%
|
||||
% panel widths list...
|
||||
% panel spec lists...
|
||||
\edef\foldoutcellfolds{%
|
||||
\foldoutcellfolds,#2}%
|
||||
\edef\foldoutcellwidths{%
|
||||
\foldoutcellwidths, \the\photobook@foldout@panelwidth}}
|
||||
\foldoutcellwidths,\the\photobook@foldout@panelwidth}}
|
||||
|
||||
% XXX need to iterate through \foldoutcellwidths...
|
||||
%\edef\photobook@foldout@showmarks{}
|
||||
%\newcommand\photobook@foldout@mark[1]{
|
||||
% \edef\photobook@foldout@showmarks{%
|
||||
% \photobook@foldout@showmarks%
|
||||
% \photobook@markfold[\photobook@foldout@prevfold]{#1}}}
|
||||
|
||||
% XXX this should be run after each page...
|
||||
% XXX FOLDMARK...
|
||||
% XXX also add this to jacket/cover...
|
||||
\newlength\photobook@showmarks@offset
|
||||
\setlength\photobook@showmarks@offset{0pt}
|
||||
\newcommand\photobook@showmarks{%
|
||||
\ifx\foldoutcellwidths\empty\else%
|
||||
\foreachitem \photobook@showmarks@width \in \foldoutcellwidths{%
|
||||
% XXX
|
||||
}\fi}
|
||||
\ifx \foldoutcellwidths \empty \else%
|
||||
\begingroup%
|
||||
\setlength\photobook@showmarks@offset{\bleed}%
|
||||
% NOTE: we need to iterate left/right pages in reverse order...
|
||||
% NOTE: the below branches are similar but not identical...
|
||||
\ifnumodd{\thepage}{%
|
||||
\xintFor* ##1 in {\xintSeq{1}{\foldoutcellwidthslen - 1}} \do {%
|
||||
\setlength\photobook@showmarks@offset{
|
||||
\photobook@showmarks@offset
|
||||
+ \foldoutcellwidths[##1]}%
|
||||
% XXX HACK: it appears that we can't expand \foldoutcellfolds[##1] in [..]...
|
||||
\edef\photobook@showmarks@tmp{\foldoutcellfolds[##1]}%
|
||||
\photobook@markfold[\photobook@showmarks@tmp]{\photobook@showmarks@offset}}%
|
||||
}{
|
||||
\xintFor* ##1 in {\xintSeq{\foldoutcellwidthslen}{2}} \do {%
|
||||
\setlength\photobook@showmarks@offset{
|
||||
\photobook@showmarks@offset
|
||||
+ \foldoutcellwidths[##1]}%
|
||||
% XXX HACK: it appears that we can't expand \foldoutcellfolds[##1] in [..]...
|
||||
\edef\photobook@showmarks@tmp{\foldoutcellfolds[##1 - 1]}%
|
||||
\photobook@markfold[\photobook@showmarks@tmp]{\photobook@showmarks@offset}}}%
|
||||
\endgroup\fi}
|
||||
\AtBeginShipout{%
|
||||
\iffoldmarks%
|
||||
\photobook@showmarks\fi}
|
||||
|
||||
% XXX mark folds on every page...
|
||||
% XXX need to set marks on top of all other content -- create them last/at shipout?
|
||||
% XXX in/out branches are identical -- unify...
|
||||
\newenvironment{foldout}[1][\foldoutspec]{%
|
||||
\begingroup%
|
||||
@ -3029,11 +3052,7 @@
|
||||
% build the panels...
|
||||
\xintFor* ##1 in {\xintSeq{1}{\photobook@foldout@count}} \do {%
|
||||
\photobook@foldout@pushpanel{%
|
||||
0pt}{\photobook@foldout@prevfold}%
|
||||
% skip for last panel...
|
||||
\ifnum \photobook@foldout@count = ##1 \else%
|
||||
%\photobook@foldout@mark{\foldoutwidth}\fi}%
|
||||
\photobook@markfold[\photobook@foldout@prevfold]{\foldoutwidth}\fi}%
|
||||
0pt}{\photobook@foldout@prevfold}}%
|
||||
% fold spec...
|
||||
\else%
|
||||
\foreachitem \photobook@foldout@opt \in \photobook@foldout@args{%
|
||||
@ -3045,8 +3064,6 @@
|
||||
\edef\photobook@foldout@prevfold{%
|
||||
\photobook@foldout@opt}%
|
||||
\setlength\photobook@foldout@panelwidth{0pt}%
|
||||
%\photobook@foldout@mark{\foldoutwidth}%
|
||||
\photobook@markfold[\photobook@foldout@prevfold]{\foldoutwidth}%
|
||||
% out...
|
||||
}{\ifthenelse{\equal{\photobook@foldout@opt}{out}}{%
|
||||
\photobook@foldout@pushpanel{%
|
||||
@ -3055,16 +3072,12 @@
|
||||
\edef\photobook@foldout@prevfold{%
|
||||
\photobook@foldout@opt}%
|
||||
\setlength\photobook@foldout@panelwidth{0pt}%
|
||||
%\photobook@foldout@mark{\foldoutwidth}%
|
||||
\photobook@markfold[\photobook@foldout@prevfold]{\foldoutwidth}%
|
||||
% explicit size...
|
||||
}{%
|
||||
% finalize prev panel...
|
||||
\ifdim \photobook@foldout@panelwidth > 0pt%
|
||||
\photobook@foldout@pushpanel{%
|
||||
\photobook@foldout@panelwidth}{\photobook@foldout@prevfold}%
|
||||
%\photobook@foldout@mark{\foldoutwidth}\fi%
|
||||
\photobook@markfold[\photobook@foldout@prevfold]{\foldoutwidth}\fi%
|
||||
\photobook@foldout@panelwidth}{\photobook@foldout@prevfold}\fi%
|
||||
%
|
||||
% XXX need to disable clearences here...
|
||||
\setlength\photobook@foldout@panelwidth{\photobook@foldout@opt}}}}%
|
||||
@ -3072,6 +3085,12 @@
|
||||
\photobook@foldout@pushpanel{%
|
||||
\photobook@foldout@panelwidth}{\photobook@foldout@prevfold}%
|
||||
\fi%
|
||||
\setsepchar{,}%
|
||||
% NOTE: the first element is empty due to how we create these
|
||||
% i.e. ('' + ',<value>')...
|
||||
\ignoreemptyitems%
|
||||
\readlist*\foldoutcellfolds{\foldoutcellfolds}%
|
||||
\readlist*\foldoutcellwidths{\foldoutcellwidths}%
|
||||
%
|
||||
% pages...
|
||||
% NOTE: we'll keep the start of the foldout set at the right page
|
||||
@ -3086,6 +3105,7 @@
|
||||
|
||||
|
||||
%% \DescribeEnv{foldoutcell}
|
||||
%% \DescribeEnv{foldoutcell*}
|
||||
%
|
||||
%% \EXPERIMENTAL
|
||||
%%
|
||||
@ -3094,6 +3114,9 @@
|
||||
%% >> \begin{foldoutcell} ... \end{foldoutcell}
|
||||
%% >> \begin{foldoutcell}[<num>] ... \end{foldoutcell}
|
||||
%% >> \begin{foldoutcell}[<from>-<to>] ... \end{foldoutcell}
|
||||
%
|
||||
%% |foldoutcell*| is the same as the non-star version but creates cells
|
||||
%% including bleeds.
|
||||
%%
|
||||
\newlength\photobook@foldoutcell@left
|
||||
\setlength\photobook@foldoutcell@left{0pt}
|
||||
@ -3102,8 +3125,8 @@
|
||||
|
||||
% 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 this can't be used outside of a foldout...
|
||||
% XXX should these clip???
|
||||
\newenvironment{foldoutcell}[1][1]{%
|
||||
\begingroup%
|
||||
\setsepchar{-}%
|
||||
@ -3123,15 +3146,62 @@
|
||||
\setlength\photobook@foldoutcell@width{%
|
||||
\foldoutcellwidths[{\photobook@foldoutcell@panels[1]}]}\fi%
|
||||
%
|
||||
% XXX need to clip bleeds on left (except panel 1) and right (except panel -1)...
|
||||
\begin{cell*}{%
|
||||
\photobook@foldoutcell@left,%
|
||||
\bleed
|
||||
+ \photobook@foldoutcell@left,%
|
||||
\bleed}%
|
||||
{\photobook@foldoutcell@width}%
|
||||
{\pageblockheight}%
|
||||
}{%
|
||||
\end{cell*}%
|
||||
\endgroup}
|
||||
% bleed version...
|
||||
\newenvironment{foldoutcell*}[1][1]{%
|
||||
\begingroup%
|
||||
\setsepchar{-}%
|
||||
\readlist*\photobook@foldoutcell@panels{#1}%
|
||||
% left offset...
|
||||
\photobook@setfoldoutoffset{photobook@foldoutcell@left}{%
|
||||
1
|
||||
}{%
|
||||
\photobook@foldoutcell@panels[1]}%
|
||||
% panel width...
|
||||
\ifnum \photobook@foldoutcell@panelslen > 1%
|
||||
\photobook@setfoldoutoffset{photobook@foldoutcell@width}{%
|
||||
\photobook@foldoutcell@panels[1]%
|
||||
}{%
|
||||
\photobook@foldoutcell@panels[2] + 1}%
|
||||
% add bleed to last panel...
|
||||
\ifnum \photobook@foldoutcell@panels[2] = \foldoutcellwidthslen%
|
||||
\setlength\photobook@foldoutcell@width{%
|
||||
\bleed
|
||||
+ \photobook@foldoutcell@width}\fi%
|
||||
\else%
|
||||
\setlength\photobook@foldoutcell@width{%
|
||||
\foldoutcellwidths[{\photobook@foldoutcell@panels[1]}]}
|
||||
\fi%
|
||||
% add bleed to first/last panel...
|
||||
\ifnum \photobook@foldoutcell@panels[1] = 1%
|
||||
\setlength\photobook@foldoutcell@width{%
|
||||
\bleed
|
||||
+ \photobook@foldoutcell@width}
|
||||
\else%
|
||||
\setlength\photobook@foldoutcell@left{%
|
||||
\bleed
|
||||
+ \photobook@foldoutcell@left}\fi%
|
||||
\ifnum \photobook@foldoutcell@panels[1] = \foldoutcellwidthslen%
|
||||
\setlength\photobook@foldoutcell@width{%
|
||||
\bleed
|
||||
+ \photobook@foldoutcell@width}\fi%
|
||||
%
|
||||
\begin{cell*}{%
|
||||
\photobook@foldoutcell@left,%
|
||||
0pt}%
|
||||
{\photobook@foldoutcell@width}%
|
||||
{\pageblockheight + 2\bleed}%
|
||||
}{%
|
||||
\end{cell*}%
|
||||
\endgroup}
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user