partially fixed image fill caption cell placement....

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2021-08-23 19:26:51 +03:00
parent d7279e6810
commit ac785f146c

View File

@ -1272,7 +1272,9 @@
% XXX should these be lengths or macros??? % XXX should these be lengths or macros???
\def\photobook@imagecell@top{0pt} \def\photobook@imagecell@top{0pt}
\def\photobook@imagecell@left{0pt} \def\photobook@imagecell@left{0pt}
\def\photobook@imagecell@clearance{0pt}
\newlength\photobook@imagecell@clearance
\setlength\photobook@imagecell@clearance{0pt}
% fit/fill... % fit/fill...
\define@boolkey{imagecell@args}{fit}[true]{% \define@boolkey{imagecell@args}{fit}[true]{%
@ -1327,7 +1329,7 @@
-\ht\photobook@imagebox \relax}}% -\ht\photobook@imagebox \relax}}%
% clearance=<len>... % clearance=<len>...
\define@key{imagecell@args}{clearance}{% \define@key{imagecell@args}{clearance}{%
\def\photobook@imagecell@clearance{#1}}% \setlength\photobook@imagecell@clearance{#1}}%
\def\photobook@imagecell@captionalign{t} \def\photobook@imagecell@captionalign{t}
\define@choicekey{imagecell@args}{caption-align}{t,c,b}[t]{% \define@choicekey{imagecell@args}{caption-align}{t,c,b}[t]{%
@ -1383,23 +1385,32 @@
% image.... % image....
\usebox\photobook@imagebox% \usebox\photobook@imagebox%
% caption cell... % caption cell...
% XXX the \ifx here does not work...
\ifx #2 \empty \else% \ifx #2 \empty \else%
\begingroup% \begingroup%
% XXX broken for fill... % XXX broken for fill...
% XXX test for portrait images... % XXX test for portrait images...
\vspace{-1em}%
\hspace{-\mindim{% \hspace{-\mindim{%
\wd\photobook@imagebox \wd\photobook@imagebox
}{% }{%
\cellwidth - \photobook@imagecell@clearance}}{% \cellwidth
-0.5\dimexpr
\cellwidth
-\wd\photobook@imagebox \relax }}{%
% prep for caption cell...
\setlength\cellwidth{\dimexpr% \setlength\cellwidth{\dimexpr%
-2\photobook@HOFFSETFIX -2\photobook@HOFFSETFIX
+\mindim{\wd\photobook@imagebox}{\cellwidth} \relax}% +\mindim{\wd\photobook@imagebox}{\cellwidth} \relax}%
\setlength\cellheight{% \setlength\cellheight{%
\mindim{\ht\photobook@imagebox}{\cellheight}}% \mindim{\ht\photobook@imagebox}{\cellheight}}%
\setlength\fboxsep{0pt}% \setlength\fboxsep{0pt}%
\fbox{%
\begin{minipage}[b][\cellheight][\photobook@imagecell@captionalign]{\cellwidth}% \begin{minipage}[b][\cellheight][\photobook@imagecell@captionalign]{\cellwidth}%
%\fbox{clearance: \the\photobook@imagecell@clearance \space offset top: \the\photobook@imagecell@top}\newline\newline%
#2% #2%
\end{minipage}}% \end{minipage}}%
}%\fbox
\endgroup\fi}% \endgroup\fi}%
\endgroup} \endgroup}
@ -2149,7 +2160,8 @@
\newcommand\imagepagefit[3][\clearimage]{% \newcommand\imagepagefit[3][\clearimage]{%
\null% \null%
\begin{pagecell}% \begin{pagecell}%
\cimagetocellfit[#1]{#2}{#3}% %\cimagetocellfit[#1]{#2}{#3}%
\imagecell[center, clearance=#1]{\captioncellunder{#2}}{#3}%
\end{pagecell}% \end{pagecell}%
\clearpage } \clearpage }