diff options
Diffstat (limited to 'macros/latex/contrib/photobook')
-rw-r--r-- | macros/latex/contrib/photobook/Makefile | 22 | ||||
-rw-r--r-- | macros/latex/contrib/photobook/README.md | 7 | ||||
-rw-r--r-- | macros/latex/contrib/photobook/photobook.cls | 92 | ||||
-rw-r--r-- | macros/latex/contrib/photobook/photobook.pdf | bin | 145475 -> 146661 bytes |
4 files changed, 73 insertions, 48 deletions
diff --git a/macros/latex/contrib/photobook/Makefile b/macros/latex/contrib/photobook/Makefile index 59b7ea002c..19edca368e 100644 --- a/macros/latex/contrib/photobook/Makefile +++ b/macros/latex/contrib/photobook/Makefile @@ -85,8 +85,7 @@ endif # markdown dialect... # -# XXX still needs some tweaking... -MD_FORMAT ?= markdown_github +MD_FORMAT ?= gfm # debug output... @@ -173,26 +172,11 @@ LN := cp -l # - |..| - verbatim does not work... # - || - parts of doc omitted... # - verbatim blocks get merged sometimes... +# - does not resolve \jobname in include... # - ... # ...not sure if this can be tweaked... -#%.md: %.tex -# pandoc -t $(MD_FORMAT) -s $< -o $@ - -# XXX EXPERIMENTAL... -# XXX revise: -# ...for this to work we need to replace: -# \documentclass{ltxdoc} -# to: -# \documentclass[markdownextra]{internet} -# XXX install the internet class... -# https://github.com/loopspace/latex-to-internet -# ...needs testing... %.md: %.tex - cat $< \ - | sed 's/documentclass{ltxdoc}/documentclass[markdownextra]{internet}/' \ - > $<.tmp - mv $<{.tmp,} - $(TEX) $< $(STDERR) + pandoc -t $(MD_FORMAT) -s $< -o $@ # meta-section... diff --git a/macros/latex/contrib/photobook/README.md b/macros/latex/contrib/photobook/README.md index 13daa3c373..7055717be0 100644 --- a/macros/latex/contrib/photobook/README.md +++ b/macros/latex/contrib/photobook/README.md @@ -28,7 +28,7 @@ $ make install The `photobook` document class requires a set of modules to be installed for it to function, the full list is included in the docs and can be -printed by calling: +generated and printed by calling: ```shell $ make depends ``` @@ -39,7 +39,8 @@ For more info on `make` targets see the: [./Makefile](./Makefile) # Documentation -Pre-built documentation can be found on +Pre-built documentation can be found in the +[Github releases](https://github.com/flynx/photobook/releases/latest) or on [CTAN](http://mirrors.ctan.org/macros/latex/contrib/photobook/photobook.pdf). @@ -69,7 +70,7 @@ Build requirements for docs: ## Notes -- The main refetence is inline with the source [photobook.cls](./photobook.cls) +- The main reference is maintained inline with the source [photobook.cls](./photobook.cls) thus it is both human-readable next to the code it documents and is used to build the `photobook.pdf`. Extracting the documentation source (`photobook*.tex`) is done diff --git a/macros/latex/contrib/photobook/photobook.cls b/macros/latex/contrib/photobook/photobook.cls index a2a84809e8..ae2ecac6b6 100644 --- a/macros/latex/contrib/photobook/photobook.cls +++ b/macros/latex/contrib/photobook/photobook.cls @@ -38,6 +38,7 @@ % % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % +% % XXX ASAP: imagecell: photobook@imagecell@left and photobook@imagecell@top % should explicitly account for clearence@left and clearence@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@FILEVERSION{v0.1.29} -\edef\photobook@FILEDATE{2023-08-24} +\edef\photobook@FILEVERSION{v0.1.31} +\edef\photobook@FILEDATE{2024-07-19} %% \documentclass{ltxdoc} @@ -248,26 +262,27 @@ %% \begin{minipage}{\textwidth} %% \begin{verbatim} %% +%% <-------------------------------------------------> paperwidth %% <---> bleed <---> bleed -%% -%% + - - - - - - - - - - - - - - - - - - - - - - + - + ^ -%% . . . | bleed -%% . +-----------------------------------------+----- v . . --- -%% . | ^ . . = . -%% . | . . . . . . | . . . = . ^ -%% . |<-- blockwidth ------------------------->= . | -%% . | . | . . . = . | -%% . | | . . = . textheight -%% . | . Page | . . . = . | -%% . | blockheight . . = . | -%% . | . | . . <--> bindingoffset | -%% . | | . . = . | -%% . | . . . . . . | . <--> gutteroffset v -%% . | v . . = . -%% . +-----------------------------------------+----- ^ . . --- -%% . . . . | bleed -%% + - - - - - - - - - - - - - - - - - - - - - - + - + v -%% . . +%% paperheight v +%% + - - - - - - - - - - - - - - - - - - - - - - + - + ^ . . . --- +%% . . . | bleed . +%% . +-----------------------------------------+----- v . . --- +%% . | ^ . . = . . +%% . | . . . . . . | . . . = . ^ +%% . |<-- blockwidth ------------------------->= . | . +%% . | . | . . . = . | +%% . | | . . = . textheight . +%% . | . Page | . . . = . | +%% . | blockheight . . = . | . +%% . | . | . . <--> bindingoffset | +%% . | | . . = . | . +%% . | . . . . . . | . <--> gutteroffset v +%% . | v . . = . . +%% . +-----------------------------------------+----- ^ . . --- +%% . . . . | bleed . +%% + - - - - - - - - - - - - - - - - - - - - - - + - + v . . . --- +%% . . ^ %% | <-- textwidth --------------> . | %% ^ gutter %% @@ -278,6 +293,9 @@ %% account for |\gutteroffset|, namely macros that do not display content %% with bleeds. %% +%% Also note that bleeds are included in \href{https://ctan.org/pkg/geometry}{geometry}'s +%% |\paperwidth| and |\paperheight|. +%% % NOTE: if blockwidth/blockheight are set they will force recalculations % and overriding of the paperwidth/paperheight if they were changed % by the user code anywhere between \documentclass[..]{photobook} @@ -917,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@imageblockoffsettop} @@ -2515,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@imagecell@imgratio{% - 1pt * \ratio{\wd\photobook@imagebox}{\ht\photobook@imagebox}}% + 1pt * \ratio{\CalcOverflowFactor\wd\photobook@imagebox}{\CalcOverflowFactor\ht\photobook@imagebox}}% \setlength\photobook@imagecell@cellratio{% 1pt * \ratio{\cellwidth}{\cellheight}}% \ifdim \photobook@imagecell@imgratio < \photobook@imagecell@cellratio% @@ -2524,7 +2543,7 @@ \includegraphics[% keepaspectratio, width=\photobook@imagecell@scale\dimexpr - + \cellwidth + \cellwidth - \photobook@imagecell@clearance@left - \photobook@imagecell@clearance@right \relax]{#3}}% \else% @@ -2532,7 +2551,7 @@ \includegraphics[% keepaspectratio, height=\photobook@imagecell@scale\dimexpr - + \cellheight + \cellheight - \photobook@imagecell@clearance@top - \photobook@imagecell@clearance@bottom \relax]{#3}}% \fi\fi\fi% @@ -4848,8 +4867,9 @@ % align center -> check if image fits vertically... \ifphotobook@ImagePageFit@centered\else% \sbox{\photobook@imagebox}{\includegraphics{#3}}% + % NOTE: \ratio{..}{..} here can break, see Issues for more info... \setlength\photobook@ImagePageFit@imgratio{% - 1pt * \ratio{\wd\photobook@imagebox}{\ht\photobook@imagebox}}% + 1pt * \ratio{\CalcOverflowFactor\wd\photobook@imagebox}{\CalcOverflowFactor\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... @@ -5692,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... diff --git a/macros/latex/contrib/photobook/photobook.pdf b/macros/latex/contrib/photobook/photobook.pdf Binary files differindex 5e785e73cf..119574f619 100644 --- a/macros/latex/contrib/photobook/photobook.pdf +++ b/macros/latex/contrib/photobook/photobook.pdf |