mirror of
https://github.com/flynx/photobook.git
synced 2025-10-29 10:20:08 +00:00
Reworked \bindingoffset to affect all cells now this has the same semantics as in \geometry{..}; added \gutteroffset to allow to offset non-bleed cells relative to the gutter.
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
cebf722ac6
commit
a5a8515410
@ -5,7 +5,8 @@
|
|||||||
% page size...
|
% page size...
|
||||||
blockwidth=240mm, blockheight=220mm,
|
blockwidth=240mm, blockheight=220mm,
|
||||||
bleed=4mm,
|
bleed=4mm,
|
||||||
bindingoffset=5mm,
|
gutteroffset=5mm,
|
||||||
|
bindingoffset=0mm,
|
||||||
% image block configuration...
|
% image block configuration...
|
||||||
imageblockwidth=0.98, imageblockheight=0.98,
|
imageblockwidth=0.98, imageblockheight=0.98,
|
||||||
imageblockoffsettop=0,
|
imageblockoffsettop=0,
|
||||||
|
|||||||
@ -34,10 +34,10 @@
|
|||||||
%
|
%
|
||||||
%
|
%
|
||||||
%
|
%
|
||||||
% XXX ASAP \bindingoffset should also affect fill/bleed images...
|
% XXX ASAP \bindingoffset should also affect fill/bleed images... (DONE)
|
||||||
% ...shift the macros that optionally account for \bindingoffset to
|
% ...shift the macros that optionally account for \bindingoffset to
|
||||||
% account for \gutteroffset
|
% account for \gutteroffset (DONE)
|
||||||
% ...everything should respect \bindingoffset
|
% ...everything should respect \bindingoffset (DONE)
|
||||||
% XXX ASAP add \gutteroffset and \gutterimageoffset to offset content
|
% XXX ASAP add \gutteroffset and \gutterimageoffset to offset content
|
||||||
% from the gutter
|
% from the gutter
|
||||||
% \gutterimageoffset is an additional offset added to bleed images...
|
% \gutterimageoffset is an additional offset added to bleed images...
|
||||||
@ -100,8 +100,8 @@
|
|||||||
|
|
||||||
%%% 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.15}
|
\edef\photobook@FILEVERSION{v0.1.17}
|
||||||
\edef\photobook@FILEDATE{2023-03-18}
|
\edef\photobook@FILEDATE{2023-04-09}
|
||||||
|
|
||||||
|
|
||||||
%% \documentclass{ltxdoc}
|
%% \documentclass{ltxdoc}
|
||||||
@ -248,8 +248,7 @@
|
|||||||
%% \DescribeMacro{blockwidth=<len>}
|
%% \DescribeMacro{blockwidth=<len>}
|
||||||
%% \DescribeMacro{blockheight=<len>}
|
%% \DescribeMacro{blockheight=<len>}
|
||||||
%% \DescribeMacro{bindingoffset=<len>}
|
%% \DescribeMacro{bindingoffset=<len>}
|
||||||
% XXX
|
%% \DescribeMacro{gutteroffset=<len>}
|
||||||
%%% \DescribeMacro{gutteroffset=<len>}
|
|
||||||
%%% \DescribeMacro{gutterimageoffset=<len>}
|
%%% \DescribeMacro{gutterimageoffset=<len>}
|
||||||
%% \DescribeMacro{bleed=<len>}
|
%% \DescribeMacro{bleed=<len>}
|
||||||
%
|
%
|
||||||
@ -258,32 +257,36 @@
|
|||||||
%% \begin{minipage}{\textwidth}
|
%% \begin{minipage}{\textwidth}
|
||||||
%% \begin{verbatim}
|
%% \begin{verbatim}
|
||||||
%%
|
%%
|
||||||
%% <---> bleed <---> bleed
|
%% <---> bleed <---> bleed
|
||||||
%%
|
%%
|
||||||
%% + - - - - - - - - - - - - - - - - - - - - - + - + ^
|
%% + - - - - - - - - - - - - - - - - - - - - - - + - + ^
|
||||||
%% . . . | bleed
|
%% . . . | bleed
|
||||||
%% . +---------------------------------------+----- v . . ---
|
%% . +-----------------------------------------+----- v . . ---
|
||||||
%% . | ^ . = .
|
%% . | ^ . . = .
|
||||||
%% . | . . . . . . | . . = . ^
|
%% . | . . . . . . | . . . = . ^
|
||||||
%% . |<-- blockwidth ----------------------->= . |
|
%% . |<-- blockwidth ------------------------->= . |
|
||||||
%% . | . | . . = . |
|
%% . | . | . . . = . |
|
||||||
%% . | | . = . textheight
|
%% . | | . . = . textheight
|
||||||
%% . | . Page | . . = . |
|
%% . | . Page | . . . = . |
|
||||||
%% . | blockheight . = . |
|
%% . | blockheight . . = . |
|
||||||
%% . | . | . . = . |
|
%% . | . | . . <--> bindingoffset |
|
||||||
%% . | | <---> bindingoffset |
|
%% . | | . . = . |
|
||||||
%% . | . . . . . . | . . = . v
|
%% . | . . . . . . | . <--> gutteroffset v
|
||||||
%% . | v . = .
|
%% . | v . . = .
|
||||||
%% . +---------------------------------------+----- ^ . . ---
|
%% . +-----------------------------------------+----- ^ . . ---
|
||||||
%% . . . . | bleed
|
%% . . . . | bleed
|
||||||
%% + - - - - - - - - - - - - - - - - - - - - - + - + v
|
%% + - - - - - - - - - - - - - - - - - - - - - - + - + v
|
||||||
%% . .
|
%% . .
|
||||||
%% | <-- textwidth --------------> . |
|
%% | <-- textwidth --------------> . |
|
||||||
%% ^ gutter
|
%% ^ gutter
|
||||||
%%
|
%%
|
||||||
%% \end{verbatim}
|
%% \end{verbatim}
|
||||||
%% \end{minipage}
|
%% \end{minipage}
|
||||||
%%
|
%%
|
||||||
|
%% Note that all macros respect |\bindingoffset| but only some macros
|
||||||
|
%% account for |\gutteroffset|, namely macros that do not display content
|
||||||
|
%% with bleeds.
|
||||||
|
%%
|
||||||
% NOTE: if blockwidth/blockheight are set they will force recalculations
|
% NOTE: if blockwidth/blockheight are set they will force recalculations
|
||||||
% and overriding of the paperwidth/paperheight if they were changed
|
% and overriding of the paperwidth/paperheight if they were changed
|
||||||
% by the user code anywhere between \documentclass[..]{photobook}
|
% by the user code anywhere between \documentclass[..]{photobook}
|
||||||
@ -811,14 +814,20 @@
|
|||||||
%
|
%
|
||||||
%% Binding offset
|
%% Binding offset
|
||||||
%%
|
%%
|
||||||
|
%% Used to offset content to account glue-up/roughing of pages for certain
|
||||||
|
%% types of binds like perfect binds.
|
||||||
|
%%
|
||||||
\newlength\bindingoffset
|
\newlength\bindingoffset
|
||||||
\setlength\bindingoffset{\photobook@bindingoffset}
|
\setlength\bindingoffset{\photobook@bindingoffset}
|
||||||
|
|
||||||
%%% \DescribeMacro{\gutteroffset=<len>}
|
%% \DescribeMacro{\gutteroffset=<len>}
|
||||||
%%% \DescribeMacro{\gutterimageoffset=<len>}
|
%%% \DescribeMacro{\gutterimageoffset=<len>}
|
||||||
%
|
%
|
||||||
%%% Gutter offsets
|
%% Gutter offsets
|
||||||
%%%
|
%%
|
||||||
|
%% Mainly used to offset content without bleeds away from or into the
|
||||||
|
%% gutter.
|
||||||
|
%%
|
||||||
\newlength\gutteroffset
|
\newlength\gutteroffset
|
||||||
\setlength\gutteroffset{\photobook@gutteroffset}
|
\setlength\gutteroffset{\photobook@gutteroffset}
|
||||||
\newlength\gutterimageoffset
|
\newlength\gutterimageoffset
|
||||||
@ -2959,22 +2968,30 @@
|
|||||||
%% \end{verbatim}
|
%% \end{verbatim}
|
||||||
%% \end{minipage}
|
%% \end{minipage}
|
||||||
%%
|
%%
|
||||||
%% The star version accounts for |\bindingoffset|.
|
%% The star version accounts for |\gutteroffset|.
|
||||||
%%
|
%%
|
||||||
%% Note that |layoutmode|'s other than block will change the paper size
|
%% Note that |layoutmode|'s other than block will change the paper size
|
||||||
%% but will not affect this either in size (block size) or in position
|
%% but will not affect this either in size (block size) or in position
|
||||||
%% (top-left).
|
%% (top-left).
|
||||||
%%
|
%%
|
||||||
|
%\newenvironment{pagecell}{%
|
||||||
|
% \begin{cell*}{\bleed,\bleed}{\pageblockwidth}{\pageblockheight}%
|
||||||
|
%}{%
|
||||||
|
% \end{cell*}}
|
||||||
\newenvironment{pagecell}{%
|
\newenvironment{pagecell}{%
|
||||||
\begin{cell*}{\bleed,\bleed}{\pageblockwidth}{\pageblockheight}%
|
\begin{cell*}{%
|
||||||
|
\bleed + \ifnumodd{\thepage}{\bindingoffset}{0pt},%
|
||||||
|
\bleed}%
|
||||||
|
{\pageblockwidth - \bindingoffset}%
|
||||||
|
{\pageblockheight}%
|
||||||
}{%
|
}{%
|
||||||
\end{cell*}}
|
\end{cell*}}
|
||||||
|
|
||||||
\newenvironment{pagecell*}{%
|
\newenvironment{pagecell*}{%
|
||||||
\begin{cell*}{%
|
\begin{cell*}{%
|
||||||
\bleed + \ifnumodd{\thepage}{\bindingoffset}{0pt},%
|
\bleed + \ifnumodd{\thepage}{\bindingoffset + \gutteroffset}{0pt},%
|
||||||
\bleed}%
|
\bleed}%
|
||||||
{\pageblockwidth - \bindingoffset}%
|
{\pageblockwidth - \bindingoffset - \gutteroffset}%
|
||||||
{\pageblockheight}%
|
{\pageblockheight}%
|
||||||
}{%
|
}{%
|
||||||
\end{cell*}}
|
\end{cell*}}
|
||||||
@ -3804,7 +3821,7 @@
|
|||||||
% create the actual cell...
|
% create the actual cell...
|
||||||
\setlength\cellparentwidth{\cellwidth}%
|
\setlength\cellparentwidth{\cellwidth}%
|
||||||
\setlength\cellparentheight{\cellheight}%
|
\setlength\cellparentheight{\cellheight}%
|
||||||
\setlength\cellwidth{#1\pageblockwidth}%
|
\setlength\cellwidth{#1\pageblockwidth - #1\bindingoffset}%
|
||||||
\setlength\cellheight{\pageblockheight}%
|
\setlength\cellheight{\pageblockheight}%
|
||||||
%
|
%
|
||||||
\savecell{photobook@spreadtopages}{\cellwidth}{\cellheight}{\BODY}%
|
\savecell{photobook@spreadtopages}{\cellwidth}{\cellheight}{\BODY}%
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user