testing / experimenting...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2023-05-05 17:21:20 +03:00
parent 8cdf25b17e
commit 93105898cb
2 changed files with 83 additions and 34 deletions

View File

@ -16,6 +16,11 @@
\begin{document} % - - - - - - - - - - - - - - - - - - - - - - - - - - - \begin{document} % - - - - - - - - - - - - - - - - - - - - - - - - - - -
\begin{page}
cliptocellclearances=\cliptocellclearances
\end{page}
% XXX ignores layoutmode=endpaper.... % XXX ignores layoutmode=endpaper....
\ImagePageFill{}{DSC00403-2} \ImagePageFill{}{DSC00403-2}
@ -24,16 +29,16 @@
% XXX ignores layoutmode=endpaper.... % XXX ignores layoutmode=endpaper....
\begin{page} \begin{page}
\begin{pagecell} \begin{pagecell}
\imagecell[fill]{}{DSC00403-2} \imagecell[fill]{}{DSC00403-2}
\end{pagecell} \end{pagecell}
\end{page} \end{page}
% XXX for some reason this is not centered correctly but scaling seems % XXX for some reason this is not centered correctly but scaling seems
% correct... % correct...
\begin{page} \begin{page}
\imagecell[fill]{}{DSC00403-2} \imagecell[fill]{}{DSC00403-2}
\end{page} \end{page}
@ -43,10 +48,10 @@
\begin{page} \begin{page}
\begin{leftside} \begin{leftside}
\imagecell[fit]{}{DSC00403-2} \imagecell[fit]{}{DSC00403-2}
\end{leftside} \end{leftside}
\begin{rightside*} \begin{rightside*}
\imagecell[fit, clearance=-\bleed]{}{DSC00403-2} \imagecell[fit, clearance=-\bleed]{}{DSC00403-2}
\end{rightside*} \end{rightside*}
\end{page} \end{page}
@ -54,14 +59,37 @@
\begin{page} \begin{page}
\begin{leftside} \begin{leftside}
\begin{cliptocell} \begin{cliptocell}
\imagecell[fit]{}{DSC00403-2} \imagecell[fit]{}{DSC00403-2}
\end{cliptocell} \end{cliptocell}
\end{leftside} \end{leftside}
\begin{rightside}
\begin{cliptocell}
\imagecell[fit]{}{DSC00403-2}
\end{cliptocell}
\end{rightside}
\end{page}
\begin{page}
\begin{leftside*}
\begin{cliptocell}
% XXX this breaks things....
%\imagecell[fit, clearance={-\bleed} {-\bleed} 0mm {-\bleed}]{}{DSC00403-2}
\imagecell[fit, clearance=-\bleed]{}{DSC00403-2}
\end{cliptocell}
\end{leftside*}
\begin{rightside*} \begin{rightside*}
\begin{cliptocell} \begin{cliptocell}
\imagecell[fit, clearance=-\bleed]{}{DSC00403-2} % XXX for some reason this is undefined here...
\end{cliptocell} %\cliptocellclearances
% XXX \cliptocellclearances does not work yet...
%\imagecell[fit, clearance=\cliptocellclearances]{}{DSC00403-2}
% XXX this does not seem to be forking correctly...
% ...looks like we are not accounting for clearance in offset...
\imagecell[fit, clearance={0pt} {-\bleed} {-\bleed} {-\bleed}]{}{DSC00403-2}
\end{cliptocell}
\end{rightside*} \end{rightside*}
\end{page} \end{page}
@ -69,14 +97,18 @@
\begin{page} \begin{page}
\begin{leftside} \begin{leftside}
\begin{cliptocell} \begin{cliptocell}
\imagecell[fill]{}{DSC00403-2} \imagecell[fill]{}{DSC00403-2}
\end{cliptocell} \end{cliptocell}
\end{leftside} \end{leftside}
\begin{rightside*} \begin{rightside*}
\begin{cliptocell} \begin{cliptocell}
\imagecell[fill, clearance=-\bleed]{}{DSC00403-2} % XXX \cliptocellclearances does not work yet...
\end{cliptocell} %\imagecell[fill, clearance=\cliptocellclearances]{}{DSC00403-2}
% XXX this does not seem to be forking correctly...
% ...looks like we are not accounting for clearance in offset...
\imagecell[fill, clearance={0pt} {-\bleed} {-\bleed} {-\bleed}]{}{DSC00403-2}
\end{cliptocell}
\end{rightside*} \end{rightside*}
\end{page} \end{page}
@ -89,4 +121,4 @@
\end{document} %------------------------------------------------------- \end{document} %-------------------------------------------------------
% vim:set ts=4 sw=4 : % vim:set ts=4 sw=4 :

