summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/photobook/photobook.cls
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/photobook/photobook.cls')
-rw-r--r--macros/latex/contrib/photobook/photobook.cls41
1 files changed, 31 insertions, 10 deletions
diff --git a/macros/latex/contrib/photobook/photobook.cls b/macros/latex/contrib/photobook/photobook.cls
index 14016662b4..09a8d9a8eb 100644
--- a/macros/latex/contrib/photobook/photobook.cls
+++ b/macros/latex/contrib/photobook/photobook.cls
@@ -38,10 +38,16 @@
%
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
%
+% XXX should cliptocell offsets be tweakable???
+% XXX ASAP should cover/jacket/endpaper/spread template cells account
+% for bleeds as an option???
+% ...i.e. include cliptocell defaults???
% XXX ASAP should cover/jacket/endpaper/spread templates/cells account
% for \bindingoffset (likely no) and/or \gutteroffset ???
% ...especially relevant to endpaper/spread...
% XXX ASAP revise how bleeds are handled by cells...
+% ...all cells should ignore bleeds unless explicitly stated
+% otherwise -- needs testing...
%
% XXX captions behave in an odd way...
% the internal (macro) minipage for some reason does not affect text
@@ -79,8 +85,8 @@
%%% NOTE: \def\<module-name>@[A-Z]+ macros will be visible to both the
%%% code and the generated docs...
-\edef\photobook@FILEVERSION{v0.1.19}
-\edef\photobook@FILEDATE{2023-04-11}
+\edef\photobook@FILEVERSION{v0.1.20}
+\edef\photobook@FILEDATE{2023-04-22}
%% \documentclass{ltxdoc}
@@ -1962,19 +1968,31 @@
\end{inlinecell*}%
\end{turn}}
+
%% \DescribeEnv{cliptocell}
%
%% Clip content to parent cell.
%%
%% >> \begin{cliptocell} ... \end{cliptocell}
%%
-%% Clip content to cell adding bleeds
+%% Clip content to cell plus offsets (bleeds) from each side
%%
%% >> \begin{cliptocell}[<size>] ... \end{cliptocell}
%% >> \begin{cliptocell}[<horizontal> <vertical>] ... \end{cliptocell}
%% >> \begin{cliptocell}[<left> <bottom> <right> <top>] ... \end{cliptocell}
%%
-%% Clipping to bleeds will not affect the cell content positioning.
+%% Offset order, i.e. left-bottom-right-top is made consistent with
+%% \href{https://ctan.org/pkg/graphicx}{graphicx} and
+%% \href{https://ctan.org/pkg/trimclip}{trimclip} modules and represents
+%% the bottom-left and top-right viewport point offsets from the parent
+%% cell.
+%%
+%% |cliptocell| does not affect the cell content positioning in any way.
+%%
+%% This is designed to simplify filling template cells and adding bleeds
+%% to certain sides and clipping flush to others, for example for cells
+%% of a dust jacket or a foldout, but |cliptocell| is not limited to
+%% this one use-case.
%%
\newlength\photobook@cliptocell@left
\setlength\photobook@cliptocell@left{0mm}%
@@ -1990,7 +2008,7 @@
\setsepchar{ }%
\readlist*\photobook@cliptocell@bleeds{#1}%
%
- % bleed
+ % args: size
\ifnum \photobook@cliptocell@bleedslen = 1%
\setlength\photobook@cliptocell@left{%
\photobook@cliptocell@bleeds[1]}%
@@ -2000,7 +2018,7 @@
\photobook@cliptocell@bleeds[1]}%
\setlength\photobook@cliptocell@top{%
\photobook@cliptocell@bleeds[1]}\fi%
- % horizontal vertical
+ % args: horizontal vertical
\ifnum \photobook@cliptocell@bleedslen = 2%
\setlength\photobook@cliptocell@left{%
\photobook@cliptocell@bleeds[1]}%
@@ -2010,7 +2028,7 @@
\photobook@cliptocell@bleeds[1]}%
\setlength\photobook@cliptocell@top{%
\photobook@cliptocell@bleeds[2]}\fi%
- % left top right bottom
+ % args: left bottom right top
\ifnum \photobook@cliptocell@bleedslen = 4%
\setlength\photobook@cliptocell@left{%
\photobook@cliptocell@bleeds[1]}%
@@ -2021,7 +2039,7 @@
\setlength\photobook@cliptocell@top{%
\photobook@cliptocell@bleeds[4]}\fi%
%
- % XXX the spaces at the end of each line here are significant...
+ % NOTE: the spaces at the end of each line here are significant!!
\begin{trimbox}{{\photobook@cliptocell@left} %
{\photobook@cliptocell@bottom} %
{\photobook@cliptocell@right} %
@@ -2030,6 +2048,11 @@
{\height - \cellheight - \photobook@cliptocell@bottom} %
{\cellwidth + \photobook@cliptocell@right} %
{\height + \photobook@cliptocell@top}}%
+ % set defaults for nested cells...
+ \setlength\photobook@cliptocell@left{0mm}%
+ \setlength\photobook@cliptocell@top{0mm}%
+ \setlength\photobook@cliptocell@right{0mm}%
+ \setlength\photobook@cliptocell@bottom{0mm}%
\begin{minipage}[t][\cellheight][t]{\cellwidth}%
\ignorespaces%
}{%
@@ -2039,8 +2062,6 @@
\endgroup}
-
-
%% \DescribeMacro{\imagecell\{..\}}
%
%% Place image in cell.