captioncell now mostly working...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2021-08-24 01:54:52 +03:00
parent bc79b6ecb6
commit 37f43f631d

View File

@ -1352,7 +1352,11 @@
\newcommand\imagecell[3][]{% \newcommand\imagecell[3][]{%
\begingroup% \begingroup%
% args... % args...
\setkeys{imagecell@args}{fit,center,clearance=0pt,#1}% \setkeys{imagecell@args}{
fit,
center,
clearance=0pt,
#1}%
% preload image... % preload image...
% fit... % fit...
\ifKV@imagecell@args@fit% \ifKV@imagecell@args@fit%
@ -1448,23 +1452,69 @@
%% \end{minipage} %% \end{minipage}
%% %%
% XXX revise keywords... \renewcommand\photobook@captioncell@formatTopAlign[1]{%
\define@boolkey{captioncell@args}{above}[true]{} \begin{\photobook@captioncell@align}%
\define@boolkey{captioncell@args}{top}[true]{} #1%
\define@boolkey{captioncell@args}{bottom}[true]{} \end{\photobook@captioncell@align}}
\define@boolkey{captioncell@args}{below}[true]{} \renewcommand\photobook@captioncell@formatBottomAlign[1]{%
\begin{minipage}[t][\cellheight][b]{\cellwidth}%
\begin{\photobook@captioncell@align}%
#1%
\end{\photobook@captioncell@align}%
\end{minipage}}
\def\photobook@captioncell@format#1{%
\photobook@captioncell@formatTopAlign{#1}}
\define@boolkey{captioncell@args}{above}[true]{%
\def\photobook@captioncell@format##1{%
\vspace{-\dimexpr \cellheight + 2\fboxsep \relax}%
\photobook@captioncell@formatBottomAlign{##1}}}
\define@boolkey{captioncell@args}{top}[true]{%
\def\photobook@captioncell@format##1{%
\photobook@captioncell@formatTopAlign{##1}}}
\define@boolkey{captioncell@args}{center}[true]{%
\def\photobook@captioncell@format##1{%
\begin{minipage}[t][\cellheight][c]{\cellwidth}%
\begin{\photobook@captioncell@align}%
##1%
\end{\photobook@captioncell@align}%
\end{minipage}}}
\define@boolkey{captioncell@args}{bottom}[true]{%
\def\photobook@captioncell@format##1{%
\photobook@captioncell@formatBottomAlign{##1}}}
\define@boolkey{captioncell@args}{below}[true]{%
\def\photobook@captioncell@format##1{%
\vspace{\dimexpr \cellheight + 2\fboxsep \relax}%
\photobook@captioncell@formatTopAlign{##1}}}
% XXX add fields: before/left/right/after... (vertical???) % XXX add fields: before/left/right/after... (vertical???)
% XXX add vertical fields direction: up/down % XXX add vertical fields direction: up/down
% XXX expand choices... % XXX expand values...
\define@choicekey{captioncell@args}{align}{flushleft,center,flushright}{} \def\photobook@captioncell@align{}
\define@choicekey{captioncell@args}{align}{flushleft,center,flushright}{%
\def\photobook@captioncell@align{#1}}
\def\photobook@captioncell@margin{0pt}
\define@key{captioncell@args}{margin}{
\def\photobook@captioncell@margin{#1}}
\newcommand\captioncell[2][]{% \newcommand\captioncell[2][]{%
\setkeys{captioncell@args}{top, align=flushleft,#1}% \setkeys{captioncell@args}{
% XXX top,
} align=flushright,
margin=1pt,
#1}%
%
\photobook@captioncell@format{%
\adjustbox{margin=\photobook@captioncell@margin}{#2}}}
% XXX HACK -- make over/under/... an argument... % XXX HACK -- make over/under/... an argument...
\newcommand\captioncellunder[1]{ \newcommand\captioncellunder[1]{