texlive[71843] Master/texmf-dist: photobook (19jul24)
commits+karl at tug.org
commits+karl at tug.org
Fri Jul 19 22:28:59 CEST 2024
Revision: 71843
https://tug.org/svn/texlive?view=revision&revision=71843
Author: karl
Date: 2024-07-19 22:28:59 +0200 (Fri, 19 Jul 2024)
Log Message:
-----------
photobook (19jul24)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/photobook/photobook.pdf
trunk/Master/texmf-dist/tex/latex/photobook/photobook.cls
Modified: trunk/Master/texmf-dist/doc/latex/photobook/photobook.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/tex/latex/photobook/photobook.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/photobook/photobook.cls 2024-07-19 20:28:44 UTC (rev 71842)
+++ trunk/Master/texmf-dist/tex/latex/photobook/photobook.cls 2024-07-19 20:28:59 UTC (rev 71843)
@@ -38,6 +38,7 @@
%
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
%
+%
% XXX ASAP: imagecell: photobook at imagecell@left and photobook at imagecell@top
% should explicitly account for clearence at left and clearence at top resp.
% XXX ASAP: imagecell: clearance should have the same semantics as cliptocell
@@ -88,12 +89,25 @@
% cell/cell* depend on absolute mode being set globally
%
%
+% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+%
+% Work around an issue with calc's \ratio{..}{..} breaking into an
+% "Arythmetic overflow" when working with large images.
+% (see Issues section for more info)
+%
+% NOTE: if the error persists just make this smaller but note that the
+% smaller this gets the greater the error can be for very small
+% images
+%
+\def\CalcOverflowFactor{0.1}%
+
+
%----------------------------------------------------------------------
%%% NOTE: \def\<module-name>@[A-Z]+ macros will be visible to both the
%%% code and the generated docs...
-\edef\photobook at FILEVERSION{v0.1.30}
-\edef\photobook at FILEDATE{2024-07-18}
+\edef\photobook at FILEVERSION{v0.1.31}
+\edef\photobook at FILEDATE{2024-07-19}
%% \documentclass{ltxdoc}
@@ -921,7 +935,7 @@
%% \DescribeMacro{\imageblockoffsettop=<ratio>}
%
-%% The ration by which the image is raised in |\ImagePage{..}| and
+%% The ratio by which the image is raised in |\ImagePage{..}| and
%% derived templates.
%%
\edef\imageblockoffsettop{\photobook at imageblockoffsettop}
@@ -2519,8 +2533,9 @@
% NOTE: here we calculate image/cell eccentricity to decide
% to fit to width or heigh of cell...
% NOTE: did I say that I "love" how LaTeX does basic math??
+ % NOTE: \ratio{..}{..} here can break, see Issues for more info...
\setlength\photobook at imagecell@imgratio{%
- 1pt * \ratio{\wd\photobook at imagebox}{\ht\photobook at imagebox}}%
+ 1pt * \ratio{\CalcOverflowFactor\wd\photobook at imagebox}{\CalcOverflowFactor\ht\photobook at imagebox}}%
\setlength\photobook at imagecell@cellratio{%
1pt * \ratio{\cellwidth}{\cellheight}}%
\ifdim \photobook at imagecell@imgratio < \photobook at imagecell@cellratio%
@@ -2528,7 +2543,7 @@
\includegraphics[%
keepaspectratio,
width=\photobook at imagecell@scale\dimexpr
- + \cellwidth
+ \cellwidth
- \photobook at imagecell@clearance at left
- \photobook at imagecell@clearance at right \relax]{#3}}%
\else%
@@ -2536,7 +2551,7 @@
\includegraphics[%
keepaspectratio,
height=\photobook at imagecell@scale\dimexpr
- + \cellheight
+ \cellheight
- \photobook at imagecell@clearance at top
- \photobook at imagecell@clearance at bottom \relax]{#3}}%
\fi\fi\fi%
@@ -4852,8 +4867,9 @@
% align center -> check if image fits vertically...
\ifphotobook at ImagePageFit@centered\else%
\sbox{\photobook at imagebox}{\includegraphics{#3}}%
+ % NOTE: \ratio{..}{..} here can break, see Issues for more info...
\setlength\photobook at ImagePageFit@imgratio{%
- 1pt * \ratio{\wd\photobook at imagebox}{\ht\photobook at imagebox}}%
+ 1pt * \ratio{\CalcOverflowFactor\wd\photobook at imagebox}{\CalcOverflowFactor\ht\photobook at 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...
@@ -5696,6 +5712,26 @@
%----------------------------------------------------------------------
+%%%% Issues
+%
+%% \subsection*{Large images can cause "Arythmetic overflow"}
+%
+%% \DescribeMacro{\CalcOverflowFactor=0.1}
+%
+%% If the issue occurs set |\CalcOverflowFactor| to a smaller value.
+%% But note, a value too small can lead to errors in the affected macros,
+%% a good value is between 0.1 and 0.01.
+%%
+%% Also note that it is recommended to pre-size images the print outside
+%% of \LaTeX.
+%%
+%% Affected macros: |\imagecell[fill]{..}{..}|, |\ImagePageFit|.
+%%
+% The issue occurs in the calc's |\ratio{..}{..}| macro when calculating
+% image proportions.
+%
+%
+%----------------------------------------------------------------------
% Index...
%
% XXX this prints trash at this point...
More information about the tex-live-commits
mailing list.