mirror of
https://github.com/flynx/photobook.git
synced 2025-10-29 02:10:08 +00:00
started unifying fold marks....
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
b6616854e5
commit
32cb31e702
@ -18,6 +18,7 @@
|
|||||||
9pt,final,openany
|
9pt,final,openany
|
||||||
]{photobook}
|
]{photobook}
|
||||||
|
|
||||||
|
\edef\foldmarkoffset{-10mm}
|
||||||
|
|
||||||
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
|||||||
@ -652,9 +652,18 @@
|
|||||||
%% foldout pages, changing this can mess up fold markers and page cell
|
%% foldout pages, changing this can mess up fold markers and page cell
|
||||||
%% placement.
|
%% placement.
|
||||||
%%
|
%%
|
||||||
% XXX use this instead of foldoutcellwidths...
|
% XXX use this instead of \foldoutcellwidths...
|
||||||
\setsepchar{,}
|
%\setsepchar{,}
|
||||||
\readlist*\pagefoldpanels{}
|
%\readlist*\pagefoldpanels{}
|
||||||
|
\def\pagefoldpanels{}
|
||||||
|
|
||||||
|
%% \DescribeMacro{\pagefoldpanelfolds=<list>}
|
||||||
|
%
|
||||||
|
%% \EXPERIMENTAL
|
||||||
|
%%
|
||||||
|
%% lists sequence of page fold types (|in|/|out|).
|
||||||
|
%%
|
||||||
|
\def\pagefoldpanelfolds{}
|
||||||
|
|
||||||
%% \DescribeMacro{\clearimage=<len>}
|
%% \DescribeMacro{\clearimage=<len>}
|
||||||
%
|
%
|
||||||
@ -844,7 +853,7 @@
|
|||||||
\setlength\pageblockwidth{\blockwidth}
|
\setlength\pageblockwidth{\blockwidth}
|
||||||
% layout: cover...
|
% layout: cover...
|
||||||
\ifcoverlayout
|
\ifcoverlayout
|
||||||
% XXX use this instead of foldoutcellwidths...
|
% XXX use this instead of \foldoutcellwidths...
|
||||||
% XXX use this for the general cell placement...
|
% XXX use this for the general cell placement...
|
||||||
\setsepchar{,}%
|
\setsepchar{,}%
|
||||||
\readlist*\pagefoldpanels{%
|
\readlist*\pagefoldpanels{%
|
||||||
@ -857,6 +866,7 @@
|
|||||||
\the\blockwidth,
|
\the\blockwidth,
|
||||||
\the\coverboardgrow,
|
\the\coverboardgrow,
|
||||||
\the\coverflap}%
|
\the\coverflap}%
|
||||||
|
\edef\foldoutfold{out}
|
||||||
\setlength\blockwidth{
|
\setlength\blockwidth{
|
||||||
\dimexpr
|
\dimexpr
|
||||||
2\blockwidth
|
2\blockwidth
|
||||||
@ -867,7 +877,7 @@
|
|||||||
% layout: jacket...
|
% layout: jacket...
|
||||||
% XXX this seems to be about 6mm off -- what are we missing here???
|
% XXX this seems to be about 6mm off -- what are we missing here???
|
||||||
\ifjacketlayout
|
\ifjacketlayout
|
||||||
% XXX use this instead of foldoutcellwidths...
|
% XXX use this instead of \foldoutcellwidths...
|
||||||
% XXX use this for the general cell placement...
|
% XXX use this for the general cell placement...
|
||||||
\setsepchar{,}%
|
\setsepchar{,}%
|
||||||
\readlist*\pagefoldpanels{%
|
\readlist*\pagefoldpanels{%
|
||||||
@ -882,6 +892,7 @@
|
|||||||
\the\blockwidth,
|
\the\blockwidth,
|
||||||
\the\jacketwrap,
|
\the\jacketwrap,
|
||||||
\the\jacketflapfront}%
|
\the\jacketflapfront}%
|
||||||
|
\edef\foldoutfold{out}
|
||||||
\setlength\blockwidth{
|
\setlength\blockwidth{
|
||||||
\dimexpr
|
\dimexpr
|
||||||
2\blockwidth
|
2\blockwidth
|
||||||
@ -892,11 +903,12 @@
|
|||||||
+ \jacketflapback \relax}\fi
|
+ \jacketflapback \relax}\fi
|
||||||
% layout: endpaper...
|
% layout: endpaper...
|
||||||
\ifendpaperlayout
|
\ifendpaperlayout
|
||||||
% XXX use this instead of foldoutcellwidths...
|
% XXX use this instead of \foldoutcellwidths...
|
||||||
% XXX use this for the general cell placement...
|
% XXX use this for the general cell placement...
|
||||||
\readlist*\pagefoldpanels{%
|
\readlist*\pagefoldpanels{%
|
||||||
\the\blockwidth,
|
\the\blockwidth,
|
||||||
\the\blockwidth}%
|
\the\blockwidth}%
|
||||||
|
\edef\foldoutfold{in}
|
||||||
\setlength\blockwidth{ 2\blockwidth }\fi\fi
|
\setlength\blockwidth{ 2\blockwidth }\fi\fi
|
||||||
\ifdim\blockheight=0pt
|
\ifdim\blockheight=0pt
|
||||||
% layout: block / endpaper...
|
% layout: block / endpaper...
|
||||||
@ -2943,9 +2955,6 @@
|
|||||||
% default fold type...
|
% default fold type...
|
||||||
\edef\foldoutfold{in}
|
\edef\foldoutfold{in}
|
||||||
|
|
||||||
\def\foldoutcellfolds{}
|
|
||||||
\def\foldoutcellwidths{}
|
|
||||||
|
|
||||||
% XXX length or command???
|
% XXX length or command???
|
||||||
\def\foldmarkoffset{0.5\bleed}
|
\def\foldmarkoffset{0.5\bleed}
|
||||||
|
|
||||||
@ -3066,36 +3075,37 @@
|
|||||||
\foldoutwidth
|
\foldoutwidth
|
||||||
+ \photobook@foldout@panelwidth}%
|
+ \photobook@foldout@panelwidth}%
|
||||||
% panel spec lists...
|
% panel spec lists...
|
||||||
\edef\foldoutcellfolds{%
|
\edef\pagefoldpanelfolds{%
|
||||||
\foldoutcellfolds,#2}%
|
\pagefoldpanelfolds,#2}%
|
||||||
\edef\foldoutcellwidths{%
|
\edef\pagefoldpanels{%
|
||||||
\foldoutcellwidths,\the\photobook@foldout@panelwidth}%
|
\pagefoldpanels,\the\photobook@foldout@panelwidth}%
|
||||||
\stepcounter{photobook@foldoutpanel}}
|
\stepcounter{photobook@foldoutpanel}}
|
||||||
|
|
||||||
% XXX also add this to jacket/cover/endpaper...
|
% XXX also add this to jacket/cover/endpaper...
|
||||||
\newlength\photobook@showmarks@offset
|
\newlength\photobook@showmarks@offset
|
||||||
\setlength\photobook@showmarks@offset{0pt}
|
\setlength\photobook@showmarks@offset{0pt}
|
||||||
\newcommand\photobook@showmarks{%
|
\newcommand\photobook@showmarks{%
|
||||||
\ifx \foldoutcellwidths \empty \else%
|
% XXX make this a list-length check...
|
||||||
|
\ifx \pagefoldpanels \empty \else%
|
||||||
\begingroup%
|
\begingroup%
|
||||||
\setlength\photobook@showmarks@offset{\bleed}%
|
\setlength\photobook@showmarks@offset{\bleed}%
|
||||||
% NOTE: we need to iterate left/right pages in reverse order...
|
% NOTE: we need to iterate left/right pages in reverse order...
|
||||||
% NOTE: the below branches are similar but not identical...
|
% NOTE: the below branches are similar but not identical...
|
||||||
\ifnumodd{\thepage}{%
|
\ifnumodd{\thepage}{%
|
||||||
\xintFor* ##1 in {\xintSeq{1}{\foldoutcellwidthslen - 1}} \do {%
|
\xintFor* ##1 in {\xintSeq{1}{\pagefoldpanelslen - 1}} \do {%
|
||||||
\setlength\photobook@showmarks@offset{
|
\setlength\photobook@showmarks@offset{
|
||||||
\photobook@showmarks@offset
|
\photobook@showmarks@offset
|
||||||
+ \foldoutcellwidths[##1]}%
|
+ \pagefoldpanels[##1]}%
|
||||||
% XXX HACK: it appears that we can't expand \foldoutcellfolds[##1] in [..]...
|
% XXX HACK: it appears that we can't expand \pagefoldpanelfolds[##1] in [..]...
|
||||||
\edef\photobook@showmarks@tmp{\foldoutcellfolds[##1]}%
|
\edef\photobook@showmarks@tmp{\pagefoldpanelfolds[##1]}%
|
||||||
\photobook@markfold[\photobook@showmarks@tmp]{\photobook@showmarks@offset}}%
|
\photobook@markfold[\photobook@showmarks@tmp]{\photobook@showmarks@offset}}%
|
||||||
}{
|
}{
|
||||||
\xintFor* ##1 in {\xintSeq{\foldoutcellwidthslen}{2}} \do {%
|
\xintFor* ##1 in {\xintSeq{\pagefoldpanelslen}{2}} \do {%
|
||||||
\setlength\photobook@showmarks@offset{
|
\setlength\photobook@showmarks@offset{
|
||||||
\photobook@showmarks@offset
|
\photobook@showmarks@offset
|
||||||
+ \foldoutcellwidths[##1]}%
|
+ \pagefoldpanels[##1]}%
|
||||||
% XXX HACK: it appears that we can't expand \foldoutcellfolds[##1] in [..]...
|
% XXX HACK: it appears that we can't expand \pagefoldpanelfolds[##1] in [..]...
|
||||||
\edef\photobook@showmarks@tmp{\foldoutcellfolds[##1 - 1]}%
|
\edef\photobook@showmarks@tmp{\pagefoldpanelfolds[##1 - 1]}%
|
||||||
\photobook@markfold[\photobook@showmarks@tmp]{\photobook@showmarks@offset}}}%
|
\photobook@markfold[\photobook@showmarks@tmp]{\photobook@showmarks@offset}}}%
|
||||||
\endgroup\fi}
|
\endgroup\fi}
|
||||||
\AtBeginShipout{%
|
\AtBeginShipout{%
|
||||||
@ -3161,8 +3171,8 @@
|
|||||||
% NOTE: the first element is empty due to how we create these
|
% NOTE: the first element is empty due to how we create these
|
||||||
% i.e. ('' + ',<value>')...
|
% i.e. ('' + ',<value>')...
|
||||||
\ignoreemptyitems%
|
\ignoreemptyitems%
|
||||||
\readlist*\foldoutcellfolds{\foldoutcellfolds}%
|
\readlist*\pagefoldpanelfolds{\pagefoldpanelfolds}%
|
||||||
\readlist*\foldoutcellwidths{\foldoutcellwidths}%
|
\readlist*\pagefoldpanels{\pagefoldpanels}%
|
||||||
%
|
%
|
||||||
% pages...
|
% pages...
|
||||||
% NOTE: we'll keep the start of the foldout set at the right page
|
% NOTE: we'll keep the start of the foldout set at the right page
|
||||||
@ -3211,7 +3221,7 @@
|
|||||||
\newlength\photobook@foldoutcell@width
|
\newlength\photobook@foldoutcell@width
|
||||||
\setlength\photobook@foldoutcell@width{0pt}
|
\setlength\photobook@foldoutcell@width{0pt}
|
||||||
|
|
||||||
% calculate offset via \foldoutcellwidths and write to dimension <name>...
|
% calculate offset via \pagefoldpanels and write to dimension <name>...
|
||||||
% >> \photobook@foldoutcell@setfoldoutoffset{<name>}{<from>}{<to>}
|
% >> \photobook@foldoutcell@setfoldoutoffset{<name>}{<from>}{<to>}
|
||||||
%
|
%
|
||||||
% NOTE: [<from>, <to>[ -- i.e. <to> is not included...
|
% NOTE: [<from>, <to>[ -- i.e. <to> is not included...
|
||||||
@ -3219,15 +3229,15 @@
|
|||||||
\expandafter\setlength\csname #1\endcsname{0pt}%
|
\expandafter\setlength\csname #1\endcsname{0pt}%
|
||||||
\ifnum \numexpr #2 \relax < \numexpr #3 \relax%
|
\ifnum \numexpr #2 \relax < \numexpr #3 \relax%
|
||||||
\xintFor* ##1 in {%
|
\xintFor* ##1 in {%
|
||||||
\xintSeq{#2}{\xintiiMin{#3}{\foldoutcellwidthslen + 1} - 1}} \do {%
|
\xintSeq{#2}{\xintiiMin{#3}{\pagefoldpanelslen + 1} - 1}} \do {%
|
||||||
\ifnumodd{\thepage}{%
|
\ifnumodd{\thepage}{%
|
||||||
\expandafter\setlength\csname #1\endcsname{%
|
\expandafter\setlength\csname #1\endcsname{%
|
||||||
\csname #1\endcsname%
|
\csname #1\endcsname%
|
||||||
+ \foldoutcellwidths[##1]}
|
+ \pagefoldpanels[##1]}
|
||||||
}{%
|
}{%
|
||||||
\expandafter\setlength\csname #1\endcsname{%
|
\expandafter\setlength\csname #1\endcsname{%
|
||||||
\csname #1\endcsname%
|
\csname #1\endcsname%
|
||||||
+ \foldoutcellwidths[-\numexpr ##1 \relax]}}}\fi}
|
+ \pagefoldpanels[-\numexpr ##1 \relax]}}}\fi}
|
||||||
|
|
||||||
% foldout panel auto-advance counter...
|
% foldout panel auto-advance counter...
|
||||||
\newcounter{foldoutpanel}
|
\newcounter{foldoutpanel}
|
||||||
@ -3251,7 +3261,7 @@
|
|||||||
% auto advance panel...
|
% auto advance panel...
|
||||||
\ifnum \photobook@foldoutcell@panels[1] = 0%
|
\ifnum \photobook@foldoutcell@panels[1] = 0%
|
||||||
% auto advance page...
|
% auto advance page...
|
||||||
\ifnum \value{foldoutpanel} = \foldoutcellwidthslen%
|
\ifnum \value{foldoutpanel} = \pagefoldpanelslen%
|
||||||
% NOTE: this will reset the counter...
|
% NOTE: this will reset the counter...
|
||||||
\newpage\fi%
|
\newpage\fi%
|
||||||
\stepcounter{foldoutpanel}%
|
\stepcounter{foldoutpanel}%
|
||||||
@ -3276,10 +3286,10 @@
|
|||||||
\else%
|
\else%
|
||||||
\ifnumodd{\thepage}{%
|
\ifnumodd{\thepage}{%
|
||||||
\setlength\photobook@foldoutcell@width{%
|
\setlength\photobook@foldoutcell@width{%
|
||||||
\foldoutcellwidths[{\photobook@foldoutcell@from}]}
|
\pagefoldpanels[{\photobook@foldoutcell@from}]}
|
||||||
}{%
|
}{%
|
||||||
\setlength\photobook@foldoutcell@width{%
|
\setlength\photobook@foldoutcell@width{%
|
||||||
\foldoutcellwidths[-\numexpr \photobook@foldoutcell@from \relax]}}\fi}
|
\pagefoldpanels[-\numexpr \photobook@foldoutcell@from \relax]}}\fi}
|
||||||
|
|
||||||
\newenvironment{foldoutcell}[1][0]{%
|
\newenvironment{foldoutcell}[1][0]{%
|
||||||
% XXX check if outside of foldout -> warn...
|
% XXX check if outside of foldout -> warn...
|
||||||
@ -3308,7 +3318,7 @@
|
|||||||
\setlength\photobook@foldoutcell@left{%
|
\setlength\photobook@foldoutcell@left{%
|
||||||
\bleed
|
\bleed
|
||||||
+ \photobook@foldoutcell@left}\fi%
|
+ \photobook@foldoutcell@left}\fi%
|
||||||
\ifnum \photobook@foldoutcell@from = \foldoutcellwidthslen%
|
\ifnum \photobook@foldoutcell@from = \pagefoldpanelslen%
|
||||||
\setlength\photobook@foldoutcell@width{%
|
\setlength\photobook@foldoutcell@width{%
|
||||||
\bleed
|
\bleed
|
||||||
+ \photobook@foldoutcell@width}\fi%
|
+ \photobook@foldoutcell@width}\fi%
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user