From 63dc93333bbb4b9a2d8585acce4746cd81b31471 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Fri, 27 Aug 2021 02:49:28 +0300 Subject: [PATCH] bugfix + notes... Signed-off-by: Alex A. Naanou --- photobook.cls | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/photobook.cls b/photobook.cls index 0132ee8..82d7c85 100644 --- a/photobook.cls +++ b/photobook.cls @@ -1316,15 +1316,9 @@ %% containing cell and provides all the cell functionality. %% -\newlength\photobook@imagecell@imgratio -\newlength\photobook@imagecell@cellratio - -% XXX TODO: -% - offset fix for fill mode... -% - caption cell in fill mode... -% - do we need to reverse left/right for fill? (feels counter-intuitive) - -% XXX should these be lengths or macros??? +% NOTE: these are macros and not lengths as we need to "resolve" these +% as late as possible, i.e. after all the arguments have been +% processed. \def\photobook@imagecell@top{0pt} \def\photobook@imagecell@left{0pt} \def\photobook@imagecell@captiontop{0pt} @@ -1333,6 +1327,10 @@ \newlength\photobook@imagecell@clearance \setlength\photobook@imagecell@clearance{0pt} +% NOTE: these feel like a hack... +\newlength\photobook@imagecell@imgratio +\newlength\photobook@imagecell@cellratio + % fit/fill... \define@boolkey{imagecell@args}{fit}[true]{% \KV@imagecell@args@fillfalse} @@ -1408,6 +1406,10 @@ \define@choicekey{imagecell@args}{caption-align}{t,c,b}[t]{% \def\photobook@imagecell@captionalign{#1}}% +% XXX add offset support... +% ...i.e. an argument that will shift the image v/h from base position. +% also need to shift the caption box accordingly but still keep it +% within the cell... % XXX can we make this an env??? \newcommand\imagecell[3][]{% \begingroup% @@ -1460,7 +1462,7 @@ % XXX for some odd reason without this the alignment completely breaks... \vspace{0pt}% \adjustbox{% - margin={\photobook@imagecell@left} 0pt 0pt {\photobook@imagecell@top}}{% + margin={\photobook@imagecell@left} 0pt 0pt {\photobook@imagecell@top}}{% % image.... \usebox\photobook@imagebox% % caption cell...