From aee3ffe30de9960c13662e59eaa7f8eec3ba0d3f Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Wed, 8 Sep 2021 18:52:23 +0300 Subject: [PATCH] lots of tweaks... Signed-off-by: Alex A. Naanou --- photobook.cls | 67 +++++++++++++++++++++++++++++------------- scripts/make-images.sh | 3 +- 2 files changed, 48 insertions(+), 22 deletions(-) diff --git a/photobook.cls b/photobook.cls index 64052eb..677a00c 100644 --- a/photobook.cls +++ b/photobook.cls @@ -1327,10 +1327,6 @@ \end{minipagecell*}} -% XXX add a direct \adjboxcell{..} -- directly passing args to \adjustbox{..}... -% XXX - - % XXX EXPERIMENTAL %% \DescribeEnv{zinlinecell} %% \DescribeEnv{zinlinecell*} @@ -1398,6 +1394,31 @@ \ignorespaces} +% XXX EXPERIMENTAL +%% \DescribeEnv{adjustcell} +%% \DescribeEnv{adjustcell*} +% +%% \EXPERIMENTAL +%% +\newenvironment{adjustcell*}[4][t]{% + \begin{adjustbox}{#2}% + \vspace{0pt}% + \begin{minipagecell*}[#1]{#3}{#4}% +}{% + \end{minipagecell*}% + \end{adjustbox}} + +\newenvironment{adjustcell}[4][t]{% + \begin{adjustbox}{#2}% + \vspace{0pt}% + \begin{minipagecell}[#1]{#3}{#4}% +}{% + \end{minipagecell}% + \end{adjustbox}} + + + + % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %%%%% Save cells @@ -3143,19 +3164,23 @@ \ignoreemptyitems% \readlist*\photobook@ImagePageFit@args{moo, #1}% \foreachitem\photobook@ImagePageFit@opt\in\photobook@ImagePageFit@args{% + \ifthenelse{\equal{\photobook@ImagePageFit@opt}{inner}}{% + \photobook@ImagePageFit@centeredtrue}{}% + \ifthenelse{\equal{\photobook@ImagePageFit@opt}{outer}}{% + \photobook@ImagePageFit@centeredtrue}{}% \ifthenelse{\equal{\photobook@ImagePageFit@opt}{top}}{% - \photobook@ImagePageFit@centeredtrue}{} + \photobook@ImagePageFit@centeredtrue}{}% \ifthenelse{\equal{\photobook@ImagePageFit@opt}{left}}{% - \photobook@ImagePageFit@centeredtrue}{} + \photobook@ImagePageFit@centeredtrue}{}% \ifthenelse{\equal{\photobook@ImagePageFit@opt}{bottom}}{% - \photobook@ImagePageFit@centeredtrue}{} + \photobook@ImagePageFit@centeredtrue}{}% \ifthenelse{\equal{\photobook@ImagePageFit@opt}{right}}{% - \photobook@ImagePageFit@centeredtrue}{}} + \photobook@ImagePageFit@centeredtrue}{}}% % align center -> check if image fits vertically... \ifphotobook@ImagePageFit@centered\else% \sbox{\photobook@imagebox}{\includegraphics{#3}}% - \setlength\photobook@ImagePageFit@imgratio{1pt - * \ratio{\wd\photobook@imagebox}{\ht\photobook@imagebox}}% + \setlength\photobook@ImagePageFit@imgratio{% + 1pt * \ratio{\wd\photobook@imagebox}{\ht\photobook@imagebox}}% % NOTE: subtracting \bindingoffset from \cellwidth here makes sure that % we avoid offsetting images close enough in ratio to the page and % messing up bleeds... @@ -3769,20 +3794,20 @@ %% \DescribeMacro{\pdfmargincomment\{..\}} % -%% Add pdf comment as overlay. +%% Add pdf comment as margin overlay. %% %% >> \pdfmargincomment{} %% -\newcommand{\pdfmargincomment}[1]{% - \begin{cell*}{ - \ifnumodd{\thepage}{% - \cellwidth - \marginparwidth - 2\bleed - 1cm - }{% - \bleed + 1cm}, - \bleed + 1cm - }{\marginparwidth}{1pt}% - \pdfcomment{#1}% - \end{cell*}} +\newcommand\pdfcommentcell[1]{% + \begin{cell*}{ + \ifnumodd{\thepage}{% + \cellwidth - \marginparwidth - 2\bleed - 1cm + }{% + \bleed + 1cm}, + \bleed + 1cm + }{\marginparwidth}{1pt}% + \pdfcomment{#1}% + \end{cell*}} %% \DescribeMacro{\pdfpagecount\{..\}} diff --git a/scripts/make-images.sh b/scripts/make-images.sh index 86fa551..9a352c6 100644 --- a/scripts/make-images.sh +++ b/scripts/make-images.sh @@ -242,7 +242,8 @@ anotatePath(){ # NOTE: did not figure out how to make a verbatim comment in latex # so here we are, doing it in shell... path=${path//_/\\_} - echo "\\pdfmargincomment{Image: $path}%" + #echo "\\pdfmargincomment{Image: $path}%" + echo "\\pdfcommentcell{Image: $path}%" }