View File

@ -38,6 +38,8 @@
% %
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
% %
% XXX ASAP: imagecell: photobook@imagecell@left and photobook@imagecell@left
% should explicitly account for clearence@left and clearence@top resp.
% XXX ASAP: imagecell: clearance should have the same semantics as cliptocell % XXX ASAP: imagecell: clearance should have the same semantics as cliptocell
% offsts... % offsts...
% (CLEARANCE) % (CLEARANCE)
@ -964,7 +966,7 @@
%%% \DescribeMacro{\clearanceright=<len>} %%% \DescribeMacro{\clearanceright=<len>}
%%% \DescribeMacro{\clearancebottom=<len>} %%% \DescribeMacro{\clearancebottom=<len>}
% XXX LEGACY CLEARANCE % XXX LEGACY CLEARANCE
%% \DescribeMacro{\clearance=<len>} %%% \DescribeMacro{\clearance=<len>}
% %
%% Cell geometry. %% Cell geometry.
%% %%
@ -996,8 +998,8 @@
\setlength\clearancebottom{0pt} \setlength\clearancebottom{0pt}
\def\clearances{0pt} \def\clearances{0pt}
% XXX LEGACY CLEARANCE % XXX LEGACY CLEARANCE
\newlength\clearance %\newlength\clearance
\setlength\clearance{0pt} %\setlength\clearance{0pt}
%% \DescribeMacro{\clearfoldoutgutter=<len>} %% \DescribeMacro{\clearfoldoutgutter=<len>}
@ -1616,7 +1618,7 @@
%%% \DescribeMacro{\clearanceright=<len>} %%% \DescribeMacro{\clearanceright=<len>}
%%% \DescribeMacro{\clearancebottom=<len>} %%% \DescribeMacro{\clearancebottom=<len>}
% XXX LEGACY CLEARANCE % XXX LEGACY CLEARANCE
%% \DescribeMacro{\clearance=<len>} %%% \DescribeMacro{\clearance=<len>}
%% %%
%% A cell defines a set of contextual lengths: %% A cell defines a set of contextual lengths:
%% %%
@ -1754,7 +1756,7 @@
\setlength\clearanceright{0pt}% \setlength\clearanceright{0pt}%
\setlength\clearancebottom{0pt}% \setlength\clearancebottom{0pt}%
% XXX LEGACY CLEARANCE % XXX LEGACY CLEARANCE
\setlength\clearance{0pt}% %\setlength\clearance{0pt}%
% %
\begin{MinipageCellContent}[\photobook@minipagecell@parentvalign]{minipagecell}% \begin{MinipageCellContent}[\photobook@minipagecell@parentvalign]{minipagecell}%
}{% }{%
@ -2044,6 +2046,7 @@
\setlength\photobook@cliptocell@right{0mm}% \setlength\photobook@cliptocell@right{0mm}%
\newlength\photobook@cliptocell@bottom \newlength\photobook@cliptocell@bottom
\setlength\photobook@cliptocell@bottom{0mm}% \setlength\photobook@cliptocell@bottom{0mm}%
\def\cliptocellclearances{0mm 0mm 0mm 0mm}%
%% Set the default bleeds for |cliptocell| environments %% Set the default bleeds for |cliptocell| environments
%% %%
@ -2054,6 +2057,10 @@
%% This will only affect |cliptocell| environments on the same level, %% This will only affect |cliptocell| environments on the same level,
%% without affecting the nested |cliptocell|s. %% without affecting the nested |cliptocell|s.
%% %%
%%% \DescribeEnv{cliptocellclearances=<left> <bottom> <right> <top>}
%%%
%%% Set by |\cliptocellbleeds{..}| and contains clearances (negative
%%% clipping bleeds) usable by imagecell.
\newcommand\cliptocellbleeds[1]{ \newcommand\cliptocellbleeds[1]{
\setsepchar{ }% \setsepchar{ }%
\readlist*\photobook@cliptocell@bleeds{#1}% \readlist*\photobook@cliptocell@bleeds{#1}%
@ -2087,7 +2094,13 @@
\setlength\photobook@cliptocell@right{% \setlength\photobook@cliptocell@right{%
\photobook@cliptocell@bleeds[3]}% \photobook@cliptocell@bleeds[3]}%
\setlength\photobook@cliptocell@top{% \setlength\photobook@cliptocell@top{%
\photobook@cliptocell@bleeds[4]}\fi} \photobook@cliptocell@bleeds[4]}\fi%
% NOTE: trailing spaces here are significant...
\def\cliptocellclearances{%
{-\photobook@cliptocell@left} %
{-\photobook@cliptocell@bottom} %
{-\photobook@cliptocell@right} %
{-\photobook@cliptocell@top}}}
\newenvironment{cliptocell}[1][0mm]{% \newenvironment{cliptocell}[1][0mm]{%
\begingroup% \begingroup%
@ -2333,6 +2346,9 @@
-0.5\ht\photobook@imagebox \relax}% -0.5\ht\photobook@imagebox \relax}%
\def\photobook@imagecell@left{\dimexpr \def\photobook@imagecell@left{\dimexpr
+0.5\cellwidth +0.5\cellwidth
% XXX EXPERIMENTAL CLEARANCE -- test...
+0.5\photobook@imagecell@clearance@left
-0.5\photobook@imagecell@clearance@right
-0.5\wd\photobook@imagebox \relax}}% -0.5\wd\photobook@imagebox \relax}}%
% left/right... % left/right...
% shortdands... % shortdands...
@ -2485,13 +2501,13 @@
keepaspectratio, keepaspectratio,
width=\photobook@imagecell@scale\dimexpr width=\photobook@imagecell@scale\dimexpr
\cellwidth \cellwidth
-\photobook@imagecell@clearance@left - \photobook@imagecell@clearance@left
-\photobook@imagecell@clearance@right \relax, - \photobook@imagecell@clearance@right \relax,
%- ((\photobook@imagecell@clearance) * 2) \relax, %- ((\photobook@imagecell@clearance) * 2) \relax,
height=\photobook@imagecell@scale\dimexpr height=\photobook@imagecell@scale\dimexpr
\cellheight \cellheight
-\photobook@imagecell@clearance@top - \photobook@imagecell@clearance@top
-\photobook@imagecell@clearance@bottom \relax]{#3}}% - \photobook@imagecell@clearance@bottom \relax]{#3}}%
%- ((\photobook@imagecell@clearance) * 2) \relax]{#3}}% %- ((\photobook@imagecell@clearance) * 2) \relax]{#3}}%
% fill... % fill...
\else\ifKV@imagecell@args@fill% \else\ifKV@imagecell@args@fill%
@ -2511,8 +2527,8 @@
keepaspectratio, keepaspectratio,
width=\photobook@imagecell@scale\dimexpr width=\photobook@imagecell@scale\dimexpr
+ \cellwidth + \cellwidth
-\photobook@imagecell@clearance@left - \photobook@imagecell@clearance@left
-\photobook@imagecell@clearance@right \relax]{#3}}% - \photobook@imagecell@clearance@right \relax]{#3}}%
%- ((\photobook@imagecell@clearance) * 2) \relax]{#3}}% %- ((\photobook@imagecell@clearance) * 2) \relax]{#3}}%
\else% \else%
\sbox{\photobook@imagebox}{% \sbox{\photobook@imagebox}{%
@ -2520,8 +2536,8 @@
keepaspectratio, keepaspectratio,
height=\photobook@imagecell@scale\dimexpr height=\photobook@imagecell@scale\dimexpr
+ \cellheight + \cellheight
-\photobook@imagecell@clearance@top - \photobook@imagecell@clearance@top
-\photobook@imagecell@clearance@bottom \relax]{#3}}% - \photobook@imagecell@clearance@bottom \relax]{#3}}%
%- ((\photobook@imagecell@clearance) * 2) \relax]{#3}}% %- ((\photobook@imagecell@clearance) * 2) \relax]{#3}}%
\fi\fi\fi% \fi\fi\fi%
% %
@ -2572,7 +2588,7 @@
\setlength\clearancebottom{\photobook@imagecell@clearance@bottom} \setlength\clearancebottom{\photobook@imagecell@clearance@bottom}
\def\clearances{\photobook@imagecell@clearences} \def\clearances{\photobook@imagecell@clearences}
% XXX LEGACY CLEARANCE % XXX LEGACY CLEARANCE
\setlength\clearance{\photobook@imagecell@clearance}% %\setlength\clearance{\photobook@imagecell@clearance}%
% clear parent... % clear parent...
% XXX might be a good idea to put this into a special reusable cell... % XXX might be a good idea to put this into a special reusable cell...
\ifphotobook@imagecell@captionclearparent% \ifphotobook@imagecell@captionclearparent%
@ -3034,7 +3050,8 @@
% XXX this is only present in images... % XXX this is only present in images...
% XXX change this to use \clearanceleft / \clearanceright / ... % XXX change this to use \clearanceleft / \clearanceright / ...
% XXX LEGACY CLEARANCE % XXX LEGACY CLEARANCE
- \clearance \relax% - \clearance
\relax%
\else% \else%
\photobook@captionblockcell@width\fi}% \photobook@captionblockcell@width\fi}%
\setlength\cellparentwidth{% \setlength\cellparentwidth{%