| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %---------------------------------------------------------------------- | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | % This does the following: | 
					
						
							|  |  |  | %	- sets up the document/pdf for viewing as a book | 
					
						
							|  |  |  | %	- adds support for page bleeds | 
					
						
							|  |  |  | %	- adds basic templates for image pages (XXX) | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | % | 
					
						
							| 
									
										
										
										
											2021-09-09 00:43:30 +03:00
										 |  |  | % | 
					
						
							|  |  |  | % This file contains both the code and the reference, but in a slightly  | 
					
						
							|  |  |  | % more readable format than the traditional LaTeX .dtx format. In general | 
					
						
							|  |  |  | % there are two main sections: | 
					
						
							|  |  |  | %	- code
 | 
					
						
							|  |  |  | %	- reference | 
					
						
							|  |  |  | %		lines starting with "%%" or "%X" where X is a section id | 
					
						
							|  |  |  | % Sections are parts of the reference that are logically ordered differently  | 
					
						
							|  |  |  | % than the code, e.g. main user tools should have priority in the reference  | 
					
						
							|  |  |  | % while meta code (identified by "%M") can be described later, while in code
 | 
					
						
							|  |  |  | % we strictly need to define macros before they are used thus meta-macros | 
					
						
							|  |  |  | % and other building blocks and components come before the user tools. | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | % Docs are build by the Makefile, so reference it for more info. | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %	$ make doc | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | % | 
					
						
							| 
									
										
										
										
											2021-09-14 02:21:24 +03:00
										 |  |  | % XXX revise \clearcaption / \captionclearpage... | 
					
						
							| 
									
										
										
										
											2021-09-13 02:30:17 +03:00
										 |  |  | % XXX add marks -- \ShowMarks{..} | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | % XXX add fold support... | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | % XXX unify API -- see CellContent env... | 
					
						
							| 
									
										
										
										
											2021-09-06 19:59:50 +03:00
										 |  |  | % XXX make this loadable both as a class and as a package... | 
					
						
							|  |  |  | %		\@ifclassloaded{photobook}{<true>}{<false>} | 
					
						
							| 
									
										
										
										
											2021-08-31 03:25:11 +03:00
										 |  |  | % XXX revise command naming -- should be obvious from name what is what: | 
					
						
							|  |  |  | %		- meta commands -- ??? (currently same as templates) | 
					
						
							|  |  |  | %		- general macros -- \usecell{..} | 
					
						
							|  |  |  | %		- templates --  \ImagePage{..} | 
					
						
							| 
									
										
										
										
											2021-08-27 19:04:05 +03:00
										 |  |  | % XXX see where we need to \ignorespaces... | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | % XXX might be a good idea to add a spine calculator... | 
					
						
							| 
									
										
										
										
											2021-09-15 21:08:42 +03:00
										 |  |  | % XXX add list of dependencies to docs... | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | % XXX manual: | 
					
						
							|  |  |  | %		- basic usage | 
					
						
							|  |  |  | %			- setup | 
					
						
							|  |  |  | %			- using templates | 
					
						
							|  |  |  | %			- pre-print | 
					
						
							|  |  |  | %		- customizing | 
					
						
							|  |  |  | %		- extending | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %---------------------------------------------------------------------- | 
					
						
							| 
									
										
										
										
											2021-08-10 06:14:42 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-10 14:14:43 +03:00
										 |  |  | %%% NOTE: \def\<module-name>@[A-Z]+ macros will be visible to both the  | 
					
						
							|  |  |  | %%%		code and the generated docs... | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | \edef\photobook@FILEVERSION{v0.1} | 
					
						
							|  |  |  | \edef\photobook@FILEDATE{2021-07-28} | 
					
						
							| 
									
										
										
										
											2021-08-10 06:14:42 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %% \documentclass{ltxdoc} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-24 12:52:59 +03:00
										 |  |  | %%% XXX Q: do we add the pdf to the repo and if so, should it be  | 
					
						
							|  |  |  | %%%	compressed (diff-able) or uncompressed (blob)?? | 
					
						
							|  |  |  | %%% \usepackage{iftex} | 
					
						
							|  |  |  | %%% \ifluatex | 
					
						
							|  |  |  | %%% 	\edef\pdfcompresslevel{\pdfvariable compresslevel}  | 
					
						
							|  |  |  | %%% 	\edef\pdfobjcompresslevel{\pdfvariable objcompresslevel} | 
					
						
							|  |  |  | %%% \fi | 
					
						
							|  |  |  | %%% \pdfcompresslevel 0 | 
					
						
							|  |  |  | %%% \pdfobjcompresslevel 0 | 
					
						
							|  |  |  | %%  | 
					
						
							| 
									
										
										
										
											2021-08-10 14:14:43 +03:00
										 |  |  | %% \usepackage[a4paper,margin=25mm,left=55mm,nohead]{geometry} | 
					
						
							| 
									
										
										
										
											2021-09-03 16:32:03 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% % NOTE: this needs to load before hyperref or bookmarks will break... | 
					
						
							|  |  |  | %% % NOTE: loading hyperref here will break it loading later in one of 
 | 
					
						
							|  |  |  | %% %		the packages... | 
					
						
							|  |  |  | %% \usepackage{titlesec} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %% \usepackage[numbered]{hypdoc} | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | %% \usepackage{doctools} | 
					
						
							| 
									
										
										
										
											2021-09-03 16:32:03 +03:00
										 |  |  | %% \usepackage{needspace} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-03 05:18:18 +03:00
										 |  |  | %% \usepackage[toc]{multitoc} | 
					
						
							|  |  |  | %% \renewcommand*{\multicolumntoc}{2} | 
					
						
							|  |  |  | %% \setlength{\columnseprule}{0.5pt} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% \usepackage{imakeidx} | 
					
						
							|  |  |  | %% \makeindex[ | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | %%		columns=1,  | 
					
						
							| 
									
										
										
										
											2021-09-03 05:18:18 +03:00
										 |  |  | %%		title=Alphabetical Index,  | 
					
						
							|  |  |  | %%		intoc, | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | %%		options= -s photobook.ist ] | 
					
						
							| 
									
										
										
										
											2021-09-03 04:03:28 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-10 14:14:43 +03:00
										 |  |  | %%% \newcommand\DescribeGlobal[1]{%
 | 
					
						
							|  |  |  | %%%	\DescribeMacro{#1}} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-16 04:13:44 +03:00
										 |  |  | %% \newcommand\LEGACY[1][]{\fbox{LEGACY #1}} | 
					
						
							|  |  |  | %% \newcommand\EXPERIMENTAL[1][]{\fbox{EXPERIMENTAL #1}} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-03 16:32:03 +03:00
										 |  |  | %%% sections to new pages... | 
					
						
							|  |  |  | %% \newcommand\sectionbreak{\Needspace{5\baselineskip}} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% % remove section numbering... | 
					
						
							|  |  |  | %% \setcounter{secnumdepth}{0} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% % paragraph configuration... | 
					
						
							| 
									
										
										
										
											2021-08-28 01:13:45 +03:00
										 |  |  | %% \setlength\parindent{0pt} | 
					
						
							|  |  |  | %% \setlength\parskip{0.5em} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-02 23:51:05 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %% \begin{document} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-10 06:14:42 +03:00
										 |  |  | %% \title{\textsf{photobook} --- Document class for building photo-books
 | 
					
						
							|  |  |  | %%		\thanks{This file describes version \FILEVERSION, 
 | 
					
						
							|  |  |  | %%			last revised \FILEDATE.}} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% \author{Alex A. Naanou\thanks{E-mail: alex.nanou@gmail.com}} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-10 06:14:42 +03:00
										 |  |  | %% \date{Released \FILEDATE} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-09 00:43:30 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %% \maketitle | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-03 05:18:18 +03:00
										 |  |  | %% \begin{abstract} | 
					
						
							|  |  |  | %%	The |photobook| \LaTeX\space document class extends the |book| class 
 | 
					
						
							|  |  |  | %%	defining a set of parameters, meta-macros, macros and environments  | 
					
						
							|  |  |  | %%	with reasonable defaults to help typeset, build and print books mainly  | 
					
						
							|  |  |  | %%	based on visual/image content. | 
					
						
							|  |  |  | %% \end{abstract} | 
					
						
							| 
									
										
										
										
											2021-09-03 04:03:28 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% \tableofcontents | 
					
						
							| 
									
										
										
										
											2021-08-08 14:07:52 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-03 05:18:18 +03:00
										 |  |  | %%%% Introduction | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% XXX parameters, page spreads, templates, cell concept, ... | 
					
						
							|  |  |  | % | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %%%% Usage | 
					
						
							| 
									
										
										
										
											2021-08-12 17:00:23 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %%	>> \documentclass[<options>]{photobook} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %---------------------------------------------------------------------- | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | \NeedsTeXFormat{LaTeX2e} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-10 06:14:42 +03:00
										 |  |  | \ProvidesClass{photobook} | 
					
						
							|  |  |  | 	[\photobook@FILEDATE \space \photobook@FILEVERSION Photo book document class] | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 
					
						
							|  |  |  | %%%% Options | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-15 21:08:42 +03:00
										 |  |  | \edef\photobook@options{\@classoptionslist} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | \RequirePackage{kvoptions} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 
					
						
							|  |  |  | % Helpers... | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | \newcommand\@DeclareLiteralOptionTo[2]{%
 | 
					
						
							|  |  |  | 	\DeclareVoidOption{#2}{%
 | 
					
						
							|  |  |  | 		\expandafter\edef\csname photobook@#1\endcsname{#2}}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | %%%%% Page geometry | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% \DescribeMacro{blockwidth=<len>} | 
					
						
							|  |  |  | %% \DescribeMacro{blockheight=<len>} | 
					
						
							|  |  |  | %% \DescribeMacro{bindingoffset=<len>} | 
					
						
							|  |  |  | %% \DescribeMacro{bleed=<len>} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% This is similar to what |geometry| does, but adds bleed support. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%   <---> bleed                                 <---> bleed | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%   + - - - - - - - - - - - - - - - - - - - - - + - +   ^ | 
					
						
							|  |  |  | %%   .                                           .   .   | bleed | 
					
						
							| 
									
										
										
										
											2021-08-28 01:43:57 +03:00
										 |  |  | %%   .   +--------------------------------------+-----  v   .   .  --- | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | %%   .   |                           ^       .   =   . | 
					
						
							|  |  |  | %%   .   |   .   .   .   .   .   .   |   .   .   =   .               ^ | 
					
						
							|  |  |  | %%   .   |<-- blockwidth ----------------------->=   .               | | 
					
						
							|  |  |  | %%   .   |   .                       |   .   .   =   .               | | 
					
						
							|  |  |  | %%   .   |                           |       .   =   .       textheight | 
					
						
							| 
									
										
										
										
											2021-08-28 01:43:57 +03:00
										 |  |  | %%   .   |   .             Page      |   .   .   =   .               | | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | %%   .   |                      blockheight  .   =   .               | | 
					
						
							|  |  |  | %%   .   |   .                       |   .   .   =   .               | | 
					
						
							|  |  |  | %%   .   |                           |       <---> bindingoffset     | | 
					
						
							|  |  |  | %%   .   |   .   .   .   .   .   .   |   .   .   =   .               v | 
					
						
							|  |  |  | %%   .   |                           v       .   =   . | 
					
						
							|  |  |  | %%   .   +---------------------------------------+-----  ^   .   .  --- | 
					
						
							|  |  |  | %%   .   .                                       .   .   | bleed | 
					
						
							|  |  |  | %%   + - - - - - - - - - - - - - - - - - - - - - + - +   v | 
					
						
							|  |  |  | %%       .                                       . | 
					
						
							|  |  |  | %%       |   <-- textwidth -------------->   .   | | 
					
						
							|  |  |  | %%                                               ^ binding line
 | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | % 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} | 
					
						
							|  |  |  | %		and \begin{document}... | 
					
						
							|  |  |  | \DeclareStringOption{blockwidth} | 
					
						
							|  |  |  | \DeclareStringOption{blockheight} | 
					
						
							| 
									
										
										
										
											2021-08-20 16:57:00 +03:00
										 |  |  | \DeclareStringOption[0pt]{bindingoffset}[10mm] | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | \DeclareStringOption[5mm]{bleed}[5mm] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %%%%% layout | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% \DescribeMacro{layoutmode=<layout>} | 
					
						
							|  |  |  | %% \DescribeMacro{block} | 
					
						
							|  |  |  | %% \DescribeMacro{endpaper} | 
					
						
							|  |  |  | %% \DescribeMacro{cover} | 
					
						
							|  |  |  | %% \DescribeMacro{jacket} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%	>> layoutmode=<option> | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% |block| (default) | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | %%	Basic page layout. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %% \begin{verbatim} | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %%       blockwidth | 
					
						
							|  |  |  | %%   <---------------> | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%   +---------------+ | 
					
						
							|  |  |  | %%   |               | | 
					
						
							|  |  |  | %%   |               | | 
					
						
							| 
									
										
										
										
											2021-08-28 01:43:57 +03:00
										 |  |  | %%   |     page      | | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %%   |               | | 
					
						
							|  |  |  | %%   |               | | 
					
						
							|  |  |  | %%   +---------------+ | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %% \end{verbatim} | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | %% \end{minipage} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% |endpaper|: | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | %%	Endpaper layout. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %% \begin{verbatim} | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %%       blockwidth 2x | 
					
						
							|  |  |  | %%   <-------------------------------> | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%   +---------------+---------------+ | 
					
						
							|  |  |  | %%   |               .               | | 
					
						
							|  |  |  | %%   |               .               | | 
					
						
							| 
									
										
										
										
											2021-08-28 01:43:57 +03:00
										 |  |  | %%   |           endpaper            | | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %%   |               .               | | 
					
						
							|  |  |  | %%   |               .               | | 
					
						
							|  |  |  | %%   +---------------+---------------+ | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %% \end{verbatim} | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | %% \end{minipage} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %%	 | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | %% |cover| | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%	Book cover layout | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | %% \DescribeMacro{coverboardgrow=<len>} | 
					
						
							|  |  |  | %% \DescribeMacro{coverflap=<len>} | 
					
						
							|  |  |  | %% \DescribeMacro{spinewidth=<len>} | 
					
						
							|  |  |  | %% \DescribeMacro{spinewidth=<len>} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %% \begin{verbatim} | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %%          blockwidth            blockwidth | 
					
						
							|  |  |  | %%       <--------------->     <---------------> | 
					
						
							|  |  |  | %%     <-> coverboardgrow                      <-> coverboardgrow | 
					
						
							|  |  |  | %%   <-> coverflap                             . <-> coverflap | 
					
						
							|  |  |  | %%   . . .                                     . . . | 
					
						
							|  |  |  | %%   +-------------------++---++-------------------+    --- | 
					
						
							|  |  |  | %%   | + - - - - - - - - ++ - ++ - - - - - - - - + |    --^ coverflap                 | 
					
						
							|  |  |  | %%   | . + - - - - - - - ++ - ++ - - - - - - - + . |    --^ coverboardgrow   | 
					
						
							|  |  |  | %%   | . .               ..   ..               . . |     ^                   | 
					
						
							|  |  |  | %%   | . .               ..   ..               . . |     | blockheight       | 
					
						
							|  |  |  | %%   | . .     Back      ..   ..     Front     . . |     |                   | 
					
						
							|  |  |  | %%   | . .               ..   ..               . . |     |                   | 
					
						
							|  |  |  | %%   | . .               ..   ..               . . |     v                   | 
					
						
							|  |  |  | %%   | . + - - - - - - - ++ - ++ - - - - - - - + . |    --v coverboardgrow   | 
					
						
							|  |  |  | %%   | + - - - - - - - - ++ - ++ - - - - - - - - + |    --v coverflap                  | 
					
						
							|  |  |  | %%   +-------------------++---++-------------------+    --- | 
					
						
							|  |  |  | %%                        .   . | 
					
						
							|  |  |  | %%                       ^.   .^ spinefold | 
					
						
							|  |  |  | %%                        .   . | 
					
						
							|  |  |  | %%                        <---> spinewidth | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %% \end{verbatim} | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | %% \end{minipage} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | %% |jacket| | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | %%	Dust jacket layout | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | %% \DescribeMacro{jacketwrap=<len>} | 
					
						
							|  |  |  | %% \DescribeMacro{jacketflap=<len>} | 
					
						
							|  |  |  | %% \DescribeMacro{jacketflapfront=<len>} | 
					
						
							|  |  |  | %% \DescribeMacro{jacketflapback=<len>} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %% \begin{verbatim} | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %%   <---> jaketflap/jacketflapback                  <---> jaketflap/jacketflapfront | 
					
						
							|  |  |  | %%   .   .                                           .   . | 
					
						
							|  |  |  | %%   .   .     blockwidth            blockwidth      .   . | 
					
						
							|  |  |  | %%   .   .  <--------------->     <--------------->  .   . | 
					
						
							|  |  |  | %%   .   .<-> coverboardgrow                      <-> coverboardgrow | 
					
						
							|  |  |  | %%   .   .  .                                     .  .   . | 
					
						
							|  |  |  | %%   +---++-----------------++---++-----------------++---+    --- | 
					
						
							|  |  |  | %%   |   .. + - - - - - - - ++ - ++ - - - - - - - + ..   |    --^ coverboardgrow | 
					
						
							|  |  |  | %%   |   .. .               ..   ..               . ..   |     ^ | 
					
						
							|  |  |  | %%   |   .. .               ..   ..               . ..   |     | blockheight | 
					
						
							|  |  |  | %%   |   .. .     Back      ..   ..     Front     . ..   |     | | 
					
						
							|  |  |  | %%   |   .. .               ..   ..               . ..   |     | | 
					
						
							|  |  |  | %%   |   .. .               ..   ..               . ..   |     v | 
					
						
							|  |  |  | %%   |   .. + - - - - - - - ++ - ++ - - - - - - - + ..   |    --v coverboardgrow | 
					
						
							|  |  |  | %%   +---++-----------------++---++-----------------++---+    ---  | 
					
						
							|  |  |  | %%       ..                  .   .                  .. | 
					
						
							|  |  |  | %%       ^ jacketwrap        .   .                  ^ jacketwrap | 
					
						
							|  |  |  | %%                          ^.   .^ spinefold | 
					
						
							|  |  |  | %%                           .   . | 
					
						
							|  |  |  | %%                           <---> spinewidth | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %% \end{verbatim} | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | %% \end{minipage} | 
					
						
							| 
									
										
										
										
											2021-08-10 14:14:43 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | % | 
					
						
							|  |  |  | % XXX in cover layout setup pdf boxes in a way to use \bleed as foldover... | 
					
						
							|  |  |  | % 		...see hyperref docs to set pdf view/print area (???) | 
					
						
							|  |  |  | %		.....should also set \bleed default to something like 17mm | 
					
						
							| 
									
										
										
										
											2021-08-10 06:14:42 +03:00
										 |  |  | % XXX do we need to implement cover fold over??? | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | % XXX fold/cut marks??? | 
					
						
							|  |  |  | \DeclareStringOption[block]{layoutmode}[block] | 
					
						
							|  |  |  | \@DeclareLiteralOptionTo{layoutmode}{block} | 
					
						
							|  |  |  | %\@DeclareLiteralOptionTo{layoutmode}{web} | 
					
						
							|  |  |  | \@DeclareLiteralOptionTo{layoutmode}{endpaper} | 
					
						
							|  |  |  | % XXX add overhang... | 
					
						
							|  |  |  | % XXX minght be a good idea to add cover types as separate values and 
 | 
					
						
							|  |  |  | %		preset defeaults per type, e.g: | 
					
						
							|  |  |  | %			layoutmode=		hardcover	softcover | 
					
						
							|  |  |  | %		should also set:  | 
					
						
							|  |  |  | %			spinefold=		5mm			5mm | 
					
						
							|  |  |  | %			coverflap=		17mm		0mm | 
					
						
							|  |  |  | %			bleed=			0mm			5mm | 
					
						
							|  |  |  | \@DeclareLiteralOptionTo{layoutmode}{cover} | 
					
						
							|  |  |  | %\@DeclareLiteralOptionTo{layoutmode}{hardcover} | 
					
						
							|  |  |  | %\@DeclareLiteralOptionTo{layoutmode}{softcover} | 
					
						
							|  |  |  | \@DeclareLiteralOptionTo{layoutmode}{jacket} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | % NOTE: this is only used when layoutmode=cover | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | % NOTE: these are documented inline with layoutmode=.. docs... | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | \DeclareStringOption[0pt]{spinewidth}[0pt] | 
					
						
							|  |  |  | \DeclareStringOption[0pt]{spinefold}[7mm] | 
					
						
							|  |  |  | \DeclareStringOption[0pt]{coverboardgrow}[3mm] | 
					
						
							|  |  |  | % XXX defaults should depend on cover type... | 
					
						
							|  |  |  | \DeclareStringOption[0pt]{coverflap}[17mm] | 
					
						
							|  |  |  | \DeclareStringOption[0pt]{jacketwrap}[2mm] | 
					
						
							|  |  |  | \DeclareStringOption[0pt]{jacketflap}[50mm] | 
					
						
							|  |  |  | \DeclareStringOption[0pt]{jacketflapfront}[50mm] | 
					
						
							|  |  |  | \DeclareStringOption[0pt]{jacketflapback}[50mm] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | %%%%% Image clearance | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% \DescribeMacro{clearimage=<len>} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% Distance from image to paper border (clearance) for full-page images. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% this can be: | 
					
						
							|  |  |  | %% - negative value set image bleed,  | 
					
						
							|  |  |  | %% - positive value set distance from paper edge to image. | 
					
						
							| 
									
										
										
										
											2021-08-10 14:14:43 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-06 19:59:50 +03:00
										 |  |  | \DeclareStringOption{clearimage}[10mm] | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | %%%%% Image block layout | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% \DescribeMacro{imageblockwidth=<len>} | 
					
						
							|  |  |  | %% \DescribeMacro{imageblockheight=<len>} | 
					
						
							|  |  |  | %% \DescribeMacro{imageblockoffsettop=<len>} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% Image block size relative to text block. | 
					
						
							| 
									
										
										
										
											2021-08-10 14:14:43 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | \DeclareStringOption[0.85]{imageblockwidth}[1] | 
					
						
							|  |  |  | \DeclareStringOption[0.85]{imageblockheight}[1] | 
					
						
							|  |  |  | \DeclareStringOption[-0.05]{imageblockoffsettop}[0] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | %%%%% PDF Viewer layout | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% \DescribeMacro{pdfpagelayout=<mode>} | 
					
						
							|  |  |  | %% \DescribeMacro{SinglePage} | 
					
						
							|  |  |  | %% \DescribeMacro{OneColumn} | 
					
						
							|  |  |  | %% \DescribeMacro{TwoColumnLeft} | 
					
						
							|  |  |  | %% \DescribeMacro{TwoColumnRight} | 
					
						
							|  |  |  | %% \DescribeMacro{TwoPageLeft} | 
					
						
							|  |  |  | %% \DescribeMacro{TwoPageRight} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | % defaults: | 
					
						
							|  |  |  | %	- TwoColumnLeft (for layoutmode=block) | 
					
						
							|  |  |  | %	- SinglePage | 
					
						
							|  |  |  | % | 
					
						
							| 
									
										
										
										
											2021-08-10 14:14:43 +03:00
										 |  |  | % XXX make this a proper link... | 
					
						
							|  |  |  | %% See: hyperref's pdfpagelayout for more options. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | \DeclareStringOption{pdfpagelayout} | 
					
						
							|  |  |  | \@DeclareLiteralOptionTo{pdfpagelayout}{SinglePage} | 
					
						
							|  |  |  | \@DeclareLiteralOptionTo{pdfpagelayout}{OneColumn} | 
					
						
							|  |  |  | \@DeclareLiteralOptionTo{pdfpagelayout}{TwoColumnRight} | 
					
						
							|  |  |  | \@DeclareLiteralOptionTo{pdfpagelayout}{TwoColumnLeft} | 
					
						
							|  |  |  | \@DeclareLiteralOptionTo{pdfpagelayout}{TwoPageRight} | 
					
						
							|  |  |  | \@DeclareLiteralOptionTo{pdfpagelayout}{TwoPageLeft} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | %%%%% Other options | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% \DescribeMacro{geometrynodefaults} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% let the user set geometry defaults. | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %%	If this is not set |photobook| will override some user settings when
 | 
					
						
							|  |  |  | %%	initializing geometry. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%	If set |photobook| will only set override: | 
					
						
							|  |  |  | %%	\begin{verbatim} | 
					
						
							|  |  |  | %%		paperwidth=\bleedblockwidth | 
					
						
							|  |  |  | %%		paperheight=\bleedblockheight | 
					
						
							|  |  |  | %%		bindingoffset=\bindingoffset | 
					
						
							|  |  |  | %%	\end{verbatim} | 
					
						
							| 
									
										
										
										
											2021-08-10 14:14:43 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | \DeclareBoolOption{geometrynodefaults} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-12 16:48:00 +03:00
										 |  |  | %% \DescribeMacro{roundprintedlengthsto=<num>} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% Number of digits to round printed lengths to (default: 1). | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% This is a shorthand to |numprint|'s |\nprounddigits{..}|, us it to 
 | 
					
						
							|  |  |  | %% change values mid-document if needed. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% This is mostly used for |\GenerateTemplate|. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | \DeclareStringOption[1]{roundprintedlengthsto}[1] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | \DeclareDefaultOption{\PassOptionsToClass{\CurrentOption}{book}} | 
					
						
							|  |  |  | \ProcessKeyvalOptions* | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 
					
						
							|  |  |  | % Parent class... | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | \LoadClass[9pt, final, openany]{book} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-02 23:51:05 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %---------------------------------------------------------------------- | 
					
						
							|  |  |  | % Packages... | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | % NOTE: imports are after \LoadClass{ .. } to avoid figting over macro | 
					
						
							|  |  |  | %		names... | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | \RequirePackage{calc} | 
					
						
							|  |  |  | \RequirePackage{xargs} | 
					
						
							|  |  |  | \RequirePackage{ifthen} | 
					
						
							|  |  |  | \RequirePackage{iftex} | 
					
						
							| 
									
										
										
										
											2021-08-15 13:38:32 +03:00
										 |  |  | \RequirePackage{pgffor} | 
					
						
							| 
									
										
										
										
											2021-09-26 01:04:41 +03:00
										 |  |  | \RequirePackage{xint} | 
					
						
							| 
									
										
										
										
											2021-09-16 04:13:44 +03:00
										 |  |  | \RequirePackage{xinttools} | 
					
						
							| 
									
										
										
										
											2021-08-27 19:04:05 +03:00
										 |  |  | \RequirePackage{listofitems} | 
					
						
							| 
									
										
										
										
											2021-08-19 23:53:01 +03:00
										 |  |  | \RequirePackage{xkeyval}  | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | \RequirePackage{etoolbox} | 
					
						
							|  |  |  | \RequirePackage{atbegshi} | 
					
						
							|  |  |  | %\RequirePackage{afterpage} | 
					
						
							|  |  |  | %\RequirePackage{changepage} | 
					
						
							|  |  |  | \RequirePackage[unicode]{hyperref} | 
					
						
							|  |  |  | %\RequirePackage{pdfcomment} | 
					
						
							|  |  |  | \RequirePackage{eso-pic} | 
					
						
							|  |  |  | \RequirePackage{environ} | 
					
						
							| 
									
										
										
										
											2021-08-12 16:48:00 +03:00
										 |  |  | \RequirePackage{numprint} | 
					
						
							| 
									
										
										
										
											2021-08-14 03:02:59 +03:00
										 |  |  | \RequirePackage{trimclip} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | \RequirePackage{xcolor} | 
					
						
							|  |  |  | \RequirePackage{colorspace} | 
					
						
							|  |  |  | \RequirePackage{graphicx} | 
					
						
							| 
									
										
										
										
											2021-08-16 06:34:22 +03:00
										 |  |  | \RequirePackage{adjustbox} | 
					
						
							| 
									
										
										
										
											2021-08-26 20:03:17 +03:00
										 |  |  | \RequirePackage[absolute]{textpos} | 
					
						
							| 
									
										
										
										
											2021-09-15 21:08:42 +03:00
										 |  |  | \RequirePackage{fancyvrb} | 
					
						
							|  |  |  | %\RequirePackage[linewidth=1pt]{mdframed} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | % XXX flow text frames... | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | % XXX this messes with geometry.... | 
					
						
							|  |  |  | %\RequirePackage{flowfram} | 
					
						
							| 
									
										
										
										
											2021-09-15 21:08:42 +03:00
										 |  |  | \RequirePackage{rotating} | 
					
						
							| 
									
										
										
										
											2021-09-12 03:29:50 +03:00
										 |  |  | \RequirePackage{fancyhdr} | 
					
						
							| 
									
										
										
										
											2021-09-15 21:08:42 +03:00
										 |  |  | \RequirePackage{pdfpages} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | %---------------------------------------------------------------------- | 
					
						
							|  |  |  | %%%% Globals | 
					
						
							| 
									
										
										
										
											2021-09-03 16:32:03 +03:00
										 |  |  | % XXX move these out to relevant sections + add a separate globals glossary... | 
					
						
							| 
									
										
										
										
											2021-08-10 06:14:42 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-08-15 13:38:32 +03:00
										 |  |  | % NOTE: most of these are setup in \InitPages... | 
					
						
							| 
									
										
										
										
											2021-08-10 06:14:42 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-10 14:14:43 +03:00
										 |  |  | %%% \DescribeGlobal{layoutmode} | 
					
						
							|  |  |  | %% \DescribeMacro{\layoutmode=<mode>} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %%	Layout mode | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | \edef\layoutmode{\photobook@layoutmode} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | % layout mode tests... | 
					
						
							|  |  |  | \newif\ifcoverlayout | 
					
						
							|  |  |  | \newif\ifhardcoverlayout | 
					
						
							|  |  |  | \newif\ifsoftcoverlayout | 
					
						
							|  |  |  | \newif\ifendpaperlayout | 
					
						
							|  |  |  | \newif\ifjacketlayout | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | % aggregates... | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | \newif\ifcoverlikelayout | 
					
						
							|  |  |  | \newif\ifblocklayout | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-10 14:14:43 +03:00
										 |  |  | %% \DescribeMacro{\pdfpagelayout=<mode>} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %%	Controls the default layout in the pdf viewer. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | \edef\pdfpagelayout{\photobook@pdfpagelayout} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-10 14:14:43 +03:00
										 |  |  | %% \DescribeMacro{\spinewidth=<len>} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %%	Spine width
 | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | \newlength\spinewidth | 
					
						
							|  |  |  | \setlength\spinewidth{\photobook@spinewidth} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-10 14:14:43 +03:00
										 |  |  | %% \DescribeMacro{\spinefold=<len>} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %%	Spine fold width
 | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | \newlength\spinefold | 
					
						
							|  |  |  | \setlength\spinefold{\photobook@spinefold} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-10 14:14:43 +03:00
										 |  |  | %% \DescribeMacro{\coverboardgrow=<len>} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %%	Controls how much biger the cover board is than the page block | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | \newlength\coverboardgrow | 
					
						
							|  |  |  | \setlength\coverboardgrow{\photobook@coverboardgrow} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-10 14:14:43 +03:00
										 |  |  | %% \DescribeMacro{\coverflap=<len>} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %%	Cover flap | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | \newlength\coverflap | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-10 14:14:43 +03:00
										 |  |  | %% \DescribeMacro{\jacketwrap=<len>} | 
					
						
							|  |  |  | %% \DescribeMacro{\jacketflap=<len>} | 
					
						
							|  |  |  | %% \DescribeMacro{\jacketflapfront=<len>} | 
					
						
							|  |  |  | %% \DescribeMacro{\jacketflapback=<len>} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %%	Jacker configuration | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | \newlength\jacketwrap | 
					
						
							|  |  |  | \newlength\jacketflap | 
					
						
							|  |  |  | \newlength\jacketflapfront | 
					
						
							|  |  |  | \newlength\jacketflapback | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-10 14:14:43 +03:00
										 |  |  | %% \DescribeMacro{\blockwidth=<len>} | 
					
						
							|  |  |  | %% \DescribeMacro{\blockheight=<len>} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %%	Page block size
 | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-15 13:38:32 +03:00
										 |  |  | % NOTE: page and bleed block sizes are set via \InitPages | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | \newlength\blockwidth | 
					
						
							|  |  |  | \newlength\blockheight | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-10 14:14:43 +03:00
										 |  |  | %% \DescribeMacro{\bleedblockwidth=<len>} | 
					
						
							|  |  |  | %% \DescribeMacro{\bleedblockheight=<len>} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %%	Page block size with bleeds | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%	These are equivalent to |\paperwidth| and |\paperheight| but are  | 
					
						
							|  |  |  | %%	independent of them... | 
					
						
							| 
									
										
										
										
											2021-08-10 14:14:43 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | \newlength\bleedblockwidth | 
					
						
							|  |  |  | \newlength\bleedblockheight | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-10 14:14:43 +03:00
										 |  |  | %% \DescribeMacro{\pageblockwidth=<len>} | 
					
						
							|  |  |  | %% \DescribeMacro{\pageblockheight=<len>} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %% Original page block size
 | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% for the block layout these are the same as |\blockwidth| and |\blockheight| | 
					
						
							|  |  |  | %% for other layouts these are the original page layout size while the  | 
					
						
							|  |  |  | %% |\blockwidth| are set tho the current layout visible size. | 
					
						
							| 
									
										
										
										
											2021-08-10 14:14:43 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | \newlength\pageblockwidth | 
					
						
							|  |  |  | \newlength\pageblockheight | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-10 14:14:43 +03:00
										 |  |  | %% \DescribeMacro{\bleed=<len>} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %%	Page bleed size
 | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | \newlength\bleed | 
					
						
							|  |  |  | \setlength\bleed{\photobook@bleed} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-10 14:14:43 +03:00
										 |  |  | %% \DescribeMacro{\bindingoffset=<len>} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %%	Binding offset | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | \newlength\bindingoffset | 
					
						
							|  |  |  | \setlength\bindingoffset{\photobook@bindingoffset} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-10 14:14:43 +03:00
										 |  |  | %% \DescribeMacro{\clearimage=<len>} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-08-19 23:53:01 +03:00
										 |  |  | %%	Image clearance | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | % NOTE: since this can be any number but we need to detect if it was set 
 | 
					
						
							|  |  |  | %		manually we'll set it to \maxdimen and hope noe will print  | 
					
						
							| 
									
										
										
										
											2021-08-19 23:53:01 +03:00
										 |  |  | %		something big enough and dare to use it as image clearance... | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | \newlength{\clearimage} | 
					
						
							|  |  |  | \setlength\clearimage{\maxdimen} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-10 14:14:43 +03:00
										 |  |  | %% \DescribeMacro{\imageblockwidth=<ratio>} | 
					
						
							|  |  |  | %% \DescribeMacro{\imageblockheight=<ratio>} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %%	Image block width relative to |\textwidth| | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | \edef\imageblockwidth{\photobook@imageblockwidth} | 
					
						
							|  |  |  | \edef\imageblockheight{\photobook@imageblockheight} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-20 16:57:00 +03:00
										 |  |  | %% \DescribeMacro{\pagetextwidth=<len>} | 
					
						
							|  |  |  | %% \DescribeMacro{\pagetextheight=<len>} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% Root page text width/height. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | \newlength\pagetextwidth | 
					
						
							|  |  |  | \setlength\pagetextwidth{\textwidth} | 
					
						
							|  |  |  | \newlength\pagetextheight | 
					
						
							|  |  |  | \setlength\pagetextheight{\textheight} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-10 14:14:43 +03:00
										 |  |  | %% \DescribeMacro{\imageblockoffsettop=<ratio>} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | \edef\imageblockoffsettop{\photobook@imageblockoffsettop} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | %% \DescribeMacro{\clearcaption=<len>} | 
					
						
							| 
									
										
										
										
											2021-09-03 16:32:03 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %% Block caption clearance from edge of parent cell. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% Used as default by |\captionblockcell{..}| | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-14 09:56:39 +03:00
										 |  |  | % XXX do we need this??? | 
					
						
							| 
									
										
										
										
											2021-09-03 16:32:03 +03:00
										 |  |  | \newlength\clearcaption | 
					
						
							|  |  |  | \setlength\clearcaption{0pt} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | %% \DescribeMacro{\captioncellspacing=<len>} | 
					
						
							| 
									
										
										
										
											2021-09-03 16:32:03 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %% Block caption spacing from parent cell. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% Used as default by |\captionblockcell{..}| | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | % XXX should this be used in other caption cells??? | 
					
						
							|  |  |  | \newlength\captioncellspacing | 
					
						
							|  |  |  | \setlength\captioncellspacing{5pt} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | %% \DescribeMacro{\captionclearpage=<len>} | 
					
						
							|  |  |  | % | 
					
						
							| 
									
										
										
										
											2021-09-16 00:29:46 +03:00
										 |  |  | %% The distance between a caption block on a template page and page 
 | 
					
						
							|  |  |  | %% borders (defaults to: |\clearimage|). | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% This is relevant only in page/spread templates. | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | \def\captionclearpage{\clearimage} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-16 00:29:46 +03:00
										 |  |  | %% \DescribeMacro{\cellparentwidth=<len>} | 
					
						
							|  |  |  | %% \DescribeMacro{\cellparentheight=<len>} | 
					
						
							|  |  |  | %% \DescribeMacro{\cellwidth=<len>} | 
					
						
							|  |  |  | %% \DescribeMacro{\cellheight=<len>} | 
					
						
							|  |  |  | %% \DescribeMacro{\celloffsetleft=<len>} | 
					
						
							|  |  |  | %% \DescribeMacro{\celloffsettop=<len>} | 
					
						
							|  |  |  | %% \DescribeMacro{\clearance=<len>} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% Cell geometry.  | 
					
						
							|  |  |  | %% For more details see the \nameref{subsec:Cells} section. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% These are set automatically by cells, thus it is not recommended to 
 | 
					
						
							|  |  |  | %% edit them manually. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% For more details see the \nameref{subsec:Cells} section. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | \newlength\cellparentwidth | 
					
						
							|  |  |  | \setlength\cellparentwidth{\paperwidth} | 
					
						
							|  |  |  | \newlength\cellparentheight | 
					
						
							|  |  |  | \setlength\cellparentheight{\paperheight} | 
					
						
							|  |  |  | \newlength\cellwidth | 
					
						
							|  |  |  | \setlength\cellwidth{\cellparentwidth} | 
					
						
							|  |  |  | \newlength\cellheight | 
					
						
							|  |  |  | \setlength\cellheight{\cellparentheight} | 
					
						
							|  |  |  | \newlength\celloffsetleft | 
					
						
							|  |  |  | \setlength\celloffsetleft{0pt} | 
					
						
							|  |  |  | \newlength\celloffsettop | 
					
						
							|  |  |  | \setlength\celloffsettop{0pt} | 
					
						
							|  |  |  | \newlength\clearance | 
					
						
							|  |  |  | \setlength\clearance{0pt} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | %---------------------------------------------------------------------- | 
					
						
							|  |  |  | %%%% Initialization | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-07 01:29:37 +03:00
										 |  |  | %% \DescribeMacro{\InitPages} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-09-07 01:29:37 +03:00
										 |  |  | %% Initialize page dimensions. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% This is not intended for direct use. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-02 19:56:46 +03:00
										 |  |  | % XXX do we need to document this?? | 
					
						
							|  |  |  | %		...is there a usecase for calling this manually? | 
					
						
							| 
									
										
										
										
											2021-08-15 13:38:32 +03:00
										 |  |  | \newcommand\InitPages{
 | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 	% layout bools/tests... | 
					
						
							|  |  |  | 	\coverlayoutfalse | 
					
						
							|  |  |  | 	\hardcoverlayoutfalse | 
					
						
							|  |  |  | 	\softcoverlayoutfalse | 
					
						
							|  |  |  | 	\endpaperlayoutfalse | 
					
						
							|  |  |  | 	\jacketlayoutfalse | 
					
						
							|  |  |  | 	\coverlikelayoutfalse | 
					
						
							|  |  |  | 	\blocklayoutfalse | 
					
						
							|  |  |  | 	\ifdefstring{\layoutmode}{block}{
 | 
					
						
							|  |  |  | 		\blocklayouttrue }{} | 
					
						
							|  |  |  | 	\ifdefstring{\layoutmode}{cover}{ 
 | 
					
						
							|  |  |  | 		\coverlayouttrue | 
					
						
							|  |  |  | 		\coverlikelayouttrue }{} | 
					
						
							|  |  |  | 	\ifdefstring{\layoutmode}{hardcover}{ 
 | 
					
						
							|  |  |  | 		\hardcoverlayouttrue | 
					
						
							|  |  |  | 		\coverlikelayouttrue }{} | 
					
						
							|  |  |  | 	\ifdefstring{\layoutmode}{softcover}{ 
 | 
					
						
							|  |  |  | 		\softcoverlayouttrue | 
					
						
							|  |  |  | 		\coverlikelayouttrue }{} | 
					
						
							|  |  |  | 	\ifdefstring{\layoutmode}{jacket}{%
 | 
					
						
							|  |  |  | 		\jacketlayouttrue | 
					
						
							|  |  |  | 		\coverlikelayouttrue }{} | 
					
						
							|  |  |  | 	\ifdefstring{\layoutmode}{endpaper}{ 
 | 
					
						
							|  |  |  | 		\endpaperlayouttrue }{} | 
					
						
							|  |  |  | 	% pdf layout... | 
					
						
							|  |  |  | 	\ifx\photobook@pdfpagelayout\empty
 | 
					
						
							|  |  |  | 		\ifblocklayout | 
					
						
							|  |  |  | 			\def\pdfpagelayout{TwoPageRight} | 
					
						
							|  |  |  | 		\else
 | 
					
						
							|  |  |  | 			\def\pdfpagelayout{SinglePage} | 
					
						
							|  |  |  | 		\fi | 
					
						
							|  |  |  | 	\else
 | 
					
						
							|  |  |  | 		\def\pdfpagelayout{\photobook@pdfpagelayout} | 
					
						
							|  |  |  | 	\fi | 
					
						
							|  |  |  | 	% items to ignore in different layouts... | 
					
						
							|  |  |  | 	% XXX is this the correct way to go??? | 
					
						
							|  |  |  | 	\ifcoverlayout | 
					
						
							|  |  |  | 		\setlength\coverflap{\photobook@coverflap} | 
					
						
							|  |  |  | 	\else
 | 
					
						
							|  |  |  | 		\setlength\coverflap{0pt} | 
					
						
							|  |  |  | 	\fi | 
					
						
							|  |  |  | 	\ifjacketlayout | 
					
						
							|  |  |  | 		\setlength\jacketwrap{\photobook@jacketwrap} | 
					
						
							|  |  |  | 		\setlength\jacketflap{\photobook@jacketflap} | 
					
						
							|  |  |  | 	\else
 | 
					
						
							|  |  |  | 		\setlength\jacketwrap{0pt} | 
					
						
							|  |  |  | 		\setlength\jacketflap{0pt} | 
					
						
							|  |  |  | 	\fi | 
					
						
							|  |  |  | 	% flaps... | 
					
						
							|  |  |  | 	\ifdim\jacketflapfront=0pt | 
					
						
							|  |  |  | 		\setlength\jacketflapfront{\jacketflap} | 
					
						
							|  |  |  | 	\fi | 
					
						
							|  |  |  | 	\ifdim\jacketflapback=0pt | 
					
						
							|  |  |  | 		\setlength\jacketflapback{\jacketflap} | 
					
						
							|  |  |  | 	\fi | 
					
						
							|  |  |  | 	% block size... | 
					
						
							|  |  |  | 	\ifdim\blockwidth=0pt | 
					
						
							|  |  |  | 		% layout: block... | 
					
						
							|  |  |  | 		\setlength\blockwidth{
 | 
					
						
							|  |  |  | 			\ifx\photobook@blockwidth\empty
 | 
					
						
							|  |  |  | 				\dimexpr  | 
					
						
							|  |  |  | 					\paperwidth  | 
					
						
							| 
									
										
										
										
											2021-09-15 21:08:42 +03:00
										 |  |  | 					- 2\bleed \relax | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 			\else
 | 
					
						
							| 
									
										
										
										
											2021-09-15 21:08:42 +03:00
										 |  |  | 				\photobook@blockwidth \fi}  | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 		\setlength\pageblockwidth{\blockwidth} | 
					
						
							|  |  |  | 		% layout: cover... | 
					
						
							|  |  |  | 		\ifcoverlayout | 
					
						
							|  |  |  | 			\setlength\blockwidth{
 | 
					
						
							|  |  |  | 				\dimexpr  | 
					
						
							|  |  |  | 					2\blockwidth  | 
					
						
							|  |  |  | 					+ \spinewidth  | 
					
						
							|  |  |  | 					+ 2\spinefold | 
					
						
							|  |  |  | 					+ 2\coverboardgrow | 
					
						
							| 
									
										
										
										
											2021-09-15 21:08:42 +03:00
										 |  |  | 					+ 2\coverflap \relax}\fi | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 		% layout: jacket... | 
					
						
							|  |  |  | 		% XXX this seems to be about 6mm off -- what are we missing here??? | 
					
						
							|  |  |  | 		\ifjacketlayout | 
					
						
							|  |  |  | 			\setlength\blockwidth{
 | 
					
						
							|  |  |  | 				\dimexpr  | 
					
						
							|  |  |  | 					2\blockwidth  | 
					
						
							|  |  |  | 					+ \spinewidth | 
					
						
							|  |  |  | 					+ 2\spinefold | 
					
						
							|  |  |  | 					+ 2\jacketwrap | 
					
						
							|  |  |  | 					+ \jacketflapfront | 
					
						
							| 
									
										
										
										
											2021-09-15 21:08:42 +03:00
										 |  |  | 					+ \jacketflapback \relax}\fi | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 		% layout: endpaper... | 
					
						
							|  |  |  | 		\ifendpaperlayout | 
					
						
							| 
									
										
										
										
											2021-09-15 21:08:42 +03:00
										 |  |  | 			\setlength\blockwidth{ 2\blockwidth }\fi\fi | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 	\ifdim\blockheight=0pt | 
					
						
							|  |  |  | 		% layout: block / endpaper... | 
					
						
							|  |  |  | 		\setlength\blockheight{
 | 
					
						
							|  |  |  | 			\ifx\photobook@blockheight\empty
 | 
					
						
							|  |  |  | 				\dimexpr \paperheight - 2\bleed \relax | 
					
						
							|  |  |  | 			\else
 | 
					
						
							| 
									
										
										
										
											2021-09-15 21:08:42 +03:00
										 |  |  | 				\photobook@blockheight \fi}  | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 		\setlength\pageblockheight{\blockheight} | 
					
						
							|  |  |  | 		% layout: cover... | 
					
						
							|  |  |  | 		\ifcoverlayout | 
					
						
							|  |  |  | 			\setlength\blockheight{
 | 
					
						
							|  |  |  | 				\dimexpr  | 
					
						
							|  |  |  | 					\blockheight | 
					
						
							|  |  |  | 					+ 2\coverboardgrow | 
					
						
							|  |  |  | 					+ 2\coverflap | 
					
						
							| 
									
										
										
										
											2021-09-15 21:08:42 +03:00
										 |  |  | 				\relax }\fi | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 		% layout: jacket... | 
					
						
							|  |  |  | 		\ifjacketlayout | 
					
						
							|  |  |  | 			\setlength\blockheight{
 | 
					
						
							|  |  |  | 				\dimexpr  | 
					
						
							|  |  |  | 					\blockheight | 
					
						
							|  |  |  | 					+ 2\coverboardgrow | 
					
						
							| 
									
										
										
										
											2021-09-15 21:08:42 +03:00
										 |  |  | 				\relax }\fi\fi | 
					
						
							| 
									
										
										
										
											2021-08-19 23:53:01 +03:00
										 |  |  | 	% default image clearance... | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 	\ifdim\clearimage=\maxdimen | 
					
						
							|  |  |  | 		\ifx\photobook@clearimage\empty
 | 
					
						
							| 
									
										
										
										
											2021-09-06 19:59:50 +03:00
										 |  |  | 			%\setlength\clearimage{-\bleed} | 
					
						
							|  |  |  | 			\setlength\clearimage{10mm} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 		\else
 | 
					
						
							| 
									
										
										
										
											2021-09-15 21:08:42 +03:00
										 |  |  | 			\setlength\clearimage{\photobook@clearimage}\fi\fi | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 	% page with bleeds... | 
					
						
							|  |  |  | 	% NOTE: this is essentially \paperwidth and \paperheight but we do 
 | 
					
						
							|  |  |  | 	%		not rely on them being defined -- photobook settings take  | 
					
						
							|  |  |  | 	%		priority over \paperwidth and \paperwidth... | 
					
						
							|  |  |  | 	\setlength\bleedblockwidth{\dimexpr 
 | 
					
						
							| 
									
										
										
										
											2021-09-15 21:08:42 +03:00
										 |  |  | 			2\bleed  | 
					
						
							|  |  |  | 			+ \blockwidth \relax} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 	\setlength\bleedblockheight{\dimexpr 
 | 
					
						
							| 
									
										
										
										
											2021-09-15 21:08:42 +03:00
										 |  |  | 			2\bleed  | 
					
						
							|  |  |  | 			+ \blockheight \relax}  | 
					
						
							| 
									
										
										
										
											2021-09-16 00:29:46 +03:00
										 |  |  | 	% cells... | 
					
						
							|  |  |  | 	\global\setlength\cellparentwidth{\blockwidth} | 
					
						
							|  |  |  | 	\global\setlength\cellparentheight{\blockheight} | 
					
						
							|  |  |  | 	\global\setlength\cellwidth{\cellparentwidth} | 
					
						
							|  |  |  | 	\global\setlength\cellheight{\cellparentheight} | 
					
						
							| 
									
										
										
										
											2021-08-12 16:48:00 +03:00
										 |  |  | 	% misc... | 
					
						
							| 
									
										
										
										
											2021-09-15 21:08:42 +03:00
										 |  |  | 	\nprounddigits{\photobook@roundprintedlengthsto}} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-22 14:52:34 +03:00
										 |  |  | %% \DescribeMacro{\ReInitPages} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %%	Reset and re-initialize page dimentions. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-22 14:52:34 +03:00
										 |  |  | \newcommand\ReInitPages{
 | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 	\setlength\blockwidth{0mm} | 
					
						
							|  |  |  | 	\setlength\blockheight{0mm} | 
					
						
							|  |  |  | 	\edef\pdfpagelayout{} | 
					
						
							|  |  |  | 	% | 
					
						
							| 
									
										
										
										
											2021-08-15 13:38:32 +03:00
										 |  |  | 	\InitPages} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | %---------------------------------------------------------------------- | 
					
						
							|  |  |  | % Setup... | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-03 16:32:03 +03:00
										 |  |  | % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 
					
						
							|  |  |  | % on-import... | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | % init/update lengths... | 
					
						
							| 
									
										
										
										
											2021-08-15 13:38:32 +03:00
										 |  |  | \InitPages | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | % minimal geometry setup... | 
					
						
							|  |  |  | \RequirePackage[ | 
					
						
							|  |  |  | 	% paper size (incl. bleeds)... | 
					
						
							|  |  |  | 	paperwidth=\bleedblockwidth, paperheight=\bleedblockheight, | 
					
						
							|  |  |  | ]{geometry} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-03 16:32:03 +03:00
										 |  |  | % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 
					
						
							|  |  |  | % pre-document... | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | \AtEndPreamble{
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-16 00:29:46 +03:00
										 |  |  | 	% Metadata... | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 	\hypersetup{
 | 
					
						
							|  |  |  | 		pdfinfo={
 | 
					
						
							|  |  |  | 			Title={\@title}, | 
					
						
							|  |  |  | 			Subject={\@subject}, | 
					
						
							|  |  |  | 			Author={\@author}, | 
					
						
							|  |  |  | 			Keywords={\@keywords}, | 
					
						
							|  |  |  | 		}, | 
					
						
							|  |  |  | 		pdfpagelayout=\pdfpagelayout, | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-16 00:29:46 +03:00
										 |  |  | 	% Geometry... | 
					
						
							| 
									
										
										
										
											2021-08-15 13:38:32 +03:00
										 |  |  | 	\InitPages | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 	% no-defaults -- the user is expected to set things up... | 
					
						
							|  |  |  | 	\ifphotobook@geometrynodefaults | 
					
						
							|  |  |  | 		\geometry{
 | 
					
						
							|  |  |  | 			% paper size (incl. bleeds)... | 
					
						
							|  |  |  | 			paperwidth=\bleedblockwidth, paperheight=\bleedblockheight, | 
					
						
							|  |  |  | 			bindingoffset=\bindingoffset} | 
					
						
							|  |  |  | 	% normal mode... | 
					
						
							|  |  |  | 	\else
 | 
					
						
							|  |  |  | 		\geometry{
 | 
					
						
							|  |  |  | 			% paper size (incl. bleeds)... | 
					
						
							|  |  |  | 			paperwidth=\bleedblockwidth, paperheight=\bleedblockheight, | 
					
						
							|  |  |  | 			bindingoffset=\bindingoffset, | 
					
						
							|  |  |  | 			% include header/footer/margin notes in printed area | 
					
						
							|  |  |  | 			twoside, includeall, nomarginpar, | 
					
						
							|  |  |  | 			ignorehead=false, ignorefoot=false, ignoremp=false, | 
					
						
							|  |  |  | 			% center printed area on page
 | 
					
						
							| 
									
										
										
										
											2021-09-16 00:29:46 +03:00
										 |  |  | 			vcentering, hcentering}\fi | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-20 16:57:00 +03:00
										 |  |  | 	\setlength\pagetextwidth{\textwidth} | 
					
						
							|  |  |  | 	\setlength\pagetextheight{\textheight} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-16 00:29:46 +03:00
										 |  |  | 	% PDF boxes... | 
					
						
							|  |  |  | 	\pdfboxesset[\bleed]{\bleedblockwidth}{\bleedblockheight}} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | %---------------------------------------------------------------------- | 
					
						
							|  |  |  | %%%% Generic commands | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-14 03:02:59 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-10 14:14:43 +03:00
										 |  |  | %% \DescribeMacro{\keywords\{..\}} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %%	Set pdf metadata keywords | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%	>>	\keywords{<keywords>} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | \def\@keywords{} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | \newcommand\keywords[1]{%
 | 
					
						
							|  |  |  | 	\def\@keywords{#1}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-10 14:14:43 +03:00
										 |  |  | %% \DescribeMacro{\subject\{..\}} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %%	Set pdf metadata subject | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%	>>	\subject{<subject>} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | \def\@subject{} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | \newcommand\subject[1]{%
 | 
					
						
							|  |  |  | 	\def\@subject{#1}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | %% \DescribeMacro{\mindim\{..\}} | 
					
						
							|  |  |  | %% \DescribeMacro{\maxdim\{..\}} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% Get min/max dimension. | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %%	>> \mindim{A}{B} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %%	>> \maxdim{A}{B} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-03 16:32:03 +03:00
										 |  |  | % XXX do we actually need these?? | 
					
						
							|  |  |  | %		...should be simple to replace with calc's:  | 
					
						
							|  |  |  | %			0pt + \minof{..} | 
					
						
							|  |  |  | %			0pt + \maxof{..} | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | \newcommand\mindim[2]{
 | 
					
						
							|  |  |  | 	\ifdim \dimexpr #1 \relax < \dimexpr #2 \relax% | 
					
						
							|  |  |  | 		\dimexpr #1 \relax% | 
					
						
							|  |  |  | 	\else% | 
					
						
							|  |  |  | 		\dimexpr #2 \relax\fi} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | \newcommand\maxdim[2]{
 | 
					
						
							|  |  |  | 	\ifdim \dimexpr #1 \relax > \dimexpr #2 \relax% | 
					
						
							|  |  |  | 		\dimexpr #1 \relax% | 
					
						
							|  |  |  | 	\else% | 
					
						
							|  |  |  | 		\dimexpr #2 \relax\fi} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-12 03:29:50 +03:00
										 |  |  | %% \DescribeMacro{\emptypage\{..\}} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% Create an empty page. | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %%	>> \emptypage | 
					
						
							|  |  |  | %%	>> \emptypage[<style>] | 
					
						
							|  |  |  | %  | 
					
						
							| 
									
										
										
										
											2021-09-12 03:52:17 +03:00
										 |  |  | %% |<style>| is the style name as defined via |fancyhdr| (default: |empty|). | 
					
						
							| 
									
										
										
										
											2021-09-12 03:29:50 +03:00
										 |  |  | %%  | 
					
						
							|  |  |  | \newcommand\emptypage[1][empty]{%
 | 
					
						
							|  |  |  | 	\begin{page}% | 
					
						
							|  |  |  | 		\ifthenelse{\equal{#1}{}}{}{%
 | 
					
						
							|  |  |  | 			\thispagestyle{#1}}% | 
					
						
							|  |  |  | 	\end{page}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %% \DescribeMacro{\cleartoleftpage} | 
					
						
							|  |  |  | % | 
					
						
							| 
									
										
										
										
											2021-09-16 02:57:01 +03:00
										 |  |  | %% Forces content to left page. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% This is a companion to |\cleardoublepage|. | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | \newcommand*{\cleartoleftpage}{%
 | 
					
						
							|  |  |  | 	\clearpage | 
					
						
							|  |  |  | 	\if@twoside | 
					
						
							|  |  |  | 		\ifodd\c@page
 | 
					
						
							|  |  |  | 			\hbox{}\newpage | 
					
						
							|  |  |  | 			\if@twocolumn | 
					
						
							|  |  |  | 				\hbox{}\newpage \fi\fi\fi } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-03 03:28:04 +03:00
										 |  |  | %M \DescribeMacro{\ResettableMacro\{..\}} | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-09-03 03:28:04 +03:00
										 |  |  | %M Create a resettable command. | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-09-03 03:28:04 +03:00
										 |  |  | %M	>> \ResettableMacro{<name>}{<code>} | 
					
						
							|  |  |  | %M	>> \ResettableMacro{<name>}[<arg-count>]{<code>} | 
					
						
							|  |  |  | %M	>> \ResettableMacro{<name>}[<arg-count>][<default>]{<code>} | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-09-03 03:28:04 +03:00
										 |  |  | %M This is similar to |\newcommand{..}| but will define two commands: | 
					
						
							|  |  |  | %M | 
					
						
							|  |  |  | %M	>> \<name>{..} | 
					
						
							|  |  |  | %M | 
					
						
							|  |  |  | %M	>> \reset<name> | 
					
						
							|  |  |  | %M | 
					
						
							|  |  |  | %M |\<name>{..}| can be freely redefined or undefined by user. | 
					
						
							|  |  |  | %M | 
					
						
							|  |  |  | %M |\reset<name>| will reset |\<name>{..}| to its original state. | 
					
						
							|  |  |  | %M | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | % parse args... | 
					
						
							|  |  |  | \def\ResettableMacro#1{%
 | 
					
						
							|  |  |  | 	\@ifnextchar[{%
 | 
					
						
							|  |  |  | 		\photobook@ResettableMacro@pre{#1}% | 
					
						
							|  |  |  | 	}{%
 | 
					
						
							|  |  |  | 		\photobook@ResettableMacro{#1}}} | 
					
						
							|  |  |  | \def\photobook@ResettableMacro@pre#1[#2]{%
 | 
					
						
							|  |  |  | 	\@ifnextchar[{%
 | 
					
						
							|  |  |  | 		\photobook@ResettableMacro@args@dfl{#1}[#2]% | 
					
						
							|  |  |  | 	}{%
 | 
					
						
							|  |  |  | 		\photobook@ResettableMacro@args{#1}[#2]}} | 
					
						
							|  |  |  | % pre -- main command definition... | 
					
						
							|  |  |  | \def\photobook@ResettableMacro#1#2{%
 | 
					
						
							| 
									
										
										
										
											2021-08-30 18:55:11 +03:00
										 |  |  | 	\expandafter\newcommand\csname photobook@ResettableMacro@#1\endcsname{#2}% | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | 	\photobook@ResettableMacro@tail{#1}} | 
					
						
							|  |  |  | \def\photobook@ResettableMacro@args#1[#2]#3{%
 | 
					
						
							| 
									
										
										
										
											2021-08-30 18:55:11 +03:00
										 |  |  | 	\expandafter\newcommand\csname photobook@ResettableMacro@#1\endcsname[#2]{#3}% | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | 	\photobook@ResettableMacro@tail{#1}} | 
					
						
							|  |  |  | \def\photobook@ResettableMacro@args@dfl#1[#2][#3]#4{%
 | 
					
						
							| 
									
										
										
										
											2021-08-30 18:55:11 +03:00
										 |  |  | 	\expandafter\newcommand\csname photobook@ResettableMacro@#1\endcsname[#2][#3]{#4}% | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | 	\photobook@ResettableMacro@tail{#1}} | 
					
						
							|  |  |  | % post... | 
					
						
							|  |  |  | \def\photobook@ResettableMacro@tail#1{%
 | 
					
						
							|  |  |  | 	% \reset<name> | 
					
						
							|  |  |  | 	\expandafter\newcommand\csname reset#1\endcsname{%
 | 
					
						
							| 
									
										
										
										
											2021-08-30 18:55:11 +03:00
										 |  |  | 		\expandafter\let\csname #1\expandafter\endcsname\csname photobook@ResettableMacro@#1\endcsname} | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | 	% initialize... | 
					
						
							|  |  |  | 	\csname reset#1\endcsname} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-15 21:08:42 +03:00
										 |  |  | % XXX EXPERIMENTAL | 
					
						
							|  |  |  | %	>> \resizedpage[<bleed>]{<width>}{<height>}{<code>} | 
					
						
							| 
									
										
										
										
											2021-09-17 18:34:12 +03:00
										 |  |  | \newenvironment{resizedpages}[3][\bleed]{
 | 
					
						
							| 
									
										
										
										
											2021-09-15 21:08:42 +03:00
										 |  |  | 	\begingroup% | 
					
						
							|  |  |  | 		% setup page... | 
					
						
							|  |  |  | 		\setlength\bleed{#1}% | 
					
						
							|  |  |  | 		\setlength\blockwidth{#2}% | 
					
						
							|  |  |  | 		\setlength\blockheight{#3}% | 
					
						
							| 
									
										
										
										
											2021-09-16 02:57:01 +03:00
										 |  |  | 		\setlength\pageblockwidth{\blockwidth}% | 
					
						
							|  |  |  | 		\setlength\pageblockheight{\blockheight}% | 
					
						
							| 
									
										
										
										
											2021-09-15 21:08:42 +03:00
										 |  |  | 		\edef\pdfpagelayout{}% | 
					
						
							| 
									
										
										
										
											2021-09-16 02:57:01 +03:00
										 |  |  | 		% | 
					
						
							| 
									
										
										
										
											2021-09-15 21:08:42 +03:00
										 |  |  | 		\InitPages% | 
					
						
							| 
									
										
										
										
											2021-09-16 00:29:46 +03:00
										 |  |  | 		% | 
					
						
							| 
									
										
										
										
											2021-09-16 02:57:01 +03:00
										 |  |  | 		\setlength\paperwidth{\bleedblockwidth}% | 
					
						
							|  |  |  | 		\setlength\paperheight{\bleedblockheight}% | 
					
						
							| 
									
										
										
										
											2021-09-16 00:29:46 +03:00
										 |  |  | 		% | 
					
						
							| 
									
										
										
										
											2021-09-15 21:08:42 +03:00
										 |  |  | 		\pdfboxesset[\bleed]{\bleedblockwidth}{\bleedblockheight}% | 
					
						
							|  |  |  | 		% | 
					
						
							| 
									
										
										
										
											2021-09-26 14:29:47 +03:00
										 |  |  | 		% NOTE: this prevents some issues with macros racing to place  | 
					
						
							|  |  |  | 		%		stuff at ship-out (possibly)... | 
					
						
							|  |  |  | 		%		...also see cell env... | 
					
						
							|  |  |  | 		%		XXX needs more digging... | 
					
						
							|  |  |  | 		%		XXX do this at beginshipout/beginpage... (???) | 
					
						
							| 
									
										
										
										
											2021-10-01 03:45:25 +03:00
										 |  |  | 		%\null% | 
					
						
							| 
									
										
										
										
											2021-10-01 05:00:46 +03:00
										 |  |  | 		%\hbox{}% | 
					
						
							| 
									
										
										
										
											2021-09-17 18:34:12 +03:00
										 |  |  | }{%
 | 
					
						
							| 
									
										
										
										
											2021-09-15 21:08:42 +03:00
										 |  |  | 	\endgroup% | 
					
						
							|  |  |  | 	% reset... | 
					
						
							|  |  |  | 	\pdfboxesset[\bleed]{\bleedblockwidth}{\bleedblockheight}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-17 18:34:12 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %---------------------------------------------------------------------- | 
					
						
							| 
									
										
										
										
											2021-08-13 15:09:38 +03:00
										 |  |  | %%%% Environments and Cells | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 
					
						
							| 
									
										
										
										
											2021-08-09 13:43:36 +03:00
										 |  |  | %%%%% Generic | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-09 13:43:36 +03:00
										 |  |  | %% \DescribeEnv{page} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% Page environment. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-15 13:38:32 +03:00
										 |  |  | %% This is mainly designed to wrap other cell environment described later. | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% Note that this may span more than one page if there is enough stuff  | 
					
						
							|  |  |  | %% packed in. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-27 19:04:05 +03:00
										 |  |  | \newenvironment{page}{%
 | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | 	\null% | 
					
						
							|  |  |  | 	\ignorespaces% | 
					
						
							| 
									
										
										
										
											2021-08-28 13:56:31 +03:00
										 |  |  | }{%
 | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | 	\clearpage} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-03 16:32:03 +03:00
										 |  |  | %% \DescribeEnv{leftpage} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% \EXPERIMENTAL | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | % XXX not sure about this... | 
					
						
							|  |  |  | \newenvironment{leftpage}{%
 | 
					
						
							|  |  |  | 	\begin{page}% | 
					
						
							|  |  |  | 		\cleartoleftpage% | 
					
						
							|  |  |  | }{%
 | 
					
						
							|  |  |  | 	\end{page}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 
					
						
							| 
									
										
										
										
											2021-08-13 15:09:38 +03:00
										 |  |  | %%%%% Cells | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | % meta helpers... | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-03 03:28:04 +03:00
										 |  |  | %M \DescribeMacro{\CellContentOptions\{..\}} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %M \EXPERIMENTAL | 
					
						
							|  |  |  | %M | 
					
						
							|  |  |  | %M Define standard cell options. | 
					
						
							|  |  |  | %M | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | % XXX figure out how to align and pad without messing with geometry... | 
					
						
							|  |  |  | \newcommand\CellContentOptions[1]{%
 | 
					
						
							|  |  |  | 	%% align... | 
					
						
							|  |  |  | 	%\expandafter\def\csname photobook@#1@align\endcsname{flushleft}% | 
					
						
							|  |  |  | 	%\define@key{#1@args}{align}{%
 | 
					
						
							|  |  |  | 	%	\expandafter\edef\csname photobook@#1@align\endcsname{##1}}% | 
					
						
							|  |  |  | 	% valign... | 
					
						
							|  |  |  | 	\expandafter\def\csname photobook@#1@valign\endcsname{t}% | 
					
						
							|  |  |  | 	\define@key{#1@args}{valign}{%
 | 
					
						
							|  |  |  | 		\expandafter\edef\csname photobook@#1@valign\endcsname{##1}}% | 
					
						
							|  |  |  | 	%% margin... | 
					
						
							|  |  |  | 	%\expandafter\def\csname photobook@#1@margin\endcsname{0pt}% | 
					
						
							|  |  |  | 	%\define@key{#1@args}{margin}{%
 | 
					
						
							|  |  |  | 	%	\expandafter\edef\csname photobook@#1@margin\endcsname{##1}}% | 
					
						
							|  |  |  | 	%% padding... | 
					
						
							|  |  |  | 	%\expandafter\def\csname photobook@#1@padding\endcsname{0pt}% | 
					
						
							|  |  |  | 	%\define@key{#1@args}{padding}{%
 | 
					
						
							|  |  |  | 	%	\expandafter\edef\csname photobook@#1@padding\endcsname{##1}}% | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-03 03:28:04 +03:00
										 |  |  | %M \DescribeEnv{CellContent} | 
					
						
							|  |  |  | %M \DescribeEnv{CellContent*} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %M \EXPERIMENTAL | 
					
						
							|  |  |  | %M | 
					
						
							|  |  |  | %M Standard cell content wrapper, used by |inlinecell|. | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-09-03 03:28:04 +03:00
										 |  |  | %M	>> \begin{CellContent}[<parent-align>]{<name>} ... \end{CellContent} | 
					
						
							|  |  |  | %M	>> \begin{CellContent*}[<parent-align>]{<name>}{<width>}{<height>} ... \end{CellContent} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %M The star version requires width/height to be manually passed while the | 
					
						
							|  |  |  | %M non-star version will get the values from |\cellwidth| and |\cellheight| | 
					
						
							|  |  |  | %M respectively. | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-09-02 18:50:55 +03:00
										 |  |  | % XXX TEST params... | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | \newenvironment{CellContent}[2][t]{%
 | 
					
						
							|  |  |  | 	\begin{CellContent*}[#1]{#2}{\cellwidth}{\cellheight}% | 
					
						
							|  |  |  | }{%
 | 
					
						
							|  |  |  | 	\end{CellContent*}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | \newenvironment{CellContent*}[4][t]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-02 16:22:53 +03:00
										 |  |  | 	\begin{adjustbox}{
 | 
					
						
							|  |  |  | 			minipage=[#1][#4][\csname photobook@#2@valign\endcsname]{#3}, | 
					
						
							|  |  |  | 			valign=#1}% | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | 		\ignorespaces% | 
					
						
							|  |  |  | }{%
 | 
					
						
							| 
									
										
										
										
											2021-09-03 03:28:04 +03:00
										 |  |  | 		% NOTE: prevent empty "minipage" from collapsing... | 
					
						
							| 
									
										
										
										
											2021-09-02 18:50:55 +03:00
										 |  |  | 		\hspace{\fill}% | 
					
						
							| 
									
										
										
										
											2021-09-02 16:22:53 +03:00
										 |  |  | 	\end{adjustbox}} | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-03 03:28:04 +03:00
										 |  |  | %M \DescribeEnv{CellContent} | 
					
						
							|  |  |  | %M \DescribeEnv{CellContent*} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %M \EXPERIMENTAL | 
					
						
							|  |  |  | %M | 
					
						
							|  |  |  | %M Like |CellContent| / |CellContent*| but will use |minipage| as the wrapper. | 
					
						
							| 
									
										
										
										
											2021-09-02 18:50:55 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-09-03 03:28:04 +03:00
										 |  |  | %M	>> \begin{MinipageCellContent}[<parent-align>]{<name>} ... \end{MinipageCellContent} | 
					
						
							|  |  |  | %M	>> \begin{MinipageCellContent*}[<parent-align>]{<name>}{<width>}{<height>} ... \end{MinipageCellContent} | 
					
						
							| 
									
										
										
										
											2021-09-02 18:50:55 +03:00
										 |  |  | % | 
					
						
							|  |  |  | % XXX TEST... | 
					
						
							|  |  |  | % XXX doc... | 
					
						
							|  |  |  | \newenvironment{MinipageCellContent}[2][t]{%
 | 
					
						
							|  |  |  | 	\begin{MinipageCellContent*}[#1]{#2}{\cellwidth}{\cellheight}% | 
					
						
							|  |  |  | }{%
 | 
					
						
							|  |  |  | 	\end{MinipageCellContent*}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | \newenvironment{MinipageCellContent*}[4][t]{%
 | 
					
						
							|  |  |  | 	\begin{minipage}[#1][#4][\csname photobook@#2@valign\endcsname]{#3}% | 
					
						
							|  |  |  | }{%
 | 
					
						
							|  |  |  | 	\end{minipage}} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | %% A cell environment is a box of specified size. | 
					
						
							| 
									
										
										
										
											2021-08-12 16:48:00 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | %% Cells can be both placed inline relative to other content or in an  | 
					
						
							|  |  |  | %% absolute location. | 
					
						
							| 
									
										
										
										
											2021-08-12 16:48:00 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | %% Note that absolute cells are placed relative to the page and currently  | 
					
						
							|  |  |  | %% can not be placed relative to other absolute cells (this might change | 
					
						
							|  |  |  | %% in the future). | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% \DescribeMacro{\cellwidth=<len>} | 
					
						
							|  |  |  | %% \DescribeMacro{\cellheight=<len>} | 
					
						
							|  |  |  | %% \DescribeMacro{\cellparentwidth=<len>} | 
					
						
							|  |  |  | %% \DescribeMacro{\cellparentheight=<len>} | 
					
						
							|  |  |  | %% \DescribeMacro{\celloffsettop=<len>} | 
					
						
							|  |  |  | %% \DescribeMacro{\celloffsetleft=<len>} | 
					
						
							| 
									
										
										
										
											2021-09-01 04:05:31 +03:00
										 |  |  | %% \DescribeMacro{\clearance=<len>} | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% A cell defines a set of contextual lengths: | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%   <--> celloffsetleft | 
					
						
							|  |  |  | %%   .   <--------------> cellwidth | 
					
						
							|  |  |  | %%   <----------------------> cellparentwidth | 
					
						
							|  |  |  | %%   .   .              .   . | 
					
						
							|  |  |  | %%   +----------------------+ . . . . . . . | 
					
						
							|  |  |  | %%   |   .              .   |     ^       ^ celloffsettop | 
					
						
							|  |  |  | %%   |   .              .   |     |       | | 
					
						
							|  |  |  | %%   |   +--------------+ . | . . | . . . v  | 
					
						
							|  |  |  | %%   |   |              |   |     |   ^ | 
					
						
							|  |  |  | %%   |   |              |   |     |   | cellheight | 
					
						
							|  |  |  | %%   |   |     cell     |   |     |   | | 
					
						
							|  |  |  | %%   |   |              |   |     |   | | 
					
						
							|  |  |  | %%   |   |              |   |     |   | | 
					
						
							|  |  |  | %%   |   +--------------+ . | . . | . v | 
					
						
							|  |  |  | %%   |                      |     | | 
					
						
							|  |  |  | %%   |                      |     | cellparentheight | 
					
						
							|  |  |  | %%   +----------------------+ . . v | 
					
						
							|  |  |  | %%                               | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% For absolutely positioned cells these define the cell offset from 
 | 
					
						
							|  |  |  | %% parent. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% The bare page can be reasonably be treated as a cell. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% Initally, outside of any cells |\cellwidth|, |\cellparentwidth| and 
 | 
					
						
							|  |  |  | %% |\cellheight|, |\cellparentheight| are equal to |\paperwidth| and 
 | 
					
						
							|  |  |  | %% |\paperheight| respectively, and |\celloffsettop| and |\celloffsetleft| | 
					
						
							|  |  |  | %% are set to |0pt|. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% Changing these is not recommended, it likely will not affect the  | 
					
						
							|  |  |  | %% current cell but can mess up nested cells. | 
					
						
							| 
									
										
										
										
											2021-08-12 16:48:00 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-15 13:38:32 +03:00
										 |  |  | %% \DescribeEnv{inlinecell} | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | %% \DescribeEnv{inlinecell*} | 
					
						
							| 
									
										
										
										
											2021-08-15 13:38:32 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %% Create a basic inline cell. | 
					
						
							|  |  |  | % | 
					
						
							| 
									
										
										
										
											2021-08-26 04:04:38 +03:00
										 |  |  | %%	>> \begin{inlinecell}{<width>}{<height>} ... \end{inlinecell} | 
					
						
							| 
									
										
										
										
											2021-08-27 19:04:05 +03:00
										 |  |  | %%	>> \begin{inlinecell}[<valign>]{<width>}{<height>} ... \end{inlinecell} | 
					
						
							| 
									
										
										
										
											2021-08-15 13:38:32 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | %% This will clip oversized content. | 
					
						
							| 
									
										
										
										
											2021-08-15 13:38:32 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | %% |inlinecell*| is like |inlinecell| but will not clip. | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %%	>> \begin{inlinecell*}{<width>}{<height>} ... \end{inlinecell*} | 
					
						
							|  |  |  | %%	>> \begin{inlinecell*}[<valign>]{<width>}{<height>} ... \end{inlinecell*} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% |<valign>| can be one of |t| (default) for top, |c| for center or |b| for bottom. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% These are just like |minipage| but provide cell mechanics. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | % XXX EXPERIMENTAL | 
					
						
							|  |  |  | \CellContentOptions{inlinecell} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | \def\photobook@inlinecell@parentvalign{t} | 
					
						
							|  |  |  | \define@boolkey{inlinecell@args}{t}[true]{%
 | 
					
						
							|  |  |  | 	\def\photobook@inlinecell@parentvalign{t}} | 
					
						
							|  |  |  | \define@boolkey{inlinecell@args}{c}[true]{%
 | 
					
						
							|  |  |  | 	\def\photobook@inlinecell@parentvalign{c}} | 
					
						
							|  |  |  | \define@boolkey{inlinecell@args}{b}[true]{%
 | 
					
						
							|  |  |  | 	\def\photobook@inlinecell@parentvalign{b}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | \newenvironment{inlinecell*}[3][]{%
 | 
					
						
							| 
									
										
										
										
											2021-08-15 13:38:32 +03:00
										 |  |  | 	\begingroup% | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | 		\setkeys{inlinecell@args}{
 | 
					
						
							|  |  |  | 			t, | 
					
						
							|  |  |  | 			#1}% | 
					
						
							|  |  |  | 		% | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | 		% get args by value... | 
					
						
							|  |  |  | 		\edef\photobook@protect@w{\the\dimexpr #2 \relax}% | 
					
						
							|  |  |  | 		\edef\photobook@protect@h{\the\dimexpr #3 \relax}% | 
					
						
							|  |  |  | 		% | 
					
						
							| 
									
										
										
										
											2021-08-27 19:04:05 +03:00
										 |  |  | 		\setlength\cellparentwidth{\cellwidth}% | 
					
						
							|  |  |  | 		\setlength\cellparentheight{\cellheight}% | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | 		\setlength\cellwidth{\photobook@protect@w}% | 
					
						
							|  |  |  | 		\setlength\cellheight{\photobook@protect@h}% | 
					
						
							| 
									
										
										
										
											2021-08-27 19:04:05 +03:00
										 |  |  | 		\setlength\celloffsettop{0pt}% | 
					
						
							|  |  |  | 		\setlength\celloffsetleft{0pt}% | 
					
						
							| 
									
										
										
										
											2021-08-15 13:38:32 +03:00
										 |  |  | 		% | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | 		\begin{CellContent}[\photobook@inlinecell@parentvalign]{inlinecell}% | 
					
						
							| 
									
										
										
										
											2021-08-15 13:38:32 +03:00
										 |  |  | }{%
 | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | 		\end{CellContent}% | 
					
						
							| 
									
										
										
										
											2021-08-15 13:38:32 +03:00
										 |  |  | 	\endgroup} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | \newenvironment{inlinecell}[3][t]{%
 | 
					
						
							|  |  |  | 	\begin{inlinecell*}[#1]{#2}{#3}% | 
					
						
							|  |  |  | 	\begin{cliptocell}% | 
					
						
							|  |  |  | }{%
 | 
					
						
							|  |  |  | 	\end{cliptocell}% | 
					
						
							|  |  |  | 	\end{inlinecell*}} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-12 15:22:03 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-02 18:50:55 +03:00
										 |  |  | % XXX EXPERIMENTAL | 
					
						
							|  |  |  | %% \DescribeEnv{minipagecell} | 
					
						
							|  |  |  | %% \DescribeEnv{minipagecell*} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% \EXPERIMENTAL | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | \CellContentOptions{minipagecell} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | \def\photobook@minipagecell@parentvalign{t} | 
					
						
							|  |  |  | \define@boolkey{minipagecell@args}{t}[true]{%
 | 
					
						
							|  |  |  | 	\def\photobook@minipagecell@parentvalign{t}} | 
					
						
							|  |  |  | \define@boolkey{minipagecell@args}{c}[true]{%
 | 
					
						
							|  |  |  | 	\def\photobook@minipagecell@parentvalign{c}} | 
					
						
							|  |  |  | \define@boolkey{minipagecell@args}{b}[true]{%
 | 
					
						
							|  |  |  | 	\def\photobook@minipagecell@parentvalign{b}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | \newenvironment{minipagecell*}[3][]{%
 | 
					
						
							|  |  |  | 	\begingroup% | 
					
						
							|  |  |  | 		\setkeys{minipagecell@args}{
 | 
					
						
							|  |  |  | 			t, | 
					
						
							|  |  |  | 			#1}% | 
					
						
							|  |  |  | 		% get args by value... | 
					
						
							|  |  |  | 		\edef\photobook@protect@w{\the\dimexpr #2 \relax}% | 
					
						
							|  |  |  | 		\edef\photobook@protect@h{\the\dimexpr #3 \relax}% | 
					
						
							|  |  |  | 		% | 
					
						
							|  |  |  | 		\setlength\cellparentwidth{\cellwidth}% | 
					
						
							|  |  |  | 		\setlength\cellparentheight{\cellheight}% | 
					
						
							|  |  |  | 		\setlength\cellwidth{\photobook@protect@w}% | 
					
						
							|  |  |  | 		\setlength\cellheight{\photobook@protect@h}% | 
					
						
							|  |  |  | 		\setlength\celloffsettop{0pt}% | 
					
						
							|  |  |  | 		\setlength\celloffsetleft{0pt}% | 
					
						
							|  |  |  | 		\setlength\clearance{0pt}% | 
					
						
							|  |  |  | 		% | 
					
						
							|  |  |  | 		\begin{MinipageCellContent}[\photobook@minipagecell@parentvalign]{minipagecell}% | 
					
						
							|  |  |  | }{%
 | 
					
						
							|  |  |  | 		\end{MinipageCellContent}% | 
					
						
							|  |  |  | 	\endgroup} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | \newenvironment{minipagecell}[3][t]{%
 | 
					
						
							|  |  |  | 	\begin{minipagecell*}[#1]{#2}{#3}% | 
					
						
							|  |  |  | 	\begin{cliptocell}% | 
					
						
							|  |  |  | }{%
 | 
					
						
							|  |  |  | 	\end{cliptocell}% | 
					
						
							|  |  |  | 	\end{minipagecell*}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | % XXX EXPERIMENTAL | 
					
						
							|  |  |  | %% \DescribeEnv{zinlinecell} | 
					
						
							|  |  |  | %% \DescribeEnv{zinlinecell*} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% \EXPERIMENTAL | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% Like |inlinecell| / |inlinecell*| but will take up zero space. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%	>> \begin{zinlinecell}{<width>}{<height>} ... \end{zinlinecell} | 
					
						
							|  |  |  | %%	>> \begin{zinlinecell}[<valign>]{<width>}{<height>} ... \end{zinlinecell} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-02 18:50:55 +03:00
										 |  |  | % XXX need to get rid of the raisebox here... | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | \NewEnviron{zinlinecell*}[1][]{%
 | 
					
						
							|  |  |  | 	\smash{\makebox[0pt][l]{%
 | 
					
						
							|  |  |  | 		% XXX HACK: RAISEBOX -- feels hackish... | 
					
						
							|  |  |  | 		\raisebox{0pt - \totalheightof{O}}{%
 | 
					
						
							|  |  |  | 			\begin{inlinecell*}[#1]{\cellwidth}{\cellheight}% | 
					
						
							|  |  |  | 				\BODY% | 
					
						
							|  |  |  | 			\end{inlinecell*}}}}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | \NewEnviron{zinlinecell}[1][]{%
 | 
					
						
							|  |  |  | 	\smash{\makebox[0pt][l]{%
 | 
					
						
							|  |  |  | 		% XXX HACK: RAISEBOX -- feels hackish... | 
					
						
							|  |  |  | 		\raisebox{0pt - \totalheightof{O}}{%
 | 
					
						
							|  |  |  | 			\begin{inlinecell}[#1]{\cellwidth}{\cellheight}% | 
					
						
							|  |  |  | 				\BODY% | 
					
						
							|  |  |  | 			\end{inlinecell}}}}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-12 15:22:03 +03:00
										 |  |  | %% \DescribeEnv{cell} | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | %% \DescribeEnv{cell*} | 
					
						
							| 
									
										
										
										
											2021-08-09 13:43:36 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-08-15 13:38:32 +03:00
										 |  |  | %% Create a basic absolutely positioned cell. | 
					
						
							| 
									
										
										
										
											2021-08-12 16:48:00 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | %%	>> \begin{cell}{<left>, <top>}{<width>}{<height>} ... \end{cell} | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %% Oversized content will be clipped. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% |cell*| is just like |cell| but will not clip its content. | 
					
						
							|  |  |  | % | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | %%	>> \begin{cell*}{<left>, <top>}{<width>}{<height>} ... \end{cell*} | 
					
						
							| 
									
										
										
										
											2021-08-27 19:04:05 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-12 15:22:03 +03:00
										 |  |  | % XXX SYNTAX: place the second arg in braces... | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | %		\begin{cell*}(<left>, <top>){<width>}{<height>} | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | \newenvironment{cell*}[3]{%
 | 
					
						
							| 
									
										
										
										
											2021-10-01 03:45:25 +03:00
										 |  |  | 	\begingroup% | 
					
						
							|  |  |  | 		\setsepchar{,}% | 
					
						
							|  |  |  | 		\readlist*\photobook@cell@offset{#1}% | 
					
						
							|  |  |  | 		% | 
					
						
							|  |  |  | 		% NOTE: if there is no \null before textblock then it can reset the  | 
					
						
							|  |  |  | 		%		non-standard page boxes...  | 
					
						
							|  |  |  | 		%		...not sure yet if this is an issue with how/when foldout env | 
					
						
							|  |  |  | 		%		updates the boxes or with textblock internals, needs  | 
					
						
							|  |  |  | 		%		investigating... | 
					
						
							|  |  |  | 		%		XXX report this as a bug if issue is in textblock... | 
					
						
							|  |  |  | 		%		XXX another place where this is relevant is in the resizedpages | 
					
						
							|  |  |  | 		%			env... | 
					
						
							|  |  |  | 		\null% | 
					
						
							|  |  |  | 		\begin{textblock*}{#2}(#1)% | 
					
						
							|  |  |  | 		\begin{inlinecell*}{#2}{#3}% | 
					
						
							|  |  |  | 			\setlength\celloffsettop{\photobook@cell@offset[1]}% | 
					
						
							|  |  |  | 			\setlength\celloffsetleft{\photobook@cell@offset[2]}% | 
					
						
							|  |  |  | 			\ignorespaces% | 
					
						
							| 
									
										
										
										
											2021-08-12 15:22:03 +03:00
										 |  |  | }{%
 | 
					
						
							| 
									
										
										
										
											2021-10-01 03:45:25 +03:00
										 |  |  | 		\end{inlinecell*}% | 
					
						
							|  |  |  | 		\end{textblock*}% | 
					
						
							|  |  |  | 	\endgroup% | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | 	\ignorespaces} | 
					
						
							| 
									
										
										
										
											2021-08-12 15:22:03 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | \newenvironment{cell}[3]{%
 | 
					
						
							|  |  |  | 	\begin{cell*}{#1}{#2}{#3}% | 
					
						
							| 
									
										
										
										
											2021-08-14 03:02:59 +03:00
										 |  |  | 	\begin{cliptocell}% | 
					
						
							| 
									
										
										
										
											2021-08-27 19:04:05 +03:00
										 |  |  | 		\ignorespaces% | 
					
						
							| 
									
										
										
										
											2021-08-14 03:02:59 +03:00
										 |  |  | }{%
 | 
					
						
							|  |  |  | 	\end{cliptocell}% | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | 	\end{cell*}% | 
					
						
							|  |  |  | 	\ignorespaces} | 
					
						
							| 
									
										
										
										
											2021-08-14 03:02:59 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-08 18:52:23 +03:00
										 |  |  | % 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}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-26 04:04:38 +03:00
										 |  |  | % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 
					
						
							| 
									
										
										
										
											2021-08-27 20:12:06 +03:00
										 |  |  | %%%%% Save cells | 
					
						
							| 
									
										
										
										
											2021-08-27 19:04:05 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-26 04:04:38 +03:00
										 |  |  | %% \DescribeMacro{\savecell\{..\}} | 
					
						
							| 
									
										
										
										
											2021-08-30 18:55:11 +03:00
										 |  |  | %% \DescribeMacro{\gsavecell\{..\}} | 
					
						
							| 
									
										
										
										
											2021-08-26 04:04:38 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %% Create a saved cell. | 
					
						
							| 
									
										
										
										
											2021-08-27 19:04:05 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-08-26 04:04:38 +03:00
										 |  |  | %%	>> \savecell{<name>}{<width>}{<height>}{ .. } | 
					
						
							| 
									
										
										
										
											2021-08-27 19:04:05 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-08-26 04:04:38 +03:00
										 |  |  | %% This is similar to |\newsavebox{..}| and |\sbox{..}| but adds  | 
					
						
							|  |  |  | %% cell functionality. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-30 18:55:11 +03:00
										 |  |  | %% |\gsavecell{..}| is the same as |\savecell{..}| but greates a global 
 | 
					
						
							|  |  |  | %% cell. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | % XXX can/should we make this an env??? | 
					
						
							| 
									
										
										
										
											2021-08-26 20:03:17 +03:00
										 |  |  | % XXX should this be split into \newsavecell{..} and \scell{..} ??? | 
					
						
							| 
									
										
										
										
											2021-08-27 19:04:05 +03:00
										 |  |  | % XXX can we use root cells inside this??? | 
					
						
							|  |  |  | %		...i.e. things using textbox*... | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | \newcommand\savecell[5][]{%
 | 
					
						
							| 
									
										
										
										
											2021-08-26 04:04:38 +03:00
										 |  |  | 	% only define a savebox once... | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | 	\@ifundefined{#2}{%
 | 
					
						
							|  |  |  | 		\expandafter\newsavebox\csname #2\endcsname}{} | 
					
						
							|  |  |  | 	\expandafter\sbox\csname #2\endcsname{%
 | 
					
						
							|  |  |  | 		\begin{inlinecell*}[#1]{#3}{#4}% | 
					
						
							|  |  |  | 			#5% | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | 		\end{inlinecell*}}% | 
					
						
							|  |  |  | 	\ignorespaces} | 
					
						
							| 
									
										
										
										
											2021-08-26 04:04:38 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | \newcommand\gsavecell[5][]{%
 | 
					
						
							| 
									
										
										
										
											2021-08-30 18:55:11 +03:00
										 |  |  | 	% only define a savebox once... | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | 	\@ifundefined{#2}{%
 | 
					
						
							|  |  |  | 		\expandafter\newsavebox\csname #2\endcsname}{} | 
					
						
							|  |  |  | 	\global\expandafter\sbox\csname #2\endcsname{%
 | 
					
						
							|  |  |  | 		\begin{inlinecell*}[#1]{#3}{#4}% | 
					
						
							|  |  |  | 			#5% | 
					
						
							| 
									
										
										
										
											2021-08-30 18:55:11 +03:00
										 |  |  | 		\end{inlinecell*}}% | 
					
						
							|  |  |  | 	\ignorespaces} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-26 04:04:38 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | %% \DescribeMacro{\usecell\{..\}} | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | %% \DescribeMacro{\usecell*\{..\}} | 
					
						
							| 
									
										
										
										
											2021-08-26 04:04:38 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-08-27 19:04:05 +03:00
										 |  |  | %% Use part of a saved cell. | 
					
						
							| 
									
										
										
										
											2021-08-26 04:04:38 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-27 19:04:05 +03:00
										 |  |  | %%	>> \usecell{<name>}(<top>, <left>){<width>}{<height>} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% This will clip the content to cell. | 
					
						
							| 
									
										
										
										
											2021-08-26 04:04:38 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | %% |\usecell*{..}| is similar to |\usecell{..}| but will not clip the  | 
					
						
							|  |  |  | %% cell content. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%	>> \usecell*{<name>}(<top>, <left>){<width>}{<height>} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% These are similar to |\usebox{..}|. | 
					
						
							| 
									
										
										
										
											2021-08-26 04:04:38 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | \def\usecell{\@ifstar{%
 | 
					
						
							|  |  |  | 	\photobook@usecell% | 
					
						
							|  |  |  | }{%
 | 
					
						
							|  |  |  | 	\photobook@usecell@star}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | % cell content... | 
					
						
							|  |  |  | % NOTE: this is not intended for direct use -- depends closure/context... | 
					
						
							|  |  |  | \def\photobook@usecell@placecell#1(#2){%
 | 
					
						
							| 
									
										
										
										
											2021-09-26 01:04:41 +03:00
										 |  |  | 	\setsepchar{,}% | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | 	\readlist*\photobook@usecell@offset{#2}% | 
					
						
							|  |  |  | 	% XXX how we align things feels a bit odd... | 
					
						
							|  |  |  | 	\vspace{-\dimexpr \photobook@usecell@offset[1] \relax}% | 
					
						
							|  |  |  | 	\adjustbox{margin={-\dimexpr \photobook@usecell@offset[2] \relax} 0pt 0pt 0pt}{%
 | 
					
						
							|  |  |  | 		\expandafter\usebox\csname #1\endcsname}} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-27 19:04:05 +03:00
										 |  |  | % XXX add option to rotate saved cell... | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | \def\photobook@usecell@star#1(#2)#3#4{
 | 
					
						
							| 
									
										
										
										
											2021-08-27 19:04:05 +03:00
										 |  |  | 	\begin{inlinecell}{#3}{#4}% | 
					
						
							|  |  |  | 		\photobook@usecell@placecell{#1}(#2)% | 
					
						
							| 
									
										
										
										
											2021-08-26 04:04:38 +03:00
										 |  |  | 	\end{inlinecell}} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-27 19:04:05 +03:00
										 |  |  | % XXX add option to rotate saved cell... | 
					
						
							|  |  |  | \def\photobook@usecell#1(#2)#3#4{
 | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | 	\begin{inlinecell*}{#3}{#4}% | 
					
						
							| 
									
										
										
										
											2021-08-27 19:04:05 +03:00
										 |  |  | 		\photobook@usecell@placecell{#1}(#2)% | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | 	\end{inlinecell*}} | 
					
						
							| 
									
										
										
										
											2021-08-26 04:04:38 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-13 15:09:38 +03:00
										 |  |  | % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 
					
						
							|  |  |  | %%%%% Cell macros | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% Cell macros require a cell environment to function correctly. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-27 19:04:05 +03:00
										 |  |  | %% \DescribeEnv{topdown} | 
					
						
							|  |  |  | %% \DescribeEnv{bottomup} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% Rotate cell content vertically, orienting it top-down or bottom-up. | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %%	>> \begin{topdown} ... \end{topdown} | 
					
						
							|  |  |  | %%	>> \begin{bottomup} ... \end{bottomup} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | \newenvironment{topdown}[1][t]{%
 | 
					
						
							| 
									
										
										
										
											2021-08-27 19:04:05 +03:00
										 |  |  | 	\begin{flushright}% | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | 	\begin{turn}{270}% | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | 	\begin{inlinecell*}[#1]{\cellheight}{\cellwidth}% | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | }{%
 | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | 	\end{inlinecell*}% | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | 	\end{turn}% | 
					
						
							| 
									
										
										
										
											2021-08-27 19:04:05 +03:00
										 |  |  | 	\end{flushright}} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | \newenvironment{bottomup}[1][t]{%
 | 
					
						
							|  |  |  | 	\begin{turn}{90}% | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | 	\begin{inlinecell*}[#1]{\cellheight}{\cellwidth}% | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | }{%
 | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | 	\end{inlinecell*}% | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | 	\end{turn}} | 
					
						
							| 
									
										
										
										
											2021-08-27 19:04:05 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-14 03:02:59 +03:00
										 |  |  | %% \DescribeEnv{cliptocell} | 
					
						
							|  |  |  | % | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | %% Clip content to parent cell. | 
					
						
							| 
									
										
										
										
											2021-08-14 03:02:59 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | \newenvironment{cliptocell}{%
 | 
					
						
							|  |  |  | 	\begin{clipbox*}{0cm {\height - \cellheight} {\cellwidth} {\height}}% | 
					
						
							|  |  |  | 	\begin{minipage}[t][\cellheight][t]{\cellwidth}%  | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | 		\ignorespaces% | 
					
						
							| 
									
										
										
										
											2021-08-14 03:02:59 +03:00
										 |  |  | }{%
 | 
					
						
							|  |  |  | 	\end{minipage}% | 
					
						
							| 
									
										
										
										
											2021-08-15 13:38:32 +03:00
										 |  |  | 	\end{clipbox*}} | 
					
						
							| 
									
										
										
										
											2021-08-14 03:02:59 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-20 01:22:17 +03:00
										 |  |  | %% \DescribeMacro{\imagecell\{..\}} | 
					
						
							| 
									
										
										
										
											2021-08-18 22:15:03 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | %% Place image in cell. | 
					
						
							| 
									
										
										
										
											2021-08-18 22:15:03 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-08-20 01:22:17 +03:00
										 |  |  | %%	>> \imagecell{<caption-cell>}{<image>} | 
					
						
							|  |  |  | %%	>> \imagecell[<key>=<value>, ..]{<caption-cell>}{<image>} | 
					
						
							| 
									
										
										
										
											2021-08-18 22:15:03 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | %%	>> \imagecell[fit]{}{<image>} | 
					
						
							|  |  |  | %%	>> \imagecell[fill]{}{<image>} | 
					
						
							| 
									
										
										
										
											2021-08-19 23:53:01 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-20 01:22:17 +03:00
										 |  |  | %%   fit (default)                fill
 | 
					
						
							|  |  |  | %%   +-----------------+    . . . +-----------------+ . . . | 
					
						
							|  |  |  | %%   |                 |    .  .  |                 |  .  . | 
					
						
							|  |  |  | %%   +-----------------+    .     |                 |     . | 
					
						
							|  |  |  | %%   | .             . |    .     |  .           .  |     . | 
					
						
							|  |  |  | %%   |    .       .    |    .     |     .     .     |     . | 
					
						
							|  |  |  | %%   |      image      |    .     |      image      |     . | 
					
						
							|  |  |  | %%   |    .       .    |    .     |     .     .     |     . | 
					
						
							|  |  |  | %%   | .             . |    .     |  .           .  |     . | 
					
						
							|  |  |  | %%   +-----------------+    .     |                 |     . | 
					
						
							|  |  |  | %%   |                 |    .  .  |                 |  .  . | 
					
						
							|  |  |  | %%   +-----------------+    . . . +-----------------+ . . . | 
					
						
							| 
									
										
										
										
											2021-08-19 23:53:01 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-20 01:22:17 +03:00
										 |  |  | %% Centering. The image will be centered by default. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | %%	>> \imagecell{}{<image>} | 
					
						
							|  |  |  | %%	>> \imagecell[center]{}{<image>} | 
					
						
							| 
									
										
										
										
											2021-08-20 01:22:17 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | %% Vertical alignment | 
					
						
							| 
									
										
										
										
											2021-08-19 23:53:01 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | %%	>> \imagecell[top]{}{<image>} | 
					
						
							|  |  |  | %%	>> \imagecell[bottom]{}{<image>} | 
					
						
							| 
									
										
										
										
											2021-08-19 23:53:01 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%   top                    center (default)       bottom | 
					
						
							|  |  |  | %%   +-----------------+    +-----------------+    +-----------------+  | 
					
						
							|  |  |  | %%   | .             . |    |                 |    |                 | | 
					
						
							|  |  |  | %%   |    .       .    |    +-----------------+    |                 | | 
					
						
							|  |  |  | %%   |      image      |    | .             . |    |                 | | 
					
						
							|  |  |  | %%   |    .       .    |    |    .       .    |    +-----------------+  | 
					
						
							|  |  |  | %%   | .             . |    |      image      |    | .             . |  | 
					
						
							|  |  |  | %%   +-----------------+    |    .       .    |    |    .       .    |  | 
					
						
							|  |  |  | %%   |                 |    | .             . |    |      image      |  | 
					
						
							|  |  |  | %%   |                 |    +-----------------+    |    .       .    |  | 
					
						
							|  |  |  | %%   |                 |    |                 |    | .             . |  | 
					
						
							|  |  |  | %%   +-----------------+    +-----------------+    +-----------------+  | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | %% Horizontal alignment | 
					
						
							| 
									
										
										
										
											2021-08-19 23:53:01 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | %%	>> \imagecell[left]{}{<image>} | 
					
						
							|  |  |  | %%	>> \imagecell[right]{}{<image>} | 
					
						
							| 
									
										
										
										
											2021-08-19 23:53:01 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%   left                   center (default)       right | 
					
						
							|  |  |  | %%   +-------------+---+    +-+-------------+-+    +---+-------------+ | 
					
						
							|  |  |  | %%   | .         . |   |    | | .         . | |    |   | .         . | | 
					
						
							|  |  |  | %%   |  .       .  |   |    | |  .       .  | |    |   |  .       .  | | 
					
						
							|  |  |  | %%   |   .     .   |   |    | |   .     .   | |    |   |   .     .   | | 
					
						
							|  |  |  | %%   |    .   .    |   |    | |    .   .    | |    |   |    .   .    | | 
					
						
							|  |  |  | %%   |    image    |   |    | |    image    | |    |   |    image    | | 
					
						
							|  |  |  | %%   |    .   .    |   |    | |    .   .    | |    |   |    .   .    | | 
					
						
							|  |  |  | %%   |   .     .   |   |    | |   .     .   | |    |   |   .     .   | | 
					
						
							|  |  |  | %%   |  .       .  |   |    | |  .       .  | |    |   |  .       .  | | 
					
						
							|  |  |  | %%   | .         . |   |    | | .         . | |    |   | .         . | | 
					
						
							|  |  |  | %%   +-------------+---+    +-+-------------+-+    +---+-------------+ | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% Horizontal and vertical alignment can be combined to control alignment  | 
					
						
							|  |  |  | %% of both vertical and horizontal images at the same time. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% Image |clearance|. This sets the amount of clearance around an image 
 | 
					
						
							|  |  |  | %% (default: |0pt|). | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | %%	>> \imagecell[clearance=-4mm]{}{<image>} | 
					
						
							| 
									
										
										
										
											2021-08-19 23:53:01 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%   clearance > 0pt        clearance = 0pt          clearance < 0pt | 
					
						
							|  |  |  | %%                                  (default)      | 
					
						
							| 
									
										
										
										
											2021-08-20 17:36:22 +03:00
										 |  |  | %%   +--------v--------+    +-----------------+    +--------^--------+     | 
					
						
							| 
									
										
										
										
											2021-08-19 23:53:01 +03:00
										 |  |  | %%   |                 |    |                 |    |                 |     | 
					
						
							|  |  |  | %%   |+---------------+|    +-----------------+  ..+-----------------+..   | 
					
						
							|  |  |  | %%   || .           . ||    | .             . |  . |.               .| .   | 
					
						
							|  |  |  | %%   ||   .       .   ||    |    .       .    |  . |    .       .    | .   | 
					
						
							| 
									
										
										
										
											2021-08-20 17:36:22 +03:00
										 |  |  | %%   |>     image     <|    |      image      |  < |      image      | >   | 
					
						
							| 
									
										
										
										
											2021-08-19 23:53:01 +03:00
										 |  |  | %%   ||   .       .   ||    |    .       .    |  . |    .       .    | .   | 
					
						
							|  |  |  | %%   || .           . ||    | .             . |  . |.               .| .   | 
					
						
							|  |  |  | %%   |+---------------+|    +-----------------+  ..+-----------------+..   | 
					
						
							|  |  |  | %%   |                 |    |                 |    |                 |     | 
					
						
							| 
									
										
										
										
											2021-08-20 17:36:22 +03:00
										 |  |  | %%   +--------^--------+    +-----------------+    +--------v--------+     | 
					
						
							| 
									
										
										
										
											2021-08-19 23:53:01 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% Note that if |clearance| is less than 0, the image will take up more | 
					
						
							| 
									
										
										
										
											2021-08-20 01:22:17 +03:00
										 |  |  | %% space than the containing cell, |\imagecell{..}| will not clip  | 
					
						
							| 
									
										
										
										
											2021-08-19 23:53:01 +03:00
										 |  |  | %% its content and the whole image surface will be shown. If clipping is 
 | 
					
						
							|  |  |  | %% needed then use |clipcell| environment as a container. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-20 16:57:00 +03:00
										 |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | %%   +-----------------+ - - caption cell size
 | 
					
						
							|  |  |  | %%   .                 .       . | 
					
						
							|  |  |  | %%   +-----------------+       . | 
					
						
							|  |  |  | %%   |                 |       .  | 
					
						
							|  |  |  | %% ..+-----------------+..  .  + | 
					
						
							|  |  |  | %% . |.caption cell   .| .     | | 
					
						
							|  |  |  | %% . |    .       .    | .     | | 
					
						
							|  |  |  | %% . |        .        | .     |  | 
					
						
							|  |  |  | %% . |    .       .    | .     | | 
					
						
							|  |  |  | %% . |.               .| .     | | 
					
						
							|  |  |  | %% ..+-----------------+..  .  + | 
					
						
							|  |  |  | %%   |                 |     | 
					
						
							|  |  |  | %%   +-----------------+     | 
					
						
							| 
									
										
										
										
											2021-08-20 16:57:00 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% |<caption-cell>| occupies the same space as the image clipped by the  | 
					
						
							|  |  |  | %% containing cell and provides all the cell functionality. | 
					
						
							| 
									
										
										
										
											2021-08-19 23:53:01 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | %% If |captionclearparent| is set, the |<caption-cell>| will fit into an  | 
					
						
							|  |  |  | %% intersection between the image area and the parent cell padded by 
 | 
					
						
							|  |  |  | %% |captionclearparent|. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-15 21:08:42 +03:00
										 |  |  | %% This will write image path, page and size to |\jobname|.image-list,  | 
					
						
							| 
									
										
										
										
											2021-09-16 00:29:46 +03:00
										 |  |  | %% this is useful for final image pre-press.  | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% To disable image list set: | 
					
						
							| 
									
										
										
										
											2021-09-15 21:08:42 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %%	>> \writeimagelistfalse | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | % XXX do we need captionclearparent to be directional (a-la margin in adjustbox)??? | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | % XXX might be a good idea to split this into two parts: | 
					
						
							|  |  |  | %		- \aligncell{..} | 
					
						
							|  |  |  | %		- \imagecell{caption}{image} | 
					
						
							|  |  |  | %			-> size image
 | 
					
						
							|  |  |  | %			-> \aligncell{
 | 
					
						
							|  |  |  | %					image
 | 
					
						
							|  |  |  | %					caption} | 
					
						
							| 
									
										
										
										
											2021-08-31 08:27:37 +03:00
										 |  |  | % XXX document scale/offsettop/offsetleft... | 
					
						
							| 
									
										
										
										
											2021-08-19 23:53:01 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-15 21:08:42 +03:00
										 |  |  | % helpers... | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | % image size logging... | 
					
						
							|  |  |  | \newif\ifwriteimagelist | 
					
						
							|  |  |  | \writeimagelisttrue | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | \newwrite\photobook@imagelist | 
					
						
							|  |  |  | \def\photobook@logimagesize@setup{%
 | 
					
						
							|  |  |  | 	\immediate\openout\photobook@imagelist=\jobname.image-list% | 
					
						
							|  |  |  | 	\AfterEndDocument{%
 | 
					
						
							|  |  |  | 		\immediate\closeout\photobook@imagelist}% | 
					
						
							|  |  |  | 	% setup only once per job... | 
					
						
							|  |  |  | 	\global\def\photobook@logimagesize@setup{}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | %	>> \photobook@logimagesize{<path>}{<page>}{<imagebox>} | 
					
						
							|  |  |  | % XXX for some reason can't use \lenprint[mm]{..} in \write{..}... | 
					
						
							|  |  |  | \newcommand\photobook@logimagesize[3]{%
 | 
					
						
							|  |  |  | 	\ifwriteimagelist% | 
					
						
							|  |  |  | 		% first setup... | 
					
						
							|  |  |  | 		\photobook@logimagesize@setup% | 
					
						
							|  |  |  | 		% write... | 
					
						
							|  |  |  | 		\immediate\write\photobook@imagelist{%
 | 
					
						
							|  |  |  | 			#1: p#2: \the\wd#3\space x \the\ht#3}\fi}% | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-27 02:49:28 +03:00
										 |  |  | % 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. | 
					
						
							| 
									
										
										
										
											2021-08-20 01:22:17 +03:00
										 |  |  | \def\photobook@imagecell@top{0pt} | 
					
						
							|  |  |  | \def\photobook@imagecell@left{0pt} | 
					
						
							| 
									
										
										
										
											2021-08-23 21:06:22 +03:00
										 |  |  | \def\photobook@imagecell@captiontop{0pt} | 
					
						
							|  |  |  | \def\photobook@imagecell@captionleft{0pt} | 
					
						
							| 
									
										
										
										
											2021-08-23 19:26:51 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | \newlength\photobook@imagecell@clearance | 
					
						
							|  |  |  | \setlength\photobook@imagecell@clearance{0pt} | 
					
						
							| 
									
										
										
										
											2021-08-20 01:22:17 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-27 02:49:28 +03:00
										 |  |  | % NOTE: these feel like a hack... | 
					
						
							|  |  |  | \newlength\photobook@imagecell@imgratio | 
					
						
							|  |  |  | \newlength\photobook@imagecell@cellratio | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-20 01:22:17 +03:00
										 |  |  | % fit/fill... | 
					
						
							|  |  |  | \define@boolkey{imagecell@args}{fit}[true]{%
 | 
					
						
							|  |  |  | 	\KV@imagecell@args@fillfalse} | 
					
						
							|  |  |  | \define@boolkey{imagecell@args}{fill}[true]{%
 | 
					
						
							|  |  |  | 	\KV@imagecell@args@fitfalse} | 
					
						
							| 
									
										
										
										
											2021-08-19 23:53:01 +03:00
										 |  |  | % center... | 
					
						
							| 
									
										
										
										
											2021-08-20 01:22:17 +03:00
										 |  |  | \define@boolkey{imagecell@args}{center}[true]{%
 | 
					
						
							|  |  |  | 	\def\photobook@imagecell@top{\dimexpr 
 | 
					
						
							| 
									
										
										
										
											2021-08-19 23:53:01 +03:00
										 |  |  | 		+0.5\cellheight  | 
					
						
							|  |  |  | 		-0.5\ht\photobook@imagebox \relax}% | 
					
						
							| 
									
										
										
										
											2021-08-20 01:22:17 +03:00
										 |  |  | 	\def\photobook@imagecell@left{\dimexpr 
 | 
					
						
							| 
									
										
										
										
											2021-08-19 23:53:01 +03:00
										 |  |  | 		+0.5\cellwidth  | 
					
						
							|  |  |  | 		-0.5\wd\photobook@imagebox \relax}}% | 
					
						
							|  |  |  | % left/right... | 
					
						
							|  |  |  | % shortdands... | 
					
						
							| 
									
										
										
										
											2021-08-20 01:22:17 +03:00
										 |  |  | \newcommand\photobook@imagecell@LEFT{%
 | 
					
						
							|  |  |  | 	\def\photobook@imagecell@left{\dimexpr%
 | 
					
						
							| 
									
										
										
										
											2021-08-23 21:06:22 +03:00
										 |  |  | 		+\photobook@imagecell@clearance \relax}% | 
					
						
							|  |  |  | 	\def\photobook@imagecell@captionleft{
 | 
					
						
							|  |  |  | 		% XXX not sure why this branch is needed... | 
					
						
							|  |  |  | 		\ifKV@imagecell@args@fit | 
					
						
							|  |  |  | 			0pt | 
					
						
							|  |  |  | 		\else% | 
					
						
							|  |  |  | 			\dimexpr% | 
					
						
							|  |  |  | 				+\cellwidth  | 
					
						
							|  |  |  | 				-\photobook@imagecell@clearance | 
					
						
							|  |  |  | 				-\wd\photobook@imagebox \relax\fi}}% | 
					
						
							| 
									
										
										
										
											2021-08-20 01:22:17 +03:00
										 |  |  | \newcommand\photobook@imagecell@RIGHT{%
 | 
					
						
							|  |  |  | 	\def\photobook@imagecell@left{\dimexpr 
 | 
					
						
							| 
									
										
										
										
											2021-08-19 23:53:01 +03:00
										 |  |  | 		+\cellwidth  | 
					
						
							| 
									
										
										
										
											2021-08-20 01:22:17 +03:00
										 |  |  | 		-\photobook@imagecell@clearance | 
					
						
							| 
									
										
										
										
											2021-08-23 21:06:22 +03:00
										 |  |  | 		-\wd\photobook@imagebox \relax} | 
					
						
							|  |  |  | 	% XXX not sure why 0.5 but it seems to work... | 
					
						
							|  |  |  | 	\def\photobook@imagecell@captionleft{%
 | 
					
						
							|  |  |  | 		-0.5\photobook@imagecell@left}}% | 
					
						
							| 
									
										
										
										
											2021-08-19 23:53:01 +03:00
										 |  |  | % args... | 
					
						
							| 
									
										
										
										
											2021-08-20 01:22:17 +03:00
										 |  |  | \define@boolkey{imagecell@args}{left}[true]{%
 | 
					
						
							|  |  |  | 	\photobook@imagecell@LEFT} | 
					
						
							| 
									
										
										
										
											2021-08-20 16:57:00 +03:00
										 |  |  | \define@boolkey{imagecell@args}{right}[true]{%
 | 
					
						
							| 
									
										
										
										
											2021-08-20 01:22:17 +03:00
										 |  |  | 	\photobook@imagecell@RIGHT} | 
					
						
							| 
									
										
										
										
											2021-08-19 23:53:01 +03:00
										 |  |  | % inside/outside... | 
					
						
							| 
									
										
										
										
											2021-08-20 01:22:17 +03:00
										 |  |  | \define@boolkey{imagecell@args}{inside}[true]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | 	\ifthenelse{\isodd{\thepage}}{%
 | 
					
						
							| 
									
										
										
										
											2021-08-20 01:22:17 +03:00
										 |  |  | 		\photobook@imagecell@LEFT% | 
					
						
							| 
									
										
										
										
											2021-08-19 23:53:01 +03:00
										 |  |  | 	}{%
 | 
					
						
							| 
									
										
										
										
											2021-08-20 01:22:17 +03:00
										 |  |  | 		\photobook@imagecell@RIGHT}}% | 
					
						
							|  |  |  | \define@boolkey{imagecell@args}{outside}[true]{%
 | 
					
						
							| 
									
										
										
										
											2021-08-20 16:57:00 +03:00
										 |  |  | 	\ifthenelse{\isodd{\thepage}}{%
 | 
					
						
							| 
									
										
										
										
											2021-08-20 01:22:17 +03:00
										 |  |  | 		\photobook@imagecell@RIGHT% | 
					
						
							| 
									
										
										
										
											2021-08-19 23:53:01 +03:00
										 |  |  | 	}{%
 | 
					
						
							| 
									
										
										
										
											2021-08-20 01:22:17 +03:00
										 |  |  | 		\photobook@imagecell@LEFT}}% | 
					
						
							| 
									
										
										
										
											2021-08-19 23:53:01 +03:00
										 |  |  | % top/bottom... | 
					
						
							| 
									
										
										
										
											2021-08-20 01:22:17 +03:00
										 |  |  | \define@boolkey{imagecell@args}{top}[true]{%
 | 
					
						
							|  |  |  | 	\def\photobook@imagecell@top{%
 | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | 		\photobook@imagecell@clearance}% | 
					
						
							|  |  |  | 	\def\photobook@imagecell@captiontop{%
 | 
					
						
							| 
									
										
										
										
											2021-08-23 21:06:22 +03:00
										 |  |  | 		-\dimexpr  | 
					
						
							|  |  |  | 			+\cellheight  | 
					
						
							|  |  |  | 			-\ht\photobook@imagebox \relax}}% | 
					
						
							| 
									
										
										
										
											2021-08-20 01:22:17 +03:00
										 |  |  | \define@boolkey{imagecell@args}{bottom}[true]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-12 03:29:50 +03:00
										 |  |  | 	\def\photobook@imagecell@top{%
 | 
					
						
							|  |  |  | 		\dimexpr  | 
					
						
							|  |  |  | 			+\cellheight  | 
					
						
							|  |  |  | 			-\photobook@imagecell@clearance | 
					
						
							|  |  |  | 			-\ht\photobook@imagebox \relax}% | 
					
						
							| 
									
										
										
										
											2021-08-23 21:06:22 +03:00
										 |  |  | 	\def\photobook@imagecell@captiontop{%
 | 
					
						
							| 
									
										
										
										
											2021-09-12 03:29:50 +03:00
										 |  |  | 		\dimexpr | 
					
						
							|  |  |  | 			\photobook@imagecell@top  | 
					
						
							|  |  |  | 			+\photobook@imagecell@clearance \relax}}% | 
					
						
							| 
									
										
										
										
											2021-08-19 23:53:01 +03:00
										 |  |  | % clearance=<len>... | 
					
						
							| 
									
										
										
										
											2021-08-20 01:22:17 +03:00
										 |  |  | \define@key{imagecell@args}{clearance}{%
 | 
					
						
							| 
									
										
										
										
											2021-08-23 19:26:51 +03:00
										 |  |  | 	\setlength\photobook@imagecell@clearance{#1}}% | 
					
						
							| 
									
										
										
										
											2021-08-19 23:53:01 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-31 08:27:37 +03:00
										 |  |  | % offsettop=<len> / offsetleft=<len>... | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | % XXX DOC!!! | 
					
						
							| 
									
										
										
										
											2021-08-31 08:27:37 +03:00
										 |  |  | \newlength\photobook@imagecell@offsettop% | 
					
						
							|  |  |  | \setlength\photobook@imagecell@offsettop{0pt}% | 
					
						
							|  |  |  | \define@key{imagecell@args}{offsettop}[0pt]{%
 | 
					
						
							|  |  |  | 	\setlength\photobook@imagecell@offsettop{#1}}% | 
					
						
							|  |  |  | \newlength\photobook@imagecell@offsetleft% | 
					
						
							|  |  |  | \setlength\photobook@imagecell@offsetleft{0pt}% | 
					
						
							|  |  |  | \define@key{imagecell@args}{offsetleft}[0pt]{%
 | 
					
						
							|  |  |  | 	\setlength\photobook@imagecell@offsetleft{#1}}% | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | % scale=<num>... | 
					
						
							|  |  |  | \edef\photobook@imagecell@scale{1}% | 
					
						
							|  |  |  | \define@key{imagecell@args}{scale}[1]{%
 | 
					
						
							|  |  |  | 	\edef\photobook@imagecell@scale{#1}}% | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | % captionalign=t|c|b... | 
					
						
							| 
									
										
										
										
											2021-08-20 17:36:22 +03:00
										 |  |  | \def\photobook@imagecell@captionalign{t} | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | \define@choicekey{imagecell@args}{captionalign}{t,c,b}[t]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | 	\def\photobook@imagecell@captionalign{#1}} | 
					
						
							| 
									
										
										
										
											2021-08-20 17:36:22 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | % captionclearparent=<len>... | 
					
						
							|  |  |  | % XXX DOC!!! | 
					
						
							|  |  |  | \newif\ifphotobook@imagecell@captionclearparent | 
					
						
							|  |  |  | \newlength\photobook@imagecell@captionclearparent | 
					
						
							|  |  |  | \define@key{imagecell@args}{captionclearparent}[0pt]{%
 | 
					
						
							|  |  |  | 	\setlength\photobook@imagecell@captionclearparent{#1}% | 
					
						
							|  |  |  | 	\photobook@imagecell@captionclearparenttrue} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-19 23:53:01 +03:00
										 |  |  | % XXX can we make this an env??? | 
					
						
							| 
									
										
										
										
											2021-08-20 01:22:17 +03:00
										 |  |  | \newcommand\imagecell[3][]{%
 | 
					
						
							| 
									
										
										
										
											2021-08-20 01:42:20 +03:00
										 |  |  | 	\begingroup% | 
					
						
							| 
									
										
										
										
											2021-08-19 23:53:01 +03:00
										 |  |  | 		% args... | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | 		\setkeys{imagecell@args}{%
 | 
					
						
							| 
									
										
										
										
											2021-08-24 01:54:52 +03:00
										 |  |  | 			fit, | 
					
						
							|  |  |  | 			center, | 
					
						
							|  |  |  | 			clearance=0pt, | 
					
						
							|  |  |  | 			#1}% | 
					
						
							| 
									
										
										
										
											2021-08-19 23:53:01 +03:00
										 |  |  | 		% preload image... | 
					
						
							| 
									
										
										
										
											2021-08-20 01:22:17 +03:00
										 |  |  | 		% fit... | 
					
						
							|  |  |  | 		\ifKV@imagecell@args@fit% | 
					
						
							|  |  |  | 			\sbox{\photobook@imagebox}{%
 | 
					
						
							| 
									
										
										
										
											2021-08-20 01:42:20 +03:00
										 |  |  | 				\includegraphics[% | 
					
						
							| 
									
										
										
										
											2021-08-20 01:22:17 +03:00
										 |  |  | 					keepaspectratio,  | 
					
						
							| 
									
										
										
										
											2021-08-31 08:27:37 +03:00
										 |  |  | 					width=\photobook@imagecell@scale\dimexpr  | 
					
						
							| 
									
										
										
										
											2021-08-20 01:22:17 +03:00
										 |  |  | 						\cellwidth  | 
					
						
							|  |  |  | 						- ((\photobook@imagecell@clearance) * 2) \relax, | 
					
						
							| 
									
										
										
										
											2021-08-31 08:27:37 +03:00
										 |  |  | 					height=\photobook@imagecell@scale\dimexpr  | 
					
						
							| 
									
										
										
										
											2021-08-20 01:22:17 +03:00
										 |  |  | 						\cellheight  | 
					
						
							| 
									
										
										
										
											2021-08-20 16:57:00 +03:00
										 |  |  | 						- ((\photobook@imagecell@clearance) * 2) \relax]{#3}}% | 
					
						
							| 
									
										
										
										
											2021-08-20 01:22:17 +03:00
										 |  |  | 		% fill... | 
					
						
							|  |  |  | 		\else\ifKV@imagecell@args@fill% | 
					
						
							|  |  |  | 			% preload image to get its proportions... | 
					
						
							| 
									
										
										
										
											2021-09-11 14:52:30 +03:00
										 |  |  | 			\sbox{\photobook@imagebox}{\includegraphics{#3}}% | 
					
						
							| 
									
										
										
										
											2021-08-20 01:22:17 +03:00
										 |  |  | 			% constrain minimal dimension of image... | 
					
						
							| 
									
										
										
										
											2021-08-26 20:03:17 +03:00
										 |  |  | 			% 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?? | 
					
						
							| 
									
										
										
										
											2021-09-11 14:52:30 +03:00
										 |  |  | 			\setlength\photobook@imagecell@imgratio{%
 | 
					
						
							|  |  |  | 				1pt * \ratio{\wd\photobook@imagebox}{\ht\photobook@imagebox}}% | 
					
						
							|  |  |  | 			\setlength\photobook@imagecell@cellratio{%
 | 
					
						
							|  |  |  | 				1pt * \ratio{\cellwidth}{\cellheight}}% | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | 			\ifdim \photobook@imagecell@imgratio < \photobook@imagecell@cellratio% | 
					
						
							| 
									
										
										
										
											2021-08-20 01:22:17 +03:00
										 |  |  | 				\sbox{\photobook@imagebox}{%
 | 
					
						
							| 
									
										
										
										
											2021-08-20 01:42:20 +03:00
										 |  |  | 					\includegraphics[% | 
					
						
							| 
									
										
										
										
											2021-08-20 01:22:17 +03:00
										 |  |  | 						keepaspectratio,  | 
					
						
							| 
									
										
										
										
											2021-08-31 08:27:37 +03:00
										 |  |  | 						width=\photobook@imagecell@scale\dimexpr  | 
					
						
							| 
									
										
										
										
											2021-08-26 20:03:17 +03:00
										 |  |  | 							+ \cellwidth | 
					
						
							| 
									
										
										
										
											2021-08-20 01:42:20 +03:00
										 |  |  | 							- ((\photobook@imagecell@clearance) * 2) \relax]{#3}}% | 
					
						
							| 
									
										
										
										
											2021-08-20 01:22:17 +03:00
										 |  |  | 			\else% | 
					
						
							|  |  |  | 				\sbox{\photobook@imagebox}{%
 | 
					
						
							| 
									
										
										
										
											2021-08-20 01:42:20 +03:00
										 |  |  | 					\includegraphics[% | 
					
						
							| 
									
										
										
										
											2021-08-20 01:22:17 +03:00
										 |  |  | 						keepaspectratio,  | 
					
						
							| 
									
										
										
										
											2021-08-31 08:27:37 +03:00
										 |  |  | 						height=\photobook@imagecell@scale\dimexpr  | 
					
						
							| 
									
										
										
										
											2021-08-26 20:03:17 +03:00
										 |  |  | 							+ \cellheight  | 
					
						
							| 
									
										
										
										
											2021-09-11 14:52:30 +03:00
										 |  |  | 							- ((\photobook@imagecell@clearance) * 2) \relax]{#3}}% | 
					
						
							| 
									
										
										
										
											2021-09-12 03:29:50 +03:00
										 |  |  | 		\fi\fi\fi% | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | 		% | 
					
						
							|  |  |  | 		\setlength\celloffsetleft{%
 | 
					
						
							|  |  |  | 			\dimexpr  | 
					
						
							|  |  |  | 				\photobook@imagecell@offsetleft  | 
					
						
							|  |  |  | 				+ \photobook@imagecell@left \relax}% | 
					
						
							|  |  |  | 		\setlength\celloffsettop{%
 | 
					
						
							|  |  |  | 			\dimexpr  | 
					
						
							|  |  |  | 				\photobook@imagecell@offsettop | 
					
						
							|  |  |  | 				+ \photobook@imagecell@top \relax}% | 
					
						
							|  |  |  | 		% | 
					
						
							|  |  |  | 		% | 
					
						
							| 
									
										
										
										
											2021-08-20 01:22:17 +03:00
										 |  |  | 		% place image box... | 
					
						
							| 
									
										
										
										
											2021-08-19 23:53:01 +03:00
										 |  |  | 		% XXX for some odd reason without this the alignment completely breaks... | 
					
						
							|  |  |  | 		\vspace{0pt}% | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | 		\smash{\makebox[0pt][l]{%
 | 
					
						
							|  |  |  | 			\adjustbox{%
 | 
					
						
							|  |  |  | 					margin={\celloffsetleft} 0pt 0pt {\celloffsettop}, | 
					
						
							|  |  |  | 					valign=T}{%
 | 
					
						
							| 
									
										
										
										
											2021-09-15 21:08:42 +03:00
										 |  |  | 				\photobook@logimagesize{#3}{\thepage}{\photobook@imagebox}% | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | 				\usebox\photobook@imagebox}}}% | 
					
						
							|  |  |  | 		%  | 
					
						
							|  |  |  | 		% | 
					
						
							|  |  |  | 		% prepare for caption cell... | 
					
						
							|  |  |  | 		\setlength\cellparentwidth{\cellwidth}% | 
					
						
							|  |  |  | 		\setlength\cellparentheight{\cellheight}% | 
					
						
							|  |  |  | 		\setlength\cellwidth{%
 | 
					
						
							|  |  |  | 			\mindim{
 | 
					
						
							|  |  |  | 				\wd\photobook@imagebox | 
					
						
							|  |  |  | 				+ \mindim{\celloffsetleft}{0pt} | 
					
						
							|  |  |  | 			}{
 | 
					
						
							|  |  |  | 				\cellwidth}}% | 
					
						
							|  |  |  | 		\setlength\cellheight{%
 | 
					
						
							|  |  |  | 			\mindim{
 | 
					
						
							|  |  |  | 				\ht\photobook@imagebox | 
					
						
							|  |  |  | 				+ \mindim{\celloffsettop}{0pt} | 
					
						
							|  |  |  | 			}{
 | 
					
						
							|  |  |  | 				\cellheight}}%  | 
					
						
							|  |  |  | 		\setlength\celloffsetleft{%
 | 
					
						
							|  |  |  | 			\maxdim{\celloffsetleft}{0pt}}% | 
					
						
							|  |  |  | 		\setlength\celloffsettop{%
 | 
					
						
							|  |  |  | 			\maxdim{\celloffsettop}{0pt}}% | 
					
						
							|  |  |  | 		\setlength\clearance{\photobook@imagecell@clearance}% | 
					
						
							|  |  |  | 		% clear parent... | 
					
						
							|  |  |  | 		% XXX might be a good idea to put this into a special reusable cell... | 
					
						
							|  |  |  | 		\ifphotobook@imagecell@captionclearparent% | 
					
						
							|  |  |  | 			% trim vertical... | 
					
						
							|  |  |  | 			% XXX this seems overcomplicated... | 
					
						
							|  |  |  | 			\setlength\cellheight{%
 | 
					
						
							|  |  |  | 				\mindim{
 | 
					
						
							|  |  |  | 					\cellheight | 
					
						
							|  |  |  | 				% trim from both sides.... | 
					
						
							|  |  |  | 				}{\mindim{
 | 
					
						
							|  |  |  | 					\cellparentheight | 
					
						
							|  |  |  | 					- 2\photobook@imagecell@captionclearparent | 
					
						
							|  |  |  | 				% trim from bottom... | 
					
						
							|  |  |  | 				}{\mindim{
 | 
					
						
							|  |  |  | 					\cellheight | 
					
						
							|  |  |  | 					+ \celloffsettop | 
					
						
							|  |  |  | 					- \photobook@imagecell@captionclearparent | 
					
						
							|  |  |  | 				% trim from top... | 
					
						
							|  |  |  | 				}{
 | 
					
						
							|  |  |  | 					\cellparentheight | 
					
						
							|  |  |  | 					- \photobook@imagecell@captionclearparent  | 
					
						
							|  |  |  | 					- \celloffsettop}}}}% | 
					
						
							|  |  |  | 			% offset top... | 
					
						
							|  |  |  | 			\setlength\celloffsettop{
 | 
					
						
							|  |  |  | 				\maxdim{
 | 
					
						
							|  |  |  | 					\celloffsettop | 
					
						
							|  |  |  | 						+ (\photobook@imagecell@captionclearparent - \celloffsettop) | 
					
						
							|  |  |  | 				}{
 | 
					
						
							|  |  |  | 					\celloffsettop}}% | 
					
						
							|  |  |  | 			% trim horizontal... | 
					
						
							|  |  |  | 			% XXX this seems overcomplicated... | 
					
						
							|  |  |  | 			\setlength\cellwidth{%
 | 
					
						
							|  |  |  | 				\mindim{
 | 
					
						
							|  |  |  | 					\cellwidth | 
					
						
							|  |  |  | 				% trim from both sides.... | 
					
						
							|  |  |  | 				}{\mindim{
 | 
					
						
							|  |  |  | 					\cellparentwidth | 
					
						
							|  |  |  | 					- 2\photobook@imagecell@captionclearparent | 
					
						
							|  |  |  | 				% trim from right... | 
					
						
							|  |  |  | 				}{\mindim{
 | 
					
						
							|  |  |  | 					\cellwidth | 
					
						
							|  |  |  | 					+ \celloffsetleft | 
					
						
							|  |  |  | 					- \photobook@imagecell@captionclearparent | 
					
						
							|  |  |  | 				% trim from left... | 
					
						
							|  |  |  | 				}{
 | 
					
						
							|  |  |  | 					\cellparentwidth | 
					
						
							|  |  |  | 					- \photobook@imagecell@captionclearparent  | 
					
						
							|  |  |  | 					- \celloffsetleft}}}}% | 
					
						
							|  |  |  | 			% offset left... | 
					
						
							|  |  |  | 			\setlength\celloffsetleft{
 | 
					
						
							|  |  |  | 				\maxdim{
 | 
					
						
							|  |  |  | 					\celloffsetleft | 
					
						
							|  |  |  | 						+ (\photobook@imagecell@captionclearparent - \celloffsetleft) | 
					
						
							|  |  |  | 				}{
 | 
					
						
							|  |  |  | 					\celloffsetleft}}\fi% | 
					
						
							|  |  |  | 		% | 
					
						
							|  |  |  | 		% | 
					
						
							|  |  |  | 		% place caption box... | 
					
						
							|  |  |  | 		\smash{\makebox[0pt][l]{%
 | 
					
						
							|  |  |  | 			\adjustbox{%
 | 
					
						
							|  |  |  | 					%cfbox=gray 0.5pt 0pt 0pt, | 
					
						
							|  |  |  | 					margin={\celloffsetleft} 0pt 0pt {\celloffsettop}, | 
					
						
							|  |  |  | 					minipage=[b][\cellheight][\photobook@imagecell@captionalign]{\cellwidth}, | 
					
						
							|  |  |  | 					valign=T}{%
 | 
					
						
							|  |  |  | 				\ignorespaces% | 
					
						
							|  |  |  | 				#2}}}% | 
					
						
							| 
									
										
										
										
											2021-08-19 23:53:01 +03:00
										 |  |  | 	\endgroup} | 
					
						
							| 
									
										
										
										
											2021-08-18 22:15:03 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-20 17:36:22 +03:00
										 |  |  | %% \DescribeMacro{\captioncell\{..\}} | 
					
						
							|  |  |  | % | 
					
						
							| 
									
										
										
										
											2021-08-26 04:04:38 +03:00
										 |  |  | %% Caption cell | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-28 01:13:45 +03:00
										 |  |  | %% Placement: | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %%	>> \captioncell[<position>]{<caption>} | 
					
						
							|  |  |  | % | 
					
						
							| 
									
										
										
										
											2021-08-20 17:36:22 +03:00
										 |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-28 01:43:57 +03:00
										 |  |  | %%     over             | 
					
						
							| 
									
										
										
										
											2021-08-20 17:36:22 +03:00
										 |  |  | %%   +-----------------+ | 
					
						
							| 
									
										
										
										
											2021-08-28 01:43:57 +03:00
										 |  |  | %%   | top             | | 
					
						
							| 
									
										
										
										
											2021-08-20 17:36:22 +03:00
										 |  |  | %%   |                 | | 
					
						
							|  |  |  | %%   |                 | | 
					
						
							|  |  |  | %%   |                 | | 
					
						
							| 
									
										
										
										
											2021-08-28 01:43:57 +03:00
										 |  |  | %%   | center          | | 
					
						
							| 
									
										
										
										
											2021-08-20 17:36:22 +03:00
										 |  |  | %%   |                 | | 
					
						
							|  |  |  | %%   |                 | | 
					
						
							| 
									
										
										
										
											2021-08-26 04:04:38 +03:00
										 |  |  | %%   |                 | | 
					
						
							| 
									
										
										
										
											2021-08-28 01:43:57 +03:00
										 |  |  | %%   | bottom          | | 
					
						
							| 
									
										
										
										
											2021-08-20 17:36:22 +03:00
										 |  |  | %%   +-----------------+ | 
					
						
							| 
									
										
										
										
											2021-08-28 01:43:57 +03:00
										 |  |  | %%     under            | 
					
						
							| 
									
										
										
										
											2021-08-20 17:36:22 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-26 04:04:38 +03:00
										 |  |  | %% Default: | 
					
						
							|  |  |  | %%	>> \captioncell{<caption>} | 
					
						
							| 
									
										
										
										
											2021-08-28 01:13:45 +03:00
										 |  |  | %%	>> \captioncell[top]{<caption>} | 
					
						
							| 
									
										
										
										
											2021-08-26 04:04:38 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-28 01:13:45 +03:00
										 |  |  | %%	>> \captioncell[center]{<caption>} | 
					
						
							|  |  |  | %%	>> \captioncell[bottom]{<caption>} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%	>> \captioncell[over]{<caption>} | 
					
						
							|  |  |  | %%	>> \captioncell[under]{<caption>} | 
					
						
							| 
									
										
										
										
											2021-08-26 04:04:38 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-28 01:13:45 +03:00
										 |  |  | %% Horizontal alignment | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %%	>> \captioncell[align=<mode>]{<caption>} | 
					
						
							|  |  |  | % | 
					
						
							| 
									
										
										
										
											2021-08-26 04:04:38 +03:00
										 |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%   +-----------------+    +-----------------+    +-----------------+ | 
					
						
							|  |  |  | %%   |flushleft        |    |     center      |    |       flushright| | 
					
						
							|  |  |  | %%   |                 |    |                 |    |                 | | 
					
						
							|  |  |  | %%   |                 |    |                 |    |                 | | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-28 01:13:45 +03:00
										 |  |  | %% Default: | 
					
						
							|  |  |  | %%	>> \captioncell{<caption>} | 
					
						
							|  |  |  | %%	>> \captioncell[align=flushleft]{<caption>} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%	>> \captioncell[align=center]{<caption>} | 
					
						
							|  |  |  | %%	>> \captioncell[align=flushright]{<caption>} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | %% Note that a caption cell does not take up any space in the parent cell | 
					
						
							|  |  |  | %% so multiple captions can be used in combination with other elements. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | %% Note that caption cells currently do not play well with other content | 
					
						
							|  |  |  | %% in the same cell that takes up space, e.g. text, pictures, ...etc. | 
					
						
							|  |  |  | %% Captions are mainly suited to play well with image cells. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-24 01:54:52 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-28 13:28:15 +03:00
										 |  |  | % over / top / center / bottom / under... | 
					
						
							| 
									
										
										
										
											2021-08-25 14:01:41 +03:00
										 |  |  | \define@boolkey{captioncell@args}{over}[true]{%
 | 
					
						
							| 
									
										
										
										
											2021-08-24 01:54:52 +03:00
										 |  |  | 	\def\photobook@captioncell@format##1{%
 | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | 		\photobook@captioncell@formatalign[-\cellheight]{b}{##1}}} | 
					
						
							| 
									
										
										
										
											2021-08-24 01:54:52 +03:00
										 |  |  | \define@boolkey{captioncell@args}{top}[true]{%
 | 
					
						
							|  |  |  | 	\def\photobook@captioncell@format##1{%
 | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | 		\photobook@captioncell@formatalign{t}{##1}}} | 
					
						
							| 
									
										
										
										
											2021-08-24 01:54:52 +03:00
										 |  |  | \define@boolkey{captioncell@args}{center}[true]{%
 | 
					
						
							|  |  |  | 	\def\photobook@captioncell@format##1{%
 | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | 		\smash{\makebox[0pt][l]{%
 | 
					
						
							|  |  |  | 			\begin{minipage}[t][\cellheight][c]{\cellwidth}% | 
					
						
							|  |  |  | 			\begin{\photobook@captioncell@align}% | 
					
						
							|  |  |  | 				\ignorespaces% | 
					
						
							|  |  |  | 				##1% | 
					
						
							|  |  |  | 			\end{\photobook@captioncell@align}% | 
					
						
							|  |  |  | 			\end{minipage}}}}} | 
					
						
							| 
									
										
										
										
											2021-08-24 01:54:52 +03:00
										 |  |  | \define@boolkey{captioncell@args}{bottom}[true]{%
 | 
					
						
							|  |  |  | 	\def\photobook@captioncell@format##1{%
 | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | 		\photobook@captioncell@formatalign{b}{##1}}} | 
					
						
							| 
									
										
										
										
											2021-08-25 14:01:41 +03:00
										 |  |  | \define@boolkey{captioncell@args}{under}[true]{%
 | 
					
						
							| 
									
										
										
										
											2021-08-24 01:54:52 +03:00
										 |  |  | 	\def\photobook@captioncell@format##1{%
 | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | 		\photobook@captioncell@formatalign[\cellheight]{t}{##1}}} | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | % align=<len>... | 
					
						
							| 
									
										
										
										
											2021-08-24 01:54:52 +03:00
										 |  |  | \def\photobook@captioncell@align{} | 
					
						
							| 
									
										
										
										
											2021-08-28 01:13:45 +03:00
										 |  |  | % XXX for some reason \define@choicekey{..} does not expand macros... | 
					
						
							|  |  |  | %\define@choicekey{captioncell@args}{align}{flushleft,center,flushright}{%
 | 
					
						
							|  |  |  | \define@key{captioncell@args}{align}{%
 | 
					
						
							| 
									
										
										
										
											2021-08-24 01:54:52 +03:00
										 |  |  | 	\def\photobook@captioncell@align{#1}} | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | % margin=<len>... | 
					
						
							| 
									
										
										
										
											2021-08-24 01:54:52 +03:00
										 |  |  | \def\photobook@captioncell@margin{0pt} | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | \define@key{captioncell@args}{margin}{%
 | 
					
						
							| 
									
										
										
										
											2021-08-24 01:54:52 +03:00
										 |  |  | 	\def\photobook@captioncell@margin{#1}} | 
					
						
							| 
									
										
										
										
											2021-08-20 16:57:00 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | % helpers... | 
					
						
							|  |  |  | % XXX set minipage height to available cell height (???) | 
					
						
							|  |  |  | \newcommand\photobook@captioncell@formatalign[3][0pt]{%
 | 
					
						
							|  |  |  | 	\smash{\makebox[0pt][l]{%
 | 
					
						
							|  |  |  | 		\begin{minipage}[t][\cellheight][t]{\cellwidth}% | 
					
						
							|  |  |  | 			% XXX for some reason without this things get misaligned... | 
					
						
							|  |  |  | 			\vspace{#1}% | 
					
						
							|  |  |  | 			% XXX HACK: for some magical reason setting the above minipage to 'b'  | 
					
						
							|  |  |  | 			%		will make \vspace{..} above break... | 
					
						
							|  |  |  | 			%		...adding another nested minipage seems to fix the issue... | 
					
						
							|  |  |  | 			\begin{minipage}[t][\cellheight][#2]{\cellwidth}% | 
					
						
							|  |  |  | 				\begin{\photobook@captioncell@align}% | 
					
						
							|  |  |  | 					\ignorespaces% | 
					
						
							|  |  |  | 					#3% | 
					
						
							|  |  |  | 				\end{\photobook@captioncell@align}% | 
					
						
							|  |  |  | 			\end{minipage} | 
					
						
							|  |  |  | 		\end{minipage}}}} | 
					
						
							|  |  |  | % format... | 
					
						
							|  |  |  | \def\photobook@captioncell@format#1{%
 | 
					
						
							|  |  |  | 	\photobook@captioncell@formatalign{t}{#1}} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-20 16:57:00 +03:00
										 |  |  | \newcommand\captioncell[2][]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | 	\setkeys{captioncell@args}{
 | 
					
						
							|  |  |  | 		top,  | 
					
						
							|  |  |  | 		align=flushright,  | 
					
						
							|  |  |  | 		margin=1pt,  | 
					
						
							|  |  |  | 		#1}% | 
					
						
							| 
									
										
										
										
											2021-08-24 01:54:52 +03:00
										 |  |  | 	\photobook@captioncell@format{%
 | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | 		\adjustbox{margin=\photobook@captioncell@margin}{#2}}% | 
					
						
							|  |  |  | 	\ignorespaces} | 
					
						
							| 
									
										
										
										
											2021-08-24 01:54:52 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-20 16:57:00 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-28 01:13:45 +03:00
										 |  |  | %% \DescribeMacro{\vcaptioncell\{..\}} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% Vertical caption cell | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-28 01:43:57 +03:00
										 |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%   (topdown)                   (bottomup) | 
					
						
							|  |  |  | %%     +-----------------+         +-----------------+ | 
					
						
							|  |  |  | %%   b | l      c      r | a       |                 | | 
					
						
							|  |  |  | %%   e | e      e      i | f       |                 | | 
					
						
							|  |  |  | %%   f | f      n      g | t       |                 | | 
					
						
							|  |  |  | %%   o | t      t      h | e     e |        r        | | 
					
						
							|  |  |  | %%   r |        e      t | r     r |        e      t | r | 
					
						
							|  |  |  | %%   e |        r        |       o | t      t      h | e | 
					
						
							|  |  |  | %%     |                 |       f | f      n      g | t | 
					
						
							|  |  |  | %%     |                 |       e | e      e      i | f | 
					
						
							|  |  |  | %%     |                 |       b | l      c      r | a | 
					
						
							|  |  |  | %%     +-----------------+         +-----------------+ | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% See samples for better illustration. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | % bottomup / topdown... | 
					
						
							|  |  |  | \def\photobook@vcaptioncell@orientation{bottomup} | 
					
						
							|  |  |  | \define@boolkey{vcaptioncell@args}{bottomup}[true]{%
 | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | 	\KV@vcaptioncell@args@topdownfalse% | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | 	\def\photobook@vcaptioncell@orientation{bottomup}} | 
					
						
							|  |  |  | \define@boolkey{vcaptioncell@args}{topdown}[true]{%
 | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | 	\KV@vcaptioncell@args@bottomupfalse% | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | 	\def\photobook@vcaptioncell@orientation{topdown}} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-28 13:28:15 +03:00
										 |  |  | % before / left / center / right / after... | 
					
						
							| 
									
										
										
										
											2021-08-28 01:13:45 +03:00
										 |  |  | \def\photobook@vcaptioncell@position{top} | 
					
						
							|  |  |  | \define@boolkey{vcaptioncell@args}{before}[true]{%
 | 
					
						
							|  |  |  | 	\def\photobook@vcaptioncell@position{%
 | 
					
						
							| 
									
										
										
										
											2021-08-29 07:03:36 +03:00
										 |  |  | 		\ifKV@vcaptioncell@args@bottomup% | 
					
						
							| 
									
										
										
										
											2021-08-28 01:13:45 +03:00
										 |  |  | 			over% | 
					
						
							|  |  |  | 		\else% | 
					
						
							|  |  |  | 			under\fi}} | 
					
						
							|  |  |  | \define@boolkey{vcaptioncell@args}{left}[true]{%
 | 
					
						
							|  |  |  | 	\def\photobook@vcaptioncell@position{%
 | 
					
						
							| 
									
										
										
										
											2021-08-29 07:03:36 +03:00
										 |  |  | 		\ifKV@vcaptioncell@args@bottomup% | 
					
						
							| 
									
										
										
										
											2021-08-28 01:13:45 +03:00
										 |  |  | 			top% | 
					
						
							|  |  |  | 		\else% | 
					
						
							|  |  |  | 			bottom\fi}} | 
					
						
							|  |  |  | \define@boolkey{vcaptioncell@args}{center}[true]{%
 | 
					
						
							|  |  |  | 	\def\photobook@vcaptioncell@position{center}} | 
					
						
							|  |  |  | \define@boolkey{vcaptioncell@args}{right}[true]{%
 | 
					
						
							|  |  |  | 	\def\photobook@vcaptioncell@position{%
 | 
					
						
							| 
									
										
										
										
											2021-08-29 07:03:36 +03:00
										 |  |  | 		\ifKV@vcaptioncell@args@bottomup% | 
					
						
							| 
									
										
										
										
											2021-08-28 01:13:45 +03:00
										 |  |  | 			bottom% | 
					
						
							|  |  |  | 		\else% | 
					
						
							|  |  |  | 			top\fi}} | 
					
						
							|  |  |  | \define@boolkey{vcaptioncell@args}{after}[true]{%
 | 
					
						
							|  |  |  | 	\def\photobook@vcaptioncell@position{%
 | 
					
						
							| 
									
										
										
										
											2021-08-29 07:03:36 +03:00
										 |  |  | 		\ifKV@vcaptioncell@args@bottomup% | 
					
						
							| 
									
										
										
										
											2021-08-28 01:13:45 +03:00
										 |  |  | 			under% | 
					
						
							|  |  |  | 		\else% | 
					
						
							|  |  |  | 			over\fi}} | 
					
						
							| 
									
										
										
										
											2021-08-28 13:28:15 +03:00
										 |  |  | % align... | 
					
						
							| 
									
										
										
										
											2021-08-28 01:13:45 +03:00
										 |  |  | \def\photobook@vcaptioncell@align{} | 
					
						
							|  |  |  | % XXX for some reason \define@choicekey{..} does not expand macros... | 
					
						
							|  |  |  | %\define@choicekey{vcaptioncell@args}{align}{flushleft,center,flushright}{%
 | 
					
						
							|  |  |  | \define@key{vcaptioncell@args}{align}{%
 | 
					
						
							|  |  |  | 	\def\photobook@vcaptioncell@align{#1}} | 
					
						
							| 
									
										
										
										
											2021-08-28 13:28:15 +03:00
										 |  |  | % margin... | 
					
						
							| 
									
										
										
										
											2021-08-28 01:13:45 +03:00
										 |  |  | \def\photobook@vcaptioncell@margin{0pt} | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | \define@key{vcaptioncell@args}{margin}{%
 | 
					
						
							| 
									
										
										
										
											2021-08-28 01:13:45 +03:00
										 |  |  | 	\def\photobook@vcaptioncell@margin{#1}} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-01 04:05:31 +03:00
										 |  |  | % valign | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | \def\photobook@vcaptioncell@valign{%
 | 
					
						
							|  |  |  | 	\ifKV@vcaptioncell@args@bottomup% | 
					
						
							|  |  |  | 		b% | 
					
						
							|  |  |  | 	\else% | 
					
						
							|  |  |  | 		t\fi} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-28 01:13:45 +03:00
										 |  |  | \newcommand\vcaptioncell[2][]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | 	\setkeys{vcaptioncell@args}{
 | 
					
						
							|  |  |  | 		left,  | 
					
						
							|  |  |  | 		bottomup,  | 
					
						
							|  |  |  | 		align=flushleft,  | 
					
						
							|  |  |  | 		margin=1pt,  | 
					
						
							|  |  |  | 		#1}% | 
					
						
							| 
									
										
										
										
											2021-08-28 01:13:45 +03:00
										 |  |  | 	% | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | 	\smash{\makebox[0pt][l]{%
 | 
					
						
							|  |  |  | 		\begin{minipage}[t][\cellheight][\photobook@vcaptioncell@valign]{\cellwidth}% | 
					
						
							|  |  |  | 		\begin{\photobook@vcaptioncell@orientation}% | 
					
						
							|  |  |  | 			\captioncell[% | 
					
						
							|  |  |  | 					\photobook@vcaptioncell@position, | 
					
						
							|  |  |  | 					align=\photobook@vcaptioncell@align, | 
					
						
							|  |  |  | 					margin=\photobook@vcaptioncell@margin]{#2}% | 
					
						
							|  |  |  | 		\end{\photobook@vcaptioncell@orientation}% | 
					
						
							|  |  |  | 		\end{minipage}}}% | 
					
						
							|  |  |  | 	\ignorespaces} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | %% \DescribeMacro{\rcaptioncell\{..\}} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% \EXPERIMENTAL | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-31 16:25:50 +03:00
										 |  |  | %% Upside-down caption cell. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | % XXX a bit off... | 
					
						
							|  |  |  | \newcommand\rcaptioncell[2][]{%
 | 
					
						
							|  |  |  | 		\captioncell[align=flushleft, #1]{%
 | 
					
						
							|  |  |  | 			\begin{turn}{180}% | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | 				% XXX HACK: RAISEBOX -- need to shift by x-height... | 
					
						
							| 
									
										
										
										
											2021-08-31 16:25:50 +03:00
										 |  |  | 				%		...currently this is set to 1/(golden ratio) would | 
					
						
							|  |  |  | 				%		be nice to make this parametric / font-derived... | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | 				\raisebox{1ex * \real{-0.618033988749855}}{#2}% | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | 			\end{turn}}% | 
					
						
							|  |  |  | 	\ignorespaces} | 
					
						
							| 
									
										
										
										
											2021-08-28 01:13:45 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-01 04:05:31 +03:00
										 |  |  | %% \DescribeMacro{\captionblockcell\{..\}} | 
					
						
							|  |  |  | % | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | %% Add caption into a box left/right of current cell. | 
					
						
							| 
									
										
										
										
											2021-09-01 04:05:31 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-03 16:32:03 +03:00
										 |  |  | %%    celloffsetleft                celloffsetleft | 
					
						
							|  |  |  | %%   <------->                     v  | 
					
						
							|  |  |  | %%   .        <-------------->     .<-------------> cellwidth | 
					
						
							|  |  |  | %%   <------------------------>    <------------------------> cellparentwidth | 
					
						
							|  |  |  | %%   .       ..              ..    ..             .         . | 
					
						
							|  |  |  | %%   +------------------------+    +------------------------+  | 
					
						
							|  |  |  | %%   |                        |    |                        |  | 
					
						
							|  |  |  | %%   |                        |    |                        |  | 
					
						
							|  |  |  | %%   |+-------++ - - - - - - +|    |+ - - - - - - ++-------+|  | 
					
						
							|  |  |  | %%   ||       |.             .|    |.             .|       ||  | 
					
						
							|  |  |  | %%   ||       |.             .|    |.             .|       ||  | 
					
						
							|  |  |  | %%   ||  cap. |.     cell    .|    |.    cell     .|  cap. ||  | 
					
						
							|  |  |  | %%   ||       |.             .|    |.             .|       ||  | 
					
						
							|  |  |  | %%   ||       |.             .|    |.             .|       ||  | 
					
						
							|  |  |  | %%   |+-------++ - - - - - - +|    |+ - - - - - - ++-------+|  | 
					
						
							|  |  |  | %%   |                        |    |                        |  | 
					
						
							|  |  |  | %%   |                        |    |                        |  | 
					
						
							|  |  |  | %%   +------------------------+    +------------------------+  | 
					
						
							|  |  |  | %%   <> clearcaption                              ..       <> clearcaption | 
					
						
							|  |  |  | %%            <> spacing                          <> spacing | 
					
						
							| 
									
										
										
										
											2021-09-01 04:05:31 +03:00
										 |  |  | %%                               | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							|  |  |  | %%                               | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | % XXX make captions clear top/bottom of page... | 
					
						
							| 
									
										
										
										
											2021-08-28 01:43:57 +03:00
										 |  |  | % XXX need to do a caption block -- a cell to one side of an image to the  | 
					
						
							|  |  |  | % 		end of the page... | 
					
						
							| 
									
										
										
										
											2021-08-31 16:25:50 +03:00
										 |  |  | % XXX can we use the normal caption and simply insert a minipage of the  | 
					
						
							|  |  |  | %		appropriate width??? | 
					
						
							| 
									
										
										
										
											2021-09-01 04:05:31 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | \newlength\photobook@captionblockcell@tmplen | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | % left / right | 
					
						
							| 
									
										
										
										
											2021-09-01 04:05:31 +03:00
										 |  |  | \define@boolkey{captionblockcell@args}{left}[true]{%
 | 
					
						
							|  |  |  | 	\KV@captionblockcell@args@rightfalse} | 
					
						
							|  |  |  | \define@boolkey{captionblockcell@args}{right}[true]{%
 | 
					
						
							|  |  |  | 	\KV@captionblockcell@args@leftfalse} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | % align=flushright|center|flushright | 
					
						
							| 
									
										
										
										
											2021-09-01 04:05:31 +03:00
										 |  |  | % XXX this should depend on left/right... | 
					
						
							| 
									
										
										
										
											2021-09-02 16:22:53 +03:00
										 |  |  | \def\photobook@captionblockcell@align{%
 | 
					
						
							|  |  |  | 	\ifKV@captionblockcell@args@left% | 
					
						
							|  |  |  | 		flushright% | 
					
						
							|  |  |  | 	\else% | 
					
						
							|  |  |  | 		flushleft\fi} | 
					
						
							| 
									
										
										
										
											2021-09-01 04:05:31 +03:00
										 |  |  | \define@key{captionblockcell@args}{align}{%
 | 
					
						
							| 
									
										
										
										
											2021-09-02 16:22:53 +03:00
										 |  |  | 	\def\photobook@captionblockcell@align{#1}} | 
					
						
							| 
									
										
										
										
											2021-09-01 04:05:31 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | % valign=t|c|b | 
					
						
							| 
									
										
										
										
											2021-09-01 04:05:31 +03:00
										 |  |  | % XXX should be a boolkey -- t|c|b??? | 
					
						
							|  |  |  | \edef\photobook@captionblockcell@valign{b} | 
					
						
							|  |  |  | \define@key{captionblockcell@args}{valign}{%
 | 
					
						
							|  |  |  | 	\edef\photobook@captionblockcell@valign{#1}} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-03 16:32:03 +03:00
										 |  |  | % clearance=<len> (defaults: \clearcaption) | 
					
						
							| 
									
										
										
										
											2021-09-01 04:05:31 +03:00
										 |  |  | \newlength\photobook@captionblockcell@clearance | 
					
						
							|  |  |  | \define@key{captionblockcell@args}{clearance}{%
 | 
					
						
							|  |  |  | 	\setlength\photobook@captionblockcell@clearance{#1}} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | % XXX should this clear only top/bottom or all sides??? | 
					
						
							|  |  |  | % XXX doc!! | 
					
						
							|  |  |  | % XXX do we need this here??? | 
					
						
							|  |  |  | \define@boolkey{captionblockcell@args}{constraintoparent}[true]{} | 
					
						
							|  |  |  | \newlength\photobook@captionblockcell@clearparent | 
					
						
							|  |  |  | \setlength\photobook@captionblockcell@clearparent{0pt} | 
					
						
							|  |  |  | \define@key{captionblockcell@args}{clearparent}{%
 | 
					
						
							|  |  |  | 	\setlength\photobook@captionblockcell@clearparent{#1}% | 
					
						
							|  |  |  | 	\KV@captionblockcell@args@constraintoparenttrue} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-14 11:06:57 +03:00
										 |  |  | % spacing=<len> | 
					
						
							| 
									
										
										
										
											2021-09-03 16:32:03 +03:00
										 |  |  | \newlength\photobook@captionblockcell@spacing | 
					
						
							|  |  |  | \setlength\photobook@captionblockcell@spacing{0pt} | 
					
						
							|  |  |  | \define@key{captionblockcell@args}{spacing}{%
 | 
					
						
							|  |  |  | 	\setlength\photobook@captionblockcell@spacing{#1}} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | % width=<len> | 
					
						
							| 
									
										
										
										
											2021-09-01 04:05:31 +03:00
										 |  |  | \newlength\photobook@captionblockcell@width
 | 
					
						
							|  |  |  | \setlength\photobook@captionblockcell@width{0pt} | 
					
						
							|  |  |  | \define@key{captionblockcell@args}{width}{%
 | 
					
						
							|  |  |  | 	\setlength\photobook@captionblockcell@width{#1}} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | % showbox | 
					
						
							|  |  |  | \define@boolkey{captionblockcell@args}{showbox}[true]{} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | \newcommand\photobook@captionblockcell@content[2][0pt]{%
 | 
					
						
							|  |  |  | 	\hspace{\celloffsetleft}{%
 | 
					
						
							|  |  |  | 		\begin{adjustbox}{
 | 
					
						
							|  |  |  | 				% NOTE: we need to draw the border before we set margins  | 
					
						
							|  |  |  | 				%		to show the original box... | 
					
						
							|  |  |  | 				fbox=#1 0pt 0pt, | 
					
						
							|  |  |  | 				margin=0pt 0pt 0pt \celloffsettop, | 
					
						
							|  |  |  | 				minipage=[t][\cellheight][\photobook@captionblockcell@valign]{\cellwidth}, | 
					
						
							|  |  |  | 				valign=T}% | 
					
						
							|  |  |  | 		\begin{\photobook@captionblockcell@align}% | 
					
						
							|  |  |  | 			\ignorespaces% | 
					
						
							|  |  |  | 			#2% | 
					
						
							|  |  |  | 		\end{\photobook@captionblockcell@align}% | 
					
						
							|  |  |  | 		\end{adjustbox}}} | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | % XXX revise how \clearance is handled... | 
					
						
							| 
									
										
										
										
											2021-09-01 04:05:31 +03:00
										 |  |  | % XXX do we need top/bottom boxes??? | 
					
						
							|  |  |  | %		...if yes do we need lop/left, top/right, bottom/left and bottom/right??? | 
					
						
							|  |  |  | % XXX should we keep within parent cell if imagecell has negative clearance??? | 
					
						
							|  |  |  | % XXX need to auto-place within images via \offsetleft... | 
					
						
							|  |  |  | % XXX add tweak support... | 
					
						
							| 
									
										
										
										
											2021-08-31 08:27:37 +03:00
										 |  |  | \newcommand\captionblockcell[2][]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-01 04:05:31 +03:00
										 |  |  | 	% XXX should this be within the group??? | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | 	\setkeys{captionblockcell@args}{%
 | 
					
						
							| 
									
										
										
										
											2021-09-01 04:05:31 +03:00
										 |  |  | 		left,  | 
					
						
							|  |  |  | 		valign=b, | 
					
						
							|  |  |  | 		clearance=\clearcaption,  | 
					
						
							| 
									
										
										
										
											2021-09-03 16:32:03 +03:00
										 |  |  | 		spacing=\captioncellspacing, | 
					
						
							| 
									
										
										
										
											2021-09-01 04:05:31 +03:00
										 |  |  | 		#1}% | 
					
						
							|  |  |  | 	% | 
					
						
							|  |  |  | 	\smash{\makebox[0pt][l]{%
 | 
					
						
							|  |  |  | 		\begingroup% | 
					
						
							|  |  |  | 			% setup cell context... | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | 			\setlength\clearcaption{%
 | 
					
						
							|  |  |  | 				\photobook@captionblockcell@clearance}% | 
					
						
							| 
									
										
										
										
											2021-09-01 04:05:31 +03:00
										 |  |  | 			\setlength\photobook@captionblockcell@tmplen{\cellwidth}% | 
					
						
							|  |  |  | 			\setlength\cellwidth{%
 | 
					
						
							|  |  |  | 				\ifnum \photobook@captionblockcell@width = 0% | 
					
						
							|  |  |  | 					\dimexpr  | 
					
						
							| 
									
										
										
										
											2021-09-03 16:32:03 +03:00
										 |  |  | 						\cellparentwidth  | 
					
						
							|  |  |  | 						- \photobook@captionblockcell@spacing | 
					
						
							|  |  |  | 						- \cellwidth  | 
					
						
							|  |  |  | 						- \clearcaption  | 
					
						
							|  |  |  | 						% XXX this is only present in images... | 
					
						
							|  |  |  | 						- \clearance \relax% | 
					
						
							| 
									
										
										
										
											2021-09-01 04:05:31 +03:00
										 |  |  | 				\else% | 
					
						
							|  |  |  | 					\photobook@captionblockcell@width\fi}% | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | 			\setlength\cellparentwidth{%
 | 
					
						
							|  |  |  | 				\photobook@captionblockcell@tmplen}% | 
					
						
							| 
									
										
										
										
											2021-09-01 04:05:31 +03:00
										 |  |  | 			\setlength\celloffsetleft{%
 | 
					
						
							|  |  |  | 				\ifKV@captionblockcell@args@left% | 
					
						
							| 
									
										
										
										
											2021-09-03 16:32:03 +03:00
										 |  |  | 					\dimexpr | 
					
						
							|  |  |  | 						- \cellwidth% | 
					
						
							|  |  |  | 						- \photobook@captionblockcell@spacing \relax% | 
					
						
							| 
									
										
										
										
											2021-09-01 04:05:31 +03:00
										 |  |  | 				\else% | 
					
						
							| 
									
										
										
										
											2021-09-03 16:32:03 +03:00
										 |  |  | 					\dimexpr | 
					
						
							|  |  |  | 						\cellparentwidth | 
					
						
							|  |  |  | 						+ \photobook@captionblockcell@spacing \relax% | 
					
						
							|  |  |  | 					\fi}% | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | 			% clear parent... | 
					
						
							|  |  |  | 			% XXX do we need this here??? | 
					
						
							|  |  |  | 			\ifKV@captionblockcell@args@constraintoparent% | 
					
						
							|  |  |  | 				% offset top... | 
					
						
							|  |  |  | 				\setlength\celloffsettop{%
 | 
					
						
							|  |  |  | 					\mindim{
 | 
					
						
							|  |  |  | 						\photobook@captionblockcell@clearparent - \celloffsettop | 
					
						
							|  |  |  | 					}{
 | 
					
						
							|  |  |  | 						\photobook@captionblockcell@clearparent}}% | 
					
						
							|  |  |  | 				% trim cell top...  | 
					
						
							|  |  |  | 				\ifdim \celloffsettop > 0pt% | 
					
						
							|  |  |  | 					\setlength\cellheight{%
 | 
					
						
							|  |  |  | 						\cellheight - \celloffsettop}\fi% | 
					
						
							|  |  |  | 				% trim cell bottom... | 
					
						
							|  |  |  | 				\ifdim \dimexpr  | 
					
						
							|  |  |  | 							\cellheight  | 
					
						
							|  |  |  | 							+ \celloffsettop \relax% | 
					
						
							|  |  |  | 						> \dimexpr  | 
					
						
							|  |  |  | 							\cellparentheight  | 
					
						
							|  |  |  | 							- \photobook@captionblockcell@clearparent \relax% | 
					
						
							|  |  |  | 					\setlength\cellheight{%
 | 
					
						
							|  |  |  | 						\dimexpr | 
					
						
							|  |  |  | 							\cellparentheight  | 
					
						
							|  |  |  | 								- \mindim{
 | 
					
						
							|  |  |  | 									\cellheight - \cellparentheight | 
					
						
							|  |  |  | 								}{
 | 
					
						
							|  |  |  | 									2\photobook@captionblockcell@clearparent} \relax}\fi% | 
					
						
							|  |  |  | 			% do not clear parent... | 
					
						
							|  |  |  | 			\else% | 
					
						
							|  |  |  | 				\setlength\celloffsettop{0pt}\fi% | 
					
						
							| 
									
										
										
										
											2021-09-01 04:05:31 +03:00
										 |  |  | 			% | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | 			% place... | 
					
						
							|  |  |  | 			\ifKV@captionblockcell@args@showbox% | 
					
						
							|  |  |  | 				\photobook@captionblockcell@content[0.1pt]{#2}% | 
					
						
							|  |  |  | 			\else% | 
					
						
							|  |  |  | 				\photobook@captionblockcell@content{#2}\fi% | 
					
						
							| 
									
										
										
										
											2021-09-01 04:05:31 +03:00
										 |  |  | 		\endgroup}}% | 
					
						
							|  |  |  | 	\ignorespaces} | 
					
						
							| 
									
										
										
										
											2021-08-28 01:43:57 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-16 06:34:22 +03:00
										 |  |  | % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 
					
						
							|  |  |  | %%%%% Paper cells | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %% Paper and page cells are very similar but differ in one aspect -- paper | 
					
						
							|  |  |  | %% cells represent the paper as indicated by |layoutmode=<layout>| while
 | 
					
						
							|  |  |  | %% page cells are always the size of the page block, i.e. |layoutmode=block|. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-16 06:34:22 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | %% \DescribeEnv{papercell} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% Paper cell. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | %% This does not include bleeds. | 
					
						
							| 
									
										
										
										
											2021-08-16 06:34:22 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | \newenvironment{papercell}{%
 | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | 	\begin{cell*}{\bleed, \bleed}{\blockwidth}{\blockheight}% | 
					
						
							| 
									
										
										
										
											2021-08-16 06:34:22 +03:00
										 |  |  | }{%
 | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | 	\end{cell*}} | 
					
						
							| 
									
										
										
										
											2021-08-16 06:34:22 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | %% \DescribeEnv{paperbleedcell} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% Paper bleed cell. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% Like |papercell| but includes bleeds. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | \newenvironment{paperbleedcell}{%
 | 
					
						
							| 
									
										
										
										
											2021-09-26 01:04:41 +03:00
										 |  |  | 	\begin{cell*}{0pt, 0pt}{\bleedblockwidth}{\bleedblockheight}% | 
					
						
							| 
									
										
										
										
											2021-08-16 06:34:22 +03:00
										 |  |  | }{%
 | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | 	\end{cell*}} | 
					
						
							| 
									
										
										
										
											2021-08-16 06:34:22 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 
					
						
							|  |  |  | %%%%% Page cells | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %% Page cells always correspond to the page block size, i.e. |layoutmode=block|  | 
					
						
							|  |  |  | %% regardless of the actual |layoutmode| set currently. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-16 06:34:22 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | %% \DescribeEnv{pagecell} | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | %% \DescribeEnv{pagecell*} | 
					
						
							| 
									
										
										
										
											2021-08-16 06:34:22 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %% Page cell.  | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% This corresponds to the visible page in the |layoutmode=block| and 
 | 
					
						
							|  |  |  | %% does not include bleeds. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-07 01:29:37 +03:00
										 |  |  | %%   <-> bleed         <-> bleed | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%   + - - - - - - - - - +    + bleed | 
					
						
							|  |  |  | %%   . +---------------+ .    v | 
					
						
							|  |  |  | %%   . |               | .    | 
					
						
							|  |  |  | %%   . |               | .    | 
					
						
							|  |  |  | %%   . |   pagecell    | .    | 
					
						
							|  |  |  | %%   . |               | .    | 
					
						
							|  |  |  | %%   . |               | .    | 
					
						
							|  |  |  | %%   . +---------------+ .    + bleed | 
					
						
							|  |  |  | %%   + - - - - - - - - - +    v | 
					
						
							| 
									
										
										
										
											2021-08-16 06:34:22 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | %% The star version accounts for |\bindingoffset|.  | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-16 06:34:22 +03:00
										 |  |  | %% Note that |layoutmode|'s other than block will change the paper size 
 | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | %% but will not affect this either in size (block size) or in position 
 | 
					
						
							|  |  |  | %% (top-left). | 
					
						
							| 
									
										
										
										
											2021-08-16 06:34:22 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | % XXX should there be a way to position this is layout modes other than block??? | 
					
						
							| 
									
										
										
										
											2021-08-16 06:34:22 +03:00
										 |  |  | \newenvironment{pagecell}{%
 | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | 	\begin{cell*}{\bleed,\bleed}{\pageblockwidth}{\pageblockheight}% | 
					
						
							| 
									
										
										
										
											2021-08-16 06:34:22 +03:00
										 |  |  | }{%
 | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | 	\end{cell*}} | 
					
						
							| 
									
										
										
										
											2021-08-16 06:34:22 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | \newenvironment{pagecell*}{%
 | 
					
						
							|  |  |  | 	\begin{cell*}{%
 | 
					
						
							| 
									
										
										
										
											2021-09-26 01:04:41 +03:00
										 |  |  | 			\bleed + \ifnumodd{\thepage}{\bindingoffset}{0pt},% | 
					
						
							|  |  |  | 			\bleed}% | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | 		{\pageblockwidth - \bindingoffset}% | 
					
						
							|  |  |  | 		{\pageblockheight}% | 
					
						
							|  |  |  | }{%
 | 
					
						
							|  |  |  | 	\end{cell*}} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-16 06:34:22 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | %% \DescribeEnv{pagebleedcell} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% Like |page| but includes bleeds. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-07 01:29:37 +03:00
										 |  |  | %%   <-> bleed         <-> bleed | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%   +-------------------+    + bleed   | 
					
						
							|  |  |  | %%   | + - - - - - - - + |    v         | 
					
						
							|  |  |  | %%   | .               . |              | 
					
						
							|  |  |  | %%   | .               . |              | 
					
						
							|  |  |  | %%   | . pagebleedcell . |              | 
					
						
							|  |  |  | %%   | .               . |              | 
					
						
							|  |  |  | %%   | .               . |              | 
					
						
							|  |  |  | %%   | + - - - - - - - + |    + bleed   | 
					
						
							|  |  |  | %%   +-------------------+    v         | 
					
						
							| 
									
										
										
										
											2021-08-16 06:34:22 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | %% Note that as with |pagecell| this is not affected by |layoutmode|. | 
					
						
							| 
									
										
										
										
											2021-08-16 06:34:22 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | \newenvironment{pagebleedcell}{%
 | 
					
						
							| 
									
										
										
										
											2021-09-26 01:04:41 +03:00
										 |  |  | 	\begin{cell*}{0pt, 0pt}{\bleedblockwidth}{\bleedblockheight}% | 
					
						
							| 
									
										
										
										
											2021-08-16 06:34:22 +03:00
										 |  |  | }{%
 | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | 	\end{cell*}} | 
					
						
							| 
									
										
										
										
											2021-08-13 15:09:38 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-26 20:03:17 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | % XXX EXPERIMENTAL / TEST... | 
					
						
							| 
									
										
										
										
											2021-08-26 20:03:17 +03:00
										 |  |  | \NewEnviron{shipoutbgcell}{%
 | 
					
						
							|  |  |  | 	\AddToShipoutPictureBG*{%
 | 
					
						
							|  |  |  | 		\begin{pagecell}% | 
					
						
							|  |  |  | 			\BODY% | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | 		\end{pagecell}}% | 
					
						
							|  |  |  | 	\ignorespaces} | 
					
						
							| 
									
										
										
										
											2021-08-26 20:03:17 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | % XXX EXPERIMENTAL / TEST... | 
					
						
							| 
									
										
										
										
											2021-08-20 16:57:00 +03:00
										 |  |  | %% \DescribeEnv{textcell} | 
					
						
							| 
									
										
										
										
											2021-08-17 02:13:34 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-09-07 01:29:37 +03:00
										 |  |  | %% \EXPERIMENTAL | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-17 02:13:34 +03:00
										 |  |  | %% A cell taking up the page text block. | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %%	>> \begin{textcell}{<width>}{<height>} ... \end{textcell} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-07 01:29:37 +03:00
										 |  |  | %%      <-----------> \textwidth | 
					
						
							|  |  |  | %%                           | 
					
						
							|  |  |  | %%   <-----------------> \pageblockwidth | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%   +-----------------+   ^ \pageblockheight | 
					
						
							|  |  |  | %%   |                 |   | | 
					
						
							|  |  |  | %%   |  +-----------+  |   |  ^ \textheight | 
					
						
							|  |  |  | %%   |  |           |  |   |  | | 
					
						
							|  |  |  | %%   |  |           |  |   |  | | 
					
						
							|  |  |  | %%   |  | textcell  |  |   |  | | 
					
						
							|  |  |  | %%   |  |           |  |   |  | | 
					
						
							|  |  |  | %%   |  |           |  |   |  | | 
					
						
							|  |  |  | %%   |  +-----------+  |   |  v | 
					
						
							|  |  |  | %%   |                 |   |  | 
					
						
							|  |  |  | %%   +-----------------+   v  | 
					
						
							| 
									
										
										
										
											2021-08-17 02:13:34 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% Note that this is an inline cell and if something is on the page it  | 
					
						
							|  |  |  | %% may not be centered properly. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | \newenvironment{textcell}{%
 | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | 	\begin{inlinecell*}{\textwidth}{\textheight}% | 
					
						
							| 
									
										
										
										
											2021-08-17 02:13:34 +03:00
										 |  |  | }{%
 | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | 	\end{inlinecell*}} | 
					
						
							| 
									
										
										
										
											2021-08-17 02:13:34 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-16 04:13:44 +03:00
										 |  |  | % XXX EXPERIMENTAL | 
					
						
							| 
									
										
										
										
											2021-09-17 18:34:12 +03:00
										 |  |  | %% \DescribeEnv{foldout} | 
					
						
							| 
									
										
										
										
											2021-09-16 04:13:44 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-09-17 18:34:12 +03:00
										 |  |  | %% \EXPERIMENTAL | 
					
						
							| 
									
										
										
										
											2021-09-16 04:13:44 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-17 16:58:43 +03:00
										 |  |  | %% Create 2 or more pages in foldout mode. | 
					
						
							|  |  |  | % | 
					
						
							| 
									
										
										
										
											2021-10-01 03:45:25 +03:00
										 |  |  | %%	>> \begin{foldout}[<fold-spec>] ... \end{foldout} | 
					
						
							| 
									
										
										
										
											2021-09-17 16:58:43 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-10-01 03:45:25 +03:00
										 |  |  | %% |<fold-spec>| grammar: | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %%   <fold-spec> ::= | 
					
						
							|  |  |  | %%       <count> | 
					
						
							|  |  |  | %%       | <fold> | 
					
						
							|  |  |  | %%       | <panels> | 
					
						
							|  |  |  | %%   <panels> ::= | 
					
						
							|  |  |  | %%       <panel> | 
					
						
							|  |  |  | %%       | <panel> <panels> | 
					
						
							|  |  |  | %%   <panel> ::= | 
					
						
							|  |  |  | %%       <width> <fold> | 
					
						
							|  |  |  | %%       | <width> | 
					
						
							|  |  |  | %%       | <fold> | 
					
						
							|  |  |  | %%   <fold> ::=  | 
					
						
							|  |  |  | %%      in | out | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-16 04:13:44 +03:00
										 |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-17 16:58:43 +03:00
										 |  |  | %%                              clearfoldoutfold | 
					
						
							|  |  |  | %%                             v                v | 
					
						
							|  |  |  | %%           | 
					
						
							|  |  |  | %%       - --+----------------++---------------++--------------+ | 
					
						
							|  |  |  | %%           =                ..               ..              | | 
					
						
							|  |  |  | %%           =                ..               ..              | | 
					
						
							|  |  |  | %%           =                ..               ..              | | 
					
						
							|  |  |  | %%           =                ..               ..              | | 
					
						
							|  |  |  | %%           =                ..               ..              | | 
					
						
							|  |  |  | %%           =                ..               ..              | | 
					
						
							|  |  |  | %%           =                ..               ..              | | 
					
						
							|  |  |  | %%           =                ..               ..              | | 
					
						
							|  |  |  | %%           =                ..               ..              | | 
					
						
							|  |  |  | %%           =            (1) ..           (2) ..          (3) | | 
					
						
							|  |  |  | %%       - --+----------------++---------------++--------------+ | 
					
						
							|  |  |  | %%           | 
					
						
							| 
									
										
										
										
											2021-09-16 04:13:44 +03:00
										 |  |  | %%  +--------------++---------------++----------------+-- - | 
					
						
							|  |  |  | %%  |              ..               ..                = | 
					
						
							|  |  |  | %%  |              ..               ..                = | 
					
						
							|  |  |  | %%  |              ..               ..                = | 
					
						
							|  |  |  | %%  |              ..               ..                = | 
					
						
							|  |  |  | %%  |              ..               ..                = | 
					
						
							|  |  |  | %%  |              ..               ..                = | 
					
						
							|  |  |  | %%  |              ..               ..                = | 
					
						
							|  |  |  | %%  |              ..               ..                = | 
					
						
							|  |  |  | %%  |              ..               ..                = | 
					
						
							| 
									
										
										
										
											2021-09-26 03:04:07 +03:00
										 |  |  | %%  |          (1) ..           (2) ..            (3) = | 
					
						
							| 
									
										
										
										
											2021-09-16 04:13:44 +03:00
										 |  |  | %%  +--------------++---------------++----------------+-- - | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%                 ^                ^ | 
					
						
							|  |  |  | %%                  clearfoldoutfold | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-19 00:13:55 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-17 16:58:43 +03:00
										 |  |  | %% A foldout always starts on the right/odd page and will always end on 
 | 
					
						
							|  |  |  | %% the left/even page.  | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% If |\foldoutpages{..}| is called on and even page, an empty normal  | 
					
						
							|  |  |  | %% page will be created pushing the foldout to the right page of the  | 
					
						
							|  |  |  | %% spread. If an odd number of pages is created the set will be padded  | 
					
						
							|  |  |  | % with an empty page before |\foldoutpages{..}| exits. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-19 00:13:55 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% Foldout panel numbering | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-26 02:54:14 +03:00
										 |  |  | %%                 right page
 | 
					
						
							| 
									
										
										
										
											2021-09-19 00:13:55 +03:00
										 |  |  | %%           - --+-------+-------+-    --+-------+-------+ | 
					
						
							|  |  |  | %%               =       |       |       |       |       | | 
					
						
							|  |  |  | %%               =  (1)  |  (2)  |  ...  | (n-1) |  (n)  | | 
					
						
							|  |  |  | %%               =       |       |       |       |       | | 
					
						
							|  |  |  | %%           - --+-------+-------+--    -+-------+-------+ | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-26 02:54:14 +03:00
										 |  |  | %%                                 left page
 | 
					
						
							|  |  |  | %%   +-------+-------+-    --+-------+-------+-- - | 
					
						
							|  |  |  | %%   |       |       |       |       |       = | 
					
						
							|  |  |  | %%   |  (1)  |  (2)  |  ...  | (n-1) |  (n)  = | 
					
						
							|  |  |  | %%   |       |       |       |       |       = | 
					
						
							|  |  |  | %%   +-------+-------+--    -+-------+-------+-- - | 
					
						
							| 
									
										
										
										
											2021-09-19 00:13:55 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | % XXX note that panel width includes right \clearfoldoutblock (???) | 
					
						
							| 
									
										
										
										
											2021-09-17 16:58:43 +03:00
										 |  |  | % XXX new cell parameters... | 
					
						
							|  |  |  | % XXX modes...  | 
					
						
							| 
									
										
										
										
											2021-09-16 04:13:44 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% Fold mode |in-in| (default): | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%                       clearfoldoutblock <-> | 
					
						
							|  |  |  | %%   <--> clearfoldoutfold  . . . . . . <->   | 
					
						
							|  |  |  | %%                                                    (3)  /\  (2)   | 
					
						
							|  |  |  | %%      +---------------------------------+               /  \      | 
					
						
							|  |  |  | %%      +-------------------------------  |                  /      | 
					
						
							|  |  |  | %%   -------------------------------------+                 /  (1)  | 
					
						
							|  |  |  | %%   ========================================         =====+=====   | 
					
						
							|  |  |  | %%   ========================================         | 
					
						
							|  |  |  | %%                                                  | 
					
						
							|  |  |  | %% \end{verbatim}                                   | 
					
						
							|  |  |  | %% \end{minipage}                                   | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% Fold mode |in-out|: | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% \begin{minipage}{\textwidth}                     | 
					
						
							|  |  |  | %% \begin{verbatim}                                 | 
					
						
							|  |  |  | %%                                                  | 
					
						
							|  |  |  | %%                      clearfoldoutblock <->                /       | 
					
						
							|  |  |  | %%   <--> clearfoldoutfold                             (3)  /        | 
					
						
							|  |  |  | %%                                                          \        | 
					
						
							|  |  |  | %%      +----------------------------------                  \  (2)  | 
					
						
							|  |  |  | %%      +---------------------------------+                  /       | 
					
						
							|  |  |  | %%   -------------------------------------+                 /  (1)   | 
					
						
							|  |  |  | %%   ========================================         =====+=====    | 
					
						
							|  |  |  | %%   ======================================== | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-19 00:13:55 +03:00
										 |  |  | % XXX order doc secions correctly... | 
					
						
							| 
									
										
										
										
											2021-09-17 17:09:28 +03:00
										 |  |  | % XXX foldout modes: | 
					
						
							|  |  |  | %			fold=in in, | 
					
						
							|  |  |  | %			fold=in out, | 
					
						
							|  |  |  | %			fold=in in out in, | 
					
						
							|  |  |  | %		...a mode is repeated if more panels than items are present, e.g. | 
					
						
							|  |  |  | %		for fold=in out, and 6 panels the folds will be {in out in out in} | 
					
						
							| 
									
										
										
										
											2021-09-18 02:59:31 +03:00
										 |  |  | %		...calculate clearances according to fold direction... | 
					
						
							|  |  |  | % XXX add manual size mode -- list of lengths... | 
					
						
							| 
									
										
										
										
											2021-09-16 04:13:44 +03:00
										 |  |  | % XXX need to: | 
					
						
							| 
									
										
										
										
											2021-09-17 16:58:43 +03:00
										 |  |  | %		- create two pages -- DONE | 
					
						
							|  |  |  | %		- first odd, second even -- DONE | 
					
						
							| 
									
										
										
										
											2021-09-16 04:13:44 +03:00
										 |  |  | %		- fold marks | 
					
						
							|  |  |  | %		- cells for panels... | 
					
						
							| 
									
										
										
										
											2021-09-17 16:58:43 +03:00
										 |  |  | %		- outer panel must be smaller than the inner panel by \clearfoldout -- DONE | 
					
						
							| 
									
										
										
										
											2021-09-16 04:13:44 +03:00
										 |  |  | % XXX move to globals... | 
					
						
							| 
									
										
										
										
											2021-09-29 23:45:10 +03:00
										 |  |  | % XXX revise defaults... | 
					
						
							| 
									
										
										
										
											2021-09-16 04:13:44 +03:00
										 |  |  | \newlength\foldoutwidth | 
					
						
							|  |  |  | \setlength\foldoutwidth{\blockwidth} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-01 05:00:46 +03:00
										 |  |  | % default fold setup... | 
					
						
							| 
									
										
										
										
											2021-10-01 03:45:25 +03:00
										 |  |  | \edef\foldoutspec{2} | 
					
						
							| 
									
										
										
										
											2021-09-16 04:13:44 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-01 05:00:46 +03:00
										 |  |  | % default fold... | 
					
						
							|  |  |  | \edef\foldoutfold{in} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-01 03:45:25 +03:00
										 |  |  | \newlength\clearfoldoutclearblock | 
					
						
							|  |  |  | \setlength\clearfoldoutclearblock{0.5mm} | 
					
						
							| 
									
										
										
										
											2021-09-16 04:13:44 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | \newlength\clearfoldoutfold | 
					
						
							|  |  |  | \setlength\clearfoldoutfold{5mm} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-01 03:45:25 +03:00
										 |  |  | \newlength\clearfoldoutedge | 
					
						
							|  |  |  | \setlength\clearfoldoutedge{1mm} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | \def\foldoutcellfolds{} | 
					
						
							| 
									
										
										
										
											2021-09-17 16:58:43 +03:00
										 |  |  | \def\foldoutcellwidths{} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-01 03:45:25 +03:00
										 |  |  | % XXX length or command??? | 
					
						
							|  |  |  | \def\foldmarkoffset{0.5\bleed} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | \newif\iffoldmarks | 
					
						
							|  |  |  | \foldmarkstrue | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | % XXX make this a tikz... (???) | 
					
						
							|  |  |  | % XXX should we replace in/out text with something like v and ^ ??? | 
					
						
							|  |  |  | \newif\ifphotobook@foldmark@in
 | 
					
						
							| 
									
										
										
										
											2021-10-01 05:00:46 +03:00
										 |  |  | \newcommand\photobook@foldmark[3][\foldoutfold]{%
 | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | 	\begingroup% | 
					
						
							|  |  |  | 		\ifnumodd{\thepage}{%
 | 
					
						
							|  |  |  | 			\ifthenelse{\equal{#1}{in}}{%
 | 
					
						
							|  |  |  | 				\photobook@foldmark@intrue}{%
 | 
					
						
							|  |  |  | 				\photobook@foldmark@infalse}}{%
 | 
					
						
							|  |  |  | 			\ifthenelse{\equal{#1}{in}}{%
 | 
					
						
							|  |  |  | 				\photobook@foldmark@infalse}{%
 | 
					
						
							|  |  |  | 				\photobook@foldmark@intrue}}% | 
					
						
							|  |  |  | 		\begin{textblock*}{0pt}(#3)% | 
					
						
							|  |  |  | 			\setlength{\unitlength}{1mm}% | 
					
						
							|  |  |  | 			\begin{picture}(0, 0)(0,0)% | 
					
						
							|  |  |  | 				\color{white} | 
					
						
							|  |  |  | 				\thicklines | 
					
						
							|  |  |  | 				\put(0,0){\line(0,#2){4}} | 
					
						
							| 
									
										
										
										
											2021-10-01 05:00:46 +03:00
										 |  |  | 				\put(0, \numexpr #2 / 2 \relax){%
 | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | 					\circle*{1.5}} | 
					
						
							|  |  |  | 				\ifphotobook@foldmark@in
 | 
					
						
							|  |  |  | 					\put(1.5, \numexpr #2 / 2 - 1 \relax){\vee} | 
					
						
							|  |  |  | 				\else
 | 
					
						
							|  |  |  | 					\put(1.5, \numexpr #2 / 2 - 1 \relax){\wedge}\fi | 
					
						
							|  |  |  | 				\color{black} | 
					
						
							|  |  |  | 				\thinlines | 
					
						
							|  |  |  | 				\put(0,0){\line(0,#2){4}} | 
					
						
							| 
									
										
										
										
											2021-10-01 05:00:46 +03:00
										 |  |  | 				\put(0, \numexpr #2 / 2 \relax){%
 | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | 					\ifphotobook@foldmark@in
 | 
					
						
							| 
									
										
										
										
											2021-10-01 05:00:46 +03:00
										 |  |  | 						\circle{1.5} | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | 					\else
 | 
					
						
							|  |  |  | 						\circle*{1.5}\fi} | 
					
						
							|  |  |  | 				\ifphotobook@foldmark@in
 | 
					
						
							|  |  |  | 					\put(1.5, \numexpr #2 / 2 - 1 \relax){\vee} | 
					
						
							|  |  |  | 				\else
 | 
					
						
							|  |  |  | 					\put(1.5, \numexpr #2 / 2 - 1 \relax){\wedge}\fi | 
					
						
							|  |  |  | 			\end{picture} | 
					
						
							|  |  |  | 		\end{textblock*}% | 
					
						
							|  |  |  | 	\endgroup} | 
					
						
							| 
									
										
										
										
											2021-10-01 05:00:46 +03:00
										 |  |  | \newcommand\photobook@topfoldmark[2][in]{%
 | 
					
						
							|  |  |  | 	\photobook@foldmark[#1]{3}{#2}} | 
					
						
							|  |  |  | \newcommand\photobook@bottomfoldmark[2][in]{%
 | 
					
						
							|  |  |  | 	\photobook@foldmark[#1]{-3}{#2}} | 
					
						
							| 
									
										
										
										
											2021-10-01 03:45:25 +03:00
										 |  |  | %	>> \photobook@markfold[<fold>]{<offset>} | 
					
						
							|  |  |  | \newcommand\photobook@markfold[2][in]{%
 | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | 	\photobook@topfoldmark[#1]{
 | 
					
						
							|  |  |  | 		#2, | 
					
						
							|  |  |  | 		\bleed  | 
					
						
							|  |  |  | 			- \foldmarkoffset}% | 
					
						
							|  |  |  | 	\photobook@bottomfoldmark[#1]{
 | 
					
						
							|  |  |  | 		#2, | 
					
						
							|  |  |  | 		\blockheight  | 
					
						
							|  |  |  | 			+ \bleed  | 
					
						
							|  |  |  | 			+ \foldmarkoffset}} | 
					
						
							| 
									
										
										
										
											2021-10-01 03:45:25 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-26 01:04:41 +03:00
										 |  |  | %	>> \photobook@setfoldoutoffset{<name>}{<from>}{<to>} | 
					
						
							| 
									
										
										
										
											2021-09-25 14:39:04 +03:00
										 |  |  | % XXX doc [from, to[ | 
					
						
							|  |  |  | % XXX this can't be used outside of a foldout... | 
					
						
							| 
									
										
										
										
											2021-09-26 01:04:41 +03:00
										 |  |  | \newcommand\photobook@setfoldoutoffset[3]{%
 | 
					
						
							|  |  |  | 	\expandafter\setlength\csname #1\endcsname{0pt}% | 
					
						
							|  |  |  | 	\ifnum \numexpr #2 \relax < \numexpr #3 \relax% | 
					
						
							|  |  |  | 		\xintFor* ##1 in {%
 | 
					
						
							| 
									
										
										
										
											2021-09-26 02:54:14 +03:00
										 |  |  | 				\ifnumodd{\thepage}{%
 | 
					
						
							|  |  |  | 					\xintSeq{#2}{\xintiiMin{#3}{\foldoutcellwidthslen + 1} - 1} | 
					
						
							|  |  |  | 				}{%
 | 
					
						
							|  |  |  | 					\xintSeq{\xintiiMin{#3}{\foldoutcellwidthslen + 1} - 1}{#2} | 
					
						
							|  |  |  | 				}} \do {%
 | 
					
						
							| 
									
										
										
										
											2021-09-26 01:04:41 +03:00
										 |  |  | 			\expandafter\setlength\csname #1\endcsname{%
 | 
					
						
							|  |  |  | 				\csname #1\endcsname% | 
					
						
							|  |  |  | 				+ \foldoutcellwidths[##1]}}\fi} | 
					
						
							| 
									
										
										
										
											2021-09-25 14:39:04 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-01 03:45:25 +03:00
										 |  |  | \newlength\photobook@foldout@panelwidth | 
					
						
							|  |  |  | \setlength\photobook@foldout@panelwidth{0pt} | 
					
						
							|  |  |  | \newlength\photobook@foldout@maxpanelwidth | 
					
						
							|  |  |  | \setlength\photobook@foldout@maxpanelwidth{0pt} | 
					
						
							| 
									
										
										
										
											2021-09-30 15:21:07 +03:00
										 |  |  | \edef\photobook@foldout@count{} | 
					
						
							|  |  |  | \edef\photobook@foldout@prevfold{in} | 
					
						
							| 
									
										
										
										
											2021-10-01 03:45:25 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | %	>> \photobook@foldout@pushpanel{<width>}{<fold>} | 
					
						
							| 
									
										
										
										
											2021-10-01 03:45:25 +03:00
										 |  |  | % XXX setup numbers... | 
					
						
							| 
									
										
										
										
											2021-09-28 12:00:08 +03:00
										 |  |  | \newcommand\photobook@foldout@pushpanel[2]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-29 23:45:10 +03:00
										 |  |  | 	% use default width.... | 
					
						
							|  |  |  | 	% XXX might need to make this a bit more elaborate... | 
					
						
							| 
									
										
										
										
											2021-09-28 12:00:08 +03:00
										 |  |  | 	\ifdim #1 = 0pt% | 
					
						
							| 
									
										
										
										
											2021-09-29 23:45:10 +03:00
										 |  |  | 		% double fold twice in same direction... | 
					
						
							|  |  |  | 		\ifthenelse{\equal{#2}{\photobook@foldout@prevfold}}{%
 | 
					
						
							| 
									
										
										
										
											2021-10-01 03:45:25 +03:00
										 |  |  | 			\setlength\photobook@foldout@panelwidth{%
 | 
					
						
							|  |  |  | 				\photobook@foldout@maxpanelwidth  | 
					
						
							| 
									
										
										
										
											2021-09-29 23:45:10 +03:00
										 |  |  | 				% XXX | 
					
						
							|  |  |  | 				+ 0pt}% | 
					
						
							|  |  |  | 		% different fold directions... | 
					
						
							|  |  |  | 		}{%
 | 
					
						
							| 
									
										
										
										
											2021-10-01 03:45:25 +03:00
										 |  |  | 			\setlength\photobook@foldout@panelwidth{%
 | 
					
						
							|  |  |  | 				\photobook@foldout@maxpanelwidth  | 
					
						
							| 
									
										
										
										
											2021-09-29 23:45:10 +03:00
										 |  |  | 				% XXX | 
					
						
							|  |  |  | 				+ 0pt}}% | 
					
						
							| 
									
										
										
										
											2021-10-01 03:45:25 +03:00
										 |  |  | 		\setlength\photobook@foldout@maxpanelwidth{\photobook@foldout@panelwidth}% | 
					
						
							| 
									
										
										
										
											2021-09-29 23:45:10 +03:00
										 |  |  | 	% explicit width... | 
					
						
							| 
									
										
										
										
											2021-09-28 12:00:08 +03:00
										 |  |  | 	\else% | 
					
						
							| 
									
										
										
										
											2021-10-01 03:45:25 +03:00
										 |  |  | 		\setlength\photobook@foldout@panelwidth{#1}\fi% | 
					
						
							| 
									
										
										
										
											2021-09-29 23:45:10 +03:00
										 |  |  | 	% accumulate width... | 
					
						
							| 
									
										
										
										
											2021-09-28 12:00:08 +03:00
										 |  |  | 	\setlength\foldoutwidth{
 | 
					
						
							|  |  |  | 		\foldoutwidth | 
					
						
							| 
									
										
										
										
											2021-10-01 03:45:25 +03:00
										 |  |  | 		+ \photobook@foldout@panelwidth}% | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | 	% panel spec lists... | 
					
						
							|  |  |  | 	\edef\foldoutcellfolds{%
 | 
					
						
							|  |  |  | 		\foldoutcellfolds,#2}% | 
					
						
							| 
									
										
										
										
											2021-09-28 12:00:08 +03:00
										 |  |  | 	\edef\foldoutcellwidths{%
 | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | 		\foldoutcellwidths,\the\photobook@foldout@panelwidth}} | 
					
						
							| 
									
										
										
										
											2021-09-30 15:21:07 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | % XXX FOLDMARK... | 
					
						
							|  |  |  | % XXX also add this to jacket/cover... | 
					
						
							|  |  |  | \newlength\photobook@showmarks@offset | 
					
						
							|  |  |  | \setlength\photobook@showmarks@offset{0pt} | 
					
						
							| 
									
										
										
										
											2021-10-05 23:40:48 +03:00
										 |  |  | \newcommand\photobook@showmarks{%
 | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | 	\ifx \foldoutcellwidths \empty \else% | 
					
						
							|  |  |  | 		\begingroup% | 
					
						
							|  |  |  | 			\setlength\photobook@showmarks@offset{\bleed}% | 
					
						
							|  |  |  | 			% NOTE: we need to iterate left/right pages in reverse order... | 
					
						
							|  |  |  | 			% NOTE: the below branches are similar but not identical... | 
					
						
							|  |  |  | 			\ifnumodd{\thepage}{%
 | 
					
						
							|  |  |  | 				\xintFor* ##1 in {\xintSeq{1}{\foldoutcellwidthslen - 1}} \do {%
 | 
					
						
							|  |  |  | 					\setlength\photobook@showmarks@offset{
 | 
					
						
							|  |  |  | 						\photobook@showmarks@offset | 
					
						
							|  |  |  | 						+ \foldoutcellwidths[##1]}% | 
					
						
							|  |  |  | 					% XXX HACK: it appears that we can't expand \foldoutcellfolds[##1] in [..]... | 
					
						
							|  |  |  | 					\edef\photobook@showmarks@tmp{\foldoutcellfolds[##1]}% | 
					
						
							|  |  |  | 					\photobook@markfold[\photobook@showmarks@tmp]{\photobook@showmarks@offset}}% | 
					
						
							|  |  |  | 			}{
 | 
					
						
							|  |  |  | 				\xintFor* ##1 in {\xintSeq{\foldoutcellwidthslen}{2}} \do {%
 | 
					
						
							|  |  |  | 					\setlength\photobook@showmarks@offset{
 | 
					
						
							|  |  |  | 						\photobook@showmarks@offset | 
					
						
							|  |  |  | 						+ \foldoutcellwidths[##1]}% | 
					
						
							|  |  |  | 					% XXX HACK: it appears that we can't expand \foldoutcellfolds[##1] in [..]... | 
					
						
							|  |  |  | 					\edef\photobook@showmarks@tmp{\foldoutcellfolds[##1 - 1]}% | 
					
						
							|  |  |  | 					\photobook@markfold[\photobook@showmarks@tmp]{\photobook@showmarks@offset}}}% | 
					
						
							|  |  |  | 		\endgroup\fi} | 
					
						
							|  |  |  | \AtBeginShipout{%
 | 
					
						
							|  |  |  | 	\iffoldmarks% | 
					
						
							|  |  |  | 		\photobook@showmarks\fi} | 
					
						
							| 
									
										
										
										
											2021-10-05 23:40:48 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-30 15:21:07 +03:00
										 |  |  | % XXX in/out branches are identical -- unify... | 
					
						
							| 
									
										
										
										
											2021-10-01 03:45:25 +03:00
										 |  |  | \newenvironment{foldout}[1][\foldoutspec]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-27 16:07:30 +03:00
										 |  |  | 	\begingroup% | 
					
						
							|  |  |  | 		\setsepchar{ }% | 
					
						
							|  |  |  | 		\readlist*\photobook@foldout@args{#1}% | 
					
						
							| 
									
										
										
										
											2021-09-30 15:21:07 +03:00
										 |  |  | 		% | 
					
						
							|  |  |  | 		% defaults... | 
					
						
							| 
									
										
										
										
											2021-09-29 23:45:10 +03:00
										 |  |  | 		\setlength\foldoutwidth{0pt}% | 
					
						
							| 
									
										
										
										
											2021-10-01 03:45:25 +03:00
										 |  |  | 		\setlength\photobook@foldout@maxpanelwidth{\blockwidth}% | 
					
						
							| 
									
										
										
										
											2021-09-30 15:21:07 +03:00
										 |  |  | 		\edef\photobook@foldout@prevfold{\foldoutfold}% | 
					
						
							|  |  |  | 		% | 
					
						
							|  |  |  | 		% panel count... | 
					
						
							| 
									
										
										
										
											2021-09-27 16:07:30 +03:00
										 |  |  | 		\ifnum \photobook@foldout@argslen = 1% | 
					
						
							| 
									
										
										
										
											2021-09-30 15:21:07 +03:00
										 |  |  | 			% in... | 
					
						
							|  |  |  | 			\ifthenelse{\equal{#1}{in}}{%
 | 
					
						
							|  |  |  | 				\edef\photobook@foldout@count{2}% | 
					
						
							|  |  |  | 				\edef\photobook@foldout@prevfold{#1}% | 
					
						
							|  |  |  | 			% out... | 
					
						
							|  |  |  | 			}{\ifthenelse{\equal{#1}{out}}{%
 | 
					
						
							|  |  |  | 				\edef\photobook@foldout@count{2}% | 
					
						
							|  |  |  | 				\edef\photobook@foldout@prevfold{#1}% | 
					
						
							|  |  |  | 			% count... | 
					
						
							|  |  |  | 			}{%
 | 
					
						
							|  |  |  | 				\edef\photobook@foldout@count{#1}}}% | 
					
						
							|  |  |  | 			% | 
					
						
							|  |  |  | 			% build the panels... | 
					
						
							|  |  |  | 			\xintFor* ##1 in {\xintSeq{1}{\photobook@foldout@count}} \do {%
 | 
					
						
							|  |  |  | 				\photobook@foldout@pushpanel{%
 | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | 					0pt}{\photobook@foldout@prevfold}}% | 
					
						
							| 
									
										
										
										
											2021-09-27 16:07:30 +03:00
										 |  |  | 		% fold spec... | 
					
						
							|  |  |  | 		\else% | 
					
						
							|  |  |  | 			\foreachitem \photobook@foldout@opt \in \photobook@foldout@args{%
 | 
					
						
							| 
									
										
										
										
											2021-09-30 15:21:07 +03:00
										 |  |  | 				% in... | 
					
						
							| 
									
										
										
										
											2021-09-27 16:07:30 +03:00
										 |  |  | 				\ifthenelse{\equal{\photobook@foldout@opt}{in}}{%
 | 
					
						
							| 
									
										
										
										
											2021-09-28 12:00:08 +03:00
										 |  |  | 					\photobook@foldout@pushpanel{%
 | 
					
						
							| 
									
										
										
										
											2021-10-01 03:45:25 +03:00
										 |  |  | 						\photobook@foldout@panelwidth}{\photobook@foldout@opt}% | 
					
						
							| 
									
										
										
										
											2021-09-28 12:00:08 +03:00
										 |  |  | 					% prep for next panel... | 
					
						
							|  |  |  | 					\edef\photobook@foldout@prevfold{%
 | 
					
						
							|  |  |  | 						\photobook@foldout@opt}% | 
					
						
							| 
									
										
										
										
											2021-10-01 03:45:25 +03:00
										 |  |  | 					\setlength\photobook@foldout@panelwidth{0pt}% | 
					
						
							| 
									
										
										
										
											2021-09-30 15:21:07 +03:00
										 |  |  | 				% out... | 
					
						
							| 
									
										
										
										
											2021-09-27 16:07:30 +03:00
										 |  |  | 				}{\ifthenelse{\equal{\photobook@foldout@opt}{out}}{%
 | 
					
						
							| 
									
										
										
										
											2021-09-28 12:00:08 +03:00
										 |  |  | 					\photobook@foldout@pushpanel{%
 | 
					
						
							| 
									
										
										
										
											2021-10-01 03:45:25 +03:00
										 |  |  | 						\photobook@foldout@panelwidth}{\photobook@foldout@opt} | 
					
						
							| 
									
										
										
										
											2021-09-28 12:00:08 +03:00
										 |  |  | 					% prep for next panel... | 
					
						
							|  |  |  | 					\edef\photobook@foldout@prevfold{%
 | 
					
						
							|  |  |  | 						\photobook@foldout@opt}% | 
					
						
							| 
									
										
										
										
											2021-10-01 03:45:25 +03:00
										 |  |  | 					\setlength\photobook@foldout@panelwidth{0pt}% | 
					
						
							| 
									
										
										
										
											2021-09-27 16:07:30 +03:00
										 |  |  | 				% explicit size... | 
					
						
							|  |  |  | 				}{%
 | 
					
						
							|  |  |  | 					% finalize prev panel... | 
					
						
							| 
									
										
										
										
											2021-10-01 03:45:25 +03:00
										 |  |  | 					\ifdim \photobook@foldout@panelwidth > 0pt% | 
					
						
							| 
									
										
										
										
											2021-09-28 12:00:08 +03:00
										 |  |  | 						\photobook@foldout@pushpanel{%
 | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | 							\photobook@foldout@panelwidth}{\photobook@foldout@prevfold}\fi% | 
					
						
							| 
									
										
										
										
											2021-09-27 16:07:30 +03:00
										 |  |  | 					% | 
					
						
							| 
									
										
										
										
											2021-09-29 23:45:10 +03:00
										 |  |  | 					% XXX need to disable clearences here... | 
					
						
							| 
									
										
										
										
											2021-10-01 03:45:25 +03:00
										 |  |  | 					\setlength\photobook@foldout@panelwidth{\photobook@foldout@opt}}}}% | 
					
						
							| 
									
										
										
										
											2021-09-27 16:07:30 +03:00
										 |  |  | 			% we ended by a fold -> add trailing panel...  | 
					
						
							| 
									
										
										
										
											2021-09-29 23:45:10 +03:00
										 |  |  | 			\photobook@foldout@pushpanel{%
 | 
					
						
							| 
									
										
										
										
											2021-10-01 03:45:25 +03:00
										 |  |  | 				\photobook@foldout@panelwidth}{\photobook@foldout@prevfold}% | 
					
						
							| 
									
										
										
										
											2021-09-27 16:07:30 +03:00
										 |  |  | 		\fi% | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | 		\setsepchar{,}% | 
					
						
							|  |  |  | 		% NOTE: the first element is empty due to how we create these  | 
					
						
							|  |  |  | 		%		i.e. ('' + ',<value>')... | 
					
						
							|  |  |  | 		\ignoreemptyitems% | 
					
						
							|  |  |  | 		\readlist*\foldoutcellfolds{\foldoutcellfolds}% | 
					
						
							|  |  |  | 		\readlist*\foldoutcellwidths{\foldoutcellwidths}% | 
					
						
							| 
									
										
										
										
											2021-09-29 23:45:10 +03:00
										 |  |  | 		% | 
					
						
							| 
									
										
										
										
											2021-09-17 18:34:12 +03:00
										 |  |  | 		% pages... | 
					
						
							|  |  |  | 		% NOTE: we'll keep the start of the foldout set at the right page
 | 
					
						
							|  |  |  | 		%		and end it on the left page. | 
					
						
							| 
									
										
										
										
											2021-09-16 04:13:44 +03:00
										 |  |  | 		\cleardoublepage% | 
					
						
							| 
									
										
										
										
											2021-09-17 18:34:12 +03:00
										 |  |  | 		\begin{resizedpages}{\foldoutwidth}{\blockheight}% | 
					
						
							| 
									
										
										
										
											2021-09-16 04:13:44 +03:00
										 |  |  | 			\ignorespaces% | 
					
						
							| 
									
										
										
										
											2021-09-17 18:34:12 +03:00
										 |  |  | }{%
 | 
					
						
							|  |  |  | 			\cleardoublepage% | 
					
						
							|  |  |  | 		\end{resizedpages}% | 
					
						
							| 
									
										
										
										
											2021-09-16 04:13:44 +03:00
										 |  |  | 	\endgroup} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-26 03:04:07 +03:00
										 |  |  | %% \DescribeEnv{foldoutcell} | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | %% \DescribeEnv{foldoutcell*} | 
					
						
							| 
									
										
										
										
											2021-09-26 03:04:07 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %% \EXPERIMENTAL | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% Create a cell spanning one or more foldout panels. | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %%	>> \begin{foldoutcell}[<num>] ... \end{foldoutcell} | 
					
						
							|  |  |  | %%	>> \begin{foldoutcell}[<from>-<to>] ... \end{foldoutcell} | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-10-07 06:41:07 +03:00
										 |  |  | %% If no arguments are given this will create a panel at |foldoutpanel| counter  | 
					
						
							|  |  |  | %% and increment it by one. | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %%	>> \begin{foldoutcell} ... \end{foldoutcell} | 
					
						
							|  |  |  | % | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | %% |foldoutcell*| is the same as the non-star version but creates cells | 
					
						
							|  |  |  | %% including bleeds. | 
					
						
							| 
									
										
										
										
											2021-09-26 03:04:07 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-10-07 06:41:07 +03:00
										 |  |  | %% Neither version clips its content, to explicitly clip use the |cliptocell|  | 
					
						
							|  |  |  | %% environment. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-26 03:04:07 +03:00
										 |  |  | \newlength\photobook@foldoutcell@left | 
					
						
							|  |  |  | \setlength\photobook@foldoutcell@left{0pt} | 
					
						
							|  |  |  | \newlength\photobook@foldoutcell@width
 | 
					
						
							|  |  |  | \setlength\photobook@foldoutcell@width{0pt} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-07 06:41:07 +03:00
										 |  |  | % XXX | 
					
						
							|  |  |  | \newcounter{foldoutpanel} | 
					
						
							|  |  |  | \setcounter{foldoutpanel}{0} | 
					
						
							|  |  |  | \edef\photobook@foldoutcell@from{0} | 
					
						
							|  |  |  | % reset panel count on each page... | 
					
						
							|  |  |  | \AtBeginShipout{%
 | 
					
						
							|  |  |  | 	\setcounter{foldoutpanel}{0} | 
					
						
							|  |  |  | 	\edef\photobook@foldoutcell@from{%
 | 
					
						
							|  |  |  | 		\thefoldoutpanel}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | % XXX revise naming.... | 
					
						
							|  |  |  | %			foldoutcell	- 1:1 (unclipped) | 
					
						
							|  |  |  | %							should be clipped to bleeds, i.e. should use 
 | 
					
						
							|  |  |  | %							foldoutcell* and create a new offset cell inside... | 
					
						
							|  |  |  | %			foldoutcell* - with bleeds like cell* (unclipped)... | 
					
						
							|  |  |  | % XXX need to be able to turn clipping on/off (???) | 
					
						
							| 
									
										
										
										
											2021-09-26 03:04:07 +03:00
										 |  |  | % XXX doc [from, to] | 
					
						
							|  |  |  | % XXX this can't be used outside of a foldout... | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | % XXX should these clip??? | 
					
						
							| 
									
										
										
										
											2021-10-07 06:41:07 +03:00
										 |  |  | \newenvironment{foldoutcell}[1][0]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-26 03:04:07 +03:00
										 |  |  | 	\begingroup% | 
					
						
							|  |  |  | 		\setsepchar{-}% | 
					
						
							|  |  |  | 		\readlist*\photobook@foldoutcell@panels{#1}% | 
					
						
							| 
									
										
										
										
											2021-10-07 06:41:07 +03:00
										 |  |  | 		% auto advance... | 
					
						
							|  |  |  | 		\ifnum \photobook@foldoutcell@panels[1] = 0% | 
					
						
							|  |  |  | 			% XXX this does not work for some reason... | 
					
						
							|  |  |  | 			%		...breaks something later... | 
					
						
							|  |  |  | 			\ifnum \value{foldoutpanel} > \foldoutcellwidthslen% | 
					
						
							|  |  |  | 				% NOTE: this will reset the counter... | 
					
						
							|  |  |  | 				\newpage\fi% | 
					
						
							|  |  |  | 			\stepcounter{foldoutpanel}% | 
					
						
							|  |  |  | 			\global\edef\photobook@foldoutcell@from{%
 | 
					
						
							|  |  |  | 				\thefoldoutpanel}% | 
					
						
							|  |  |  | 		% explicit panels... | 
					
						
							|  |  |  | 		\else% | 
					
						
							|  |  |  | 			\global\edef\photobook@foldoutcell@from{
 | 
					
						
							|  |  |  | 				\photobook@foldoutcell@panels[1]}\fi% | 
					
						
							| 
									
										
										
										
											2021-09-26 03:04:07 +03:00
										 |  |  | 		% left offset... | 
					
						
							|  |  |  | 		\photobook@setfoldoutoffset{photobook@foldoutcell@left}{%
 | 
					
						
							|  |  |  | 				1 | 
					
						
							|  |  |  | 			}{%
 | 
					
						
							| 
									
										
										
										
											2021-10-07 06:41:07 +03:00
										 |  |  | 				\photobook@foldoutcell@from}% | 
					
						
							| 
									
										
										
										
											2021-09-26 03:04:07 +03:00
										 |  |  | 		% panel width... | 
					
						
							|  |  |  | 		\ifnum \photobook@foldoutcell@panelslen > 1% | 
					
						
							|  |  |  | 			\photobook@setfoldoutoffset{photobook@foldoutcell@width}{%
 | 
					
						
							| 
									
										
										
										
											2021-10-07 06:41:07 +03:00
										 |  |  | 					\photobook@foldoutcell@from% | 
					
						
							| 
									
										
										
										
											2021-09-26 03:04:07 +03:00
										 |  |  | 				}{%
 | 
					
						
							|  |  |  | 					\photobook@foldoutcell@panels[2] + 1}% | 
					
						
							|  |  |  | 		\else% | 
					
						
							|  |  |  | 			\setlength\photobook@foldoutcell@width{%
 | 
					
						
							| 
									
										
										
										
											2021-10-07 06:41:07 +03:00
										 |  |  | 				\foldoutcellwidths[{\photobook@foldoutcell@from}]}\fi% | 
					
						
							| 
									
										
										
										
											2021-09-26 03:04:07 +03:00
										 |  |  | 		% | 
					
						
							|  |  |  | 		\begin{cell*}{%
 | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | 					\bleed  | 
					
						
							|  |  |  | 						+ \photobook@foldoutcell@left,% | 
					
						
							| 
									
										
										
										
											2021-09-26 03:04:07 +03:00
										 |  |  | 					\bleed}% | 
					
						
							|  |  |  | 				{\photobook@foldoutcell@width}% | 
					
						
							|  |  |  | 				{\pageblockheight}% | 
					
						
							|  |  |  | }{%
 | 
					
						
							|  |  |  | 		\end{cell*}% | 
					
						
							|  |  |  | 	\endgroup} | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | % bleed version... | 
					
						
							| 
									
										
										
										
											2021-10-07 06:41:07 +03:00
										 |  |  | \newenvironment{foldoutcell*}[1][0]{%
 | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | 	\begingroup% | 
					
						
							|  |  |  | 		\setsepchar{-}% | 
					
						
							|  |  |  | 		\readlist*\photobook@foldoutcell@panels{#1}% | 
					
						
							| 
									
										
										
										
											2021-10-07 06:41:07 +03:00
										 |  |  | 		% auto advance... | 
					
						
							|  |  |  | 		\ifnum \photobook@foldoutcell@panels[1] = 0% | 
					
						
							|  |  |  | 			% XXX this does not work for some reason... | 
					
						
							|  |  |  | 			%		...breaks something later... | 
					
						
							|  |  |  | 			\ifnum \value{foldoutpanel} > \foldoutcellwidthslen% | 
					
						
							|  |  |  | 				% NOTE: this will reset the counter... | 
					
						
							|  |  |  | 				\newpage\fi% | 
					
						
							|  |  |  | 			\stepcounter{foldoutpanel}% | 
					
						
							|  |  |  | 			\global\edef\photobook@foldoutcell@from{%
 | 
					
						
							|  |  |  | 				\thefoldoutpanel}% | 
					
						
							|  |  |  | 		% explicit panels... | 
					
						
							|  |  |  | 		\else% | 
					
						
							|  |  |  | 			\global\edef\photobook@foldoutcell@from{
 | 
					
						
							|  |  |  | 				\photobook@foldoutcell@panels[1]}\fi% | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | 		% left offset... | 
					
						
							|  |  |  | 		\photobook@setfoldoutoffset{photobook@foldoutcell@left}{%
 | 
					
						
							|  |  |  | 				1 | 
					
						
							|  |  |  | 			}{%
 | 
					
						
							| 
									
										
										
										
											2021-10-07 06:41:07 +03:00
										 |  |  | 				\photobook@foldoutcell@from}% | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | 		% panel width... | 
					
						
							|  |  |  | 		\ifnum \photobook@foldoutcell@panelslen > 1% | 
					
						
							|  |  |  | 			\photobook@setfoldoutoffset{photobook@foldoutcell@width}{%
 | 
					
						
							| 
									
										
										
										
											2021-10-07 06:41:07 +03:00
										 |  |  | 					\photobook@foldoutcell@from% | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | 				}{%
 | 
					
						
							|  |  |  | 					\photobook@foldoutcell@panels[2] + 1}% | 
					
						
							|  |  |  | 			% add bleed to last panel... | 
					
						
							|  |  |  | 			\ifnum \photobook@foldoutcell@panels[2] = \foldoutcellwidthslen% | 
					
						
							|  |  |  | 				\setlength\photobook@foldoutcell@width{%
 | 
					
						
							|  |  |  | 					\bleed | 
					
						
							|  |  |  | 					+ \photobook@foldoutcell@width}\fi% | 
					
						
							|  |  |  | 		\else% | 
					
						
							|  |  |  | 			\setlength\photobook@foldoutcell@width{%
 | 
					
						
							| 
									
										
										
										
											2021-10-07 06:41:07 +03:00
										 |  |  | 				\foldoutcellwidths[{\photobook@foldoutcell@from}]} | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | 		\fi% | 
					
						
							|  |  |  | 		% add bleed to first/last panel... | 
					
						
							| 
									
										
										
										
											2021-10-07 06:41:07 +03:00
										 |  |  | 		\ifnum \photobook@foldoutcell@from = 1% | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | 			\setlength\photobook@foldoutcell@width{%
 | 
					
						
							|  |  |  | 				\bleed | 
					
						
							|  |  |  | 				+ \photobook@foldoutcell@width} | 
					
						
							|  |  |  | 		\else% | 
					
						
							|  |  |  | 			\setlength\photobook@foldoutcell@left{%
 | 
					
						
							|  |  |  | 				\bleed | 
					
						
							|  |  |  | 				+ \photobook@foldoutcell@left}\fi% | 
					
						
							| 
									
										
										
										
											2021-10-07 06:41:07 +03:00
										 |  |  | 		\ifnum \photobook@foldoutcell@from = \foldoutcellwidthslen% | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | 			\setlength\photobook@foldoutcell@width{%
 | 
					
						
							|  |  |  | 				\bleed | 
					
						
							|  |  |  | 				+ \photobook@foldoutcell@width}\fi% | 
					
						
							|  |  |  | 		% | 
					
						
							|  |  |  | 		\begin{cell*}{%
 | 
					
						
							|  |  |  | 					\photobook@foldoutcell@left,% | 
					
						
							|  |  |  | 					0pt}% | 
					
						
							|  |  |  | 				{\photobook@foldoutcell@width}% | 
					
						
							|  |  |  | 				{\pageblockheight + 2\bleed}% | 
					
						
							|  |  |  | }{%
 | 
					
						
							|  |  |  | 		\end{cell*}% | 
					
						
							|  |  |  | 	\endgroup} | 
					
						
							| 
									
										
										
										
											2021-09-26 03:04:07 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-30 22:59:21 +03:00
										 |  |  | %% \DescribeEnv{spreadtopages} | 
					
						
							|  |  |  | %% \DescribeEnv{spreadtopages*} | 
					
						
							|  |  |  | %% \DescribeMacro{\usespreadpage\{..\}} | 
					
						
							|  |  |  | %% \DescribeMacro{\usespreadpage*\{..\}} | 
					
						
							| 
									
										
										
										
											2021-08-27 20:12:06 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %% Spread cell into pages. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%   +----------------------------------- -                  | 
					
						
							|  |  |  | %%   |                                                      <-- input cell | 
					
						
							|  |  |  | %%   |          .          .          .                      | 
					
						
							|  |  |  | %%   |     Oversized content cell...                         | 
					
						
							|  |  |  | %%   |          .          .          .                      | 
					
						
							|  |  |  | %%   |                                                       | 
					
						
							|  |  |  | %%   +----------.----------.----------.-- -                  | 
					
						
							|  |  |  | %%   .          . .         . .         .  . | 
					
						
							|  |  |  | %%   .          .   .         .   .         .    .          | 
					
						
							|  |  |  | %%   +----------+    +----------+    +----------+    +-- -   | 
					
						
							|  |  |  | %%   |          |    |          |    |          |    |      <-- output pages | 
					
						
							|  |  |  | %%   |          |    |          |    |          |    |       | 
					
						
							|  |  |  | %%   |     Overs|    |ized conte|    |nt cell...|    |       | 
					
						
							|  |  |  | %%   |          |    |          |    |          |    |       | 
					
						
							|  |  |  | %%   |          |    |          |    |          |    |     | 
					
						
							|  |  |  | %%   +----------+    +----------+    +----------+    +-- - | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-30 22:59:21 +03:00
										 |  |  | %% |spreadtopages| creates a cell and spreads it into pages right away. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%	>> \begin{spreadtopages} .. \end{spreadtopages} | 
					
						
							|  |  |  | %%	>> \begin{spreadtopages}[<page-count>] .. \end{spreadtopages} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | %% |spreadtopages*| creates a named save cell only allowing the pages  | 
					
						
							|  |  |  | %% to be placed manually via |\usespreadpage{..}|. | 
					
						
							| 
									
										
										
										
											2021-08-30 22:59:21 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %%	>> \begin{spreadtopages*}{<name>} .. \end{spreadtopages*} | 
					
						
							|  |  |  | %%	>> \begin{spreadtopages*}[<page-count>]{<name>} .. \end{spreadtopages*} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% |\usespreadpage{..}| places a page from a saved cell. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%	>> \usespreadpage{<name>} | 
					
						
							|  |  |  | %%	>> \usespreadpage[<page-num>]{<name>} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% |\usespreadpage*{..}| is the same as the non-star version but will  | 
					
						
							|  |  |  | %%	not use a |page| environment, enabling the user to populate the page
 | 
					
						
							|  |  |  | %%	with other elements. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | %% Page numbers are 1-based. | 
					
						
							| 
									
										
										
										
											2021-08-30 22:59:21 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% Note that the cell created by |spreadtopages*| env is a normal save 
 | 
					
						
							|  |  |  | %% cell and can be manipulated via |\usecell{..}| and |\usecell*{..}|. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-27 20:12:06 +03:00
										 |  |  | % XXX add nudge/grow support... | 
					
						
							| 
									
										
										
										
											2021-08-30 18:55:11 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | \NewEnviron{spreadtopages*}[2][2]{%
 | 
					
						
							| 
									
										
										
										
											2021-08-30 19:00:40 +03:00
										 |  |  | 	% setup page count... | 
					
						
							|  |  |  | 	\@ifundefined{thespreadtopages#2page}{%
 | 
					
						
							|  |  |  | 		\newcounter{spreadtopages#2page}}{} | 
					
						
							| 
									
										
										
										
											2021-08-30 18:55:11 +03:00
										 |  |  | 	\setcounter{spreadtopages#2page}{1} | 
					
						
							| 
									
										
										
										
											2021-08-30 19:00:40 +03:00
										 |  |  | 	% | 
					
						
							| 
									
										
										
										
											2021-08-30 18:55:11 +03:00
										 |  |  | 	\begingroup% | 
					
						
							|  |  |  | 		% create the actual cell... | 
					
						
							|  |  |  | 		\setlength\cellparentwidth{\cellwidth}% | 
					
						
							|  |  |  | 		\setlength\cellparentheight{\cellheight}% | 
					
						
							|  |  |  | 		\setlength\cellwidth{#1\pageblockwidth}% | 
					
						
							|  |  |  | 		\setlength\cellheight{\pageblockheight}% | 
					
						
							|  |  |  | 		% | 
					
						
							|  |  |  | 		\gsavecell{#2}{\cellwidth}{\cellheight}{\BODY}% | 
					
						
							|  |  |  | 	\endgroup% | 
					
						
							|  |  |  | 	\ignorespaces} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-30 22:59:21 +03:00
										 |  |  | % NOTE: this essentially counts pages, \usecell{..} / \usecell*{..} are  | 
					
						
							|  |  |  | %		better suited for custom stuff... | 
					
						
							|  |  |  | % NOTE: page is a 1 based offset in pages and can be fractional... | 
					
						
							| 
									
										
										
										
											2021-08-31 02:43:22 +03:00
										 |  |  | % NOTE: \usecell*{..} takes care of all the bleed calculations... | 
					
						
							| 
									
										
										
										
											2021-08-30 22:59:21 +03:00
										 |  |  | \def\usespreadpage{\@ifstar{%
 | 
					
						
							|  |  |  | 		\photobook@usespreadpage@star% | 
					
						
							|  |  |  | 	}{%
 | 
					
						
							|  |  |  | 		\photobook@usespreadpage}} | 
					
						
							|  |  |  | \newcommand\photobook@usespreadpage@star[2][]{%
 | 
					
						
							| 
									
										
										
										
											2021-08-30 18:55:11 +03:00
										 |  |  | 	\begin{pagecell}% | 
					
						
							|  |  |  | 		% auto advance pages... | 
					
						
							|  |  |  | 		\ifthenelse{\equal{#1}{}}{%
 | 
					
						
							|  |  |  | 			\usecell*{#2}% | 
					
						
							|  |  |  | 				(0pt, \numexpr \value{spreadtopages#2page} - 1 \relax\cellwidth)% | 
					
						
							|  |  |  | 				{\cellwidth}{\cellheight}% | 
					
						
							|  |  |  | 			\stepcounter{spreadtopages#2page}% | 
					
						
							|  |  |  | 		% manual page selected... | 
					
						
							|  |  |  | 		}{%
 | 
					
						
							|  |  |  | 			\usecell*{#2}% | 
					
						
							|  |  |  | 				(0pt, \numexpr #1 - 1 \relax\cellwidth)% | 
					
						
							|  |  |  | 				{\cellwidth}{\cellheight}}% | 
					
						
							| 
									
										
										
										
											2021-08-30 22:59:21 +03:00
										 |  |  | 	\end{pagecell}} | 
					
						
							|  |  |  | \newcommand\photobook@usespreadpage[2][]{%
 | 
					
						
							|  |  |  | 	\begin{page}% | 
					
						
							|  |  |  | 		\usespreadpage*[#1]{#2}% | 
					
						
							| 
									
										
										
										
											2021-08-30 18:55:11 +03:00
										 |  |  | 	\end{page}} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-27 20:12:06 +03:00
										 |  |  | \NewEnviron{spreadtopages}[1][2]{%
 | 
					
						
							|  |  |  | 	\begingroup% | 
					
						
							|  |  |  | 		% create the actual cell... | 
					
						
							|  |  |  | 		\setlength\cellparentwidth{\cellwidth}% | 
					
						
							|  |  |  | 		\setlength\cellparentheight{\cellheight}% | 
					
						
							|  |  |  | 		\setlength\cellwidth{#1\pageblockwidth}% | 
					
						
							|  |  |  | 		\setlength\cellheight{\pageblockheight}% | 
					
						
							|  |  |  | 		% | 
					
						
							|  |  |  | 		\savecell{photobook@spreadtopages}{\cellwidth}{\cellheight}{\BODY}% | 
					
						
							| 
									
										
										
										
											2021-08-30 22:59:21 +03:00
										 |  |  | 		% | 
					
						
							|  |  |  | 		% place the pages... | 
					
						
							| 
									
										
										
										
											2021-08-30 18:55:11 +03:00
										 |  |  | 		\foreach \photobook@spreadtopages@page in {1, ..., #1}{%
 | 
					
						
							|  |  |  | 			\usespreadpage[\photobook@spreadtopages@page]{photobook@spreadtopages}}% | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | 	\endgroup% | 
					
						
							|  |  |  | 	\ignorespaces} | 
					
						
							| 
									
										
										
										
											2021-08-27 20:12:06 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-09 13:43:36 +03:00
										 |  |  | % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 
					
						
							|  |  |  | %%%%% Endpaper cells | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% \DescribeEnv{leftside} | 
					
						
							|  |  |  | %% \DescribeEnv{rightside} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%   +---------------+---------------+ | 
					
						
							|  |  |  | %%   |               |               | | 
					
						
							|  |  |  | %%   |               |               | | 
					
						
							|  |  |  | %%   |   leftside    |   rightside   | | 
					
						
							|  |  |  | %%   |               |               | | 
					
						
							|  |  |  | %%   |               |               | | 
					
						
							|  |  |  | %%   +---------------+---------------+ | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | % XXX for some reason naming these anything starting with endpaper will | 
					
						
							|  |  |  | %		make LaTeX complain that that is already defined... | 
					
						
							|  |  |  | %		...collision with bools??? | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | \newenvironment{leftside}{%
 | 
					
						
							|  |  |  | 	\begin{pagecell}% | 
					
						
							|  |  |  | }{%
 | 
					
						
							|  |  |  | 	\end{pagecell}} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | \newenvironment{rightside}{%
 | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | 	\begin{cell*}% | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | 			{\bleed + \pageblockwidth, \bleed}% | 
					
						
							|  |  |  | 			{\pageblockwidth}{\pageblockheight}% | 
					
						
							|  |  |  | }{%
 | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | 	\end{cell*}} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-09 13:43:36 +03:00
										 |  |  | % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 
					
						
							|  |  |  | %%%%% Cover and dust jacket cells | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% \DescribeEnv{frontcover} | 
					
						
							|  |  |  | %% \DescribeEnv{backcover} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% \DescribeEnv{spine} | 
					
						
							|  |  |  | %% \DescribeEnv{vspine} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% \DescribeEnv{frontflap} | 
					
						
							|  |  |  | %% \DescribeEnv{backflap} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% Covers and dust jackets differ only in that covers do not {usually}  | 
					
						
							|  |  |  | %% have flaps. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%   backflap        spline/vspine           frontflap | 
					
						
							|  |  |  | %%     .    backcover      .   frontcover      . | 
					
						
							|  |  |  | %%     v     v             v     v             v | 
					
						
							|  |  |  | %%   +---+---------------+---+---------------+---+                | 
					
						
							|  |  |  | %%   |   |               |   |               |   | | 
					
						
							|  |  |  | %%   |   |               |   |               |   | | 
					
						
							|  |  |  | %%   |   |     Back      |   |     Front     |   | | 
					
						
							|  |  |  | %%   |   |               |   |               |   | | 
					
						
							|  |  |  | %%   |   |               |   |               |   | | 
					
						
							|  |  |  | %%   +---+---------------+---+---------------+---+                | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							| 
									
										
										
										
											2021-08-12 15:22:03 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | \newenvironment{frontcover}{%
 | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | 	\begin{cell*}{
 | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | 				\bleed  | 
					
						
							|  |  |  | 					+ \jacketflapback  | 
					
						
							|  |  |  | 					+ \coverflap  | 
					
						
							|  |  |  | 					+ \jacketwrap  | 
					
						
							|  |  |  | 					+ \coverboardgrow  | 
					
						
							|  |  |  | 					+ \pageblockwidth  | 
					
						
							|  |  |  | 					+ 2\spinefold  | 
					
						
							|  |  |  | 					+ \spinewidth, | 
					
						
							|  |  |  | 				\bleed  | 
					
						
							|  |  |  | 					+ \coverflap }% | 
					
						
							|  |  |  | 			{ \pageblockwidth + \coverboardgrow }% | 
					
						
							|  |  |  | 			{ \pageblockheight + 2\coverboardgrow }% | 
					
						
							|  |  |  | }{%
 | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | 	\end{cell*}} | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | \newenvironment{backcover}{%
 | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | 	\begin{cell*}{
 | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | 				\bleed  | 
					
						
							|  |  |  | 					+ \jacketflapback  | 
					
						
							|  |  |  | 					+ \coverflap  | 
					
						
							|  |  |  | 					+ \jacketwrap, | 
					
						
							|  |  |  | 				\bleed  | 
					
						
							|  |  |  | 					+ \coverflap }% | 
					
						
							|  |  |  | 			{ \pageblockwidth + \coverboardgrow }% | 
					
						
							|  |  |  | 			{ \pageblockheight + 2\coverboardgrow }% | 
					
						
							|  |  |  | }{%
 | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | 	\end{cell*}} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | % spines... | 
					
						
							|  |  |  | % | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | \newenvironment{spine}{%
 | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | 	\begin{cell*}{
 | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | 				\bleed  | 
					
						
							|  |  |  | 					+ \jacketflapback  | 
					
						
							|  |  |  | 					+ \coverflap  | 
					
						
							|  |  |  | 					+ \jacketwrap  | 
					
						
							|  |  |  | 					+ \coverboardgrow  | 
					
						
							|  |  |  | 					+ \pageblockwidth  | 
					
						
							|  |  |  | 					+ \spinefold, | 
					
						
							|  |  |  | 				\bleed  | 
					
						
							|  |  |  | 					+ \coverflap }% | 
					
						
							|  |  |  | 			{ \spinewidth }% | 
					
						
							|  |  |  | 			{ \pageblockheight + 2\coverboardgrow }% | 
					
						
							|  |  |  | }{%
 | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | 	\end{cell*}} | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | \newenvironment{vspine}[1][topdown]{%
 | 
					
						
							|  |  |  | 	\def\photobook@vspine@orientation{#1}% | 
					
						
							|  |  |  | 	% | 
					
						
							|  |  |  | 	\begin{spine}% | 
					
						
							|  |  |  | 	\begin{\photobook@vspine@orientation}% | 
					
						
							|  |  |  | }{%
 | 
					
						
							|  |  |  | 	\end{\photobook@vspine@orientation}% | 
					
						
							|  |  |  | 	\end{spine}} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | % jackets flaps... | 
					
						
							|  |  |  | % | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | \newenvironment{frontflap}{%
 | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | 	\begin{cell*}{
 | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | 				\bleed  | 
					
						
							|  |  |  | 					+ \jacketflapback  | 
					
						
							|  |  |  | 					+ 2\jacketwrap  | 
					
						
							|  |  |  | 					+ 2\coverboardgrow  | 
					
						
							|  |  |  | 					+ 2\pageblockwidth  | 
					
						
							|  |  |  | 					+ 2\spinefold  | 
					
						
							|  |  |  | 					+ \spinewidth, | 
					
						
							|  |  |  | 				\bleed  | 
					
						
							|  |  |  | 					+ \coverflap }%  | 
					
						
							|  |  |  | 			{ \jacketflapfront }% | 
					
						
							|  |  |  | 			{ \pageblockheight + 2\coverboardgrow }% | 
					
						
							|  |  |  | }{%
 | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | 	\end{cell*}} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | \newenvironment{backflap}{%
 | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | 	\begin{cell*}{
 | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | 				\bleed, | 
					
						
							|  |  |  | 				\bleed  | 
					
						
							|  |  |  | 					+ \coverflap }% | 
					
						
							|  |  |  | 			{ \jacketflapback }% | 
					
						
							|  |  |  | 			{ \pageblockheight + 2\coverboardgrow }% | 
					
						
							|  |  |  | }{%
 | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | 	\end{cell*}} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | %---------------------------------------------------------------------- | 
					
						
							| 
									
										
										
										
											2021-08-27 19:04:05 +03:00
										 |  |  | %%%% Caption Templates | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | % XXX need to be able to configure/pass/override: | 
					
						
							|  |  |  | %		- size / \captionsize... | 
					
						
							|  |  |  | %		- color... | 
					
						
							|  |  |  | % XXX captions seem not to account for \imageblockoffsettop... | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | %% \DescribeMacro{\captionsize\{..\}} | 
					
						
							|  |  |  | % | 
					
						
							| 
									
										
										
										
											2021-09-16 00:29:46 +03:00
										 |  |  | %% Defines the caption font. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% Can be redefined to control caption font/style. | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | \ResettableMacro{captionsize}{%
 | 
					
						
							| 
									
										
										
										
											2021-08-28 13:28:15 +03:00
										 |  |  | 	\fontsize{6.5pt}{8pt}\selectfont} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-31 16:25:50 +03:00
										 |  |  | %% \DescribeMacro{\captionformat\{..\}} | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-09-16 00:29:46 +03:00
										 |  |  | %% General caption format. | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %%	>> \captionformat{<code>} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% This can be redefined to control the image caption. | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | \ResettableMacro{captionformat}[1]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-16 00:29:46 +03:00
										 |  |  | 	\adjustbox{
 | 
					
						
							|  |  |  | 			margin=0.1em 0.2em,  | 
					
						
							|  |  |  | 			varwidth=\cellwidth}{%
 | 
					
						
							| 
									
										
										
										
											2021-08-27 19:45:04 +03:00
										 |  |  | 		\captionsize #1}} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-31 08:27:37 +03:00
										 |  |  | %---------------------------------------------------------------------- | 
					
						
							|  |  |  | %%%% Page Templates | 
					
						
							| 
									
										
										
										
											2021-08-31 16:25:50 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %% This section contains a set of predefined configurable single-page | 
					
						
							|  |  |  | %% templates. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-31 08:27:37 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-10 15:54:38 +03:00
										 |  |  | % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 
					
						
							| 
									
										
										
										
											2021-08-31 16:25:50 +03:00
										 |  |  | %%%%% Tweaking | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% Most page/spread templates provide an ability to externally "tweak"  | 
					
						
							|  |  |  | %% some image proportions. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% This is an alternative means to setting template properties, e.g: | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %%		\tweakimagescale{0.8} | 
					
						
							|  |  |  | %%		\ImagePage{image} | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% Is equivalent to: | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %%	>> \ImagePage[scale=0.8]{image} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% Tweaks get reset after each template. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-31 08:27:37 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | %% \DescribeMacro{\imagescale=<num>} | 
					
						
							|  |  |  | %% \DescribeMacro{\imageoffsettop=<len>} | 
					
						
							|  |  |  | %% \DescribeMacro{\imageoffsetleft=<len>} | 
					
						
							| 
									
										
										
										
											2021-08-27 19:45:04 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-08-31 08:27:37 +03:00
										 |  |  | %% Tweak next image templates scale/offsettop/offsetleft | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-31 16:25:50 +03:00
										 |  |  | %% Note that |\imagescale| is not a length. | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %%	>> \edef\imagescale{<scale>} | 
					
						
							|  |  |  | %%	>> \setlength\imageoffsettop{<len>} | 
					
						
							|  |  |  | %%	>> \setlength\imageoffsetleft{<len>} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-31 08:27:37 +03:00
										 |  |  | \edef\imagescale{1} | 
					
						
							| 
									
										
										
										
											2021-08-31 16:25:50 +03:00
										 |  |  | % NOTE: these are initialized later by \resetimagetweaks... | 
					
						
							| 
									
										
										
										
											2021-08-31 08:27:37 +03:00
										 |  |  | \newlength\imageoffsettop | 
					
						
							|  |  |  | \newlength\imageoffsetleft | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-31 08:27:37 +03:00
										 |  |  | %% \DescribeMacro{\tweakimagescale\{..\}} | 
					
						
							| 
									
										
										
										
											2021-09-03 05:18:18 +03:00
										 |  |  | %% \DescribeMacro{\tweakimageoffsettop\{..\}} | 
					
						
							| 
									
										
										
										
											2021-08-31 08:27:37 +03:00
										 |  |  | %% \DescribeMacro{\tweakimageoffsetleft\{..\}} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% Convenience commands | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-31 16:25:50 +03:00
										 |  |  | %% These provide a uniform interface for tweaking. | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %%	>> \tweakimagescale{<scale>} | 
					
						
							|  |  |  | %%	>> \tweakimageoffsettop{<len>} | 
					
						
							|  |  |  | %%	>> \tweakimageoffsetleft{<len>} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-31 08:27:37 +03:00
										 |  |  | \newcommand\tweakimagescale[1]{%
 | 
					
						
							|  |  |  | 	\edef\imagescale{#1}} | 
					
						
							| 
									
										
										
										
											2021-09-03 05:18:18 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-31 08:27:37 +03:00
										 |  |  | \newcommand\tweakimageoffsettop[1]{%
 | 
					
						
							|  |  |  | 	\setlength\imageoffsettop{#1}} | 
					
						
							| 
									
										
										
										
											2021-09-03 05:18:18 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-31 08:27:37 +03:00
										 |  |  | \newcommand\tweakimageoffsetleft[1]{%
 | 
					
						
							|  |  |  | 	\setlength\imageoffsetleft{#1}} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-03 05:18:18 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-31 08:27:37 +03:00
										 |  |  | %% \DescribeMacro{\resetimagetweaks\{..\}} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% Reset tweaked values. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | \newcommand\resetimagetweaks{%
 | 
					
						
							|  |  |  | 	\edef\imagescale{1}% | 
					
						
							|  |  |  | 	\setlength\imageoffsettop{0pt}% | 
					
						
							|  |  |  | 	\setlength\imageoffsetleft{0pt}} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-31 08:27:37 +03:00
										 |  |  | % setup initial state... | 
					
						
							|  |  |  | \resetimagetweaks | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 
					
						
							|  |  |  | % meta-commands... | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-03 03:28:04 +03:00
										 |  |  | %M \DescribeMacro{\ImagePageTemplate\{..\}} | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-09-03 03:28:04 +03:00
										 |  |  | %M	>> \ImagePageTemplate{<name>}{<code>} | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-09-03 03:28:04 +03:00
										 |  |  | %M This will define two commands: | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-09-03 03:28:04 +03:00
										 |  |  | %M	>> \<name>[<options>]{<caption>}{<code>} | 
					
						
							|  |  |  | %M	>> \<name>*[<options>]{<caption>}{<code>} | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-09-03 03:28:04 +03:00
										 |  |  | %M |\<name>{..}| will use |\<name>Caption{..}| template command to typeset  | 
					
						
							|  |  |  | %M the image caption while |\<name>*{..}| will show the caption as-is. | 
					
						
							|  |  |  | %M | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | \def\ImagePageTemplate#1#2{%
 | 
					
						
							|  |  |  | 	% handle <macro>* version... | 
					
						
							|  |  |  | 	\expandafter\def\csname #1\endcsname{\@ifstar{%
 | 
					
						
							| 
									
										
										
										
											2021-08-31 08:27:37 +03:00
										 |  |  | 		\csname photobook@ImagePageTemplate@#1@star\endcsname% | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | 	}{%
 | 
					
						
							| 
									
										
										
										
											2021-08-31 08:27:37 +03:00
										 |  |  | 		\csname photobook@ImagePageTemplate@#1\endcsname}}% | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | 	% main implementation (raw caption)... | 
					
						
							| 
									
										
										
										
											2021-08-31 08:27:37 +03:00
										 |  |  | 	\expandafter\newcommand\csname photobook@ImagePageTemplate@#1@star\endcsname[3][]{%
 | 
					
						
							|  |  |  | 		#2% | 
					
						
							|  |  |  | 		\resetimagetweaks}% | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | 	% main implementation with caption template... | 
					
						
							| 
									
										
										
										
											2021-08-31 08:27:37 +03:00
										 |  |  | 	\expandafter\newcommand\csname photobook@ImagePageTemplate@#1\endcsname[3][]{%
 | 
					
						
							|  |  |  | 		\csname photobook@ImagePageTemplate@#1@star\endcsname[##1]{%
 | 
					
						
							| 
									
										
										
										
											2021-08-31 03:25:11 +03:00
										 |  |  | 			\@ifundefined{#1Caption}{%
 | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | 				##2% | 
					
						
							|  |  |  | 			}{%
 | 
					
						
							| 
									
										
										
										
											2021-08-31 03:25:11 +03:00
										 |  |  | 				\csname #1Caption\endcsname{##2}}}{##3}}} | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-31 16:25:50 +03:00
										 |  |  | \newsavebox\photobook@imagebox | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 
					
						
							| 
									
										
										
										
											2021-09-03 05:18:18 +03:00
										 |  |  | %%%%% General interface
 | 
					
						
							| 
									
										
										
										
											2021-08-31 16:25:50 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %% A templates provide a uniform interface consisting of several commands: | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% Base template command: | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %%	>> \<template-name>{<caption>}{<image>} | 
					
						
							|  |  |  | %%	>> \<template-name>[<options>]{<caption>}{<image>} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% |<options>| is the same as for |\imagecell{..}|. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% Template-specific caption command: | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %%	>> \<template-name>Caption{<caption>} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% This can be redefined to control typesetting the caption for all 
 | 
					
						
							|  |  |  | %% consecutive templates. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% Reset template caption to default: | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %%	>> \reset<template-name>Caption | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% An equivalent to the non-star version but use the caption as-is: | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %%	>> \<template-name>*{<caption>}{<image>} | 
					
						
							|  |  |  | %%	>> \<template-name>*[<options>]{<caption>}{<image>} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% Note that thogh some template versions differ only in |<options>|  | 
					
						
							|  |  |  | %% defaults passed to |\imagecell{..}|, they are split to provide ability  | 
					
						
							|  |  |  | %% to configure the template defaults separately. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-03 05:18:18 +03:00
										 |  |  | % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 
					
						
							|  |  |  | %%%%% No bleed | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-31 03:25:11 +03:00
										 |  |  | %% \DescribeMacro{\ImagePage\{..\}} | 
					
						
							|  |  |  | %% \DescribeMacro{\ImagePageCaption\{..\}} | 
					
						
							|  |  |  | %% \DescribeMacro{\resetImagePageCaption} | 
					
						
							|  |  |  | %% \DescribeMacro{\ImagePage*\{..\}} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | %%	Basic image page
 | 
					
						
							| 
									
										
										
										
											2021-08-29 07:03:36 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-27 19:04:05 +03:00
										 |  |  | %%   +-----------------+ | 
					
						
							|  |  |  | %%   |                 | | 
					
						
							|  |  |  | %%   | +-------------+ | | 
					
						
							|  |  |  | %%   | | .         . | | | 
					
						
							|  |  |  | %%   | |   .     .   | | | 
					
						
							|  |  |  | %%   | |    image    | | | 
					
						
							|  |  |  | %%   | |   .     .   | | | 
					
						
							|  |  |  | %%   | | .         . | | | 
					
						
							|  |  |  | %%   | +-------------+ | | 
					
						
							|  |  |  | %%   |               c | | 
					
						
							|  |  |  | %%   |                 | | 
					
						
							|  |  |  | %%   +-----------------+ | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-29 07:03:36 +03:00
										 |  |  | %% Create an image page: | 
					
						
							| 
									
										
										
										
											2021-08-31 16:25:50 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% Note that |\ImagePage{..}| only supports tweaking |scale|, this is 
 | 
					
						
							|  |  |  | %% intentional ad tweaking offset will mess up page alignment relative  | 
					
						
							|  |  |  | %% to other pages in a book. | 
					
						
							| 
									
										
										
										
											2021-08-29 07:03:36 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-31 03:25:11 +03:00
										 |  |  | \ResettableMacro{ImagePageCaption}[1]{%
 | 
					
						
							| 
									
										
										
										
											2021-08-29 07:03:36 +03:00
										 |  |  | 	\captioncell[under, align=flushright]{%
 | 
					
						
							|  |  |  | 		\captionformat{#1}}} | 
					
						
							| 
									
										
										
										
											2021-08-31 03:25:11 +03:00
										 |  |  | \ImagePageTemplate{ImagePage}{%
 | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | 	\clearpage% | 
					
						
							| 
									
										
										
										
											2021-08-20 16:57:00 +03:00
										 |  |  | 	\begin{page}% | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | 	\begin{pagecell*}% | 
					
						
							| 
									
										
										
										
											2021-08-29 07:03:36 +03:00
										 |  |  | 	\begin{minipage}[t][\cellheight][c]{\cellwidth}% | 
					
						
							|  |  |  | 		\vspace{\imageblockoffsettop\pagetextheight}% | 
					
						
							|  |  |  | 		\begin{center}% | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | 			\begin{inlinecell*}% | 
					
						
							|  |  |  | 					{\imageblockwidth\pagetextwidth}% | 
					
						
							|  |  |  | 					{\imageblockheight\pagetextheight}% | 
					
						
							|  |  |  | 				\imagecell[fit, | 
					
						
							|  |  |  | 					scale=\imagescale, | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | 					%captionclearparent=\captionclearpage, | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | 					#1]{#2}{#3}% | 
					
						
							|  |  |  | 			\end{inlinecell*}% | 
					
						
							| 
									
										
										
										
											2021-08-29 07:03:36 +03:00
										 |  |  | 		\end{center}% | 
					
						
							|  |  |  | 	\end{minipage}% | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | 	\end{pagecell*}% | 
					
						
							| 
									
										
										
										
											2021-08-20 16:57:00 +03:00
										 |  |  | 	\end{page}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | %% \DescribeMacro{\ImagePageClear\{..\}} | 
					
						
							|  |  |  | %% \DescribeMacro{\ImagePageClearCaption\{..\}} | 
					
						
							|  |  |  | %% \DescribeMacro{\resetImagePageClearCaption} | 
					
						
							|  |  |  | %% \DescribeMacro{\ImagePageClear*\{..\}} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %%	>> \ImagePageClear[<options>]{<caption>}{<image>} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%    \clearimage      \clearimage | 
					
						
							|  |  |  | %%    v                v | 
					
						
							|  |  |  | %%   +-----------------+      +-----------------+  < \clearimage | 
					
						
							|  |  |  | %%   |                 |      |  +-----------+  |    | 
					
						
							|  |  |  | %%   |+---------------+|      |  | .       . |  | | 
					
						
							|  |  |  | %%   || .           . ||      |  |  .     .  |  | | 
					
						
							|  |  |  | %%   ||    .     .    ||      |  |   .   .   |  | | 
					
						
							|  |  |  | %%   ||     image     ||      |  |   image   |  | | 
					
						
							|  |  |  | %%   ||    .     .    ||      |  |   .   .   |  | | 
					
						
							|  |  |  | %%   || .           . ||      |  |  .     .  |  | | 
					
						
							|  |  |  | %%   |+---------------+|      |  | .       . |  | | 
					
						
							|  |  |  | %%   |               c |      |  +-----------+  | | 
					
						
							|  |  |  | %%   +-----------------+      +-----------------+  < \clearimage | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-06 19:59:50 +03:00
										 |  |  | %% Default image clearance is set by |\clearimage| global length. | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | %% This respects |\bindingoffset|. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | % XXX make captions adaptive???  | 
					
						
							|  |  |  | \ResettableMacro{ImagePageClearCaption}[1]{%
 | 
					
						
							|  |  |  | 	\captioncell[under, align=flushright]{%
 | 
					
						
							|  |  |  | 		\captionformat{#1}}} | 
					
						
							|  |  |  | \ImagePageTemplate{ImagePageClear}{%
 | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | 	\clearpage% | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | 	\begin{page}% | 
					
						
							| 
									
										
										
										
											2021-09-12 03:29:50 +03:00
										 |  |  | 	% NOTE: this accounts for \bindingoffset... | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | 	\begin{pagecell*}% | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | 		\imagecell[% | 
					
						
							|  |  |  | 			center,  | 
					
						
							|  |  |  | 			clearance=\clearimage,  | 
					
						
							|  |  |  | 			scale=\imagescale, | 
					
						
							|  |  |  | 			offsettop=\imageoffsettop, | 
					
						
							|  |  |  | 			offsetleft=\imageoffsetleft, | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | 			captionclearparent=\captionclearpage, | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | 			#1]{#2}{#3}% | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | 	\end{pagecell*}% | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | 	\end{page}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | %% \DescribeMacro{\ImagePageClear<D>\{..\}} | 
					
						
							|  |  |  | %% \DescribeMacro{\ImagePageClear<D>Caption\{..\}} | 
					
						
							|  |  |  | %% \DescribeMacro{\resetImagePageClear<D>Caption} | 
					
						
							|  |  |  | %% \DescribeMacro{\ImagePageClear<D>*\{..\}} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% |<D>| can be one of T, B, L or R, for top, bottom, left and right  | 
					
						
							|  |  |  | %% respectively. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%   +-----------------+    +-----------------+  | 
					
						
							| 
									
										
										
										
											2021-09-05 02:35:57 +03:00
										 |  |  | %%   | +-------------+ |    |                 |    | 
					
						
							|  |  |  | %%   | | .         . | |    | c               |  | 
					
						
							|  |  |  | %%   | |   .     .   | |    | +-------------+ |  | 
					
						
							|  |  |  | %%   | |    image    | |    | | .         . | |  | 
					
						
							|  |  |  | %%   | |   . (T) .   | |    | |   .     .   | |  | 
					
						
							|  |  |  | %%   | | .         . | |    | |    image    | |  | 
					
						
							|  |  |  | %%   | +-------------+ |    | |   . (B) .   | |  | 
					
						
							|  |  |  | %%   |               c |    | | .         . | |  | 
					
						
							|  |  |  | %%   |                 |    | +-------------+ |  | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | %%   +-----------------+    +-----------------+  | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%   +-----------------+    +-----------------+  | 
					
						
							| 
									
										
										
										
											2021-09-05 02:35:57 +03:00
										 |  |  | %%   | +---------+     |    |     +---------+ |  | 
					
						
							|  |  |  | %%   | |.       .|     |    |     |.       .| |  | 
					
						
							|  |  |  | %%   | | .     . |     |    |     | .     . | |  | 
					
						
							|  |  |  | %%   | |  .   .  |     |    |     |  .   .  | |  | 
					
						
							|  |  |  | %%   | |  image  |     |    |     |  image  | |  | 
					
						
							|  |  |  | %%   | |  .(L).  |     |    |     |  .(R).  | |  | 
					
						
							|  |  |  | %%   | | .     . |     |    |     | .     . | |  | 
					
						
							|  |  |  | %%   | |.       .|     |    |     |.       .| |  | 
					
						
							|  |  |  | %%   | +---------+ c   |    |   c +---------+ |  | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | %%   +-----------------+    +-----------------+  | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | % XXX TEST... | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | \ResettableMacro{ImagePageClearTCaption}[1]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | 	\captioncell[under]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | 		\captionformat{#1}}} | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | % XXX the image seems to be a line too low... | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | \ImagePageTemplate{ImagePageClearT}{%
 | 
					
						
							|  |  |  | 	\ImagePageClear*[% | 
					
						
							|  |  |  | 		top, | 
					
						
							|  |  |  | 		#1]{#2}{#3}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | \ResettableMacro{ImagePageClearBCaption}[1]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | 	\captioncell[over]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | 		\captionformat{#1}}} | 
					
						
							|  |  |  | \ImagePageTemplate{ImagePageClearB}{%
 | 
					
						
							|  |  |  | 	\ImagePageClear*[% | 
					
						
							|  |  |  | 		bottom, | 
					
						
							|  |  |  | 		#1]{#2}{#3}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | \ResettableMacro{ImagePageClearLCaption}[1]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | 	\captionblockcell[right, clearance=\captionclearpage]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | 		\captionformat{#1}}} | 
					
						
							|  |  |  | \ImagePageTemplate{ImagePageClearL}{%
 | 
					
						
							|  |  |  | 	\ImagePageClear*[% | 
					
						
							|  |  |  | 		left, | 
					
						
							|  |  |  | 		#1]{#2}{#3}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | \ResettableMacro{ImagePageClearRCaption}[1]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | 	\captionblockcell[left, clearance=\captionclearpage]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | 		\captionformat{#1}}} | 
					
						
							|  |  |  | \ImagePageTemplate{ImagePageClearR}{%
 | 
					
						
							|  |  |  | 	\ImagePageClear*[% | 
					
						
							|  |  |  | 		right, | 
					
						
							|  |  |  | 		#1]{#2}{#3}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-03 05:18:18 +03:00
										 |  |  | % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 
					
						
							|  |  |  | %%%%% Partial bleed | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-31 03:25:11 +03:00
										 |  |  | %% \DescribeMacro{\ImagePageFit\{..\}} | 
					
						
							|  |  |  | %% \DescribeMacro{\ImagePageFitCaption\{..\}} | 
					
						
							|  |  |  | %% \DescribeMacro{\resetImagePageFitCaption} | 
					
						
							|  |  |  | %% \DescribeMacro{\ImagePageFit*\{..\}} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-08-31 16:25:50 +03:00
										 |  |  | %% Fit image into page... | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-08-31 03:25:11 +03:00
										 |  |  | %%	>> \ImagePageFit[<options>]{<caption>}{<image>} | 
					
						
							| 
									
										
										
										
											2021-08-14 03:02:59 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | %%                               . . . . . . . | 
					
						
							|  |  |  | %%   +-----------------+      +-----------------+ | 
					
						
							|  |  |  | %%   |                 |      |  |.         .|  | | 
					
						
							|  |  |  | %% . +-----------------+ .    |  | .       . |  | | 
					
						
							|  |  |  | %% . | .             . | .    |  |  .     .  |  | | 
					
						
							|  |  |  | %% . |    .       .    | .    |  |   .   .   |  | | 
					
						
							|  |  |  | %% . |      image      | .    |  |   image   |  | | 
					
						
							|  |  |  | %% . |    .       .    | .    |  |   .   .   |  | | 
					
						
							|  |  |  | %% . | .             . | .    |  |  .     .  |  | | 
					
						
							|  |  |  | %% . +-----------------+ .    |  | .       . |  | | 
					
						
							|  |  |  | %%   |               c |      |  |.        c.|  | | 
					
						
							|  |  |  | %%   +-----------------+      +-----------------+ | 
					
						
							|  |  |  | %%                               . . . . . . . | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-06 19:59:50 +03:00
										 |  |  | %% Default image clearance is set by |\bleed| global length. | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | %% If centered image fits vertically this will account for |\bindingoffset|. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | % XXX make captions adaptive???  | 
					
						
							| 
									
										
										
										
											2021-08-31 03:25:11 +03:00
										 |  |  | \ResettableMacro{ImagePageFitCaption}[1]{%
 | 
					
						
							| 
									
										
										
										
											2021-08-29 07:03:36 +03:00
										 |  |  | 	\captioncell[under, align=flushright]{%
 | 
					
						
							|  |  |  | 		\captionformat{#1}}} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | \newif\ifphotobook@ImagePageFit@centered
 | 
					
						
							|  |  |  | \photobook@ImagePageFit@centeredfalse | 
					
						
							| 
									
										
										
										
											2021-08-13 15:09:38 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | \newlength\photobook@ImagePageFit@imgratio | 
					
						
							|  |  |  | \newlength\photobook@ImagePageFit@cellratio | 
					
						
							|  |  |  | \def\photobook@ImagePageFit@opt{} | 
					
						
							|  |  |  | \def\photobook@ImagePageFit@args{} | 
					
						
							| 
									
										
										
										
											2021-08-14 03:02:59 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | \ImagePageTemplate{ImagePageFit}{%
 | 
					
						
							|  |  |  | 	\begingroup% | 
					
						
							|  |  |  | 		% see if default alignment is overridden... | 
					
						
							| 
									
										
										
										
											2021-09-26 01:04:41 +03:00
										 |  |  | 		\setsepchar{,}% | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | 		\ignoreemptyitems% | 
					
						
							|  |  |  | 		\readlist*\photobook@ImagePageFit@args{moo, #1}% | 
					
						
							|  |  |  | 		\foreachitem\photobook@ImagePageFit@opt\in\photobook@ImagePageFit@args{%
 | 
					
						
							| 
									
										
										
										
											2021-09-16 02:57:01 +03:00
										 |  |  | 			\ifthenelse{\equal{\photobook@ImagePageFit@opt}{fill}}{%
 | 
					
						
							|  |  |  | 				\photobook@ImagePageFit@centeredtrue}{}% | 
					
						
							| 
									
										
										
										
											2021-09-08 18:52:23 +03:00
										 |  |  | 			\ifthenelse{\equal{\photobook@ImagePageFit@opt}{inner}}{%
 | 
					
						
							|  |  |  | 				\photobook@ImagePageFit@centeredtrue}{}% | 
					
						
							|  |  |  | 			\ifthenelse{\equal{\photobook@ImagePageFit@opt}{outer}}{%
 | 
					
						
							|  |  |  | 				\photobook@ImagePageFit@centeredtrue}{}% | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | 			\ifthenelse{\equal{\photobook@ImagePageFit@opt}{top}}{%
 | 
					
						
							| 
									
										
										
										
											2021-09-08 18:52:23 +03:00
										 |  |  | 				\photobook@ImagePageFit@centeredtrue}{}% | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | 			\ifthenelse{\equal{\photobook@ImagePageFit@opt}{left}}{%
 | 
					
						
							| 
									
										
										
										
											2021-09-08 18:52:23 +03:00
										 |  |  | 				\photobook@ImagePageFit@centeredtrue}{}% | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | 			\ifthenelse{\equal{\photobook@ImagePageFit@opt}{bottom}}{%
 | 
					
						
							| 
									
										
										
										
											2021-09-08 18:52:23 +03:00
										 |  |  | 				\photobook@ImagePageFit@centeredtrue}{}% | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | 			\ifthenelse{\equal{\photobook@ImagePageFit@opt}{right}}{%
 | 
					
						
							| 
									
										
										
										
											2021-09-08 18:52:23 +03:00
										 |  |  | 				\photobook@ImagePageFit@centeredtrue}{}}% | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | 		% align center -> check if image fits vertically... | 
					
						
							|  |  |  | 		\ifphotobook@ImagePageFit@centered\else% | 
					
						
							|  |  |  | 			\sbox{\photobook@imagebox}{\includegraphics{#3}}% | 
					
						
							| 
									
										
										
										
											2021-09-08 18:52:23 +03:00
										 |  |  | 			\setlength\photobook@ImagePageFit@imgratio{%
 | 
					
						
							|  |  |  | 				1pt * \ratio{\wd\photobook@imagebox}{\ht\photobook@imagebox}}% | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | 			% NOTE: subtracting \bindingoffset from \cellwidth here makes sure that | 
					
						
							|  |  |  | 			%		we avoid offsetting images close enough in ratio to the page and
 | 
					
						
							|  |  |  | 			%		messing up bleeds... | 
					
						
							| 
									
										
										
										
											2021-09-16 02:57:01 +03:00
										 |  |  | 			\setlength\photobook@ImagePageFit@cellratio{%
 | 
					
						
							|  |  |  | 				1pt * \ratio{\cellwidth - \bindingoffset}{\cellheight}}% | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | 			\ifdim \photobook@ImagePageFit@imgratio > \photobook@ImagePageFit@cellratio% | 
					
						
							|  |  |  | 				\photobook@ImagePageFit@centeredtrue\fi\fi% | 
					
						
							|  |  |  | 		% | 
					
						
							|  |  |  | 		% ignore \bindingoffset -> center the image... | 
					
						
							|  |  |  | 		\ifphotobook@ImagePageFit@centered% | 
					
						
							|  |  |  | 			\clearpage% | 
					
						
							|  |  |  | 			\begin{page}% | 
					
						
							| 
									
										
										
										
											2021-09-12 03:29:50 +03:00
										 |  |  | 			% NOTE: this does not account for \bindingoffset... | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | 			\begin{pagecell}% | 
					
						
							|  |  |  | 				\imagecell[% | 
					
						
							|  |  |  | 					center,  | 
					
						
							|  |  |  | 					clearance=-\bleed,  | 
					
						
							|  |  |  | 					scale=\imagescale, | 
					
						
							|  |  |  | 					offsettop=\imageoffsettop, | 
					
						
							|  |  |  | 					offsetleft=\imageoffsetleft, | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | 					captionclearparent=\captionclearpage, | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | 					#1]{#2}{#3}% | 
					
						
							|  |  |  | 			\end{pagecell}% | 
					
						
							|  |  |  | 			\end{page}% | 
					
						
							|  |  |  | 		% special case: centered vertical image -> account for \bindingoffset... | 
					
						
							|  |  |  | 		\else% | 
					
						
							|  |  |  | 			\ImagePageClear*[% | 
					
						
							|  |  |  | 				clearance=-\bleed,  | 
					
						
							|  |  |  | 				#1]{#2}{#3}\fi% | 
					
						
							|  |  |  | 	\endgroup} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | %% \DescribeMacro{\ImagePageFit<D>\{..\}} | 
					
						
							|  |  |  | %% \DescribeMacro{\ImagePageFit<D>Caption\{..\}} | 
					
						
							|  |  |  | %% \DescribeMacro{\resetImagePageFit<D>Caption} | 
					
						
							|  |  |  | %% \DescribeMacro{\ImagePageFit<D>*\{..\}} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | %% |<D>| can be one of T, B, L or R, for top, bottom, left and right  | 
					
						
							|  |  |  | %% respectively. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-08 14:07:52 +03:00
										 |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | %%   . . . . . . . . . . . .   | 
					
						
							|  |  |  | %%   . +-----------------+ .    +-----------------+ | 
					
						
							|  |  |  | %%   . |  .           .  | .    |                 | | 
					
						
							|  |  |  | %%   . |     .     .     | .    |                 | | 
					
						
							|  |  |  | %%   . |      image      | .    |                 | | 
					
						
							|  |  |  | %%   . |     . (T) .     | .  . |-----------------| . | 
					
						
							|  |  |  | %%   . |  .           .  | .  . |  .           .  | . | 
					
						
							|  |  |  | %%   . |-----------------| .  . |     .     .     | . | 
					
						
							|  |  |  | %%     |                 |    . |      image      | . | 
					
						
							|  |  |  | %%     |                 |    . |     . (B) .     | . | 
					
						
							|  |  |  | %%     |                 |    . |  .           .  | . | 
					
						
							|  |  |  | %%     +-----------------+    . +-----------------+ . | 
					
						
							|  |  |  | %%                            . . . . . . . . . . . . | 
					
						
							|  |  |  | %%    | 
					
						
							|  |  |  | %%   . . . . . . . .                  . . . . . . . . | 
					
						
							|  |  |  | %%   . +-----------------+      +-----------------+ . | 
					
						
							|  |  |  | %%   . |.         .|     |      |     |.         .| . | 
					
						
							|  |  |  | %%   . | .       . |     |      |     | .       . | . | 
					
						
							|  |  |  | %%   . |  .     .  |     |      |     |  .     .  | . | 
					
						
							|  |  |  | %%   . |   .   .   |     |      |     |   .   .   | . | 
					
						
							|  |  |  | %%   . |   image   |     |      |     |   image   | . | 
					
						
							|  |  |  | %%   . |   .(L).   |     |      |     |   .(R).   | . | 
					
						
							|  |  |  | %%   . |  .     .  |     |      |     |  .     .  | . | 
					
						
							|  |  |  | %%   . | .       . |     |      |     | .       . | . | 
					
						
							|  |  |  | %%   . |.         .| c   |      |   c |.         .| . | 
					
						
							|  |  |  | %%   . +-----------------+      +-----------------+ . | 
					
						
							|  |  |  | %%   . . . . . . . .                  . . . . . . . . | 
					
						
							| 
									
										
										
										
											2021-08-08 14:07:52 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | \ResettableMacro{ImagePageFitTCaption}[1]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | 	\captioncell[under]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | 		\captionformat{#1}}} | 
					
						
							|  |  |  | \ImagePageTemplate{ImagePageFitT}{%
 | 
					
						
							|  |  |  | 	\ImagePageFit*[% | 
					
						
							|  |  |  | 		top,  | 
					
						
							|  |  |  | 		#1]{#2}{#3}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | \ResettableMacro{ImagePageFitBCaption}[1]{%
 | 
					
						
							|  |  |  | 	\captioncell[over]{%
 | 
					
						
							|  |  |  | 		\captionformat{#1}}} | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | % XXX the image seems a bit too low... | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | \ImagePageTemplate{ImagePageFitB}{%
 | 
					
						
							|  |  |  | 	\ImagePageFit*[% | 
					
						
							|  |  |  | 		bottom,  | 
					
						
							|  |  |  | 		#1]{#2}{#3}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | \ResettableMacro{ImagePageFitLCaption}[1]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | 	\captionblockcell[right, clearance=\captionclearpage]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | 		\captionformat{#1}}} | 
					
						
							|  |  |  | \ImagePageTemplate{ImagePageFitL}{%
 | 
					
						
							|  |  |  | 	\ImagePageFit*[% | 
					
						
							|  |  |  | 		left,  | 
					
						
							|  |  |  | 		#1]{#2}{#3}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | \ResettableMacro{ImagePageFitRCaption}[1]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | 	\captionblockcell[left, clearance=\captionclearpage]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | 		\captionformat{#1}}} | 
					
						
							|  |  |  | \ImagePageTemplate{ImagePageFitR}{%
 | 
					
						
							|  |  |  | 	\ImagePageFit*[% | 
					
						
							|  |  |  | 		right,  | 
					
						
							|  |  |  | 		#1]{#2}{#3}} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-03 05:18:18 +03:00
										 |  |  | % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 
					
						
							|  |  |  | %%%%% Full bleed | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | %% \DescribeMacro{\ImagePageFill\{..\}} | 
					
						
							|  |  |  | %% \DescribeMacro{\ImagePageFillCaption\{..\}} | 
					
						
							|  |  |  | %% \DescribeMacro{\resetImagePageFillCaption} | 
					
						
							|  |  |  | %% \DescribeMacro{\ImagePageFill*\{..\}} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %%	Like |\ImagePage| but will fill page with image. | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %%	>> \ImagePageFill[<options>]{<caption>}{<image>} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%   . . . . . . . . . . . . . . . . . . . | 
					
						
							|  |  |  | %%   . .      +-----------------+      . . | 
					
						
							|  |  |  | %%   .    .   |              c  |   .    . | 
					
						
							|  |  |  | %%   .       .|                 |.       . | 
					
						
							|  |  |  | %%   .        | .             . |        . | 
					
						
							|  |  |  | %%   .        |    .       .    |        . | 
					
						
							|  |  |  | %%   .        |      image      |        . | 
					
						
							|  |  |  | %%   .        |    .       .    |        . | 
					
						
							|  |  |  | %%   .        | .             . |        . | 
					
						
							|  |  |  | %%   .       .|                 |.       . | 
					
						
							|  |  |  | %%   .    .   |                 |   .    . | 
					
						
							|  |  |  | %%   . .      +-----------------+      . . | 
					
						
							|  |  |  | %%   . . . . . . . . . . . . . . . . . . . | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-06 19:59:50 +03:00
										 |  |  | %% Default image clearance is set by |\bleed| global length. | 
					
						
							| 
									
										
										
										
											2021-09-03 05:18:18 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | \ResettableMacro{ImagePageFillCaption}[1]{%
 | 
					
						
							|  |  |  | 	\captioncell[top, align=flushright]{%
 | 
					
						
							|  |  |  | 		\captionformat{#1}}} | 
					
						
							|  |  |  | \ImagePageTemplate{ImagePageFill}{%
 | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | 	\ImagePageFit*[% | 
					
						
							|  |  |  | 		fill,  | 
					
						
							|  |  |  | 		#1]{#2}{#3}} | 
					
						
							| 
									
										
										
										
											2021-09-03 05:18:18 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-31 16:25:50 +03:00
										 |  |  | %% \DescribeMacro{\ImageHalfPageL\{..\}} | 
					
						
							|  |  |  | %% \DescribeMacro{\ImageHalfPageLCaption\{..\}} | 
					
						
							|  |  |  | %% \DescribeMacro{\resetImageHalfPageLCaption} | 
					
						
							|  |  |  | %% \DescribeMacro{\ImageHalfPageL*\{..\}} | 
					
						
							| 
									
										
										
										
											2021-08-10 06:14:42 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-08-31 03:25:11 +03:00
										 |  |  | %% Left half of image filling page with full bleed. | 
					
						
							| 
									
										
										
										
											2021-08-10 06:14:42 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %%	>> \imageleftspreadfullbleed[<vertical-offset>]{<caption>}{<image>} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | %%  . . . . . . . . . . . . .  | 
					
						
							|  |  |  | %%  . +-----------------+      | 
					
						
							|  |  |  | %%  . |   .             |      | 
					
						
							|  |  |  | %%  . |       .         |      | 
					
						
							|  |  |  | %%  . |           .     |      | 
					
						
							|  |  |  | %%  . |               . |      | 
					
						
							|  |  |  | %%  . |               image
 | 
					
						
							|  |  |  | %%  . |               . |      | 
					
						
							|  |  |  | %%  . |           .     |      | 
					
						
							|  |  |  | %%  . |       .         |      | 
					
						
							|  |  |  | %%  . |   .           c |      | 
					
						
							|  |  |  | %%  . +-----------------+      | 
					
						
							|  |  |  | %%  . . . . . . . . . . . . .  | 
					
						
							| 
									
										
										
										
											2021-08-10 06:14:42 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							| 
									
										
										
										
											2021-08-10 14:14:43 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-31 03:25:11 +03:00
										 |  |  | % XXX TEST... | 
					
						
							|  |  |  | % XXX do a better default... | 
					
						
							| 
									
										
										
										
											2021-08-31 16:25:50 +03:00
										 |  |  | \ResettableMacro{ImageHalfPageLCaption}[1]{%
 | 
					
						
							| 
									
										
										
										
											2021-08-31 03:25:11 +03:00
										 |  |  | 	\captioncell[bottom, align=flushright]{%
 | 
					
						
							|  |  |  | 		\captionformat{#1}}} | 
					
						
							| 
									
										
										
										
											2021-08-31 16:25:50 +03:00
										 |  |  | \ImagePageTemplate{ImageHalfPageL}{%
 | 
					
						
							|  |  |  | 	\begin{spreadtopages*}[2]{photobook@ImageHalfPageL@cell}% | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | 		\imagecell[% | 
					
						
							|  |  |  | 			fill,  | 
					
						
							|  |  |  | 			clearance=-\bleed, | 
					
						
							| 
									
										
										
										
											2021-08-31 08:27:37 +03:00
										 |  |  | 			scale=\imagescale, | 
					
						
							|  |  |  | 			offsettop=\imageoffsettop, | 
					
						
							|  |  |  | 			offsetleft=\imageoffsetleft, | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | 			captionclearparent=\captionclearpage, | 
					
						
							| 
									
										
										
										
											2021-08-31 08:27:37 +03:00
										 |  |  | 			#1]{#2}{#3}% | 
					
						
							| 
									
										
										
										
											2021-08-31 03:25:11 +03:00
										 |  |  | 	\end{spreadtopages*}% | 
					
						
							|  |  |  | 	% | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | 	\clearpage% | 
					
						
							| 
									
										
										
										
											2021-08-31 16:25:50 +03:00
										 |  |  | 	\usespreadpage[1]{photobook@ImageHalfPageL@cell}} | 
					
						
							| 
									
										
										
										
											2021-08-10 06:14:42 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-31 03:25:11 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-31 08:27:37 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-31 16:25:50 +03:00
										 |  |  | %% \DescribeMacro{\ImageHalfPageR\{..\}} | 
					
						
							|  |  |  | %% \DescribeMacro{\ImageHalfPageRCaption\{..\}} | 
					
						
							|  |  |  | %% \DescribeMacro{\resetImageHalfPageRCaption} | 
					
						
							|  |  |  | %% \DescribeMacro{\ImageHalfPageR*\{..\}} | 
					
						
							| 
									
										
										
										
											2021-08-10 06:14:42 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-08-31 03:25:11 +03:00
										 |  |  | %% Right half of image filling page with full bleed. | 
					
						
							| 
									
										
										
										
											2021-08-10 06:14:42 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %%	>> \imagerightspreadfullbleed[<vertical-offset>]{<caption>}{<image>} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | %%  . . . . . . . . . . . . . | 
					
						
							|  |  |  | %%      +-----------------+ . | 
					
						
							|  |  |  | %%      |             .   | . | 
					
						
							|  |  |  | %%      |         .       | . | 
					
						
							|  |  |  | %%      |     .           | . | 
					
						
							|  |  |  | %%      | .               | . | 
					
						
							|  |  |  | %%    image               | . | 
					
						
							|  |  |  | %%      | .               | . | 
					
						
							|  |  |  | %%      |     .           | . | 
					
						
							|  |  |  | %%      |         .       | . | 
					
						
							|  |  |  | %%      |             . c | . | 
					
						
							|  |  |  | %%      +-----------------+ . | 
					
						
							|  |  |  | %%  . . . . . . . . . . . . . | 
					
						
							| 
									
										
										
										
											2021-08-10 06:14:42 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							| 
									
										
										
										
											2021-08-10 14:14:43 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-31 03:25:11 +03:00
										 |  |  | % XXX TEST... | 
					
						
							|  |  |  | % XXX do a better default... | 
					
						
							| 
									
										
										
										
											2021-08-31 16:25:50 +03:00
										 |  |  | \ResettableMacro{ImageHalfPageRCaption}[1]{%
 | 
					
						
							| 
									
										
										
										
											2021-08-31 03:25:11 +03:00
										 |  |  | 	\captioncell[bottom, align=flushright]{%
 | 
					
						
							|  |  |  | 		\captionformat{#1}}} | 
					
						
							| 
									
										
										
										
											2021-08-31 16:25:50 +03:00
										 |  |  | \ImagePageTemplate{ImageHalfPageR}{%
 | 
					
						
							|  |  |  | 	\begin{spreadtopages*}[2]{photobook@ImageHalfPageR@cell}% | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | 		\imagecell[% | 
					
						
							|  |  |  | 			fill,  | 
					
						
							|  |  |  | 			clearance=-\bleed,  | 
					
						
							| 
									
										
										
										
											2021-08-31 08:27:37 +03:00
										 |  |  | 			scale=\imagescale, | 
					
						
							|  |  |  | 			offsettop=\imageoffsettop, | 
					
						
							|  |  |  | 			offsetleft=\imageoffsetleft, | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | 			captionclearparent=\captionclearpage, | 
					
						
							| 
									
										
										
										
											2021-08-31 08:27:37 +03:00
										 |  |  | 			#1]{#2}{#3}% | 
					
						
							| 
									
										
										
										
											2021-08-31 03:25:11 +03:00
										 |  |  | 	\end{spreadtopages*}% | 
					
						
							|  |  |  | 	% | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | 	\clearpage% | 
					
						
							| 
									
										
										
										
											2021-08-31 16:25:50 +03:00
										 |  |  | 	\usespreadpage[2]{photobook@ImageHalfPageR@cell}} | 
					
						
							| 
									
										
										
										
											2021-08-10 06:14:42 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | %---------------------------------------------------------------------- | 
					
						
							|  |  |  | %%%% Spread Templates | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-03 05:18:18 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | %%%%% No bleed | 
					
						
							| 
									
										
										
										
											2021-09-03 05:18:18 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | % XXX TEST!! | 
					
						
							|  |  |  | % XXX doc... | 
					
						
							|  |  |  | % XXX Should we make this just like with pages, i.e. \imagePage{..} and 
 | 
					
						
							|  |  |  | %		\ImagePageFit{..}, the first places relative to text and raises  | 
					
						
							|  |  |  | %		slightly while the second simply centers... | 
					
						
							|  |  |  | %% \DescribeMacro{\ImageSpread\{..\}} | 
					
						
							|  |  |  | %% \DescribeMacro{\ImageSpreadCaption\{..\}} | 
					
						
							|  |  |  | %% \DescribeMacro{\resetImageSpreadCaption} | 
					
						
							|  |  |  | %% \DescribeMacro{\ImageSpread*\{..\}} | 
					
						
							| 
									
										
										
										
											2021-08-09 13:43:36 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | %%    +---------------+---------------+  | 
					
						
							|  |  |  | %%    | +-------------+-------------+ |  | 
					
						
							|  |  |  | %%    | |  .          .          .  | |  | 
					
						
							|  |  |  | %%    | |      .      .      .      | |  | 
					
						
							|  |  |  | %%    | |          .  .  .          | |  | 
					
						
							|  |  |  | %%    | |           image           | |  | 
					
						
							|  |  |  | %%    | |          .  .  .          | |  | 
					
						
							|  |  |  | %%    | |      .      .      .      | |  | 
					
						
							|  |  |  | %%    | |  .          .          .  | |  | 
					
						
							|  |  |  | %%    | +-------------+-------------+ |  | 
					
						
							|  |  |  | %%    +---------------+---------------+  | 
					
						
							| 
									
										
										
										
											2021-08-09 13:43:36 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							| 
									
										
										
										
											2021-08-10 14:14:43 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | % XXX do a better default... | 
					
						
							|  |  |  | %		...adaptive??? | 
					
						
							|  |  |  | \ResettableMacro{ImageSpreadCaption}[1]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-10 15:54:38 +03:00
										 |  |  | 	\captioncell[under]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | 		\captionformat{#1}}} | 
					
						
							|  |  |  | \ImagePageTemplate{ImageSpread}{%
 | 
					
						
							|  |  |  | 	\cleartoleftpage% | 
					
						
							|  |  |  | 	\begin{spreadtopages}[2]% | 
					
						
							|  |  |  | 		\imagecell[% | 
					
						
							|  |  |  | 			fit,  | 
					
						
							| 
									
										
										
										
											2021-09-06 19:59:50 +03:00
										 |  |  | 			clearance=\clearimage,  | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | 			scale=\imagescale, | 
					
						
							|  |  |  | 			offsettop=\imageoffsettop, | 
					
						
							|  |  |  | 			offsetleft=\imageoffsetleft, | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | 			captionclearparent=\captionclearpage, | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | 			#1]{#2}{#3}% | 
					
						
							|  |  |  | 	\end{spreadtopages}} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | %% \DescribeMacro{\ImageSpread<D>\{..\}} | 
					
						
							|  |  |  | %% \DescribeMacro{\ImageSpread<D>Caption\{..\}} | 
					
						
							|  |  |  | %% \DescribeMacro{\resetImageSpread<D>Caption} | 
					
						
							|  |  |  | %% \DescribeMacro{\ImageSpread<D>*\{..\}} | 
					
						
							| 
									
										
										
										
											2021-08-09 13:43:36 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | %% |<D>| can be one of T, B, L or R, for top, bottom, left and right  | 
					
						
							|  |  |  | %% respectively. | 
					
						
							| 
									
										
										
										
											2021-08-27 19:04:05 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-09 13:43:36 +03:00
										 |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | %%    +---------------+---------------+  +---------------+---------------+    | 
					
						
							|  |  |  | %%    | +-------------+-------------+ |  |               .               |    | 
					
						
							|  |  |  | %%    | |  .          .          .  | |  |  c            .               |    | 
					
						
							|  |  |  | %%    | |       .     .     .       | |  | +-------------+-------------+ |    | 
					
						
							|  |  |  | %%    | |           image           | |  | |  .          .          .  | |    | 
					
						
							|  |  |  | %%    | |       .    (T)    .       | |  | |       .     .     .       | |    | 
					
						
							|  |  |  | %%    | |  .          .          .  | |  | |           image           | |    | 
					
						
							|  |  |  | %%    | +-------------+-------------+ |  | |       .    (B)    .       | |    | 
					
						
							|  |  |  | %%    |               .            c  |  | |  .          .          .  | |    | 
					
						
							|  |  |  | %%    |               .               |  | +-------------+-------------+ |    | 
					
						
							|  |  |  | %%    +---------------+---------------+  +---------------+---------------+    | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%    +---------------+---------------+  +---------------+---------------+  | 
					
						
							|  |  |  | %%    | +-------------+---------+     |  |     +---------+-------------+ |  | 
					
						
							|  |  |  | %%    | |  .          .      .  |     |  |     |  .      .          .  | |  | 
					
						
							|  |  |  | %%    | |     .       .   .     |     |  |     |     .   .       .     | |  | 
					
						
							|  |  |  | %%    | |        .    ..        |     |  |     |        ..    .        | |  | 
					
						
							|  |  |  | %%    | |         image         |     |  |     |         image         | |  | 
					
						
							|  |  |  | %%    | |        . (L)..        |     |  |     |        ..(R) .        | |  | 
					
						
							|  |  |  | %%    | |     .       .   .     |     |  |     |     .   .       .     | |  | 
					
						
							|  |  |  | %%    | |  .          .      .  |     |  |     |  .      .          .  | |  | 
					
						
							|  |  |  | %%    | +-------------+---------+ c   |  |   c +---------+-------------+ |  | 
					
						
							|  |  |  | %%    +---------------+---------------+  +---------------+---------------+  | 
					
						
							| 
									
										
										
										
											2021-08-09 13:43:36 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							| 
									
										
										
										
											2021-08-10 14:14:43 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | \ResettableMacro{ImageSpreadTCaption}[1]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-10 15:54:38 +03:00
										 |  |  | 	\captioncell[under]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | 		\captionformat{#1}}} | 
					
						
							|  |  |  | \ImagePageTemplate{ImageSpreadT}{%
 | 
					
						
							|  |  |  | 	\ImageSpread*[% | 
					
						
							|  |  |  | 		top,  | 
					
						
							|  |  |  | 		#1]{#2}{#3}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | \ResettableMacro{ImageSpreadBCaption}[1]{%
 | 
					
						
							|  |  |  | 	\captioncell[over]{%
 | 
					
						
							|  |  |  | 		\captionformat{#1}}} | 
					
						
							|  |  |  | \ImagePageTemplate{ImageSpreadB}{%
 | 
					
						
							|  |  |  | 	\ImageSpread*[% | 
					
						
							|  |  |  | 		bottom,  | 
					
						
							|  |  |  | 		#1]{#2}{#3}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | \ResettableMacro{ImageSpreadLCaption}[1]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | 	\captionblockcell[right, clearance=\captionclearpage]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | 		\captionformat{#1}}} | 
					
						
							|  |  |  | \ImagePageTemplate{ImageSpreadL}{%
 | 
					
						
							|  |  |  | 	\ImageSpread*[% | 
					
						
							|  |  |  | 		left,  | 
					
						
							|  |  |  | 		#1]{#2}{#3}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | \ResettableMacro{ImageSpreadRCaption}[1]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | 	\captionblockcell[left, clearance=\captionclearpage]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | 		\captionformat{#1}}} | 
					
						
							|  |  |  | \ImagePageTemplate{ImageSpreadR}{%
 | 
					
						
							|  |  |  | 	\ImageSpread*[% | 
					
						
							|  |  |  | 		right,  | 
					
						
							|  |  |  | 		#1]{#2}{#3}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 
					
						
							|  |  |  | %%%%% Partial bleed | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-10 03:27:33 +03:00
										 |  |  | %% \DescribeMacro{\ImageSpreadFit\{..\}} | 
					
						
							|  |  |  | %% \DescribeMacro{\ImageSpreadFitCaption\{..\}} | 
					
						
							|  |  |  | %% \DescribeMacro{\resetImageSpreadFitCaption} | 
					
						
							|  |  |  | %% \DescribeMacro{\ImageSpreadFit*\{..\}} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-08-09 13:43:36 +03:00
										 |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-10 03:27:33 +03:00
										 |  |  | %%                                                  . . . . . . . . . . . | 
					
						
							|  |  |  | %%     +---------------+---------------+      +---------------+---------------+   | 
					
						
							|  |  |  | %%     |               .               |      |     |.        .        .|.    |   | 
					
						
							|  |  |  | %%   . |-------------------------------| .    |     |  .      .      .  |     |   | 
					
						
							|  |  |  | %%   . |    .          .          .    | .    |     |    .    .    .    |     |   | 
					
						
							|  |  |  | %%   . |         .     .     .         | .    |     |      .  .  .      |     |   | 
					
						
							|  |  |  | %%   . |             image             | .    |     |       image       |     |   | 
					
						
							|  |  |  | %%   . |         .     .     .         | .    |     |      .  .  .      |     |   | 
					
						
							|  |  |  | %%   . |    .          .          .    | .    |     |    .    .    .    |     |   | 
					
						
							|  |  |  | %%   . |-------------------------------| .    |     |  .      .      .  |     |   | 
					
						
							|  |  |  | %%     |               .             c |      |     |.        .        .| c   |   | 
					
						
							|  |  |  | %%     +---------------+---------------+      +---------------+---------------+   | 
					
						
							|  |  |  | %%                                                  . . . . . . . . . . . | 
					
						
							| 
									
										
										
										
											2021-08-09 13:43:36 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							| 
									
										
										
										
											2021-08-10 14:14:43 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-10 03:27:33 +03:00
										 |  |  | % XXX TEST... | 
					
						
							|  |  |  | % XXX make caption adaptive... | 
					
						
							|  |  |  | \ResettableMacro{ImageSpreadFitCaption}[1]{%
 | 
					
						
							|  |  |  | 	\captioncell[under]{%
 | 
					
						
							| 
									
										
										
										
											2021-08-31 02:43:22 +03:00
										 |  |  | 		\captionformat{#1}}} | 
					
						
							| 
									
										
										
										
											2021-09-10 03:27:33 +03:00
										 |  |  | \ImagePageTemplate{ImageSpreadFit}{%
 | 
					
						
							| 
									
										
										
										
											2021-08-31 02:43:22 +03:00
										 |  |  | 	\cleartoleftpage% | 
					
						
							|  |  |  | 	\begin{spreadtopages}[2]% | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | 		\imagecell[% | 
					
						
							|  |  |  | 			fit,  | 
					
						
							|  |  |  | 			clearance=-\bleed,  | 
					
						
							| 
									
										
										
										
											2021-08-31 08:27:37 +03:00
										 |  |  | 			scale=\imagescale, | 
					
						
							|  |  |  | 			offsettop=\imageoffsettop, | 
					
						
							|  |  |  | 			offsetleft=\imageoffsetleft, | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | 			captionclearparent=\captionclearpage, | 
					
						
							| 
									
										
										
										
											2021-08-31 08:27:37 +03:00
										 |  |  | 			#1]{#2}{#3}% | 
					
						
							| 
									
										
										
										
											2021-08-31 02:43:22 +03:00
										 |  |  | 	\end{spreadtopages}} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-10 03:27:33 +03:00
										 |  |  | %% \DescribeMacro{\ImageSpread<D>\{..\}} | 
					
						
							|  |  |  | %% \DescribeMacro{\ImageSpread<D>Caption\{..\}} | 
					
						
							|  |  |  | %% \DescribeMacro{\resetImageSpread<D>Caption} | 
					
						
							|  |  |  | %% \DescribeMacro{\ImageSpread<D>*\{..\}} | 
					
						
							| 
									
										
										
										
											2021-08-09 13:43:36 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-09-10 03:27:33 +03:00
										 |  |  | %% Image spread aligned left (with bleed). | 
					
						
							| 
									
										
										
										
											2021-08-09 13:43:36 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-09-10 03:27:33 +03:00
										 |  |  | %% 	>> \ImageSpread<D>[<options>]{<caption>}{<image>} | 
					
						
							| 
									
										
										
										
											2021-08-09 13:43:36 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							| 
									
										
										
										
											2021-09-10 03:27:33 +03:00
										 |  |  | %%                                            | 
					
						
							|  |  |  | %%  . . . . . . . . . . . . . . . . . . .            | 
					
						
							|  |  |  | %%  . +---------------+---------------+ .    +---------------+---------------+   | 
					
						
							|  |  |  | %%  . |   .           .           .   | .    | c             .               |   | 
					
						
							|  |  |  | %%  . |       .       .       .       | .  . |-------------------------------| . | 
					
						
							|  |  |  | %%  . |           .   .   .           | .  . |   .           .           .   | . | 
					
						
							|  |  |  | %%  . |             image             | .  . |       .       .       .       | . | 
					
						
							|  |  |  | %%  . |           .  (T)   .          | .  . |           .   .   .           | . | 
					
						
							|  |  |  | %%  . |       .       .       .       | .  . |             image             | . | 
					
						
							|  |  |  | %%  . |   .           .           .   | .  . |           .  (B)  .           | . | 
					
						
							|  |  |  | %%  . |-------------------------------| .  . |       .       .       .       | . | 
					
						
							|  |  |  | %%    |               .             c |    . |   .           .           .   | . | 
					
						
							|  |  |  | %%    +---------------+---------------+    . +---------------+---------------+ . | 
					
						
							|  |  |  | %%                                         . . . . . . . . . . . . . . . . . . . | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%  . . . . . . . . . . . . . . . .              . . . . . . . . . . . . . . . . | 
					
						
							|  |  |  | %%  . +---------------+---------------+      +---------------+---------------+ . | 
					
						
							|  |  |  | %%  . | .             .         . |   |      |   | .         .             . | . | 
					
						
							|  |  |  | %%  . |    .          .      .    |   |      |   |    .      .          .    | . | 
					
						
							|  |  |  | %%  . |       .       .   .       |   |      |   |       .   .       .       | . | 
					
						
							|  |  |  | %%  . |          .    ..          |   |      |   |          ..   .           | . | 
					
						
							|  |  |  | %%  . |           image           |   |      |   |          image            | . | 
					
						
							|  |  |  | %%  . |          . (L)..          |   |      |   |          .(R) .           | . | 
					
						
							|  |  |  | %%  . |       .       .   .       |   |      |   |       .   .       .       | . | 
					
						
							|  |  |  | %%  . |    .          .      .    |   |      |   |    .      .          .    | . | 
					
						
							|  |  |  | %%  . | .             .         . | c |      | c | .         .             . | . | 
					
						
							|  |  |  | %%  . +---------------+---------------+      +---------------+---------------+ . | 
					
						
							|  |  |  | %%  . . . . . . . . . . . . . . . .              . . . . . . . . . . . . . . . . | 
					
						
							| 
									
										
										
										
											2021-08-09 13:43:36 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							| 
									
										
										
										
											2021-08-10 14:14:43 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-10 03:27:33 +03:00
										 |  |  | % XXX TEST... | 
					
						
							| 
									
										
										
										
											2021-08-31 02:43:22 +03:00
										 |  |  | % XXX do a better default... | 
					
						
							| 
									
										
										
										
											2021-09-10 03:27:33 +03:00
										 |  |  | % XXX need a caption box... | 
					
						
							|  |  |  | \ResettableMacro{ImageSpreadFitTCaption}[1]{%
 | 
					
						
							|  |  |  | 	\captioncell[under]{%
 | 
					
						
							| 
									
										
										
										
											2021-08-31 02:43:22 +03:00
										 |  |  | 		\captionformat{#1}}} | 
					
						
							| 
									
										
										
										
											2021-09-10 03:27:33 +03:00
										 |  |  | \ImagePageTemplate{ImageSpreadFitT}{%
 | 
					
						
							|  |  |  | 	\ImageSpreadFit*[top, #1]{#2}{#3}} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-10 03:27:33 +03:00
										 |  |  | \ResettableMacro{ImageSpreadFitBCaption}[1]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-10 15:54:38 +03:00
										 |  |  | 	\captioncell[over]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-10 03:27:33 +03:00
										 |  |  | 		\captionformat{#1}}} | 
					
						
							|  |  |  | \ImagePageTemplate{ImageSpreadFitB}{%
 | 
					
						
							|  |  |  | 	\ImageSpreadFit*[bottom, #1]{#2}{#3}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | \ResettableMacro{ImageSpreadFitLCaption}[1]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | 	\captionblockcell[right, clearance=\captionclearpage]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-10 03:27:33 +03:00
										 |  |  | 		\captionformat{#1}}} | 
					
						
							|  |  |  | \ImagePageTemplate{ImageSpreadFitL}{%
 | 
					
						
							|  |  |  | 	\ImageSpreadFit*[left, #1]{#2}{#3}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | \ResettableMacro{ImageSpreadFitRCaption}[1]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | 	\captionblockcell[left, clearance=\captionclearpage]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-10 03:27:33 +03:00
										 |  |  | 		\captionformat{#1}}} | 
					
						
							|  |  |  | \ImagePageTemplate{ImageSpreadFitR}{%
 | 
					
						
							|  |  |  | 	\ImageSpreadFit*[right, #1]{#2}{#3}} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-31 02:43:22 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-03 05:18:18 +03:00
										 |  |  | % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 
					
						
							|  |  |  | %%%%% Full bleed | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-31 03:25:11 +03:00
										 |  |  | %% \DescribeMacro{\ImageSpreadFill\{..\}} | 
					
						
							|  |  |  | %% \DescribeMacro{\ImageSpreadFillCaption\{..\}} | 
					
						
							|  |  |  | %% \DescribeMacro{\resetImageSpreadFillCaption} | 
					
						
							|  |  |  | %% \DescribeMacro{\ImageSpreadFill*\{..\}} | 
					
						
							| 
									
										
										
										
											2021-08-09 13:43:36 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %% Image spread with full bleed. | 
					
						
							|  |  |  | % | 
					
						
							| 
									
										
										
										
											2021-08-31 03:25:11 +03:00
										 |  |  | %%	>> \ImageSpreadFill[<options>]{<caption>}{<image>} | 
					
						
							| 
									
										
										
										
											2021-08-09 13:43:36 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-10 14:14:43 +03:00
										 |  |  | %%  . . . . . . . . . . . . . . . . . . . | 
					
						
							|  |  |  | %%  . +---------------+---------------+ . | 
					
						
							|  |  |  | %%  . |   .           .           .   | . | 
					
						
							|  |  |  | %%  . |      .        .        .      | . | 
					
						
							|  |  |  | %%  . |         .     .     .         | . | 
					
						
							|  |  |  | %%  . |            .  .  .            | . | 
					
						
							|  |  |  | %%  . |             image             | . | 
					
						
							|  |  |  | %%  . |            .  .  .            | . | 
					
						
							|  |  |  | %%  . |         .     .     .         | . | 
					
						
							|  |  |  | %%  . |      .        .        .      | . | 
					
						
							|  |  |  | %%  . |   .           .           . c | . | 
					
						
							|  |  |  | %%  . +---------------+---------------+ . | 
					
						
							|  |  |  | %%  . . . . . . . . . . . . . . . . . . . | 
					
						
							| 
									
										
										
										
											2021-08-09 13:43:36 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							| 
									
										
										
										
											2021-08-10 14:14:43 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-31 02:43:22 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | % XXX do a better default... | 
					
						
							| 
									
										
										
										
											2021-08-31 03:25:11 +03:00
										 |  |  | \ResettableMacro{ImageSpreadFillCaption}[1]{%
 | 
					
						
							| 
									
										
										
										
											2021-08-31 02:43:22 +03:00
										 |  |  | 	\captioncell[bottom, align=flushright]{%
 | 
					
						
							|  |  |  | 		\captionformat{#1}}} | 
					
						
							| 
									
										
										
										
											2021-08-31 03:25:11 +03:00
										 |  |  | \ImagePageTemplate{ImageSpreadFill}{%
 | 
					
						
							| 
									
										
										
										
											2021-08-31 02:43:22 +03:00
										 |  |  | 	\cleartoleftpage% | 
					
						
							|  |  |  | 	\begin{spreadtopages}[2]% | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | 		\imagecell[% | 
					
						
							|  |  |  | 			fill,  | 
					
						
							|  |  |  | 			clearance=-\bleed,  | 
					
						
							| 
									
										
										
										
											2021-08-31 08:27:37 +03:00
										 |  |  | 			scale=\imagescale, | 
					
						
							|  |  |  | 			offsettop=\imageoffsettop, | 
					
						
							|  |  |  | 			offsetleft=\imageoffsetleft, | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | 			captionclearparent=\captionclearpage, | 
					
						
							| 
									
										
										
										
											2021-08-31 08:27:37 +03:00
										 |  |  | 			#1]{#2}{#3}% | 
					
						
							| 
									
										
										
										
											2021-08-31 02:43:22 +03:00
										 |  |  | 	\end{spreadtopages}} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-02 23:51:05 +03:00
										 |  |  | %---------------------------------------------------------------------- | 
					
						
							| 
									
										
										
										
											2021-09-03 05:18:18 +03:00
										 |  |  | %%%% Meta Macros / Environments | 
					
						
							| 
									
										
										
										
											2021-09-03 03:28:04 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %% These macros and environments are used internally to help define cells | 
					
						
							|  |  |  | %% and templates and thus can be useful when extending the functionality  | 
					
						
							|  |  |  | %% of this class both when authoring styles and when creating user 
 | 
					
						
							| 
									
										
										
										
											2021-09-10 15:54:38 +03:00
										 |  |  | %% macros/templates.\footnote{%
 | 
					
						
							|  |  |  | %% 		Note that in code the relevant meta-macros are defined in the logical 
 | 
					
						
							|  |  |  | %% 		locations for each macro, i.e. before first use and at the start of 
 | 
					
						
							|  |  |  | %% 		the relevant context. This section in the reference is placed near  | 
					
						
							|  |  |  | %% 		the end so as to focus the user's attention on the main class interface, | 
					
						
							|  |  |  | %% 		class internal architecture and extension API being secondary.} | 
					
						
							| 
									
										
										
										
											2021-09-02 23:51:05 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-03 16:32:03 +03:00
										 |  |  | %% \input{\jobname-meta} | 
					
						
							| 
									
										
										
										
											2021-09-02 23:51:05 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-10 15:54:38 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-02 23:51:05 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-03 03:28:04 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-27 19:04:05 +03:00
										 |  |  | %---------------------------------------------------------------------- | 
					
						
							| 
									
										
										
										
											2021-09-03 03:28:04 +03:00
										 |  |  | %%%% Miscellaneous | 
					
						
							| 
									
										
										
										
											2021-08-27 19:04:05 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-16 00:29:46 +03:00
										 |  |  | %% \DescribeMacro{\PageInfo} | 
					
						
							| 
									
										
										
										
											2021-09-16 02:57:01 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %% Display basic paper / page / cell geometry. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | \newcommand\PageInfo[1][mm]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-16 00:29:46 +03:00
										 |  |  | 	Layout: \layoutmode | 
					
						
							|  |  |  | 	\par | 
					
						
							| 
									
										
										
										
											2021-09-16 02:57:01 +03:00
										 |  |  | 	paper: \lenprint[#1]{\paperwidth} x \lenprint[#1]{\paperheight} (w. bleeds) \\ | 
					
						
							|  |  |  | 	block: \lenprint[#1]{\blockwidth} x \lenprint[#1]{\blockheight} \\ | 
					
						
							|  |  |  | 	cell: \lenprint[#1]{\cellparentwidth} x \lenprint[#1]{\cellparentheight} \\ | 
					
						
							|  |  |  | 	bleed: \lenprint[#1]{\bleed}} | 
					
						
							| 
									
										
										
										
											2021-08-27 19:04:05 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | %% \DescribeMacro{\GenerateTemplate\{..\}} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% Generate template page for current |layoutmode|. | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %%	>> \GenerateTemplate | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% Cell size can be printed in |mm| (default) or in any explicit unit  | 
					
						
							|  |  |  | %% supported by \LaTeX. | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %%	>> \GenerateTemplate{<unit>} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% This can be useful if one needs to make the cover/jacket/... in either a  | 
					
						
							|  |  |  | %% different software package or by hand. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% This is a no-op for |layoutmode=block|. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-16 00:29:46 +03:00
										 |  |  | % XXX should digits/rounding be configurable??? | 
					
						
							|  |  |  | \newcommand\photobook@TemplateCell[2][mm]{
 | 
					
						
							|  |  |  | 	\begin{center} | 
					
						
							|  |  |  | 		\vfill% | 
					
						
							|  |  |  | 		#2 \\ | 
					
						
							|  |  |  | 		(\lenprint[#1]{\cellwidth} \space x \lenprint[#1]{\cellheight}) | 
					
						
							|  |  |  | 		\vfill% | 
					
						
							|  |  |  | 		\vspace{0pt}% | 
					
						
							|  |  |  | 	\end{center}% | 
					
						
							|  |  |  | 	\ignorespaces} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-27 19:04:05 +03:00
										 |  |  | \newcommand\GenerateTemplate[1][mm]{
 | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | 	\TPoptions{showboxes=true}% | 
					
						
							| 
									
										
										
										
											2021-08-27 19:04:05 +03:00
										 |  |  | 	\begin{page} | 
					
						
							|  |  |  | 		\setlength{\parindent}{0em} | 
					
						
							|  |  |  | 		% NOTE: only the relevant blocks will be visible... | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | 		\ifendpaperlayout% | 
					
						
							|  |  |  | 			\begin{leftside} | 
					
						
							|  |  |  | 				\photobook@TemplateCell[#1]{ENDPAPER LEFT} | 
					
						
							|  |  |  | 			\end{leftside} | 
					
						
							|  |  |  | 			\begin{rightside} | 
					
						
							|  |  |  | 				\photobook@TemplateCell[#1]{ENDPAPER RIGHT} | 
					
						
							|  |  |  | 			\end{rightside}\fi% | 
					
						
							|  |  |  | 		\ifcoverlikelayout% | 
					
						
							|  |  |  | 			\begin{frontcover} | 
					
						
							|  |  |  | 				\photobook@TemplateCell[#1]{FRONT COVER} | 
					
						
							|  |  |  | 			\end{frontcover} | 
					
						
							|  |  |  | 			\begin{vspine}% | 
					
						
							|  |  |  | 				\photobook@TemplateCell[#1]{SPINE}% | 
					
						
							|  |  |  | 			\end{vspine} | 
					
						
							|  |  |  | 			\begin{backcover} | 
					
						
							|  |  |  | 				\photobook@TemplateCell[#1]{BACK COVER} | 
					
						
							|  |  |  | 			\end{backcover}\fi% | 
					
						
							|  |  |  | 		\ifjacketlayout% | 
					
						
							|  |  |  | 			\begin{frontflap}% | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | 				\photobook@TemplateCell[#1]{FRONT FLAP} | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | 			\end{frontflap} | 
					
						
							|  |  |  | 			\begin{backflap}% | 
					
						
							|  |  |  | 				\photobook@TemplateCell[#1]{BACK FLAP} | 
					
						
							|  |  |  | 			\end{backflap}\fi% | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | 	\end{page}} | 
					
						
							| 
									
										
										
										
											2021-08-27 19:04:05 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-12 03:52:17 +03:00
										 |  |  | % XXX place marks in bleed area... | 
					
						
							|  |  |  | % XXX do this for all pages... (???) | 
					
						
							|  |  |  | \newcommand\ShowMarks[1][1pt]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-13 02:30:17 +03:00
										 |  |  | 	% general... | 
					
						
							|  |  |  | 	% XXX corners / cut marks... | 
					
						
							| 
									
										
										
										
											2021-09-12 03:52:17 +03:00
										 |  |  | 	\ifendpaperlayout% | 
					
						
							|  |  |  | 		% XXX fold... | 
					
						
							|  |  |  | 	\fi% | 
					
						
							|  |  |  | 	\ifcoverlikelayout% | 
					
						
							|  |  |  | 		% XXX spine... | 
					
						
							|  |  |  | 		% XXX folds... | 
					
						
							|  |  |  | 	\fi% | 
					
						
							|  |  |  | 	\ifjacketlayout% | 
					
						
							|  |  |  | 		% XXX spine... | 
					
						
							|  |  |  | 		% XXX folds... | 
					
						
							|  |  |  | 	\fi} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-15 21:08:42 +03:00
										 |  |  | % XXX EXPERIMENTAL... | 
					
						
							|  |  |  | \def\photobook@pdfboxstore@stored{} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | % XXX should these be stacked??? | 
					
						
							|  |  |  | % XXX handle slot name... | 
					
						
							|  |  |  | \newcommand\storepdfboxes[1][stored]{%
 | 
					
						
							|  |  |  | 	\edef\photobook@pdfboxstore@stored{%
 | 
					
						
							|  |  |  | 		\photobook@pdfboxes}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | % XXX handle slot name... | 
					
						
							|  |  |  | \newcommand\restorepdfboxes[1][stored]{%
 | 
					
						
							|  |  |  | 	\expandafter\pdfpageattr\expandafter{\photobook@pdfboxstore@stored}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-16 00:29:46 +03:00
										 |  |  | %% \DescribeMacro{\pdfboxesset\{..\}} | 
					
						
							| 
									
										
										
										
											2021-09-15 21:08:42 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-09-16 00:29:46 +03:00
										 |  |  | %%	>> \pdfboxesset[<bleed>]{<bleedblockwidth>}{<bleedblockheight>} | 
					
						
							| 
									
										
										
										
											2021-09-15 21:08:42 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | \newcommand\pdfboxesset[3][\bleed]{%
 | 
					
						
							|  |  |  | 	% calculate pdf box dimensions in pt... | 
					
						
							|  |  |  | 	\edef\photobook@pdfboxesset@w{\strip@pt\dimexpr 
 | 
					
						
							|  |  |  | 		0.996264009963\dimexpr #2 \relax\relax}% | 
					
						
							|  |  |  | 	\edef\photobook@pdfboxesset@h{\strip@pt\dimexpr 
 | 
					
						
							|  |  |  | 		0.996264009963\dimexpr #3 \relax\relax}% | 
					
						
							|  |  |  | 	\edef\photobook@pdfboxesset@bleed{\strip@pt\dimexpr 
 | 
					
						
							|  |  |  | 		0.996264009963\dimexpr #1 \relax\relax}% | 
					
						
							|  |  |  | 	\edef\photobook@pdfboxesset@t{\strip@pt\dimexpr 
 | 
					
						
							|  |  |  | 		0.996264009963\dimexpr #3 - #1 \relax\relax}% | 
					
						
							|  |  |  | 	\edef\photobook@pdfboxesset@r{\strip@pt\dimexpr 
 | 
					
						
							|  |  |  | 		0.996264009963\dimexpr #2 - #1 \relax\relax}% | 
					
						
							|  |  |  | 	% | 
					
						
							| 
									
										
										
										
											2021-10-01 03:45:25 +03:00
										 |  |  | 	\edef\photobook@pdfboxes{%
 | 
					
						
							| 
									
										
										
										
											2021-09-16 04:13:44 +03:00
										 |  |  | 		/MediaBox [0 0 \photobook@pdfboxesset@w\space \photobook@pdfboxesset@h] | 
					
						
							|  |  |  | 		/BleedBox [0 0 \photobook@pdfboxesset@w\space \photobook@pdfboxesset@h] | 
					
						
							|  |  |  | 		/ArtBox [ | 
					
						
							|  |  |  | 			\photobook@pdfboxesset@bleed\space \photobook@pdfboxesset@bleed\space 
 | 
					
						
							|  |  |  | 			\photobook@pdfboxesset@r\space \photobook@pdfboxesset@t] | 
					
						
							|  |  |  | 		/TrimBox [ | 
					
						
							|  |  |  | 			\photobook@pdfboxesset@bleed\space \photobook@pdfboxesset@bleed\space 
 | 
					
						
							|  |  |  | 			\photobook@pdfboxesset@r\space \photobook@pdfboxesset@t] | 
					
						
							|  |  |  | 		/CropBox [ | 
					
						
							|  |  |  | 			\photobook@pdfboxesset@bleed\space \photobook@pdfboxesset@bleed\space 
 | 
					
						
							|  |  |  | 			\photobook@pdfboxesset@r\space \photobook@pdfboxesset@t]}% | 
					
						
							|  |  |  | 	% | 
					
						
							| 
									
										
										
										
											2021-09-15 21:08:42 +03:00
										 |  |  | 	% set the boxes... | 
					
						
							|  |  |  | 	\ifxetex% | 
					
						
							| 
									
										
										
										
											2021-09-16 04:13:44 +03:00
										 |  |  | 		% XXX make this reusable -- currently this will add new boxes per  | 
					
						
							|  |  |  | 		%		call, need to cleanup... | 
					
						
							|  |  |  | 		\AtBeginShipout{\AtBeginShipoutAddToBox{%
 | 
					
						
							|  |  |  | 			\special{pdf:put @thispage << \photobook@pdfboxes >>}}}% | 
					
						
							| 
									
										
										
										
											2021-09-15 21:08:42 +03:00
										 |  |  | 	\else% | 
					
						
							|  |  |  | 		\expandafter\pdfpageattr\expandafter{\photobook@pdfboxes}\fi} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-09 00:43:30 +03:00
										 |  |  | %% \DescribeMacro{\pdfcommentcell\{..\}} | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-09-08 18:52:23 +03:00
										 |  |  | %% Add pdf comment as margin overlay. | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-10 02:00:19 +03:00
										 |  |  | %%	>> \pdfcommentcell[<options>]{<comment>} | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-10 02:00:19 +03:00
										 |  |  | \newcommand\pdfcommentcell[2][]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-08 18:52:23 +03:00
										 |  |  | 	\begin{cell*}{
 | 
					
						
							|  |  |  | 				\ifnumodd{\thepage}{%
 | 
					
						
							|  |  |  | 					\cellwidth - \marginparwidth - 2\bleed - 1cm | 
					
						
							|  |  |  | 				}{%
 | 
					
						
							|  |  |  | 					\bleed + 1cm}, | 
					
						
							|  |  |  | 				\bleed + 1cm | 
					
						
							|  |  |  | 			}{\marginparwidth}{1pt}% | 
					
						
							| 
									
										
										
										
											2021-09-10 02:00:19 +03:00
										 |  |  | 		\pdfcomment[color=yellow, #1]{#2}% | 
					
						
							| 
									
										
										
										
											2021-09-08 18:52:23 +03:00
										 |  |  | 	\end{cell*}} | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-28 01:49:51 +03:00
										 |  |  | %% \DescribeMacro{\pdfpagecount\{..\}} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %%	Get pdf page count
 | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%	>>	\pdfpagecount{<file.pdf>} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | \newcommand\pdfpagecount[1]{%
 | 
					
						
							|  |  |  | 	\ifpdftex% | 
					
						
							|  |  |  | 		\pdfximage{#1}% | 
					
						
							| 
									
										
										
										
											2021-08-28 01:49:51 +03:00
										 |  |  |     	\number\pdflastximagepages% | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | 	\else\ifxetex% | 
					
						
							| 
									
										
										
										
											2021-08-28 01:49:51 +03:00
										 |  |  | 		\number\XeTeXpdfpagecount"#1"% | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | 	\else\ifluatex% | 
					
						
							| 
									
										
										
										
											2021-08-28 01:49:51 +03:00
										 |  |  | 		\number\directlua{%
 | 
					
						
							|  |  |  | 			local pages = 0 | 
					
						
							|  |  |  | 			local doc = pdfe.open("\luaescapestring{#1}") | 
					
						
							|  |  |  | 			if doc then
 | 
					
						
							|  |  |  | 				pages = pdfe.getnofpages(doc) | 
					
						
							|  |  |  | 				pdfe.close(doc) | 
					
						
							|  |  |  | 			end
 | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | 			tex.write(pages) }\fi\fi} | 
					
						
							| 
									
										
										
										
											2021-08-28 01:49:51 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | %% \DescribeMacro{\pdfspinewidth\{..\}} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %%	Calculate spine thickness | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%	>>	\pdfspinewidth{<paper-thikness>}{<cover-thikness>}{<block-pdf>} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | % NOTE: really "like" how LaTeX overcomplicats simple math... | 
					
						
							|  |  |  | \newcommand\pdfspinewidth[3]{%
 | 
					
						
							|  |  |  | 	\setlength\spinewidth{\dimexpr
 | 
					
						
							|  |  |  | 			(#1 mm) * \numexpr \pdfpagecount{#3} / 2 \relax | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | 			+ ((#2 mm) * 2) | 
					
						
							|  |  |  | 		\relax}} | 
					
						
							| 
									
										
										
										
											2021-08-28 01:49:51 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-27 19:04:05 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %---------------------------------------------------------------------- | 
					
						
							| 
									
										
										
										
											2021-09-03 05:18:18 +03:00
										 |  |  | % Index... | 
					
						
							| 
									
										
										
										
											2021-09-03 04:03:28 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-09-03 05:18:18 +03:00
										 |  |  | % XXX this prints trash at this point... | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | %		...I do not want to build the index manually but it seems that | 
					
						
							|  |  |  | %		we are slowly moving in that direction... | 
					
						
							| 
									
										
										
										
											2021-09-03 04:03:28 +03:00
										 |  |  | %%% \printindex | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 
					
						
							| 
									
										
										
										
											2021-08-12 16:48:00 +03:00
										 |  |  | %%% XXX DEBUG... | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %%%\AtBeginDocument{
 | 
					
						
							|  |  |  | %%%} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | %---------------------------------------------------------------------- | 
					
						
							| 
									
										
										
										
											2021-09-12 17:43:31 +03:00
										 |  |  | %% \end{document} %                         vim:set ts=4 sw=4 nowrap : |