| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %---------------------------------------------------------------------- | 
					
						
							|  |  |  | % | 
					
						
							| 
									
										
										
										
											2023-04-11 15:39:19 +03:00
										 |  |  | % photobook.cls | 
					
						
							|  |  |  | % ------------- | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | % | 
					
						
							|  |  |  | % This does the following: | 
					
						
							|  |  |  | %	- sets up the document/pdf for viewing as a book | 
					
						
							| 
									
										
										
										
											2023-04-11 15:39:19 +03:00
										 |  |  | %	- sets up page bleeds | 
					
						
							|  |  |  | %	- defines cells as basic template building blocks | 
					
						
							|  |  |  | %	- adds basic templates for image pages and spreads | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											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. | 
					
						
							|  |  |  | % | 
					
						
							| 
									
										
										
										
											2022-11-16 18:13:23 +03:00
										 |  |  | % Docs are built by the Makefile, so reference it for more info. | 
					
						
							| 
									
										
										
										
											2021-09-09 00:43:30 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2022-11-16 18:13:23 +03:00
										 |  |  | % To make the reference use: | 
					
						
							| 
									
										
										
										
											2023-04-11 15:39:19 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2022-11-16 18:13:23 +03:00
										 |  |  | %	$ make pdf | 
					
						
							| 
									
										
										
										
											2021-09-09 00:43:30 +03:00
										 |  |  | % | 
					
						
							|  |  |  | % | 
					
						
							| 
									
										
										
										
											2021-12-03 01:27:55 +03:00
										 |  |  | % NOTE: in a stripped code install this file may contain only code and 
 | 
					
						
							|  |  |  | %		code comments, in this case, to see the docs refer to either the  | 
					
						
							|  |  |  | %		source or the actual documentation/pdf. | 
					
						
							|  |  |  | % NOTE: the stripped code file is auto-generated, it is not recommended  | 
					
						
							|  |  |  | %		to edit it directly, edit the source instead. | 
					
						
							|  |  |  | % | 
					
						
							| 
									
										
										
										
											2021-09-09 00:43:30 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2023-04-11 15:39:19 +03:00
										 |  |  | % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 
					
						
							|  |  |  | % | 
					
						
							| 
									
										
										
										
											2023-09-13 17:37:43 +03:00
										 |  |  | % XXX ASAP: imagecell: photobook@imagecell@left and photobook@imagecell@top | 
					
						
							| 
									
										
										
										
											2023-05-05 17:21:20 +03:00
										 |  |  | %		should explicitly account for clearence@left and clearence@top resp. | 
					
						
							| 
									
										
										
										
											2023-05-05 15:27:39 +03:00
										 |  |  | % XXX ASAP: imagecell: clearance should have the same semantics as cliptocell  | 
					
						
							|  |  |  | %		offsts...  | 
					
						
							|  |  |  | %		(CLEARANCE) | 
					
						
							| 
									
										
										
										
											2023-05-01 10:00:17 +03:00
										 |  |  | % XXX ASAP should cover/jacket/endpaper/spread cells set default cliptocell  | 
					
						
							|  |  |  | %		bleeds??? | 
					
						
							| 
									
										
										
										
											2023-05-05 14:11:18 +03:00
										 |  |  | % XXX ASAP: should \blockwidth include \bindingoffset (current) or not??? | 
					
						
							| 
									
										
										
										
											2023-05-05 15:27:39 +03:00
										 |  |  | %		...currently I think that no, as \blockwidth indicates the outer  | 
					
						
							|  |  |  | %		width of the block, and this poses the question: | 
					
						
							|  |  |  | %			should \pagewidth include \bindingoffset??? | 
					
						
							| 
									
										
										
										
											2023-04-11 15:39:19 +03:00
										 |  |  | % XXX ASAP should cover/jacket/endpaper/spread templates/cells account | 
					
						
							|  |  |  | %		for \bindingoffset (likely no) and/or \gutteroffset ??? | 
					
						
							|  |  |  | %		...especially relevant to endpaper/spread... | 
					
						
							|  |  |  | % XXX ASAP revise how bleeds are handled by cells... | 
					
						
							| 
									
										
										
										
											2023-04-21 18:05:26 +03:00
										 |  |  | %		...all cells should ignore bleeds unless explicitly stated  | 
					
						
							|  |  |  | %		otherwise -- needs testing... | 
					
						
							| 
									
										
										
										
											2023-04-06 18:34:47 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2023-05-01 10:00:17 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2023-04-11 15:21:06 +03:00
										 |  |  | % XXX captions behave in an odd way... | 
					
						
							|  |  |  | %		the internal (macro) minipage for some reason does not affect text 
 | 
					
						
							|  |  |  | %		justification while adding a minipage in the macro argument works | 
					
						
							|  |  |  | %		as expected -- some odd input mode??? | 
					
						
							| 
									
										
										
										
											2021-09-14 02:21:24 +03:00
										 |  |  | % XXX revise \clearcaption / \captionclearpage... | 
					
						
							| 
									
										
										
										
											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... | 
					
						
							| 
									
										
										
										
											2023-04-11 15:21:06 +03:00
										 |  |  | % XXX might be a good idea to add a spine calculator (auto)... | 
					
						
							|  |  |  | %		...i.e. input paper and cover board thickness and auto-calc spine... | 
					
						
							| 
									
										
										
										
											2022-11-16 18:13:23 +03:00
										 |  |  | % XXX might be fun to add a 'box' layout to build book boxes... | 
					
						
							| 
									
										
										
										
											2023-02-25 12:46:21 +03:00
										 |  |  | % XXX add a grid cell / image cell (???) | 
					
						
							|  |  |  | %		make it trivial to define AxB cell layouts and fill them (fully/partially) | 
					
						
							| 
									
										
										
										
											2021-11-01 18:12:59 +03:00
										 |  |  | % XXX manual / book: | 
					
						
							| 
									
										
										
										
											2021-09-15 21:08:42 +03:00
										 |  |  | %		- basic usage | 
					
						
							|  |  |  | %			- setup | 
					
						
							| 
									
										
										
										
											2021-11-04 23:10:41 +03:00
										 |  |  | %			- templates (copyright, front matter, back matter, acknowledgements, ...) | 
					
						
							| 
									
										
										
										
											2021-09-15 21:08:42 +03:00
										 |  |  | %			- using templates | 
					
						
							|  |  |  | %			- pre-print | 
					
						
							|  |  |  | %		- customizing | 
					
						
							|  |  |  | %		- extending | 
					
						
							| 
									
										
										
										
											2023-03-03 18:48:10 +03:00
										 |  |  | % XXX DOC add notes about external libs section: | 
					
						
							|  |  |  | %		- textpos | 
					
						
							|  |  |  | %			cell/cell* depend on absolute mode being set globally | 
					
						
							| 
									
										
										
										
											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... | 
					
						
							| 
									
										
										
										
											2023-09-11 19:41:48 +03:00
										 |  |  | \edef\photobook@FILEVERSION{v0.1.28} | 
					
						
							| 
									
										
										
										
											2023-08-24 23:06:17 +03:00
										 |  |  | \edef\photobook@FILEDATE{2023-08-24} | 
					
						
							| 
									
										
										
										
											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
										 |  |  | %%% \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-12-07 01:12:39 +03:00
										 |  |  | %%  | 
					
						
							|  |  |  | %% \newcommand\blankfootnote[1]{%
 | 
					
						
							|  |  |  | %% 	\begingroup | 
					
						
							|  |  |  | %% 		\renewcommand\thefootnote{}% | 
					
						
							|  |  |  | %% 		\footnote{#1}% | 
					
						
							|  |  |  | %% 		\addtocounter{footnote}{-1}% | 
					
						
							|  |  |  | %% 	\endgroup} | 
					
						
							| 
									
										
										
										
											2021-08-28 01:13:45 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											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-11-07 19:32:25 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-09-03 05:18:18 +03:00
										 |  |  | %%%% Introduction | 
					
						
							|  |  |  | % | 
					
						
							| 
									
										
										
										
											2021-12-07 01:12:39 +03:00
										 |  |  | %% \LaTeX\ is great with textual and text-primary content with figures | 
					
						
							| 
									
										
										
										
											2021-11-06 12:24:14 +03:00
										 |  |  | %% peppered in, as long as pictures/figures flow within, with or as part | 
					
						
							| 
									
										
										
										
											2021-12-07 01:12:39 +03:00
										 |  |  | %% of text, vanilla \LaTeX\ is fantastic. | 
					
						
							| 
									
										
										
										
											2021-11-06 12:24:14 +03:00
										 |  |  | %%  | 
					
						
							| 
									
										
										
										
											2021-12-07 01:12:39 +03:00
										 |  |  | %% One can relatively easily stretch the flow concept to more complex | 
					
						
							|  |  |  | %% layouts introducing {\it even} and {\it odd} pages (the |book| class is 
 | 
					
						
							|  |  |  | %% one example) and flow rules based on them, but the next step, {\it bleeds},  | 
					
						
							|  |  |  | %% combining page pairs into {\it spreads} as is often needed when designing  | 
					
						
							|  |  |  | %% image-oriented books is lacking. Full-bleed images/pages can be implemented  | 
					
						
							|  |  |  | %% manually, some more effort is needed to split something horizontally  | 
					
						
							|  |  |  | %% into a page spread, but doing so for whole book's worth of content is 
 | 
					
						
							|  |  |  | %% not practical -- automating and experimenting with this process is 
 | 
					
						
							|  |  |  | %% how |photobook| began. | 
					
						
							| 
									
										
										
										
											2021-11-06 12:24:14 +03:00
										 |  |  | %%  | 
					
						
							|  |  |  | %% |photobook| extends the |book| class adding page layout types, bleeds | 
					
						
							| 
									
										
										
										
											2021-12-07 01:12:39 +03:00
										 |  |  | %% and other global geometry configuration, introduces the {\it page} and
 | 
					
						
							|  |  |  | %% {\it spread} as first-class elements into the document flow. These concepts | 
					
						
							| 
									
										
										
										
											2021-11-06 12:24:14 +03:00
										 |  |  | %% are generalized as |cell|s. A |cell| is similar to a figure, it can | 
					
						
							|  |  |  | %% be placed within the document flow, but unlike a figure a |cell| can | 
					
						
							|  |  |  | %% be aligned relative to a page, it can fill a page, a cell can even be | 
					
						
							|  |  |  | %% horizontally split to fill several pages (how spreads are implemented). | 
					
						
							|  |  |  | %%  | 
					
						
							| 
									
										
										
										
											2021-12-07 01:12:39 +03:00
										 |  |  | %% On top of the |cell|, {\it page}, and {\it spread} concepts, |photobook|  | 
					
						
							|  |  |  | %% also builds a set of configurable high level macros and templates for 
 | 
					
						
							|  |  |  | %% common use cases like full bleed image spreads, foldouts, ... etc. | 
					
						
							| 
									
										
										
										
											2021-11-07 00:30:41 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-09-03 05:18:18 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											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>} | 
					
						
							| 
									
										
										
										
											2023-04-09 18:12:54 +03:00
										 |  |  | %% \DescribeMacro{gutteroffset=<len>} | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | %% \DescribeMacro{bleed=<len>} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% This is similar to what |geometry| does, but adds bleed support. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2023-04-09 18:12:54 +03:00
										 |  |  | %%   <---> bleed                                   <---> bleed | 
					
						
							|  |  |  | %%                                                  | 
					
						
							|  |  |  | %%   + - - - - - - - - - - - - - - - - - - - - - - + - +   ^ | 
					
						
							|  |  |  | %%   .                                             .   .   | bleed | 
					
						
							|  |  |  | %%   .   +-----------------------------------------+-----  v   .   .  --- | 
					
						
							|  |  |  | %%   .   |                           ^       .  .  =   . | 
					
						
							|  |  |  | %%   .   |   .   .   .   .   .   .   |   .   .  .  =   .               ^ | 
					
						
							|  |  |  | %%   .   |<-- blockwidth ------------------------->=   .               | | 
					
						
							|  |  |  | %%   .   |   .                       |   .   .  .  =   .               | | 
					
						
							|  |  |  | %%   .   |                           |       .  .  =   .       textheight | 
					
						
							|  |  |  | %%   .   |   .             Page      |   .   .  .  =   .               | | 
					
						
							|  |  |  | %%   .   |                      blockheight  .  .  =   .               | | 
					
						
							|  |  |  | %%   .   |   .                       |   .   .  <--> bindingoffset     | | 
					
						
							|  |  |  | %%   .   |                           |       .  .  =   .               | | 
					
						
							| 
									
										
										
										
											2023-04-09 18:28:57 +03:00
										 |  |  | %%   .   |   .   .   .   .   .   .   |   .   <--> gutteroffset         v | 
					
						
							| 
									
										
										
										
											2023-04-09 18:12:54 +03:00
										 |  |  | %%   .   |                           v       .  .  =   . | 
					
						
							|  |  |  | %%   .   +-----------------------------------------+-----  ^   .   .  --- | 
					
						
							|  |  |  | %%   .   .                                         .   .   | bleed | 
					
						
							|  |  |  | %%   + - - - - - - - - - - - - - - - - - - - - - - + - +   v | 
					
						
							|  |  |  | %%       .                                         . | 
					
						
							|  |  |  | %%       |   <-- textwidth -------------->    .    | | 
					
						
							|  |  |  | %%                                                 ^ gutter | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2023-04-09 18:12:54 +03:00
										 |  |  | %% Note that all macros respect |\bindingoffset| but only some macros  | 
					
						
							|  |  |  | %% account for |\gutteroffset|, namely macros that do not display content  | 
					
						
							|  |  |  | %% with bleeds. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | % 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} | 
					
						
							| 
									
										
										
										
											2023-04-05 17:22:36 +03:00
										 |  |  | \DeclareStringOption[0pt]{bindingoffset}[0mm] | 
					
						
							| 
									
										
										
										
											2023-04-05 17:06:18 +03:00
										 |  |  | \DeclareStringOption[0pt]{gutteroffset}[0mm] | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | \DeclareStringOption[5mm]{bleed}[5mm] | 
					
						
							| 
									
										
										
										
											2021-10-17 00:25:55 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | %% \DescribeMacro{flatfold=<len>} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% Sets the clearance set aside for a flat fold, used for foldouts  | 
					
						
							|  |  |  | %% (see: \nameref{subsec:Foldout page cells} section). | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-10-13 14:47:15 +03:00
										 |  |  | \DeclareStringOption[0pt]{flatfold}[0.2mm] | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-17 00:25:55 +03:00
										 |  |  | %% \DescribeMacro{pagefold=<fold>} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% Sets the default fold type. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% Can be |in| or |out|. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | % XXX check values... | 
					
						
							|  |  |  | \DeclareStringOption{pagefold} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-17 01:59:17 +03:00
										 |  |  | %% \DescribeMacro{foldout=<fold-spec>} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% Sets the default fold specification (i.e. sets |\defaultfoldout|). | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% For more information see: \nameref{subsec:Foldout page cells} section. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | \DeclareStringOption[2]{foldout}[2] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %%%%% layout | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% \DescribeMacro{layoutmode=<layout>} | 
					
						
							|  |  |  | %% \DescribeMacro{block} | 
					
						
							| 
									
										
										
										
											2023-04-05 17:06:18 +03:00
										 |  |  | %% \DescribeMacro{spread} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %% \DescribeMacro{endpaper} | 
					
						
							|  |  |  | %% \DescribeMacro{cover} | 
					
						
							|  |  |  | %% \DescribeMacro{jacket} | 
					
						
							| 
									
										
										
										
											2023-04-11 15:39:19 +03:00
										 |  |  | %%% \DescribeMacro{web} | 
					
						
							| 
									
										
										
										
											2021-10-13 00:28:37 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %% Sat page layout mode. | 
					
						
							|  |  |  | % | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %%	>> 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
										 |  |  | %% | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2023-04-05 17:06:18 +03:00
										 |  |  | %% |spread|/|endpaper|: | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2023-04-05 17:06:18 +03:00
										 |  |  | %%	Spread/endpaper layout. | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-10-18 15:14:40 +03:00
										 |  |  | % XXX should this use \flatfold??? | 
					
						
							| 
									
										
										
										
											2021-08-08 12:16:50 +03:00
										 |  |  | %% \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 | 
					
						
							|  |  |  | %%   <-------------------------------> | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%   +---------------+---------------+ | 
					
						
							|  |  |  | %%   |               .               | | 
					
						
							|  |  |  | %%   |               .               | | 
					
						
							| 
									
										
										
										
											2023-04-05 17:06:18 +03:00
										 |  |  | %%   |            spread             | | 
					
						
							| 
									
										
										
										
											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
										 |  |  | %%	 | 
					
						
							| 
									
										
										
										
											2023-04-05 17:06:18 +03:00
										 |  |  | %% Note that |endpaper| is simply an alias to |spread|, this helps make | 
					
						
							|  |  |  | %% the book source to be more semantic and readable. | 
					
						
							|  |  |  | %%	 | 
					
						
							| 
									
										
										
										
											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 | 
					
						
							|  |  |  | %%       <--------------->     <---------------> | 
					
						
							| 
									
										
										
										
											2023-04-27 01:24:24 +03:00
										 |  |  | %%     <-> coverboardgrow.     .               <-> coverboardgrow | 
					
						
							|  |  |  | %%   <-> coverflap       .     .               . <-> coverflap | 
					
						
							|  |  |  | %%   . . .               .     .               . . . | 
					
						
							|  |  |  | %%   .xx .               xx   xx               . xx.    ] fold marks | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %%   +-------------------++---++-------------------+    --- | 
					
						
							|  |  |  | %%   | + - - - - - - - - ++ - ++ - - - - - - - - + |    --^ coverflap                 | 
					
						
							|  |  |  | %%   | . + - - - - - - - ++ - ++ - - - - - - - + . |    --^ coverboardgrow   | 
					
						
							|  |  |  | %%   | . .               ..   ..               . . |     ^                   | 
					
						
							|  |  |  | %%   | . .               ..   ..               . . |     | blockheight       | 
					
						
							|  |  |  | %%   | . .     Back      ..   ..     Front     . . |     |                   | 
					
						
							|  |  |  | %%   | . .               ..   ..               . . |     |                   | 
					
						
							|  |  |  | %%   | . .               ..   ..               . . |     v                   | 
					
						
							|  |  |  | %%   | . + - - - - - - - ++ - ++ - - - - - - - + . |    --v coverboardgrow   | 
					
						
							|  |  |  | %%   | + - - - - - - - - ++ - ++ - - - - - - - - + |    --v coverflap                  | 
					
						
							|  |  |  | %%   +-------------------++---++-------------------+    --- | 
					
						
							| 
									
										
										
										
											2023-04-27 01:24:24 +03:00
										 |  |  | %%    xx                 xx   xx                 xx     ] fold marks | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %%                        .   . | 
					
						
							|  |  |  | %%                       ^.   .^ 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      .   . | 
					
						
							|  |  |  | %%   .   .  <--------------->     <--------------->  .   . | 
					
						
							| 
									
										
										
										
											2023-04-27 01:24:24 +03:00
										 |  |  | %%   .   .<-> coverboardgrow.     .               <-> coverboardgrow | 
					
						
							|  |  |  | %%   .   .  .               .     .               .  .   . | 
					
						
							|  |  |  | %%   .   xx .               .x   x.               . xx   .    ] fold marks | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %%   +---++-----------------++---++-----------------++---+    --- | 
					
						
							|  |  |  | %%   |   .. + - - - - - - - ++ - ++ - - - - - - - + ..   |    --^ coverboardgrow | 
					
						
							|  |  |  | %%   |   .. .               ..   ..               . ..   |     ^ | 
					
						
							|  |  |  | %%   |   .. .               ..   ..               . ..   |     | blockheight | 
					
						
							|  |  |  | %%   |   .. .     Back      ..   ..     Front     . ..   |     | | 
					
						
							|  |  |  | %%   |   .. .               ..   ..               . ..   |     | | 
					
						
							|  |  |  | %%   |   .. .               ..   ..               . ..   |     v | 
					
						
							|  |  |  | %%   |   .. + - - - - - - - ++ - ++ - - - - - - - + ..   |    --v coverboardgrow | 
					
						
							|  |  |  | %%   +---++-----------------++---++-----------------++---+    ---  | 
					
						
							| 
									
										
										
										
											2023-04-27 01:24:24 +03:00
										 |  |  | %%       xx                  x   x                  xx        ] fold marks | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %%       ..                  .   .                  .. | 
					
						
							|  |  |  | %%       ^ 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
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2023-04-05 17:06:18 +03:00
										 |  |  | %% Note that for |cover|, |spread|/|endpaper|, and |jacket|,  | 
					
						
							| 
									
										
										
										
											2022-11-14 20:57:17 +03:00
										 |  |  | %% \href{https://ctan.org/pkg/fancyhdr}{fancyhdr}'s |\pagestyle{..}| is 
 | 
					
						
							|  |  |  | %% set to |empty| by default. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											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} | 
					
						
							| 
									
										
										
										
											2023-04-05 17:06:18 +03:00
										 |  |  | \@DeclareLiteralOptionTo{layoutmode}{spread} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | % 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] | 
					
						
							|  |  |  | \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} | 
					
						
							|  |  |  | % | 
					
						
							| 
									
										
										
										
											2021-10-13 00:28:37 +03:00
										 |  |  | %% Sets PDF page display mode. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% Defaults to |TwoColumnLeft| for |layoutmode=block| and |SinglePage| for
 | 
					
						
							|  |  |  | %% other modes. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% See:  | 
					
						
							|  |  |  | %% \href{https://ctan.altspu.ru/macros/latex/contrib/hyperref/doc/hyperref-doc.pdf}{hyperref}'s  | 
					
						
							|  |  |  | %% |pdfpagelayout| for more options. | 
					
						
							| 
									
										
										
										
											2021-08-10 14:14:43 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											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 | 
					
						
							|  |  |  | % | 
					
						
							| 
									
										
										
										
											2021-10-17 00:25:55 +03:00
										 |  |  | %% \DescribeMacro{nofoldmarks} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% If given disable fold marks. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% This sets |\iffoldmarks| to false, otherwise it is set to true. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | \DeclareBoolOption{nofoldmarks} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-22 12:00:57 +03:00
										 |  |  | %% \DescribeMacro{foldmarksize=<len>} | 
					
						
							| 
									
										
										
										
											2021-10-22 12:00:25 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %% Sets the fold mark size (default: 6mm). | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-10-25 02:17:31 +03:00
										 |  |  | \DeclareStringOption[6mm]{foldmarksize} | 
					
						
							| 
									
										
										
										
											2021-10-22 12:00:25 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %% \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
										 |  |  | %---------------------------------------------------------------------- | 
					
						
							| 
									
										
										
										
											2022-11-14 20:57:17 +03:00
										 |  |  | %%%% Packages | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% |photobook| adds and uses internally the following packages:  | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2022-11-14 20:57:17 +03:00
										 |  |  | % NOTE: imports are after \LoadClass{ .. } to avoid fighting over macro | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %		names... | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-11-14 20:57:17 +03:00
										 |  |  | %% \href{https://ctan.org/pkg/geometry}{geometry}, | 
					
						
							|  |  |  | %% \href{https://ctan.org/pkg/kvoptions}{kvoptions}, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | %% \href{https://ctan.org/pkg/calc}{calc}, | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | \RequirePackage{calc} | 
					
						
							| 
									
										
										
										
											2022-11-14 20:57:17 +03:00
										 |  |  | %% \href{https://ctan.org/pkg/xargs}{xargs}, | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | \RequirePackage{xargs} | 
					
						
							| 
									
										
										
										
											2022-11-14 20:57:17 +03:00
										 |  |  | %% \href{https://ctan.org/pkg/ifthen}{ifthen}, | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | \RequirePackage{ifthen} | 
					
						
							| 
									
										
										
										
											2022-11-14 20:57:17 +03:00
										 |  |  | %% \href{https://ctan.org/pkg/iftex}{iftex}, | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | \RequirePackage{iftex} | 
					
						
							| 
									
										
										
										
											2022-11-14 20:57:17 +03:00
										 |  |  | %% \href{https://ctan.org/pkg/pgffor}{pgffor}, | 
					
						
							| 
									
										
										
										
											2021-08-15 13:38:32 +03:00
										 |  |  | \RequirePackage{pgffor} | 
					
						
							| 
									
										
										
										
											2022-11-14 20:57:17 +03:00
										 |  |  | %% \href{https://ctan.org/pkg/xint}{xint}, | 
					
						
							| 
									
										
										
										
											2021-09-26 01:04:41 +03:00
										 |  |  | \RequirePackage{xint} | 
					
						
							| 
									
										
										
										
											2022-11-14 20:57:17 +03:00
										 |  |  | %% \href{https://ctan.org/pkg/xinttools}{xinttools}, | 
					
						
							| 
									
										
										
										
											2021-09-16 04:13:44 +03:00
										 |  |  | \RequirePackage{xinttools} | 
					
						
							| 
									
										
										
										
											2022-11-14 20:57:17 +03:00
										 |  |  | %% \href{https://ctan.org/pkg/listofitems}{listofitems}, | 
					
						
							| 
									
										
										
										
											2021-08-27 19:04:05 +03:00
										 |  |  | \RequirePackage{listofitems} | 
					
						
							| 
									
										
										
										
											2022-11-14 20:57:17 +03:00
										 |  |  | %% \href{https://ctan.org/pkg/xkeyval}{xkeyval}, | 
					
						
							| 
									
										
										
										
											2021-08-19 23:53:01 +03:00
										 |  |  | \RequirePackage{xkeyval}  | 
					
						
							| 
									
										
										
										
											2022-11-14 20:57:17 +03:00
										 |  |  | %% \href{https://ctan.org/pkg/etoolbox}{etoolbox}, | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | \RequirePackage{etoolbox} | 
					
						
							| 
									
										
										
										
											2022-11-14 20:57:17 +03:00
										 |  |  | %% \href{https://ctan.org/pkg/atbegshi}{atbegshi}, | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | \RequirePackage{atbegshi} | 
					
						
							|  |  |  | %\RequirePackage{afterpage} | 
					
						
							|  |  |  | %\RequirePackage{changepage} | 
					
						
							| 
									
										
										
										
											2022-11-14 20:57:17 +03:00
										 |  |  | %% \href{https://ctan.org/pkg/hyperref}{hyperref}, | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | \RequirePackage[unicode]{hyperref} | 
					
						
							|  |  |  | %\RequirePackage{pdfcomment} | 
					
						
							| 
									
										
										
										
											2022-11-14 20:57:17 +03:00
										 |  |  | %% \href{https://ctan.org/pkg/eso-pic}{eso-pic}, | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | \RequirePackage{eso-pic} | 
					
						
							| 
									
										
										
										
											2022-11-14 20:57:17 +03:00
										 |  |  | %% \href{https://ctan.org/pkg/environ}{environ}, | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | \RequirePackage{environ} | 
					
						
							| 
									
										
										
										
											2022-11-14 20:57:17 +03:00
										 |  |  | %% \href{https://ctan.org/pkg/numprint}{numprint}, | 
					
						
							| 
									
										
										
										
											2021-08-12 16:48:00 +03:00
										 |  |  | \RequirePackage{numprint} | 
					
						
							| 
									
										
										
										
											2022-11-14 20:57:17 +03:00
										 |  |  | %% \href{https://ctan.org/pkg/trimclip}{trimclip}, | 
					
						
							| 
									
										
										
										
											2021-08-14 03:02:59 +03:00
										 |  |  | \RequirePackage{trimclip} | 
					
						
							| 
									
										
										
										
											2022-11-14 20:57:17 +03:00
										 |  |  | %% \href{https://ctan.org/pkg/xcolor}{xcolor}, | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | \RequirePackage{xcolor} | 
					
						
							| 
									
										
										
										
											2023-02-25 12:46:21 +03:00
										 |  |  | %% \href{https://ctan.org/pkg/pagecolor}{pagecolor}, | 
					
						
							|  |  |  | \RequirePackage{pagecolor} | 
					
						
							| 
									
										
										
										
											2022-11-14 20:57:17 +03:00
										 |  |  | %% \href{https://ctan.org/pkg/colorspace}{colorspace}, | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | \RequirePackage{colorspace} | 
					
						
							| 
									
										
										
										
											2022-11-14 20:57:17 +03:00
										 |  |  | %% \href{https://ctan.org/pkg/graphicx}{graphicx}, | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | \RequirePackage{graphicx} | 
					
						
							| 
									
										
										
										
											2022-11-14 20:57:17 +03:00
										 |  |  | %% \href{https://ctan.org/pkg/adjustbox}{adjustbox}, | 
					
						
							| 
									
										
										
										
											2021-08-16 06:34:22 +03:00
										 |  |  | \RequirePackage{adjustbox} | 
					
						
							| 
									
										
										
										
											2022-11-14 20:57:17 +03:00
										 |  |  | %% \href{https://ctan.org/pkg/adjustbox}{adjustbox}, | 
					
						
							| 
									
										
										
										
											2023-03-02 17:34:51 +03:00
										 |  |  | % XXX BUG TEXTPOS textblock in absolute mode does not behave well with 
 | 
					
						
							|  |  |  | %		sbox in absolute mode... | 
					
						
							| 
									
										
										
										
											2021-08-26 20:03:17 +03:00
										 |  |  | \RequirePackage[absolute]{textpos} | 
					
						
							| 
									
										
										
										
											2022-11-14 20:57:17 +03:00
										 |  |  | %% \href{https://ctan.org/pkg/fancyvrb}{fancyvrb}, | 
					
						
							| 
									
										
										
										
											2021-09-15 21:08:42 +03:00
										 |  |  | \RequirePackage{fancyvrb} | 
					
						
							| 
									
										
										
										
											2022-11-14 20:57:17 +03:00
										 |  |  | %% \href{https://ctan.org/pkg/tikz}{tikz}, | 
					
						
							| 
									
										
										
										
											2021-10-17 00:25:55 +03:00
										 |  |  | \RequirePackage{tikz} | 
					
						
							| 
									
										
										
										
											2021-09-15 21:08:42 +03:00
										 |  |  | %\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} | 
					
						
							| 
									
										
										
										
											2022-11-14 20:57:17 +03:00
										 |  |  | %% \href{https://ctan.org/pkg/rotating}{rotating}, | 
					
						
							| 
									
										
										
										
											2021-09-15 21:08:42 +03:00
										 |  |  | \RequirePackage{rotating} | 
					
						
							| 
									
										
										
										
											2022-11-14 20:57:17 +03:00
										 |  |  | %% \href{https://ctan.org/pkg/fancyhdr}{fancyhdr}, and
 | 
					
						
							| 
									
										
										
										
											2021-09-12 03:29:50 +03:00
										 |  |  | \RequirePackage{fancyhdr} | 
					
						
							| 
									
										
										
										
											2022-11-14 20:57:17 +03:00
										 |  |  | %% \href{https://ctan.org/pkg/pdfpages}{pdfpages}. | 
					
						
							| 
									
										
										
										
											2021-09-15 21:08:42 +03:00
										 |  |  | \RequirePackage{pdfpages} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-11-14 20:57:17 +03:00
										 |  |  | %% \newline | 
					
						
							|  |  |  | %% Most of these packages can be used by the book author without explicitly | 
					
						
							|  |  |  | %% importing them. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											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 | 
					
						
							| 
									
										
										
										
											2023-04-05 17:06:18 +03:00
										 |  |  | \newif\ifspreadlayout | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | \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 | 
					
						
							| 
									
										
										
										
											2022-11-14 01:03:10 +03:00
										 |  |  | \setlength\coverflap{\photobook@coverflap} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-11 04:11:04 +03:00
										 |  |  | \newlength\photobook@coverflap@active | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											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 | 
					
						
							| 
									
										
										
										
											2022-11-14 01:03:10 +03:00
										 |  |  | \setlength\jacketwrap{\photobook@jacketwrap} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | \newlength\jacketflap | 
					
						
							| 
									
										
										
										
											2022-11-14 01:03:10 +03:00
										 |  |  | \setlength\jacketflap{\photobook@jacketflap} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | \newlength\jacketflapfront | 
					
						
							| 
									
										
										
										
											2022-11-14 01:03:10 +03:00
										 |  |  | \setlength\jacketflapfront{\photobook@jacketflapfront} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | \newlength\jacketflapback | 
					
						
							| 
									
										
										
										
											2022-11-14 01:03:10 +03:00
										 |  |  | \setlength\jacketflapback{\photobook@jacketflapback} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-11 04:11:04 +03:00
										 |  |  | \newlength\photobook@jacketwrap@active | 
					
						
							|  |  |  | \newlength\photobook@jacketflap@active | 
					
						
							|  |  |  | \newlength\photobook@jacketflapfront@active | 
					
						
							|  |  |  | \newlength\photobook@jacketflapback@active | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											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
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-10-13 00:28:37 +03:00
										 |  |  | %% Page bleed size
 | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | \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
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-10-13 00:28:37 +03:00
										 |  |  | %% Binding offset | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2023-04-09 18:12:54 +03:00
										 |  |  | %% Used to offset content to account glue-up/roughing of pages for certain  | 
					
						
							|  |  |  | %% types of binds like perfect binds. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | \newlength\bindingoffset | 
					
						
							|  |  |  | \setlength\bindingoffset{\photobook@bindingoffset} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-09 18:12:54 +03:00
										 |  |  | %% \DescribeMacro{\gutteroffset=<len>} | 
					
						
							| 
									
										
										
										
											2023-04-05 17:06:18 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2023-04-09 18:12:54 +03:00
										 |  |  | %% Gutter offsets | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% Mainly used to offset content without bleeds away from or into the  | 
					
						
							|  |  |  | %% gutter. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2023-04-05 17:06:18 +03:00
										 |  |  | \newlength\gutteroffset | 
					
						
							|  |  |  | \setlength\gutteroffset{\photobook@gutteroffset} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-16 00:58:45 +03:00
										 |  |  | %% \DescribeMacro{\defaultfoldout=<fold-spec>} | 
					
						
							| 
									
										
										
										
											2021-10-17 01:59:17 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %% Set the default fold specification. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% This can be set via the |foldout| class option. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% For more information see: \nameref{subsec:Foldout page cells} section. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | \edef\defaultfoldout{\photobook@foldout} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-13 00:28:37 +03:00
										 |  |  | %% \DescribeMacro{\flatfold=<len>} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% Sets the amount of paper to account for a flat fold. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | \newlength\flatfold | 
					
						
							|  |  |  | \setlength\flatfold{\photobook@flatfold} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-17 00:25:55 +03:00
										 |  |  | %% \DescribeMacro{\pagefold=<fold>} | 
					
						
							| 
									
										
										
										
											2021-10-15 14:47:53 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-10-17 00:25:55 +03:00
										 |  |  | %% Default fold type. | 
					
						
							| 
									
										
										
										
											2021-10-15 14:47:53 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-10-17 00:25:55 +03:00
										 |  |  | %% This defaults to |out| for |jacket| and |cover| and to |in| for other | 
					
						
							|  |  |  | %% layouts. | 
					
						
							| 
									
										
										
										
											2021-10-15 14:47:53 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-10-17 00:25:55 +03:00
										 |  |  | \newcommand\photobook@setpagefold[1]{%
 | 
					
						
							|  |  |  | 	\edef\pagefold{
 | 
					
						
							|  |  |  | 		\ifx \photobook@pagefold \empty% | 
					
						
							|  |  |  | 			#1% | 
					
						
							|  |  |  | 		\else% | 
					
						
							|  |  |  | 			\photobook@pagefold\fi}} | 
					
						
							|  |  |  | \photobook@setpagefold{in} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-17 01:59:17 +03:00
										 |  |  | %% \DescribeMacro{\foldmarkoffset=<len>} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% Sets the offset of fold marks from outside of page edge (default: |0.5\bleed|). | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% Note that this can either be a command or a dimension. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-10-18 15:14:40 +03:00
										 |  |  | %\def\foldmarkoffset{0.5\bleed} | 
					
						
							|  |  |  | \def\foldmarkoffset{2mm} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-23 00:58:03 +03:00
										 |  |  | %% \DescribeMacro{\foldmarksize=<len>} | 
					
						
							| 
									
										
										
										
											2021-10-18 15:14:40 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-10-19 10:27:30 +03:00
										 |  |  | %% Sets fold marker size (vertical). | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-10-29 23:27:21 +03:00
										 |  |  | \newlength\photobook@foldmarklen | 
					
						
							|  |  |  | \setlength\photobook@foldmarklen{\photobook@foldmarksize} | 
					
						
							| 
									
										
										
										
											2021-10-17 01:59:17 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | %% \DescribeMacro{\iffoldmarks} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% Disable/enable fold marks. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% The default is true, to toggle on/off use |\foldmarkstrue| / |\foldmarksfalse|. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% This can be set globally via the |nofoldmarks| class option. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | \newif\iffoldmarks | 
					
						
							|  |  |  | \ifphotobook@nofoldmarks% | 
					
						
							|  |  |  | 	\foldmarksfalse% | 
					
						
							|  |  |  | \else% | 
					
						
							|  |  |  | 	\foldmarkstrue\fi% | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											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
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-10-13 00:28:37 +03:00
										 |  |  | %% The ration by which the image is raised in |\ImagePage{..}| and 
 | 
					
						
							|  |  |  | %% derived templates. | 
					
						
							| 
									
										
										
										
											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>} | 
					
						
							| 
									
										
										
										
											2023-05-05 15:27:39 +03:00
										 |  |  | % XXX EXPERIMENTAL CLEARANCE | 
					
						
							|  |  |  | %%% \DescribeMacro{\clearanceleft=<len>} | 
					
						
							|  |  |  | %%% \DescribeMacro{\clearancetop=<len>} | 
					
						
							|  |  |  | %%% \DescribeMacro{\clearanceright=<len>} | 
					
						
							|  |  |  | %%% \DescribeMacro{\clearancebottom=<len>} | 
					
						
							| 
									
										
										
										
											2023-09-11 21:16:25 +03:00
										 |  |  | % XXX revise... | 
					
						
							|  |  |  | %%% \DescribeMacro{\clearances=<len's>} | 
					
						
							| 
									
										
										
										
											2021-09-16 00:29:46 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %% Cell geometry.  | 
					
						
							| 
									
										
										
										
											2021-10-09 13:43:51 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-16 00:29:46 +03:00
										 |  |  | %% 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} | 
					
						
							| 
									
										
										
										
											2023-05-05 15:27:39 +03:00
										 |  |  | \newlength\clearanceleft | 
					
						
							|  |  |  | \setlength\clearanceleft{0pt} | 
					
						
							|  |  |  | \newlength\clearancetop | 
					
						
							|  |  |  | \setlength\clearancetop{0pt} | 
					
						
							|  |  |  | \newlength\clearanceright | 
					
						
							|  |  |  | \setlength\clearanceright{0pt} | 
					
						
							|  |  |  | \newlength\clearancebottom | 
					
						
							|  |  |  | \setlength\clearancebottom{0pt} | 
					
						
							|  |  |  | \def\clearances{0pt} | 
					
						
							| 
									
										
										
										
											2021-09-16 00:29:46 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-13 00:28:37 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-11 16:06:20 +03:00
										 |  |  | %% \DescribeMacro{\clearfoldoutgutter=<len>} | 
					
						
							| 
									
										
										
										
											2021-10-10 05:53:12 +03:00
										 |  |  | %% \DescribeMacro{\clearfoldoutfold=<len>} | 
					
						
							| 
									
										
										
										
											2021-10-17 00:25:55 +03:00
										 |  |  | %% \DescribeMacro{\clearfoldoutedge=<len>} | 
					
						
							| 
									
										
										
										
											2021-10-09 13:43:51 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %% Foldout geometry. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-10-10 05:53:12 +03:00
										 |  |  | %% For more info see \nameref{subsec:Foldout page cells} section. | 
					
						
							| 
									
										
										
										
											2021-10-09 13:43:51 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2023-04-11 16:06:20 +03:00
										 |  |  | \newlength\clearfoldoutgutter | 
					
						
							|  |  |  | \setlength\clearfoldoutgutter{8mm} | 
					
						
							| 
									
										
										
										
											2021-10-17 00:25:55 +03:00
										 |  |  | \newlength\clearfoldoutfold | 
					
						
							|  |  |  | \setlength\clearfoldoutfold{5mm} | 
					
						
							|  |  |  | \newlength\clearfoldoutedge | 
					
						
							|  |  |  | \setlength\clearfoldoutedge{1mm} | 
					
						
							| 
									
										
										
										
											2021-10-09 13:43:51 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-16 00:29:46 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											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 | 
					
						
							| 
									
										
										
										
											2023-04-05 17:06:18 +03:00
										 |  |  | 	\spreadlayoutfalse | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 	\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 }{} | 
					
						
							| 
									
										
										
										
											2023-04-05 17:06:18 +03:00
										 |  |  | 	\ifdefstring{\layoutmode}{spread}{ 
 | 
					
						
							|  |  |  | 		\spreadlayouttrue | 
					
						
							|  |  |  | 		\endpaperlayouttrue }{} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 	\ifdefstring{\layoutmode}{endpaper}{ 
 | 
					
						
							| 
									
										
										
										
											2023-04-05 17:06:18 +03:00
										 |  |  | 		\spreadlayouttrue | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 		\endpaperlayouttrue }{} | 
					
						
							|  |  |  | 	% pdf layout... | 
					
						
							|  |  |  | 	\ifx\photobook@pdfpagelayout\empty
 | 
					
						
							|  |  |  | 		\ifblocklayout | 
					
						
							|  |  |  | 			\def\pdfpagelayout{TwoPageRight} | 
					
						
							|  |  |  | 		\else
 | 
					
						
							| 
									
										
										
										
											2021-10-21 16:43:06 +03:00
										 |  |  | 			\def\pdfpagelayout{SinglePage}\fi | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 	\else
 | 
					
						
							| 
									
										
										
										
											2021-10-21 16:43:06 +03:00
										 |  |  | 		\def\pdfpagelayout{\photobook@pdfpagelayout}\fi | 
					
						
							| 
									
										
										
										
											2023-03-11 04:11:04 +03:00
										 |  |  | 	% keep user settings but respect the current layout... | 
					
						
							|  |  |  | 	\ifcoverlayout | 
					
						
							|  |  |  | 		\setlength\photobook@coverflap@active{\coverflap} | 
					
						
							|  |  |  | 	\else
 | 
					
						
							|  |  |  | 		\setlength\photobook@coverflap@active{0pt}\fi | 
					
						
							|  |  |  | 	\ifjacketlayout | 
					
						
							|  |  |  | 		\setlength\photobook@jacketwrap@active{\jacketwrap} | 
					
						
							|  |  |  | 		\setlength\photobook@jacketflap@active{\jacketflap} | 
					
						
							|  |  |  | 		% flaps... | 
					
						
							|  |  |  | 		\ifdim\jacketflapfront=0pt | 
					
						
							|  |  |  | 			\setlength\photobook@jacketflapfront@active{\photobook@jacketflap@active} | 
					
						
							|  |  |  | 		\else
 | 
					
						
							|  |  |  | 			\setlength\photobook@jacketflapfront@active{\jacketflapfront}\fi | 
					
						
							|  |  |  | 		\ifdim\jacketflapback=0pt | 
					
						
							|  |  |  | 			\setlength\photobook@jacketflapback@active{\photobook@jacketflap@active} | 
					
						
							|  |  |  | 		\else
 | 
					
						
							|  |  |  | 			\setlength\photobook@jacketflapback@active{\jacketflapback}\fi | 
					
						
							|  |  |  | 	\else
 | 
					
						
							|  |  |  | 		\setlength\photobook@jacketwrap@active{0pt} | 
					
						
							|  |  |  | 		\setlength\photobook@jacketflap@active{0pt} | 
					
						
							|  |  |  | 		\setlength\photobook@jacketflapfront@active{0pt} | 
					
						
							|  |  |  | 		\setlength\photobook@jacketflapback@active{0pt}\fi | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 	% 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 | 
					
						
							| 
									
										
										
										
											2022-11-14 20:57:17 +03:00
										 |  |  | 			\pagestyle{empty}% | 
					
						
							| 
									
										
										
										
											2023-04-27 01:24:24 +03:00
										 |  |  | 			% XXX should spinefolds be panels??? | 
					
						
							| 
									
										
										
										
											2021-10-15 14:47:53 +03:00
										 |  |  | 			\setsepchar{,}% | 
					
						
							|  |  |  | 			\readlist*\pagefoldpanels{%
 | 
					
						
							|  |  |  | 				\the\coverflap, | 
					
						
							| 
									
										
										
										
											2021-10-17 00:25:55 +03:00
										 |  |  | 				% board thickness is ignored... | 
					
						
							|  |  |  | 				\the\dimexpr | 
					
						
							|  |  |  | 					\coverboardgrow | 
					
						
							|  |  |  | 					+ \pageblockwidth \relax, | 
					
						
							| 
									
										
										
										
											2021-10-15 14:47:53 +03:00
										 |  |  | 				\the\spinefold, | 
					
						
							|  |  |  | 				\the\spinewidth, | 
					
						
							|  |  |  | 				\the\spinefold, | 
					
						
							| 
									
										
										
										
											2021-10-17 00:25:55 +03:00
										 |  |  | 				\the\dimexpr | 
					
						
							|  |  |  | 					\coverboardgrow | 
					
						
							|  |  |  | 					+ \pageblockwidth \relax, | 
					
						
							|  |  |  | 				% board thickness is ignored... | 
					
						
							| 
									
										
										
										
											2021-10-15 14:47:53 +03:00
										 |  |  | 				\the\coverflap}% | 
					
						
							| 
									
										
										
										
											2021-10-17 00:25:55 +03:00
										 |  |  | 			\photobook@setpagefold{out} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 			\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 | 
					
						
							| 
									
										
										
										
											2022-11-14 20:57:17 +03:00
										 |  |  | 			\pagestyle{empty}% | 
					
						
							| 
									
										
										
										
											2021-10-15 14:47:53 +03:00
										 |  |  | 			\setsepchar{,}% | 
					
						
							|  |  |  | 			\readlist*\pagefoldpanels{%
 | 
					
						
							| 
									
										
										
										
											2023-03-11 04:11:04 +03:00
										 |  |  | 				\the\photobook@jacketflapback@active, | 
					
						
							| 
									
										
										
										
											2021-10-15 14:47:53 +03:00
										 |  |  | 				\the\jacketwrap, | 
					
						
							| 
									
										
										
										
											2021-10-17 00:25:55 +03:00
										 |  |  | 				\the\dimexpr | 
					
						
							|  |  |  | 					\coverboardgrow | 
					
						
							| 
									
										
										
										
											2023-04-27 01:24:24 +03:00
										 |  |  | 					+ \spinefold | 
					
						
							| 
									
										
										
										
											2021-10-17 00:25:55 +03:00
										 |  |  | 					+ \pageblockwidth \relax, | 
					
						
							| 
									
										
										
										
											2021-10-15 14:47:53 +03:00
										 |  |  | 				\the\spinewidth, | 
					
						
							| 
									
										
										
										
											2021-10-17 00:25:55 +03:00
										 |  |  | 				\the\dimexpr | 
					
						
							|  |  |  | 					\coverboardgrow | 
					
						
							| 
									
										
										
										
											2023-04-27 01:24:24 +03:00
										 |  |  | 					+ \spinefold | 
					
						
							| 
									
										
										
										
											2021-10-17 00:25:55 +03:00
										 |  |  | 					+ \pageblockwidth \relax, | 
					
						
							| 
									
										
										
										
											2021-10-15 14:47:53 +03:00
										 |  |  | 				\the\jacketwrap, | 
					
						
							| 
									
										
										
										
											2023-03-11 04:11:04 +03:00
										 |  |  | 				\the\photobook@jacketflapfront@active}% | 
					
						
							| 
									
										
										
										
											2021-10-17 00:25:55 +03:00
										 |  |  | 			\photobook@setpagefold{out} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 			\setlength\blockwidth{
 | 
					
						
							|  |  |  | 				\dimexpr  | 
					
						
							|  |  |  | 					2\blockwidth  | 
					
						
							| 
									
										
										
										
											2021-10-17 00:25:55 +03:00
										 |  |  | 					+ 2\coverboardgrow | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 					+ \spinewidth | 
					
						
							|  |  |  | 					+ 2\spinefold | 
					
						
							|  |  |  | 					+ 2\jacketwrap | 
					
						
							| 
									
										
										
										
											2023-03-11 04:11:04 +03:00
										 |  |  | 					+ \photobook@jacketflapfront@active | 
					
						
							|  |  |  | 					+ \photobook@jacketflapback@active \relax}\fi | 
					
						
							| 
									
										
										
										
											2023-04-05 17:06:18 +03:00
										 |  |  | 		% layout: spread/endpaper... | 
					
						
							|  |  |  | 		\ifspreadlayout | 
					
						
							| 
									
										
										
										
											2022-11-14 20:57:17 +03:00
										 |  |  | 			\pagestyle{empty}% | 
					
						
							| 
									
										
										
										
											2023-04-27 01:24:24 +03:00
										 |  |  | 			\setsepchar{,}% | 
					
						
							| 
									
										
										
										
											2021-10-15 14:47:53 +03:00
										 |  |  | 			\readlist*\pagefoldpanels{%
 | 
					
						
							| 
									
										
										
										
											2021-10-17 00:25:55 +03:00
										 |  |  | 				\the\pageblockwidth, | 
					
						
							|  |  |  | 				\the\pageblockwidth}% | 
					
						
							|  |  |  | 			\photobook@setpagefold{in} | 
					
						
							| 
									
										
										
										
											2021-10-21 16:43:06 +03:00
										 |  |  | 			\setlength\blockwidth{2\blockwidth}\fi\fi | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 	\ifdim\blockheight=0pt | 
					
						
							| 
									
										
										
										
											2023-04-05 17:06:18 +03:00
										 |  |  | 		% layout: block / spread... | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 		\setlength\blockheight{
 | 
					
						
							|  |  |  | 			\ifx\photobook@blockheight\empty
 | 
					
						
							|  |  |  | 				\dimexpr \paperheight - 2\bleed \relax | 
					
						
							|  |  |  | 			\else
 | 
					
						
							| 
									
										
										
										
											2021-10-21 16:43:06 +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-10-21 16:43:06 +03:00
										 |  |  | 				\relax}\fi | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 		% layout: jacket... | 
					
						
							|  |  |  | 		\ifjacketlayout | 
					
						
							|  |  |  | 			\setlength\blockheight{
 | 
					
						
							|  |  |  | 				\dimexpr  | 
					
						
							|  |  |  | 					\blockheight | 
					
						
							|  |  |  | 					+ 2\coverboardgrow | 
					
						
							| 
									
										
										
										
											2021-10-21 16:43:06 +03:00
										 |  |  | 				\relax}\fi\fi | 
					
						
							| 
									
										
										
										
											2021-08-19 23:53:01 +03:00
										 |  |  | 	% default image clearance... | 
					
						
							| 
									
										
										
										
											2021-10-21 16:43:06 +03:00
										 |  |  | 	\ifdim \clearimage = \maxdimen | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 		\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-10-25 02:17:31 +03:00
										 |  |  | \newcommand\ReInitPages{%
 | 
					
						
							|  |  |  | 	\setlength\blockwidth{0mm}% | 
					
						
							|  |  |  | 	\setlength\blockheight{0mm}% | 
					
						
							|  |  |  | 	\edef\pdfpagelayout{}% | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 	% | 
					
						
							| 
									
										
										
										
											2021-10-25 02:17:31 +03:00
										 |  |  | 	\InitPages% | 
					
						
							|  |  |  | 	\ResetFoldMarks} | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-13 02:09:11 +03:00
										 |  |  | %% \DescribeMacro{\ChangeLayout} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% Change document layout. | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %%	>> \ChangeLayout{<layoutmode>} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% This is a shorthand for |\def\layoutmode{<layoutmode>}| and then 
 | 
					
						
							|  |  |  | %% |\ReInitPages|, and as this is changing any other parameters that may  | 
					
						
							|  |  |  | %% affect the layout, this should be done last. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | \newcommand\ChangeLayout[1]{%
 | 
					
						
							|  |  |  | 	\def\layoutmode{#1}% | 
					
						
							|  |  |  | 	\ReInitPages} | 
					
						
							| 
									
										
										
										
											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} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-25 12:46:21 +03:00
										 |  |  | % colors... | 
					
						
							| 
									
										
										
										
											2023-02-27 17:01:33 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2023-02-25 12:46:21 +03:00
										 |  |  | % This prevents \pagecolor from getting drawn over other elements... | 
					
						
							|  |  |  | \pagecolor{white} | 
					
						
							|  |  |  | \pagecolor{none} | 
					
						
							|  |  |  | \color{black} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											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. | 
					
						
							| 
									
										
										
										
											2023-09-11 19:09:25 +03:00
										 |  |  | %% Also note that items within the page environment are placed in the  | 
					
						
							|  |  |  | %% same way as in any normal page, for absolute placement use either | 
					
						
							|  |  |  | %% specific cells/environments like |papercell| or more generic |call|. | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-27 19:04:05 +03:00
										 |  |  | \newenvironment{page}{%
 | 
					
						
							| 
									
										
										
										
											2023-03-03 04:15:12 +03:00
										 |  |  | 	% XXX do we need \null here??? | 
					
						
							| 
									
										
										
										
											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
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-12 15:57:28 +03:00
										 |  |  | %M \DescribeEnv{MinipageCellContent} | 
					
						
							|  |  |  | %M \DescribeEnv{MinipageCellContent*} | 
					
						
							| 
									
										
										
										
											2021-09-03 03:28:04 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %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>} | 
					
						
							| 
									
										
										
										
											2023-05-05 15:27:39 +03:00
										 |  |  | % XXX EXPERIMENTAL CLEARANCE | 
					
						
							|  |  |  | %%% \DescribeMacro{\clearanceleft=<len>} | 
					
						
							|  |  |  | %%% \DescribeMacro{\clearancetop=<len>} | 
					
						
							|  |  |  | %%% \DescribeMacro{\clearanceright=<len>} | 
					
						
							|  |  |  | %%% \DescribeMacro{\clearancebottom=<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. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-10-10 12:03:08 +03:00
										 |  |  | %% The bare page can be reasonably treated as a cell. | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% 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}% | 
					
						
							| 
									
										
										
										
											2023-05-05 15:27:39 +03:00
										 |  |  | 		\setlength\clearanceleft{0pt}% | 
					
						
							|  |  |  | 		\setlength\clearancetop{0pt}% | 
					
						
							|  |  |  | 		\setlength\clearanceright{0pt}% | 
					
						
							|  |  |  | 		\setlength\clearancebottom{0pt}% | 
					
						
							| 
									
										
										
										
											2021-09-02 18:50:55 +03:00
										 |  |  | 		% | 
					
						
							|  |  |  | 		\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 | 
					
						
							| 
									
										
										
										
											2023-01-15 16:14:51 +03:00
										 |  |  | % XXX revise docs... | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | %% \DescribeEnv{zinlinecell} | 
					
						
							|  |  |  | %% \DescribeEnv{zinlinecell*} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% \EXPERIMENTAL | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2023-01-17 13:41:41 +03:00
										 |  |  | %% Like |inlinecell| / |inlinecell*| but will take up zero space and 
 | 
					
						
							|  |  |  | %% sized to |\cellwidth| x |\cellheight|. | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2023-01-15 05:13:40 +03:00
										 |  |  | %%	>> \begin{zinlinecell} ... \end{zinlinecell} | 
					
						
							|  |  |  | %%	>> \begin{zinlinecell}[<valign>] ... \end{zinlinecell} | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											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
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2023-03-03 18:41:49 +03:00
										 |  |  | %% |cell| and |cell*| are absolutely positioned either relative to 
 | 
					
						
							|  |  |  | %% the current page or to the closest savecell. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2023-03-03 18:53:19 +03:00
										 |  |  | % XXX should this have an explicit absolute/relative option??? | 
					
						
							|  |  |  | % XXX handle textpos's absolute option internally (+arg) ??? | 
					
						
							| 
									
										
										
										
											2023-03-03 18:48:10 +03:00
										 |  |  | %		- save external state | 
					
						
							|  |  |  | %		- set internal state | 
					
						
							|  |  |  | %		- reset bac to saved | 
					
						
							| 
									
										
										
										
											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>} | 
					
						
							| 
									
										
										
										
											2023-03-03 00:52:04 +03:00
										 |  |  | %\newenvironment{cell*}[3]{%
 | 
					
						
							| 
									
										
										
										
											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... | 
					
						
							| 
									
										
										
										
											2023-03-03 00:52:04 +03:00
										 |  |  | 		%\null% | 
					
						
							| 
									
										
										
										
											2021-10-01 03:45:25 +03:00
										 |  |  | 		\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 | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2023-04-12 16:06:46 +03:00
										 |  |  | %% This a cell wrapper for |adjustbox|. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | % XXX DOC | 
					
						
							| 
									
										
										
										
											2021-09-08 18:52:23 +03:00
										 |  |  | \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. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2023-03-02 17:34:51 +03:00
										 |  |  | %% |\gsavecell{..}| is the same as |\savecell{..}| but creates a global 
 | 
					
						
							| 
									
										
										
										
											2021-08-30 18:55:11 +03:00
										 |  |  | %% cell. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2023-03-03 18:41:49 +03:00
										 |  |  | %% Note that both |\gsavecell{..}| and |\savecell{..}| make the nested | 
					
						
							|  |  |  | %% |cell| and |cell*| position relative to the cell and not the page. | 
					
						
							|  |  |  | %% This is done by setting |\TPoptions{absolute=false}| for the cell | 
					
						
							|  |  |  | %% content which will also affect |textpos|'s macros. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											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}{%
 | 
					
						
							| 
									
										
										
										
											2023-03-03 00:52:04 +03:00
										 |  |  | 		\expandafter\newsavebox\csname #2\endcsname}{}% | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | 	\expandafter\sbox\csname #2\endcsname{%
 | 
					
						
							| 
									
										
										
										
											2023-03-02 19:31:22 +03:00
										 |  |  | 		\TPoptions{absolute=false}% | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | 		\begin{inlinecell*}[#1]{#3}{#4}% | 
					
						
							|  |  |  | 			#5% | 
					
						
							| 
									
										
										
										
											2023-03-02 19:31:22 +03:00
										 |  |  | 		\end{inlinecell*}% | 
					
						
							|  |  |  | 		\TPoptions{absolute=true}}% | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | 	\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}{%
 | 
					
						
							| 
									
										
										
										
											2023-03-03 00:52:04 +03:00
										 |  |  | 		\expandafter\newsavebox\csname #2\endcsname}{}% | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | 	\global\expandafter\sbox\csname #2\endcsname{%
 | 
					
						
							| 
									
										
										
										
											2023-03-02 19:31:22 +03:00
										 |  |  | 		\TPoptions{absolute=false}% | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | 		\begin{inlinecell*}[#1]{#3}{#4}% | 
					
						
							|  |  |  | 			#5% | 
					
						
							| 
									
										
										
										
											2023-03-02 19:31:22 +03:00
										 |  |  | 		\end{inlinecell*}% | 
					
						
							|  |  |  | 		\TPoptions{absolute=true}}% | 
					
						
							| 
									
										
										
										
											2021-08-30 18:55:11 +03:00
										 |  |  | 	\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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-19 21:28:03 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-14 03:02:59 +03:00
										 |  |  | %% \DescribeEnv{cliptocell} | 
					
						
							| 
									
										
										
										
											2023-09-11 18:53:49 +03:00
										 |  |  | %% \DescribeEnv{setcliptocellbleeds} | 
					
						
							| 
									
										
										
										
											2021-08-14 03:02:59 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-08-30 01:42:11 +03:00
										 |  |  | %% Clip content to parent cell. | 
					
						
							| 
									
										
										
										
											2021-08-14 03:02:59 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2023-04-19 21:01:24 +03:00
										 |  |  | %%	>> \begin{cliptocell} ... \end{cliptocell} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2023-04-21 18:05:26 +03:00
										 |  |  | %% Clip content to cell plus offsets (bleeds) from each side | 
					
						
							| 
									
										
										
										
											2023-04-19 21:01:24 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %%	>> \begin{cliptocell}[<size>] ... \end{cliptocell} | 
					
						
							|  |  |  | %%	>> \begin{cliptocell}[<horizontal> <vertical>] ... \end{cliptocell} | 
					
						
							|  |  |  | %%	>> \begin{cliptocell}[<left> <bottom> <right> <top>] ... \end{cliptocell} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2023-04-21 18:05:26 +03:00
										 |  |  | %% Offset order, i.e. left-bottom-right-top is made consistent with 
 | 
					
						
							|  |  |  | %% \href{https://ctan.org/pkg/graphicx}{graphicx} and 
 | 
					
						
							|  |  |  | %% \href{https://ctan.org/pkg/trimclip}{trimclip} modules and represents  | 
					
						
							|  |  |  | %% the bottom-left and top-right viewport point offsets from the parent 
 | 
					
						
							|  |  |  | %% cell. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% |cliptocell| does not affect the cell content positioning in any way. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% This is designed to simplify filling template cells and adding bleeds  | 
					
						
							|  |  |  | %% to certain sides and clipping flush to others, for example for cells  | 
					
						
							|  |  |  | %% of a dust jacket or a foldout, but |cliptocell| is not limited to 
 | 
					
						
							|  |  |  | %% this one use-case. | 
					
						
							| 
									
										
										
										
											2023-04-19 21:20:50 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2023-04-19 16:38:03 +03:00
										 |  |  | \newlength\photobook@cliptocell@left | 
					
						
							| 
									
										
										
										
											2023-04-19 21:01:24 +03:00
										 |  |  | \setlength\photobook@cliptocell@left{0mm}% | 
					
						
							| 
									
										
										
										
											2023-04-19 16:38:03 +03:00
										 |  |  | \newlength\photobook@cliptocell@top | 
					
						
							| 
									
										
										
										
											2023-04-19 21:01:24 +03:00
										 |  |  | \setlength\photobook@cliptocell@top{0mm}% | 
					
						
							| 
									
										
										
										
											2023-04-19 16:38:03 +03:00
										 |  |  | \newlength\photobook@cliptocell@right | 
					
						
							| 
									
										
										
										
											2023-04-19 21:01:24 +03:00
										 |  |  | \setlength\photobook@cliptocell@right{0mm}% | 
					
						
							| 
									
										
										
										
											2023-04-19 16:38:03 +03:00
										 |  |  | \newlength\photobook@cliptocell@bottom | 
					
						
							| 
									
										
										
										
											2023-04-19 21:01:24 +03:00
										 |  |  | \setlength\photobook@cliptocell@bottom{0mm}% | 
					
						
							| 
									
										
										
										
											2023-09-11 18:53:49 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | \def\cliptocellbleeds{{0mm} {0mm} {0mm} {0mm}}% | 
					
						
							| 
									
										
										
										
											2023-09-05 17:37:03 +03:00
										 |  |  | \def\cliptocellclearances{{0mm} {0mm} {0mm} {0mm}}% | 
					
						
							| 
									
										
										
										
											2023-04-19 16:38:03 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-27 00:37:37 +03:00
										 |  |  | %% Set the default bleeds for |cliptocell| environments | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2023-09-11 18:53:49 +03:00
										 |  |  | %%	>> \setcliptocellbleeds{<size>} | 
					
						
							|  |  |  | %%	>> \setcliptocellbleeds{<horizontal> <vertical>} | 
					
						
							|  |  |  | %%	>> \setcliptocellbleeds{<left> <bottom> <right> <top>} | 
					
						
							| 
									
										
										
										
											2023-04-27 00:37:37 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% This will only affect |cliptocell| environments on the same level,  | 
					
						
							|  |  |  | %% without affecting the nested |cliptocell|s. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2023-09-11 18:53:49 +03:00
										 |  |  | %%% \DescribeEnv{cliptocellbleeds=<left> <bottom> <right> <top>} | 
					
						
							| 
									
										
										
										
											2023-05-05 17:21:20 +03:00
										 |  |  | %%% \DescribeEnv{cliptocellclearances=<left> <bottom> <right> <top>} | 
					
						
							|  |  |  | %%% | 
					
						
							| 
									
										
										
										
											2023-09-11 18:53:49 +03:00
										 |  |  | %%% Set by |\setcliptocellbleeds{..}| and contain bleeds and clearances (negative  | 
					
						
							|  |  |  | %%% clipping bleeds) respectively, usable by imagecell and others. | 
					
						
							| 
									
										
										
										
											2023-09-05 17:37:03 +03:00
										 |  |  | %%% | 
					
						
							|  |  |  | %%% XXX still testing.... | 
					
						
							| 
									
										
										
										
											2023-09-11 18:53:49 +03:00
										 |  |  | \newcommand\setcliptocellbleeds[1]{
 | 
					
						
							| 
									
										
										
										
											2023-04-24 12:37:13 +03:00
										 |  |  | 	\setsepchar{ }% | 
					
						
							|  |  |  | 	\readlist*\photobook@cliptocell@bleeds{#1}% | 
					
						
							| 
									
										
										
										
											2023-04-27 00:37:37 +03:00
										 |  |  | 	\setsepchar{,}% | 
					
						
							| 
									
										
										
										
											2023-04-24 12:37:13 +03:00
										 |  |  | 	% args: size
 | 
					
						
							|  |  |  | 	\ifnum \photobook@cliptocell@bleedslen = 1% | 
					
						
							|  |  |  | 		\setlength\photobook@cliptocell@left{%
 | 
					
						
							|  |  |  | 			\photobook@cliptocell@bleeds[1]}% | 
					
						
							|  |  |  | 		\setlength\photobook@cliptocell@bottom{%
 | 
					
						
							|  |  |  | 			\photobook@cliptocell@bleeds[1]}% | 
					
						
							|  |  |  | 		\setlength\photobook@cliptocell@right{%
 | 
					
						
							|  |  |  | 			\photobook@cliptocell@bleeds[1]}% | 
					
						
							|  |  |  | 		\setlength\photobook@cliptocell@top{%
 | 
					
						
							|  |  |  | 			\photobook@cliptocell@bleeds[1]}\fi% | 
					
						
							|  |  |  | 	% args: horizontal vertical
 | 
					
						
							|  |  |  | 	\ifnum \photobook@cliptocell@bleedslen = 2% | 
					
						
							|  |  |  | 		\setlength\photobook@cliptocell@left{%
 | 
					
						
							|  |  |  | 			\photobook@cliptocell@bleeds[1]}% | 
					
						
							|  |  |  | 		\setlength\photobook@cliptocell@bottom{%
 | 
					
						
							|  |  |  | 			\photobook@cliptocell@bleeds[2]}% | 
					
						
							|  |  |  | 		\setlength\photobook@cliptocell@right{%
 | 
					
						
							|  |  |  | 			\photobook@cliptocell@bleeds[1]}% | 
					
						
							|  |  |  | 		\setlength\photobook@cliptocell@top{%
 | 
					
						
							|  |  |  | 			\photobook@cliptocell@bleeds[2]}\fi% | 
					
						
							|  |  |  | 	% args: left bottom right top | 
					
						
							|  |  |  | 	\ifnum \photobook@cliptocell@bleedslen = 4% | 
					
						
							|  |  |  | 		\setlength\photobook@cliptocell@left{%
 | 
					
						
							|  |  |  | 			\photobook@cliptocell@bleeds[1]}% | 
					
						
							|  |  |  | 		\setlength\photobook@cliptocell@bottom{%
 | 
					
						
							|  |  |  | 			\photobook@cliptocell@bleeds[2]}% | 
					
						
							|  |  |  | 		\setlength\photobook@cliptocell@right{%
 | 
					
						
							|  |  |  | 			\photobook@cliptocell@bleeds[3]}% | 
					
						
							|  |  |  | 		\setlength\photobook@cliptocell@top{%
 | 
					
						
							| 
									
										
										
										
											2023-05-05 17:21:20 +03:00
										 |  |  | 			\photobook@cliptocell@bleeds[4]}\fi% | 
					
						
							|  |  |  | 	% NOTE: trailing spaces here are significant... | 
					
						
							| 
									
										
										
										
											2023-09-05 17:37:03 +03:00
										 |  |  | 	% XXX should we use \the here? | 
					
						
							|  |  |  | 	%		...it makes things printable... | 
					
						
							| 
									
										
										
										
											2023-09-11 18:53:49 +03:00
										 |  |  | 	\def\cliptocellbleeds{%
 | 
					
						
							|  |  |  | 		{\the\photobook@cliptocell@left} % | 
					
						
							|  |  |  | 		{\the\photobook@cliptocell@bottom} % | 
					
						
							|  |  |  | 		{\the\photobook@cliptocell@right} % | 
					
						
							| 
									
										
										
										
											2023-09-11 21:16:25 +03:00
										 |  |  | 		{\the\photobook@cliptocell@top}}% | 
					
						
							| 
									
										
										
										
											2023-05-05 17:21:20 +03:00
										 |  |  | 	\def\cliptocellclearances{%
 | 
					
						
							| 
									
										
										
										
											2023-09-05 17:37:03 +03:00
										 |  |  | 		{-\the\photobook@cliptocell@left} % | 
					
						
							|  |  |  | 		{-\the\photobook@cliptocell@bottom} % | 
					
						
							|  |  |  | 		{-\the\photobook@cliptocell@right} % | 
					
						
							|  |  |  | 		{-\the\photobook@cliptocell@top}}} | 
					
						
							| 
									
										
										
										
											2023-04-24 12:37:13 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-19 21:01:24 +03:00
										 |  |  | \newenvironment{cliptocell}[1][0mm]{%
 | 
					
						
							| 
									
										
										
										
											2023-04-19 16:38:03 +03:00
										 |  |  | 	\begingroup% | 
					
						
							| 
									
										
										
										
											2023-09-11 18:53:49 +03:00
										 |  |  | 		\setcliptocellbleeds{#1} | 
					
						
							| 
									
										
										
										
											2023-04-20 14:47:27 +03:00
										 |  |  | 		% NOTE: the spaces at the end of each line here are significant!! | 
					
						
							| 
									
										
										
										
											2023-04-19 21:01:24 +03:00
										 |  |  | 		\begin{trimbox}{{\photobook@cliptocell@left} %
 | 
					
						
							|  |  |  | 				{\photobook@cliptocell@bottom} % | 
					
						
							|  |  |  | 				{\photobook@cliptocell@right} % | 
					
						
							|  |  |  | 				{\photobook@cliptocell@top}}% | 
					
						
							|  |  |  | 		\begin{clipbox*}{{-\photobook@cliptocell@left} %
 | 
					
						
							|  |  |  | 				{\height - \cellheight - \photobook@cliptocell@bottom} % | 
					
						
							|  |  |  | 				{\cellwidth + \photobook@cliptocell@right} % | 
					
						
							| 
									
										
										
										
											2023-04-19 21:20:50 +03:00
										 |  |  | 				{\height + \photobook@cliptocell@top}}% | 
					
						
							| 
									
										
										
										
											2023-04-23 03:14:01 +03:00
										 |  |  | 		% set defaults for nested cells... | 
					
						
							| 
									
										
										
										
											2023-09-11 18:53:49 +03:00
										 |  |  | 		\setcliptocellbleeds{0mm}% | 
					
						
							| 
									
										
										
										
											2023-04-19 16:38:03 +03:00
										 |  |  | 		\begin{minipage}[t][\cellheight][t]{\cellwidth}%  | 
					
						
							|  |  |  | 			\ignorespaces% | 
					
						
							|  |  |  | 	}{%
 | 
					
						
							|  |  |  | 		\end{minipage}% | 
					
						
							|  |  |  | 		\end{clipbox*}% | 
					
						
							| 
									
										
										
										
											2023-04-19 21:01:24 +03:00
										 |  |  | 		\end{trimbox}% | 
					
						
							| 
									
										
										
										
											2023-04-19 16:38:03 +03:00
										 |  |  | 	\endgroup} | 
					
						
							| 
									
										
										
										
											2023-04-18 12:36:33 +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|). | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2023-09-11 22:48:44 +03:00
										 |  |  | %%	>> \imagecell[clearance=<size>]{}{<image>} | 
					
						
							|  |  |  | %%	>> \imagecell[clearance=<horizontal> <vertical>]{}{<image>} | 
					
						
							|  |  |  | %%	>> \imagecell[clearance=<left> <bottom> <top> <right>]{}{<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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-05-05 15:27:39 +03:00
										 |  |  | % XXX EXPERIMENTAL | 
					
						
							|  |  |  | \newlength\photobook@imagecell@clearance@left | 
					
						
							|  |  |  | \setlength\photobook@imagecell@clearance@left{0pt} | 
					
						
							|  |  |  | \newlength\photobook@imagecell@clearance@top | 
					
						
							|  |  |  | \setlength\photobook@imagecell@clearance@top{0pt} | 
					
						
							|  |  |  | \newlength\photobook@imagecell@clearance@right | 
					
						
							|  |  |  | \setlength\photobook@imagecell@clearance@right{0pt} | 
					
						
							|  |  |  | \newlength\photobook@imagecell@clearance@bottom | 
					
						
							|  |  |  | \setlength\photobook@imagecell@clearance@bottom{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  | 
					
						
							| 
									
										
										
										
											2023-05-05 18:41:27 +03:00
										 |  |  | 		+0.5\photobook@imagecell@clearance@top | 
					
						
							|  |  |  | 		-0.5\photobook@imagecell@clearance@bottom | 
					
						
							| 
									
										
										
										
											2021-08-19 23:53:01 +03:00
										 |  |  | 		-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  | 
					
						
							| 
									
										
										
										
											2023-05-05 17:21:20 +03:00
										 |  |  | 		+0.5\photobook@imagecell@clearance@left | 
					
						
							|  |  |  | 		-0.5\photobook@imagecell@clearance@right | 
					
						
							| 
									
										
										
										
											2021-08-19 23:53:01 +03:00
										 |  |  | 		-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%
 | 
					
						
							| 
									
										
										
										
											2023-05-05 15:27:39 +03:00
										 |  |  | 		+\photobook@imagecell@clearance@left \relax}% | 
					
						
							| 
									
										
										
										
											2021-08-23 21:06:22 +03:00
										 |  |  | 	\def\photobook@imagecell@captionleft{
 | 
					
						
							|  |  |  | 		% XXX not sure why this branch is needed... | 
					
						
							|  |  |  | 		\ifKV@imagecell@args@fit | 
					
						
							|  |  |  | 			0pt | 
					
						
							|  |  |  | 		\else% | 
					
						
							|  |  |  | 			\dimexpr% | 
					
						
							|  |  |  | 				+\cellwidth  | 
					
						
							| 
									
										
										
										
											2023-05-05 15:27:39 +03:00
										 |  |  | 				-\photobook@imagecell@clearance@left | 
					
						
							|  |  |  | 				%-\photobook@imagecell@clearance | 
					
						
							| 
									
										
										
										
											2021-08-23 21:06:22 +03:00
										 |  |  | 				-\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  | 
					
						
							| 
									
										
										
										
											2023-05-05 15:27:39 +03:00
										 |  |  | 		-\photobook@imagecell@clearance@right | 
					
						
							|  |  |  | 		%-\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{%
 | 
					
						
							| 
									
										
										
										
											2023-05-05 15:27:39 +03:00
										 |  |  | 		\photobook@imagecell@clearance@top}% | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | 	\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  | 
					
						
							| 
									
										
										
										
											2023-05-05 15:27:39 +03:00
										 |  |  | 			-\photobook@imagecell@clearance@bottom | 
					
						
							|  |  |  | 			%-\photobook@imagecell@clearance | 
					
						
							| 
									
										
										
										
											2021-09-12 03:29:50 +03:00
										 |  |  | 			-\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  | 
					
						
							| 
									
										
										
										
											2023-05-05 15:27:39 +03:00
										 |  |  | 			+\photobook@imagecell@clearance@bottom \relax}}% | 
					
						
							| 
									
										
										
										
											2021-08-19 23:53:01 +03:00
										 |  |  | % clearance=<len>... | 
					
						
							| 
									
										
										
										
											2023-05-05 15:27:39 +03:00
										 |  |  | % clearance=<horizontal> <vertical>... | 
					
						
							|  |  |  | % clearance=<left> <bottom> <right> <top>... | 
					
						
							| 
									
										
										
										
											2021-08-20 01:22:17 +03:00
										 |  |  | \define@key{imagecell@args}{clearance}{%
 | 
					
						
							| 
									
										
										
										
											2023-05-05 15:27:39 +03:00
										 |  |  | 	% XXX EXPERIMENTAL | 
					
						
							|  |  |  | 	% XXX this is essentially the same as \photobook@cliptocell@bleeds -- unite... | 
					
						
							|  |  |  | 	\def\photobook@imagecell@clearances{#1}% | 
					
						
							| 
									
										
										
										
											2023-09-11 19:41:48 +03:00
										 |  |  | 	\setsepchar{ }% | 
					
						
							| 
									
										
										
										
											2023-05-05 15:27:39 +03:00
										 |  |  | 	\readlist*\photobook@imagecell@clearencelist{#1}% | 
					
						
							|  |  |  | 	\setsepchar{,}% | 
					
						
							|  |  |  | 	%% args: size
 | 
					
						
							|  |  |  | 	\ifnum \photobook@imagecell@clearencelistlen = 1% | 
					
						
							|  |  |  | 		\setlength\photobook@imagecell@clearance@left{%
 | 
					
						
							|  |  |  | 			\photobook@imagecell@clearencelist[1]}% | 
					
						
							|  |  |  | 		\setlength\photobook@imagecell@clearance@bottom{%
 | 
					
						
							|  |  |  | 			\photobook@imagecell@clearencelist[1]}% | 
					
						
							|  |  |  | 		\setlength\photobook@imagecell@clearance@right{%
 | 
					
						
							|  |  |  | 			\photobook@imagecell@clearencelist[1]}% | 
					
						
							|  |  |  | 		\setlength\photobook@imagecell@clearance@top{%
 | 
					
						
							|  |  |  | 			\photobook@imagecell@clearencelist[1]}\fi% | 
					
						
							|  |  |  | 	% args: horizontal vertical
 | 
					
						
							|  |  |  | 	\ifnum \photobook@imagecell@clearencelistlen = 2% | 
					
						
							|  |  |  | 		\setlength\photobook@imagecell@clearance@left{%
 | 
					
						
							|  |  |  | 			\photobook@imagecell@clearencelist[1]}% | 
					
						
							|  |  |  | 		\setlength\photobook@imagecell@clearance@bottom{%
 | 
					
						
							|  |  |  | 			\photobook@imagecell@clearencelist[2]}% | 
					
						
							|  |  |  | 		\setlength\photobook@imagecell@clearance@right{%
 | 
					
						
							|  |  |  | 			\photobook@imagecell@clearencelist[1]}% | 
					
						
							|  |  |  | 		\setlength\photobook@imagecell@clearance@top{%
 | 
					
						
							|  |  |  | 			\photobook@imagecell@clearencelist[2]}\fi% | 
					
						
							|  |  |  | 	% args: left bottom right top | 
					
						
							|  |  |  | 	\ifnum \photobook@imagecell@clearencelistlen = 4% | 
					
						
							|  |  |  | 		\setlength\photobook@imagecell@clearance@left{%
 | 
					
						
							|  |  |  | 			\photobook@imagecell@clearencelist[1]}% | 
					
						
							|  |  |  | 		\setlength\photobook@imagecell@clearance@bottom{%
 | 
					
						
							|  |  |  | 			\photobook@imagecell@clearencelist[2]}% | 
					
						
							|  |  |  | 		\setlength\photobook@imagecell@clearance@right{%
 | 
					
						
							|  |  |  | 			\photobook@imagecell@clearencelist[3]}% | 
					
						
							|  |  |  | 		\setlength\photobook@imagecell@clearance@top{%
 | 
					
						
							| 
									
										
										
										
											2023-09-11 19:41:48 +03:00
										 |  |  | 			\photobook@imagecell@clearencelist[4]}\fi}% | 
					
						
							| 
									
										
										
										
											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  | 
					
						
							| 
									
										
										
										
											2023-05-05 17:21:20 +03:00
										 |  |  | 						- \photobook@imagecell@clearance@left  | 
					
						
							|  |  |  | 						- \photobook@imagecell@clearance@right \relax, | 
					
						
							| 
									
										
										
										
											2021-08-31 08:27:37 +03:00
										 |  |  | 					height=\photobook@imagecell@scale\dimexpr  | 
					
						
							| 
									
										
										
										
											2021-08-20 01:22:17 +03:00
										 |  |  | 						\cellheight  | 
					
						
							| 
									
										
										
										
											2023-05-05 17:21:20 +03:00
										 |  |  | 						- \photobook@imagecell@clearance@top  | 
					
						
							|  |  |  | 						- \photobook@imagecell@clearance@bottom \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 | 
					
						
							| 
									
										
										
										
											2023-05-05 17:21:20 +03:00
										 |  |  | 							- \photobook@imagecell@clearance@left | 
					
						
							|  |  |  | 							- \photobook@imagecell@clearance@right \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  | 
					
						
							| 
									
										
										
										
											2023-05-05 17:21:20 +03:00
										 |  |  | 							- \photobook@imagecell@clearance@top | 
					
						
							|  |  |  | 							- \photobook@imagecell@clearance@bottom \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}}% | 
					
						
							| 
									
										
										
										
											2023-05-05 15:27:39 +03:00
										 |  |  | 		\setlength\clearanceleft{\photobook@imagecell@clearance@left} | 
					
						
							|  |  |  | 		\setlength\clearancetop{\photobook@imagecell@clearance@top} | 
					
						
							|  |  |  | 		\setlength\clearanceright{\photobook@imagecell@clearance@right} | 
					
						
							|  |  |  | 		\setlength\clearancebottom{\photobook@imagecell@clearance@bottom} | 
					
						
							|  |  |  | 		\def\clearances{\photobook@imagecell@clearences} | 
					
						
							| 
									
										
										
										
											2021-09-14 02:17:04 +03:00
										 |  |  | 		% 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% | 
					
						
							| 
									
										
										
										
											2023-02-25 12:46:21 +03:00
										 |  |  | 					% XXX BUG: for some reason the text here will not line-break... | 
					
						
							|  |  |  | 					%		putting it in a minipage here does nothing while the same | 
					
						
							|  |  |  | 					%		minipage on the lient size fixes the issue... | 
					
						
							| 
									
										
										
										
											2021-09-02 02:05:32 +03:00
										 |  |  | 					#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  | 
					
						
							| 
									
										
										
										
											2023-09-11 21:16:25 +03:00
										 |  |  | 						% XXX EXPERIMENTAL CLEARANCE | 
					
						
							| 
									
										
										
										
											2021-09-03 16:32:03 +03:00
										 |  |  | 						% XXX this is only present in images... | 
					
						
							| 
									
										
										
										
											2023-09-11 21:16:25 +03:00
										 |  |  | 						- \clearanceleft | 
					
						
							|  |  |  | 						%- \clearanceright | 
					
						
							| 
									
										
										
										
											2023-05-05 15:27:39 +03:00
										 |  |  | 						% XXX LEGACY CLEARANCE | 
					
						
							| 
									
										
										
										
											2023-09-11 21:16:25 +03:00
										 |  |  | 						%- \clearance  | 
					
						
							| 
									
										
										
										
											2023-05-05 17:21:20 +03:00
										 |  |  | 					\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} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2023-04-09 18:12:54 +03:00
										 |  |  | %% The star version accounts for |\gutteroffset|.  | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											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
										 |  |  | %% | 
					
						
							|  |  |  | \newenvironment{pagecell}{%
 | 
					
						
							| 
									
										
										
										
											2023-04-09 18:12:54 +03:00
										 |  |  | 	\begin{cell*}{%
 | 
					
						
							|  |  |  | 			\bleed + \ifnumodd{\thepage}{\bindingoffset}{0pt},% | 
					
						
							|  |  |  | 			\bleed}% | 
					
						
							|  |  |  | 		{\pageblockwidth - \bindingoffset}% | 
					
						
							|  |  |  | 		{\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*}{%
 | 
					
						
							| 
									
										
										
										
											2023-04-09 18:12:54 +03:00
										 |  |  | 			\bleed + \ifnumodd{\thepage}{\bindingoffset + \gutteroffset}{0pt},% | 
					
						
							| 
									
										
										
										
											2021-09-26 01:04:41 +03:00
										 |  |  | 			\bleed}% | 
					
						
							| 
									
										
										
										
											2023-04-09 18:12:54 +03:00
										 |  |  | 		{\pageblockwidth - \bindingoffset - \gutteroffset}% | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | 		{\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-10-09 17:04:07 +03:00
										 |  |  | % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 
					
						
							|  |  |  | %%%%% Foldout page cells | 
					
						
							| 
									
										
										
										
											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-10-18 15:14:40 +03:00
										 |  |  | %% A foldout is a special case cell that changes the page format.  | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% In addition to cell lengths a foldout defines a set of additional  | 
					
						
							|  |  |  | %% lengths and lists within its context. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% \DescribeMacro{\pagefoldpanels=<list>} | 
					
						
							|  |  |  | %% \DescribeMacro{\pagefoldpanelfolds=<list>} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% Lists page folded panel widths and fold types respectively. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% |pagefoldpanels| is set automatically for layouts other than |block|  | 
					
						
							|  |  |  | %% and for foldout pages, changing this can mess up fold markers and 
 | 
					
						
							|  |  |  | %% page cell placement. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% |pagefoldpanelfolds| is generated when creating a foldout. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% See: | 
					
						
							|  |  |  | %% \href{https://ctan.altspu.ru/macros/generic/listofitems/listofitems-en.pdf}{listofitems} | 
					
						
							|  |  |  | %% for list API. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | % XXX add a generic panel constructor.. | 
					
						
							|  |  |  | %		\foldedcell[<height>]{<index>} | 
					
						
							|  |  |  | % NOTE: these are wrapped in \@ifundefined{..} to prevent overwriting when
 | 
					
						
							|  |  |  | %		values are defined in \InitPages... | 
					
						
							|  |  |  | \@ifundefined{pagefoldpanels}{%
 | 
					
						
							| 
									
										
										
										
											2021-10-21 16:43:06 +03:00
										 |  |  | 	\def\pagefoldpanels{}}{} | 
					
						
							| 
									
										
										
										
											2021-10-18 15:14:40 +03:00
										 |  |  | \@ifundefined{pagefoldpanelfolds}{%
 | 
					
						
							| 
									
										
										
										
											2021-10-21 16:43:06 +03:00
										 |  |  | 	\def\pagefoldpanelfolds{}}{} | 
					
						
							| 
									
										
										
										
											2021-10-18 15:14:40 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-31 18:48:17 +03:00
										 |  |  | %% \DescribeMacro{\foldoutwidth=<len>} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% Total foldout page width, calculated when a foldout page is created. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | \newlength\foldoutwidth | 
					
						
							|  |  |  | \setlength\foldoutwidth{\blockwidth} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-09 17:04:07 +03:00
										 |  |  | %% \DescribeEnv{foldout} | 
					
						
							|  |  |  | % | 
					
						
							| 
									
										
										
										
											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-12 05:08:14 +03:00
										 |  |  | %% |<fold-spec>| can be a number of folds, or contain one or more fold  | 
					
						
							|  |  |  | %% types (|in| or |out|), two or more panel widths (dimensions) or a | 
					
						
							|  |  |  | %% sequence of both (i.e. dim fold dim ...) where missing widths are  | 
					
						
							|  |  |  | %% automatically calculated and missing folds are the same as the previous | 
					
						
							|  |  |  | %% fold or the default if no folds are specified. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2023-04-11 15:58:00 +03:00
										 |  |  | %% If no |<fold-spec>| is given, then the value of |\defaultfoldout| is
 | 
					
						
							| 
									
										
										
										
											2021-10-17 01:59:17 +03:00
										 |  |  | %% used (default: |2|). | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-16 04:13:44 +03:00
										 |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-10-13 00:28:37 +03:00
										 |  |  | %%                            v    \flatfold    v | 
					
						
							| 
									
										
										
										
											2021-09-17 16:58:43 +03:00
										 |  |  | %%           | 
					
						
							| 
									
										
										
										
											2021-10-09 16:09:39 +03:00
										 |  |  | %%       - --=----------------++---------------++--------------+ | 
					
						
							| 
									
										
										
										
											2021-09-17 16:58:43 +03:00
										 |  |  | %%           =                ..               ..              | | 
					
						
							|  |  |  | %%           =                ..               ..              | | 
					
						
							|  |  |  | %%           =                ..               ..              | | 
					
						
							|  |  |  | %%           =                ..               ..              | | 
					
						
							|  |  |  | %%           =                ..               ..              | | 
					
						
							|  |  |  | %%           =                ..               ..              | | 
					
						
							|  |  |  | %%           =                ..               ..              | | 
					
						
							|  |  |  | %%           =                ..               ..              | | 
					
						
							|  |  |  | %%           =                ..               ..              | | 
					
						
							|  |  |  | %%           =            (1) ..           (2) ..          (3) | | 
					
						
							| 
									
										
										
										
											2021-10-09 16:09:39 +03:00
										 |  |  | %%       - --=----------------++---------------++--------------+ | 
					
						
							| 
									
										
										
										
											2021-09-17 16:58:43 +03:00
										 |  |  | %%           | 
					
						
							| 
									
										
										
										
											2021-10-09 16:09:39 +03:00
										 |  |  | %%  +--------------++---------------++----------------=-- - | 
					
						
							| 
									
										
										
										
											2021-09-16 04:13:44 +03:00
										 |  |  | %%  |              ..               ..                = | 
					
						
							|  |  |  | %%  |              ..               ..                = | 
					
						
							|  |  |  | %%  |              ..               ..                = | 
					
						
							|  |  |  | %%  |              ..               ..                = | 
					
						
							|  |  |  | %%  |              ..               ..                = | 
					
						
							|  |  |  | %%  |              ..               ..                = | 
					
						
							|  |  |  | %%  |              ..               ..                = | 
					
						
							|  |  |  | %%  |              ..               ..                = | 
					
						
							|  |  |  | %%  |              ..               ..                = | 
					
						
							| 
									
										
										
										
											2021-09-26 03:04:07 +03:00
										 |  |  | %%  |          (1) ..           (2) ..            (3) = | 
					
						
							| 
									
										
										
										
											2021-10-09 16:09:39 +03:00
										 |  |  | %%  +--------------++---------------++----------------=-- - | 
					
						
							| 
									
										
										
										
											2021-09-16 04:13:44 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-10-13 00:28:37 +03:00
										 |  |  | %%                 ^    \flatfold    ^ | 
					
						
							| 
									
										
										
										
											2021-09-16 04:13:44 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% \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.  | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-10-11 19:52:27 +03:00
										 |  |  | %% If |\foldoutpages{..}| is called on an even page, an empty normal  | 
					
						
							| 
									
										
										
										
											2021-09-17 16:58:43 +03:00
										 |  |  | %% 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  | 
					
						
							| 
									
										
										
										
											2021-10-11 19:52:27 +03:00
										 |  |  | %% with an empty page before |\foldoutpages{..}| exits. | 
					
						
							| 
									
										
										
										
											2021-09-17 16:58:43 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											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-10-09 16:09:39 +03:00
										 |  |  | %%           - --=-------+-------+-    --+-------+-------+ | 
					
						
							| 
									
										
										
										
											2021-09-19 00:13:55 +03:00
										 |  |  | %%               =       |       |       |       |       | | 
					
						
							|  |  |  | %%               =  (1)  |  (2)  |  ...  | (n-1) |  (n)  | | 
					
						
							|  |  |  | %%               =       |       |       |       |       | | 
					
						
							| 
									
										
										
										
											2021-10-09 16:09:39 +03:00
										 |  |  | %%           - --=-------+-------+--    -+-------+-------+ | 
					
						
							| 
									
										
										
										
											2021-09-19 00:13:55 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-09-26 02:54:14 +03:00
										 |  |  | %%                                 left page
 | 
					
						
							| 
									
										
										
										
											2021-10-09 16:09:39 +03:00
										 |  |  | %%   +-------+-------+-    --+-------+-------=-- - | 
					
						
							| 
									
										
										
										
											2021-09-26 02:54:14 +03:00
										 |  |  | %%   |       |       |       |       |       = | 
					
						
							|  |  |  | %%   |  (1)  |  (2)  |  ...  | (n-1) |  (n)  = | 
					
						
							|  |  |  | %%   |       |       |       |       |       = | 
					
						
							| 
									
										
										
										
											2021-10-09 16:09:39 +03:00
										 |  |  | %%   +-------+-------+--    -+-------+-------=-- - | 
					
						
							| 
									
										
										
										
											2021-09-19 00:13:55 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-10-18 15:14:40 +03:00
										 |  |  | %% Formal |<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
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-10-18 15:14:40 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2023-04-11 16:06:20 +03:00
										 |  |  | %% \DescribeMacro{\clearfoldoutgutter=<len>} | 
					
						
							| 
									
										
										
										
											2021-10-10 06:40:44 +03:00
										 |  |  | %% \DescribeMacro{\clearfoldoutedge=<len>} | 
					
						
							|  |  |  | %% \DescribeMacro{\clearfoldoutfold=<len>} | 
					
						
							| 
									
										
										
										
											2021-10-09 13:43:51 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-10-07 07:34:01 +03:00
										 |  |  | %% Fold panel sizing for similar fold sequence: | 
					
						
							| 
									
										
										
										
											2021-09-16 04:13:44 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-10-08 13:59:32 +03:00
										 |  |  | %%                       \clearfoldoutedge <-> | 
					
						
							|  |  |  | %%                    \clearfoldoutfold <->   | 
					
						
							| 
									
										
										
										
											2023-04-11 16:06:20 +03:00
										 |  |  | %%   <--> \clearfoldoutgutter | 
					
						
							| 
									
										
										
										
											2021-09-16 04:13:44 +03:00
										 |  |  | %%                                                    (3)  /\  (2)   | 
					
						
							|  |  |  | %%      +---------------------------------+               /  \      | 
					
						
							|  |  |  | %%      +-------------------------------  |                  /      | 
					
						
							|  |  |  | %%   -------------------------------------+                 /  (1)  | 
					
						
							|  |  |  | %%   ========================================         =====+=====   | 
					
						
							|  |  |  | %%   ========================================         | 
					
						
							|  |  |  | %%                                                  | 
					
						
							|  |  |  | %% \end{verbatim}                                   | 
					
						
							|  |  |  | %% \end{minipage}                                   | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-10-07 07:34:01 +03:00
										 |  |  | %% Note that |in in| fold sequence is drawn, |out out| is identical in 
 | 
					
						
							|  |  |  | %% sizing but reflectd. | 
					
						
							| 
									
										
										
										
											2021-09-16 04:13:44 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-10-07 07:34:01 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% Fold panel sizing for dissimilar fold sequence: | 
					
						
							| 
									
										
										
										
											2021-09-16 04:13:44 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %% \begin{minipage}{\textwidth}                     | 
					
						
							|  |  |  | %% \begin{verbatim}                                 | 
					
						
							|  |  |  | %%                                                  | 
					
						
							| 
									
										
										
										
											2021-10-08 13:59:32 +03:00
										 |  |  | %%                      \clearfoldoutedge <->                /       | 
					
						
							| 
									
										
										
										
											2023-04-11 16:06:20 +03:00
										 |  |  | %%   <--> \clearfoldoutgutter                          (3)  /        | 
					
						
							| 
									
										
										
										
											2021-09-16 04:13:44 +03:00
										 |  |  | %%                                                          \        | 
					
						
							|  |  |  | %%      +----------------------------------                  \  (2)  | 
					
						
							|  |  |  | %%      +---------------------------------+                  /       | 
					
						
							|  |  |  | %%   -------------------------------------+                 /  (1)   | 
					
						
							|  |  |  | %%   ========================================         =====+=====    | 
					
						
							|  |  |  | %%   ======================================== | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-10-07 07:34:01 +03:00
										 |  |  | %% |in out| is drawn, |out it| is the same but reflected. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-10-13 00:28:37 +03:00
										 |  |  | %% The size of the paper fold is set by |\flatfold|. | 
					
						
							| 
									
										
										
										
											2021-10-08 13:59:32 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-10-31 18:48:17 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 
					
						
							|  |  |  | % Fold marks... | 
					
						
							| 
									
										
										
										
											2021-09-16 04:13:44 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-17 00:25:55 +03:00
										 |  |  | % draw in/out fold mark... | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %	>> \foldinmark[<baseline>] | 
					
						
							|  |  |  | %	>> \foldoutmark[<baseline>] | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | % NOTE: these should be used in a box. | 
					
						
							|  |  |  | % NOTE: these are centered in origin. | 
					
						
							| 
									
										
										
										
											2021-10-21 12:40:38 +03:00
										 |  |  | % | 
					
						
							| 
									
										
										
										
											2021-10-20 13:23:06 +03:00
										 |  |  | % XXX these can affect the items after -- need to encapsulate better + test... | 
					
						
							|  |  |  | % XXX do we need to make centering block size dependant on \foldmarksize  | 
					
						
							|  |  |  | %		or are the two independent??? (test) | 
					
						
							| 
									
										
										
										
											2021-10-31 18:48:17 +03:00
										 |  |  | % XXX MARKOFFSET for some reason splitting the \vspace{..} into a  | 
					
						
							|  |  |  | %		arg-dependant and a foldmarklen-dependant parts below yields  | 
					
						
							|  |  |  | %		wrong results... | 
					
						
							|  |  |  | %		...not that simply splitting the original into two \vspace{..}  | 
					
						
							|  |  |  | %		calls works fine... | 
					
						
							| 
									
										
										
										
											2021-10-21 15:11:33 +03:00
										 |  |  | \newsavebox\photobook@foldinmark | 
					
						
							| 
									
										
										
										
											2021-10-25 02:17:31 +03:00
										 |  |  | \newsavebox\photobook@foldoutmark | 
					
						
							|  |  |  | \newcommand\ResetFoldMarks{%
 | 
					
						
							|  |  |  | 	\sbox{\photobook@foldinmark}{%
 | 
					
						
							|  |  |  | 		% XXX MARKOFFSET | 
					
						
							| 
									
										
										
										
											2021-10-29 23:27:21 +03:00
										 |  |  | 		%\vspace{0.5\photobook@foldmarklen}% | 
					
						
							| 
									
										
										
										
											2021-10-25 02:17:31 +03:00
										 |  |  | 		\smash{\makebox[0pt][l]{%
 | 
					
						
							|  |  |  | 			% size-agnostic centering... | 
					
						
							|  |  |  | 			\hspace{-5mm}{\makebox[1cm][c]{%
 | 
					
						
							|  |  |  | 				\begin{tikzpicture}% | 
					
						
							|  |  |  | 					\draw[white, ultra thick]  | 
					
						
							| 
									
										
										
										
											2021-10-29 23:27:21 +03:00
										 |  |  | 						(-0.3333\photobook@foldmarklen,0.3333\photobook@foldmarklen)  | 
					
						
							| 
									
										
										
										
											2021-10-25 02:17:31 +03:00
										 |  |  | 						-- (0,0)  | 
					
						
							| 
									
										
										
										
											2021-10-29 23:27:21 +03:00
										 |  |  | 						-- (0.3333\photobook@foldmarklen,0.3333\photobook@foldmarklen); | 
					
						
							| 
									
										
										
										
											2021-10-25 02:17:31 +03:00
										 |  |  | 					\draw[white, ultra thick]  | 
					
						
							| 
									
										
										
										
											2021-10-29 23:27:21 +03:00
										 |  |  | 						(0,0.6666\photobook@foldmarklen)  | 
					
						
							|  |  |  | 						-- (0,-0.3333\photobook@foldmarklen); | 
					
						
							| 
									
										
										
										
											2021-10-25 02:17:31 +03:00
										 |  |  | 					\draw[black, thin]  | 
					
						
							| 
									
										
										
										
											2021-10-29 23:27:21 +03:00
										 |  |  | 						(-0.3333\photobook@foldmarklen,0.3333\photobook@foldmarklen)  | 
					
						
							| 
									
										
										
										
											2021-10-25 02:17:31 +03:00
										 |  |  | 						-- (0,0)  | 
					
						
							| 
									
										
										
										
											2021-10-29 23:27:21 +03:00
										 |  |  | 						-- (0.3333\photobook@foldmarklen,0.3333\photobook@foldmarklen); | 
					
						
							| 
									
										
										
										
											2021-10-25 02:17:31 +03:00
										 |  |  | 					\draw[black, thin]  | 
					
						
							| 
									
										
										
										
											2021-10-29 23:27:21 +03:00
										 |  |  | 						(0,0.6666\photobook@foldmarklen)  | 
					
						
							|  |  |  | 						-- (0,-0.3333\photobook@foldmarklen); | 
					
						
							| 
									
										
										
										
											2021-10-25 02:17:31 +03:00
										 |  |  | 				\end{tikzpicture}}}}}} | 
					
						
							|  |  |  | 	\sbox{\photobook@foldoutmark}{%
 | 
					
						
							|  |  |  | 		% XXX MARKOFFSET | 
					
						
							| 
									
										
										
										
											2021-10-29 23:27:21 +03:00
										 |  |  | 		%\vspace{0.5\photobook@foldmarklen}% | 
					
						
							| 
									
										
										
										
											2021-10-25 02:17:31 +03:00
										 |  |  | 		\smash{\makebox[0pt][l]{%
 | 
					
						
							|  |  |  | 			% size-agnostic centering... | 
					
						
							|  |  |  | 			\hspace{-5mm}{\makebox[1cm][c]{%
 | 
					
						
							|  |  |  | 				\begin{tikzpicture}% | 
					
						
							|  |  |  | 					\draw[white, ultra thick]  | 
					
						
							| 
									
										
										
										
											2021-10-29 23:27:21 +03:00
										 |  |  | 						(-0.3333\photobook@foldmarklen,0)  | 
					
						
							|  |  |  | 						-- (0,0.3333\photobook@foldmarklen)  | 
					
						
							|  |  |  | 						-- (0.3333\photobook@foldmarklen,0); | 
					
						
							| 
									
										
										
										
											2021-10-25 02:17:31 +03:00
										 |  |  | 					\draw[white, ultra thick]  | 
					
						
							| 
									
										
										
										
											2021-10-29 23:27:21 +03:00
										 |  |  | 						(0,0.6666\photobook@foldmarklen)  | 
					
						
							|  |  |  | 						-- (0,-0.3333\photobook@foldmarklen); | 
					
						
							| 
									
										
										
										
											2021-10-25 02:17:31 +03:00
										 |  |  | 					\draw[black, thin]  | 
					
						
							| 
									
										
										
										
											2021-10-29 23:27:21 +03:00
										 |  |  | 						(-0.3333\photobook@foldmarklen,0)  | 
					
						
							|  |  |  | 						-- (0,0.3333\photobook@foldmarklen)  | 
					
						
							|  |  |  | 						-- (0.3333\photobook@foldmarklen,0); | 
					
						
							| 
									
										
										
										
											2021-10-25 02:17:31 +03:00
										 |  |  | 					\draw[black, thin]  | 
					
						
							| 
									
										
										
										
											2021-10-29 23:27:21 +03:00
										 |  |  | 						(0,0.6666\photobook@foldmarklen)  | 
					
						
							|  |  |  | 						-- (0,-0.3333\photobook@foldmarklen); | 
					
						
							| 
									
										
										
										
											2021-10-25 02:17:31 +03:00
										 |  |  | 				\end{tikzpicture}}}}}}} | 
					
						
							|  |  |  | \ResetFoldMarks | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-26 00:35:54 +03:00
										 |  |  | % XXX EXPERIMENTAL... | 
					
						
							| 
									
										
										
										
											2021-10-31 18:48:17 +03:00
										 |  |  | % XXX not sure if this should ever be needed... | 
					
						
							|  |  |  | %\newcommand\setfoldmarksize[1][6mm]{%
 | 
					
						
							|  |  |  | %	\setlength\photobook@foldmarklen{#1}% | 
					
						
							|  |  |  | %	%\edef\photobook@foldmarklen{#1}% | 
					
						
							|  |  |  | %	\ResetFoldMarks} | 
					
						
							| 
									
										
										
										
											2021-10-26 00:35:54 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-25 02:17:31 +03:00
										 |  |  | %	>> \foldinmark[<baseline>] | 
					
						
							| 
									
										
										
										
											2021-10-21 16:43:06 +03:00
										 |  |  | \newcommand\foldinmark[1][0pt]{%
 | 
					
						
							| 
									
										
										
										
											2021-10-31 18:48:17 +03:00
										 |  |  | 	% XXX MARKOFFSET | 
					
						
							| 
									
										
										
										
											2021-10-26 00:35:54 +03:00
										 |  |  | 	%\vspace{#1}% | 
					
						
							| 
									
										
										
										
											2021-10-29 23:27:21 +03:00
										 |  |  | 	\vspace{\dimexpr 0.5\photobook@foldmarklen + #1 \relax}% | 
					
						
							| 
									
										
										
										
											2021-10-21 16:43:06 +03:00
										 |  |  | 	\usebox\photobook@foldinmark} | 
					
						
							| 
									
										
										
										
											2021-10-25 02:17:31 +03:00
										 |  |  | %	>> \foldoutmark[<baseline>] | 
					
						
							| 
									
										
										
										
											2021-10-17 00:25:55 +03:00
										 |  |  | \newcommand\foldoutmark[1][0pt]{
 | 
					
						
							| 
									
										
										
										
											2021-10-31 18:48:17 +03:00
										 |  |  | 	% XXX MARKOFFSET  | 
					
						
							| 
									
										
										
										
											2021-10-26 00:35:54 +03:00
										 |  |  | 	%\vspace{#1}% | 
					
						
							| 
									
										
										
										
											2021-10-29 23:27:21 +03:00
										 |  |  | 	\vspace{\dimexpr 0.5\photobook@foldmarklen + #1 \relax}% | 
					
						
							| 
									
										
										
										
											2021-10-25 02:17:31 +03:00
										 |  |  | 	\usebox\photobook@foldoutmark} | 
					
						
							| 
									
										
										
										
											2021-10-17 00:25:55 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | %	>> \photobook@foldmark[<baseline>]{<type>}{<left>, <top>} | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | \newif\ifphotobook@foldmark@in
 | 
					
						
							| 
									
										
										
										
											2021-10-17 00:25:55 +03:00
										 |  |  | \newcommand\photobook@foldmark[3][0pt]{%
 | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | 	\begingroup% | 
					
						
							|  |  |  | 		\ifnumodd{\thepage}{%
 | 
					
						
							| 
									
										
										
										
											2021-10-17 00:25:55 +03:00
										 |  |  | 			\ifthenelse{\equal{#2}{in}}{%
 | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | 				\photobook@foldmark@intrue}{%
 | 
					
						
							|  |  |  | 				\photobook@foldmark@infalse}}{%
 | 
					
						
							| 
									
										
										
										
											2021-10-17 00:25:55 +03:00
										 |  |  | 			\ifthenelse{\equal{#2}{in}}{%
 | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | 				\photobook@foldmark@infalse}{%
 | 
					
						
							|  |  |  | 				\photobook@foldmark@intrue}}% | 
					
						
							|  |  |  | 		\begin{textblock*}{0pt}(#3)% | 
					
						
							| 
									
										
										
										
											2021-10-17 00:25:55 +03:00
										 |  |  | 			\ifphotobook@foldmark@in% | 
					
						
							|  |  |  | 				\foldinmark[#1]% | 
					
						
							|  |  |  | 			\else% | 
					
						
							|  |  |  | 				\foldoutmark[#1]\fi% | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | 		\end{textblock*}% | 
					
						
							|  |  |  | 	\endgroup} | 
					
						
							| 
									
										
										
										
											2021-10-01 05:00:46 +03:00
										 |  |  | \newcommand\photobook@topfoldmark[2][in]{%
 | 
					
						
							| 
									
										
										
										
											2021-10-29 23:27:21 +03:00
										 |  |  | 	\photobook@foldmark[-0.5\photobook@foldmarklen]{#1}{#2}} | 
					
						
							| 
									
										
										
										
											2021-10-01 05:00:46 +03:00
										 |  |  | \newcommand\photobook@bottomfoldmark[2][in]{%
 | 
					
						
							| 
									
										
										
										
											2021-10-29 23:27:21 +03:00
										 |  |  | 	\photobook@foldmark[0.5\photobook@foldmarklen]{#1}{#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-10-31 18:48:17 +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-09 14:21:48 +03:00
										 |  |  | % | 
					
						
							|  |  |  | % XXX should we set maxpanelwidth when manually setting panel widths??? | 
					
						
							| 
									
										
										
										
											2021-10-09 13:57:57 +03:00
										 |  |  | % XXX might be good to warn the user if the manual fold will not work... | 
					
						
							|  |  |  | %		after two folds in same direction panels must be strictly smaller... | 
					
						
							|  |  |  | %		...would be nice to maintain maxpanelwidth and warn if explicit 
 | 
					
						
							|  |  |  | %		width is larger... | 
					
						
							| 
									
										
										
										
											2021-09-28 12:00:08 +03:00
										 |  |  | \newcommand\photobook@foldout@pushpanel[2]{%
 | 
					
						
							| 
									
										
										
										
											2021-10-09 13:43:51 +03:00
										 |  |  | 	% initial max panel size... | 
					
						
							|  |  |  | 	\ifnum \thephotobook@foldoutpanel = 1% | 
					
						
							|  |  |  | 		\setlength\photobook@foldout@maxpanelwidth{%
 | 
					
						
							|  |  |  | 			\blockwidth | 
					
						
							|  |  |  | 			- \clearfoldoutedge}\fi% | 
					
						
							| 
									
										
										
										
											2021-10-09 13:57:57 +03:00
										 |  |  | 	% panel #2 -- clear binding... | 
					
						
							| 
									
										
										
										
											2021-10-09 13:43:51 +03:00
										 |  |  | 	\ifnum \thephotobook@foldoutpanel = 2% | 
					
						
							| 
									
										
										
										
											2021-10-09 13:57:57 +03:00
										 |  |  | 		\setlength\photobook@foldout@maxpanelwidth{%
 | 
					
						
							|  |  |  | 			\photobook@foldout@maxpanelwidth | 
					
						
							| 
									
										
										
										
											2023-04-11 16:06:20 +03:00
										 |  |  | 			- \clearfoldoutgutter}\fi% | 
					
						
							| 
									
										
										
										
											2021-10-08 13:59:32 +03:00
										 |  |  | 	% calculate widths... | 
					
						
							| 
									
										
										
										
											2021-09-28 12:00:08 +03:00
										 |  |  | 	\ifdim #1 = 0pt% | 
					
						
							| 
									
										
										
										
											2021-10-09 13:57:57 +03:00
										 |  |  | 		% first two panels do not need fold compensation... | 
					
						
							| 
									
										
										
										
											2021-10-09 13:43:51 +03:00
										 |  |  | 		\ifnum \thephotobook@foldoutpanel < 3% | 
					
						
							| 
									
										
										
										
											2021-10-01 03:45:25 +03:00
										 |  |  | 			\setlength\photobook@foldout@panelwidth{%
 | 
					
						
							| 
									
										
										
										
											2021-10-08 13:59:32 +03:00
										 |  |  | 				\photobook@foldout@maxpanelwidth | 
					
						
							| 
									
										
										
										
											2021-10-13 00:28:37 +03:00
										 |  |  | 				+ \flatfold}% | 
					
						
							| 
									
										
										
										
											2021-10-09 13:57:57 +03:00
										 |  |  | 		\else% | 
					
						
							|  |  |  | 			% double fold twice in same direction... | 
					
						
							|  |  |  | 			\ifthenelse{\equal{#2}{\photobook@foldout@prevfold}}{%
 | 
					
						
							|  |  |  | 				\setlength\photobook@foldout@panelwidth{%
 | 
					
						
							|  |  |  | 					\photobook@foldout@maxpanelwidth  | 
					
						
							| 
									
										
										
										
											2021-10-13 00:28:37 +03:00
										 |  |  | 					+ \flatfold | 
					
						
							| 
									
										
										
										
											2021-10-09 13:57:57 +03:00
										 |  |  | 					- \clearfoldoutfold}% | 
					
						
							|  |  |  | 			% different fold directions -- no resizing needed here... | 
					
						
							|  |  |  | 			}{%
 | 
					
						
							|  |  |  | 				\setlength\photobook@foldout@panelwidth{%
 | 
					
						
							|  |  |  | 					\photobook@foldout@maxpanelwidth | 
					
						
							| 
									
										
										
										
											2021-10-13 00:28:37 +03:00
										 |  |  | 					+ \flatfold}}\fi% | 
					
						
							| 
									
										
										
										
											2021-10-08 13:59:32 +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-09 14:21:48 +03:00
										 |  |  | 		% XXX should we set the maxpanelwidth here too??? | 
					
						
							|  |  |  | 		%		...if yes, should we be more thorough and size it to the  | 
					
						
							|  |  |  | 		%		available space (accounting for last two folds)?? | 
					
						
							|  |  |  | 		%\setlength\photobook@foldout@maxpanelwidth{#1}% | 
					
						
							| 
									
										
										
										
											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... | 
					
						
							| 
									
										
										
										
											2021-10-16 18:22:42 +03:00
										 |  |  | 	\edef\pagefoldpanelfolds{%
 | 
					
						
							|  |  |  | 		\pagefoldpanelfolds,#2}% | 
					
						
							|  |  |  | 	\edef\pagefoldpanels{%
 | 
					
						
							|  |  |  | 		\pagefoldpanels,\the\photobook@foldout@panelwidth}% | 
					
						
							| 
									
										
										
										
											2021-10-09 13:43:51 +03:00
										 |  |  | 	\stepcounter{photobook@foldoutpanel}} | 
					
						
							| 
									
										
										
										
											2021-09-30 15:21:07 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-10 06:40:44 +03:00
										 |  |  | % XXX also add this to jacket/cover/endpaper... | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | \newlength\photobook@showmarks@offset | 
					
						
							|  |  |  | \setlength\photobook@showmarks@offset{0pt} | 
					
						
							| 
									
										
										
										
											2021-10-05 23:40:48 +03:00
										 |  |  | \newcommand\photobook@showmarks{%
 | 
					
						
							| 
									
										
										
										
											2021-10-16 18:22:42 +03:00
										 |  |  | 	% XXX make this a list-length check... | 
					
						
							|  |  |  | 	\ifx \pagefoldpanels \empty \else% | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | 		\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}{%
 | 
					
						
							| 
									
										
										
										
											2021-10-16 18:22:42 +03:00
										 |  |  | 				\xintFor* ##1 in {\xintSeq{1}{\pagefoldpanelslen - 1}} \do {%
 | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | 					\setlength\photobook@showmarks@offset{
 | 
					
						
							|  |  |  | 						\photobook@showmarks@offset | 
					
						
							| 
									
										
										
										
											2021-10-16 18:22:42 +03:00
										 |  |  | 						+ \pagefoldpanels[##1]}% | 
					
						
							|  |  |  | 					% XXX HACK: it appears that we can't expand \pagefoldpanelfolds[##1] in [..]... | 
					
						
							|  |  |  | 					\edef\photobook@showmarks@tmp{\pagefoldpanelfolds[##1]}% | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | 					\photobook@markfold[\photobook@showmarks@tmp]{\photobook@showmarks@offset}}% | 
					
						
							|  |  |  | 			}{
 | 
					
						
							| 
									
										
										
										
											2021-10-16 18:22:42 +03:00
										 |  |  | 				\xintFor* ##1 in {\xintSeq{\pagefoldpanelslen}{2}} \do {%
 | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | 					\setlength\photobook@showmarks@offset{
 | 
					
						
							|  |  |  | 						\photobook@showmarks@offset | 
					
						
							| 
									
										
										
										
											2021-10-16 18:22:42 +03:00
										 |  |  | 						+ \pagefoldpanels[##1]}% | 
					
						
							|  |  |  | 					% XXX HACK: it appears that we can't expand \pagefoldpanelfolds[##1] in [..]... | 
					
						
							|  |  |  | 					\edef\photobook@showmarks@tmp{\pagefoldpanelfolds[##1 - 1]}% | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | 					\photobook@markfold[\photobook@showmarks@tmp]{\photobook@showmarks@offset}}}% | 
					
						
							|  |  |  | 		\endgroup\fi} | 
					
						
							|  |  |  | \AtBeginShipout{%
 | 
					
						
							|  |  |  | 	\iffoldmarks% | 
					
						
							|  |  |  | 		\photobook@showmarks\fi} | 
					
						
							| 
									
										
										
										
											2021-10-05 23:40:48 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-09 13:43:51 +03:00
										 |  |  | \newcounter{photobook@foldoutpanel} | 
					
						
							|  |  |  | \setcounter{photobook@foldoutpanel}{1} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-17 01:59:17 +03:00
										 |  |  | \newenvironment{foldout}[1][\defaultfoldout]{%
 | 
					
						
							| 
									
										
										
										
											2021-09-27 16:07:30 +03:00
										 |  |  | 	\begingroup% | 
					
						
							|  |  |  | 		\setsepchar{ }% | 
					
						
							|  |  |  | 		\readlist*\photobook@foldout@args{#1}% | 
					
						
							| 
									
										
										
										
											2023-04-27 00:37:37 +03:00
										 |  |  | 		\setsepchar{,}% | 
					
						
							| 
									
										
										
										
											2021-09-30 15:21:07 +03:00
										 |  |  | 		% | 
					
						
							|  |  |  | 		% defaults... | 
					
						
							| 
									
										
										
										
											2021-10-09 13:43:51 +03:00
										 |  |  | 		\setcounter{photobook@foldoutpanel}{1} | 
					
						
							| 
									
										
										
										
											2021-09-29 23:45:10 +03:00
										 |  |  | 		\setlength\foldoutwidth{0pt}% | 
					
						
							| 
									
										
										
										
											2021-10-17 00:25:55 +03:00
										 |  |  | 		\edef\photobook@foldout@prevfold{\pagefold}% | 
					
						
							| 
									
										
										
										
											2021-09-30 15:21:07 +03:00
										 |  |  | 		% | 
					
						
							|  |  |  | 		% panel count... | 
					
						
							| 
									
										
										
										
											2021-09-27 16:07:30 +03:00
										 |  |  | 		\ifnum \photobook@foldout@argslen = 1% | 
					
						
							| 
									
										
										
										
											2021-10-12 16:44:11 +03:00
										 |  |  | 			% in/out... | 
					
						
							|  |  |  | 			\ifthenelse{
 | 
					
						
							|  |  |  | 					\equal{#1}{in}  | 
					
						
							|  |  |  | 						\OR \equal{#1}{out}}{%
 | 
					
						
							| 
									
										
										
										
											2021-09-30 15:21:07 +03:00
										 |  |  | 				\edef\photobook@foldout@count{2}% | 
					
						
							|  |  |  | 				\edef\photobook@foldout@prevfold{#1}% | 
					
						
							|  |  |  | 			% count... | 
					
						
							|  |  |  | 			}{%
 | 
					
						
							| 
									
										
										
										
											2021-10-12 16:44:11 +03:00
										 |  |  | 				\edef\photobook@foldout@count{#1}}% | 
					
						
							| 
									
										
										
										
											2021-09-30 15:21:07 +03:00
										 |  |  | 			% | 
					
						
							|  |  |  | 			% 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-10-12 16:44:11 +03:00
										 |  |  | 				% in/out... | 
					
						
							|  |  |  | 				\ifthenelse{
 | 
					
						
							|  |  |  | 						\equal{\photobook@foldout@opt}{in}  | 
					
						
							|  |  |  | 							\OR \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-10-12 16:44:11 +03:00
										 |  |  | 					\setlength\photobook@foldout@panelwidth{\photobook@foldout@opt}}}% | 
					
						
							| 
									
										
										
										
											2021-10-08 13:59:32 +03:00
										 |  |  | 			% 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-08 13:59:32 +03:00
										 |  |  | 		% prepare data for cells... | 
					
						
							| 
									
										
										
										
											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% | 
					
						
							| 
									
										
										
										
											2021-10-16 18:22:42 +03:00
										 |  |  | 		\readlist*\pagefoldpanelfolds{\pagefoldpanelfolds}% | 
					
						
							|  |  |  | 		\readlist*\pagefoldpanels{\pagefoldpanels}% | 
					
						
							| 
									
										
										
										
											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
										 |  |  | % | 
					
						
							|  |  |  | %% 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 07:13:03 +03:00
										 |  |  | %% If no arguments are given this will create a panel at |foldoutpanel|  | 
					
						
							|  |  |  | %% counter and increment it by one.  | 
					
						
							| 
									
										
										
										
											2021-10-07 06:41:07 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %%	>> \begin{foldoutcell} ... \end{foldoutcell} | 
					
						
							|  |  |  | % | 
					
						
							| 
									
										
										
										
											2021-10-12 16:44:11 +03:00
										 |  |  | %% This will also auto-advance the page when all panels are filled. | 
					
						
							|  |  |  | %%  | 
					
						
							|  |  |  | %% Note that manual panel placement has no effect on the panel counter  | 
					
						
							|  |  |  | %% thus care must be taken when mixing manual and auto-advanced panels. | 
					
						
							|  |  |  | %% Also note that |foldoutpanel|'s value is not maintained within manually  | 
					
						
							|  |  |  | %% placed panels and should be treated as undefined. | 
					
						
							| 
									
										
										
										
											2021-10-07 07:13:03 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											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-10-10 06:40:44 +03:00
										 |  |  | %% These can only be used from within a |foldout| cell. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-10-12 16:44:11 +03:00
										 |  |  | % XXX should we be able to turn clipping on/off??? | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											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-16 18:22:42 +03:00
										 |  |  | % calculate offset via \pagefoldpanels and write to dimension <name>... | 
					
						
							| 
									
										
										
										
											2021-10-12 16:44:11 +03:00
										 |  |  | %	>> \photobook@foldoutcell@setfoldoutoffset{<name>}{<from>}{<to>} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | % NOTE: [<from>, <to>[ -- i.e. <to> is not included... | 
					
						
							|  |  |  | \newcommand\photobook@foldoutcell@setfoldoutoffset[3]{%
 | 
					
						
							|  |  |  | 	\expandafter\setlength\csname #1\endcsname{0pt}% | 
					
						
							|  |  |  | 	\ifnum \numexpr #2 \relax < \numexpr #3 \relax% | 
					
						
							|  |  |  | 		\xintFor* ##1 in {%
 | 
					
						
							| 
									
										
										
										
											2021-10-16 18:22:42 +03:00
										 |  |  | 				\xintSeq{#2}{\xintiiMin{#3}{\pagefoldpanelslen + 1} - 1}} \do {%
 | 
					
						
							| 
									
										
										
										
											2021-10-12 16:44:11 +03:00
										 |  |  | 			\ifnumodd{\thepage}{%
 | 
					
						
							|  |  |  | 				\expandafter\setlength\csname #1\endcsname{%
 | 
					
						
							|  |  |  | 					\csname #1\endcsname% | 
					
						
							| 
									
										
										
										
											2021-10-16 18:22:42 +03:00
										 |  |  | 					+ \pagefoldpanels[##1]} | 
					
						
							| 
									
										
										
										
											2021-10-12 16:44:11 +03:00
										 |  |  | 			}{%
 | 
					
						
							|  |  |  | 				\expandafter\setlength\csname #1\endcsname{%
 | 
					
						
							|  |  |  | 					\csname #1\endcsname% | 
					
						
							| 
									
										
										
										
											2021-10-16 18:22:42 +03:00
										 |  |  | 					+ \pagefoldpanels[-\numexpr ##1 \relax]}}}\fi} | 
					
						
							| 
									
										
										
										
											2021-10-12 16:44:11 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | % foldout panel auto-advance counter... | 
					
						
							| 
									
										
										
										
											2021-10-07 06:41:07 +03:00
										 |  |  | \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}} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-12 16:44:11 +03:00
										 |  |  | % set panel left/width dimensions (helper)... | 
					
						
							|  |  |  | %	>> \photobook@foldoutcell@setdimensions[<panel-spec>] | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | % NOTE: for <panel-spec> see docs for foldoutcell/foldoutcell*... | 
					
						
							|  |  |  | \newcommand\photobook@foldoutcell@setdimensions[1][0]{
 | 
					
						
							|  |  |  | 	% parse args... | 
					
						
							|  |  |  | 	\setsepchar{-}% | 
					
						
							|  |  |  | 	\readlist*\photobook@foldoutcell@panels{#1}% | 
					
						
							| 
									
										
										
										
											2023-04-27 00:37:37 +03:00
										 |  |  | 	\setsepchar{,}% | 
					
						
							| 
									
										
										
										
											2021-10-12 16:44:11 +03:00
										 |  |  | 	% | 
					
						
							|  |  |  | 	% auto advance panel... | 
					
						
							|  |  |  | 	\ifnum \photobook@foldoutcell@panels[1] = 0% | 
					
						
							|  |  |  | 		% auto advance page... | 
					
						
							| 
									
										
										
										
											2021-10-16 18:22:42 +03:00
										 |  |  | 		\ifnum \value{foldoutpanel} = \pagefoldpanelslen% | 
					
						
							| 
									
										
										
										
											2021-10-12 16:44:11 +03:00
										 |  |  | 			% 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% | 
					
						
							|  |  |  | 	% left offset... | 
					
						
							|  |  |  | 	\photobook@foldoutcell@setfoldoutoffset{photobook@foldoutcell@left}{%
 | 
					
						
							|  |  |  | 			1 | 
					
						
							|  |  |  | 		}{%
 | 
					
						
							|  |  |  | 			\photobook@foldoutcell@from}% | 
					
						
							|  |  |  | 	% panel from-to width... | 
					
						
							|  |  |  | 	\ifnum \photobook@foldoutcell@panelslen > 1% | 
					
						
							|  |  |  | 		\photobook@foldoutcell@setfoldoutoffset{photobook@foldoutcell@width}{%
 | 
					
						
							|  |  |  | 				\photobook@foldoutcell@from% | 
					
						
							| 
									
										
										
										
											2021-09-26 03:04:07 +03:00
										 |  |  | 			}{%
 | 
					
						
							| 
									
										
										
										
											2021-10-12 16:44:11 +03:00
										 |  |  | 				\photobook@foldoutcell@panels[2] + 1}% | 
					
						
							|  |  |  | 	% panel N width... | 
					
						
							|  |  |  | 	\else% | 
					
						
							|  |  |  | 		\ifnumodd{\thepage}{%
 | 
					
						
							| 
									
										
										
										
											2021-09-26 03:04:07 +03:00
										 |  |  | 			\setlength\photobook@foldoutcell@width{%
 | 
					
						
							| 
									
										
										
										
											2021-10-16 18:22:42 +03:00
										 |  |  | 				\pagefoldpanels[{\photobook@foldoutcell@from}]} | 
					
						
							| 
									
										
										
										
											2021-10-12 16:44:11 +03:00
										 |  |  | 		}{%
 | 
					
						
							|  |  |  | 			\setlength\photobook@foldoutcell@width{%
 | 
					
						
							| 
									
										
										
										
											2021-10-16 18:22:42 +03:00
										 |  |  | 				\pagefoldpanels[-\numexpr \photobook@foldoutcell@from \relax]}}\fi} | 
					
						
							| 
									
										
										
										
											2021-10-12 16:44:11 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | \newenvironment{foldoutcell}[1][0]{%
 | 
					
						
							|  |  |  | 	% XXX check if outside of foldout -> warn... | 
					
						
							|  |  |  | 	\begingroup% | 
					
						
							|  |  |  | 		\photobook@foldoutcell@setdimensions[#1]% | 
					
						
							| 
									
										
										
										
											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-12 16:44:11 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-07 06:41:07 +03:00
										 |  |  | \newenvironment{foldoutcell*}[1][0]{%
 | 
					
						
							| 
									
										
										
										
											2021-10-12 16:44:11 +03:00
										 |  |  | 	% XXX check if outside of foldout -> warn... | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | 	\begingroup% | 
					
						
							| 
									
										
										
										
											2021-10-12 16:44:11 +03:00
										 |  |  | 		\photobook@foldoutcell@setdimensions[#1]% | 
					
						
							| 
									
										
										
										
											2021-10-06 04:18:08 +03:00
										 |  |  | 		% 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-16 18:22:42 +03:00
										 |  |  | 		\ifnum \photobook@foldoutcell@from = \pagefoldpanelslen% | 
					
						
							| 
									
										
										
										
											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-10-09 17:04:07 +03:00
										 |  |  | % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 
					
						
							|  |  |  | %%%%% Multi-page cells | 
					
						
							|  |  |  | % | 
					
						
							| 
									
										
										
										
											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}% | 
					
						
							| 
									
										
										
										
											2023-04-09 18:12:54 +03:00
										 |  |  | 		\setlength\cellwidth{#1\pageblockwidth - #1\bindingoffset}% | 
					
						
							| 
									
										
										
										
											2021-08-27 20:12:06 +03:00
										 |  |  | 		\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} | 
					
						
							| 
									
										
										
										
											2023-05-04 18:53:19 +03:00
										 |  |  | %%% \DescribeEnv{leftside*} | 
					
						
							| 
									
										
										
										
											2021-08-09 13:43:36 +03:00
										 |  |  | %% \DescribeEnv{rightside} | 
					
						
							| 
									
										
										
										
											2023-05-04 18:53:19 +03:00
										 |  |  | %%% \DescribeEnv{rightside*} | 
					
						
							| 
									
										
										
										
											2021-08-09 13:43:36 +03:00
										 |  |  | % | 
					
						
							|  |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%   +---------------+---------------+ | 
					
						
							|  |  |  | %%   |               |               | | 
					
						
							|  |  |  | %%   |               |               | | 
					
						
							|  |  |  | %%   |   leftside    |   rightside   | | 
					
						
							|  |  |  | %%   |               |               | | 
					
						
							|  |  |  | %%   |               |               | | 
					
						
							|  |  |  | %%   +---------------+---------------+ | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2023-05-04 18:53:19 +03:00
										 |  |  | %%% The star versions set the appropriate bleeds for cliptocell. | 
					
						
							|  |  |  | %%% | 
					
						
							| 
									
										
										
										
											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}{%
 | 
					
						
							| 
									
										
										
										
											2023-05-05 15:27:39 +03:00
										 |  |  | 	\begin{cell*}% | 
					
						
							|  |  |  | 			{\bleed, \bleed}% | 
					
						
							|  |  |  | 			{\pageblockwidth}{\pageblockheight}% | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | }{%
 | 
					
						
							| 
									
										
										
										
											2023-05-05 15:27:39 +03:00
										 |  |  | 	\end{cell*}} | 
					
						
							| 
									
										
										
										
											2023-05-04 18:53:19 +03:00
										 |  |  | % XXX EXPERIMENTAL | 
					
						
							|  |  |  | \newenvironment{leftside*}{%
 | 
					
						
							|  |  |  | 	\begin{leftside}% | 
					
						
							| 
									
										
										
										
											2023-09-11 19:41:48 +03:00
										 |  |  | 	\begin{cliptocell}[{\bleed} {\bleed} 0mm {\bleed}]% | 
					
						
							|  |  |  | 	\setcliptocellbleeds{{\bleed} {\bleed} 0mm {\bleed}}% | 
					
						
							| 
									
										
										
										
											2023-05-04 18:53:19 +03:00
										 |  |  | }{%
 | 
					
						
							| 
									
										
										
										
											2023-09-11 19:41:48 +03:00
										 |  |  | 	\end{cliptocell} | 
					
						
							| 
									
										
										
										
											2023-05-04 18:53:19 +03:00
										 |  |  | 	\end{leftside}} | 
					
						
							| 
									
										
										
										
											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*}} | 
					
						
							| 
									
										
										
										
											2023-05-04 18:53:19 +03:00
										 |  |  | % XXX EXPERIMENTAL | 
					
						
							|  |  |  | \newenvironment{rightside*}{%
 | 
					
						
							|  |  |  | 	\begin{rightside}% | 
					
						
							| 
									
										
										
										
											2023-09-11 19:41:48 +03:00
										 |  |  | 	\begin{cliptocell}[0mm {\bleed} {\bleed} {\bleed}]% | 
					
						
							|  |  |  | 	\setcliptocellbleeds{0mm {\bleed} {\bleed} {\bleed}}% | 
					
						
							| 
									
										
										
										
											2023-05-04 18:53:19 +03:00
										 |  |  | }{%
 | 
					
						
							| 
									
										
										
										
											2023-09-11 19:41:48 +03:00
										 |  |  | 	\end{cliptocell} | 
					
						
							| 
									
										
										
										
											2023-05-04 18:53:19 +03:00
										 |  |  | 	\end{rightside}} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											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} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2022-11-11 15:29:35 +03:00
										 |  |  | %%   backflap         spine/vspine           frontflap | 
					
						
							| 
									
										
										
										
											2021-08-09 13:43:36 +03:00
										 |  |  | %%     .    backcover      .   frontcover      . | 
					
						
							|  |  |  | %%     v     v             v     v             v | 
					
						
							|  |  |  | %%   +---+---------------+---+---------------+---+                | 
					
						
							|  |  |  | %%   |   |               |   |               |   | | 
					
						
							|  |  |  | %%   |   |               |   |               |   | | 
					
						
							|  |  |  | %%   |   |     Back      |   |     Front     |   | | 
					
						
							|  |  |  | %%   |   |               |   |               |   | | 
					
						
							|  |  |  | %%   |   |               |   |               |   | | 
					
						
							|  |  |  | %%   +---+---------------+---+---------------+---+                | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							| 
									
										
										
										
											2021-08-12 15:22:03 +03:00
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2022-11-11 15:29:35 +03:00
										 |  |  | %% Note that when typesetting a spine with both top-down and bottom-up  | 
					
						
							|  |  |  | %% text it is recommended to use |topdown|/|bottomup| in |zinlinecell|'s  | 
					
						
							|  |  |  | %% in a normal |spine| rather than using a |vspine| and trying to rotate  | 
					
						
							|  |  |  | %% part of the content. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											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  | 
					
						
							| 
									
										
										
										
											2023-03-11 04:11:04 +03:00
										 |  |  | 					+ \photobook@jacketflapback@active | 
					
						
							|  |  |  | 					+ \photobook@coverflap@active | 
					
						
							|  |  |  | 					+ \photobook@jacketwrap@active | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | 					+ \coverboardgrow  | 
					
						
							|  |  |  | 					+ \pageblockwidth  | 
					
						
							|  |  |  | 					+ 2\spinefold  | 
					
						
							|  |  |  | 					+ \spinewidth, | 
					
						
							|  |  |  | 				\bleed  | 
					
						
							| 
									
										
										
										
											2023-03-11 04:11:04 +03:00
										 |  |  | 					+ \photobook@coverflap@active }% | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | 			{ \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  | 
					
						
							| 
									
										
										
										
											2023-03-11 04:11:04 +03:00
										 |  |  | 					+ \photobook@jacketflapback@active | 
					
						
							|  |  |  | 					+ \photobook@coverflap@active | 
					
						
							|  |  |  | 					+ \photobook@jacketwrap@active, | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | 				\bleed  | 
					
						
							| 
									
										
										
										
											2023-03-11 04:11:04 +03:00
										 |  |  | 					+ \photobook@coverflap@active }% | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | 			{ \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  | 
					
						
							| 
									
										
										
										
											2023-03-11 04:11:04 +03:00
										 |  |  | 					+ \photobook@jacketflapback@active | 
					
						
							|  |  |  | 					+ \photobook@coverflap@active | 
					
						
							|  |  |  | 					+ \photobook@jacketwrap@active | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | 					+ \coverboardgrow  | 
					
						
							|  |  |  | 					+ \pageblockwidth  | 
					
						
							|  |  |  | 					+ \spinefold, | 
					
						
							|  |  |  | 				\bleed  | 
					
						
							| 
									
										
										
										
											2023-03-11 04:11:04 +03:00
										 |  |  | 					+ \photobook@coverflap@active }% | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | 			{ \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  | 
					
						
							| 
									
										
										
										
											2023-03-11 04:11:04 +03:00
										 |  |  | 					+ \photobook@jacketflapback@active | 
					
						
							|  |  |  | 					+ 2\photobook@jacketwrap@active | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | 					+ 2\coverboardgrow  | 
					
						
							|  |  |  | 					+ 2\pageblockwidth  | 
					
						
							|  |  |  | 					+ 2\spinefold  | 
					
						
							|  |  |  | 					+ \spinewidth, | 
					
						
							|  |  |  | 				\bleed  | 
					
						
							| 
									
										
										
										
											2023-03-11 04:11:04 +03:00
										 |  |  | 					+ \photobook@coverflap@active }% | 
					
						
							|  |  |  | 			{ \photobook@jacketflapfront@active }% | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | 			{ \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  | 
					
						
							| 
									
										
										
										
											2023-03-11 04:11:04 +03:00
										 |  |  | 					+ \photobook@coverflap@active }% | 
					
						
							|  |  |  | 			{ \photobook@jacketflapback@active }% | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | 			{ \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... | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											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. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2022-02-23 16:31:56 +03:00
										 |  |  | % XXX PRECLEAR this may lead to pages collapsing on each other, test... | 
					
						
							|  |  |  | % | 
					
						
							| 
									
										
										
										
											2022-02-23 16:22:34 +03:00
										 |  |  | %% Note that most page templates do not |\clearpage| before expanding,  | 
					
						
							|  |  |  | %% this enables one to prepend elements (like pdf comments), if clearing  | 
					
						
							|  |  |  | %% a page is required add |\clearpage| manually before the template. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2021-08-31 08:27:37 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-01 04:40:46 +03:00
										 |  |  | % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 
					
						
							| 
									
										
										
										
											2023-03-01 17:04:44 +03:00
										 |  |  | %%%%% Basic book information
 | 
					
						
							| 
									
										
										
										
											2023-03-01 04:40:46 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-01 17:04:44 +03:00
										 |  |  | % XXX Document metadata -- move to globals... | 
					
						
							| 
									
										
										
										
											2023-03-01 04:40:46 +03:00
										 |  |  | % XXX Use LaTeX generic metadata... | 
					
						
							| 
									
										
										
										
											2023-08-25 10:27:08 +03:00
										 |  |  | %% \DescribeMacro{BookType=<text>} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% Used in page macro text to indicate the type of document built, by default
 | 
					
						
							|  |  |  | %% this is set to |book| for the most common case but can be set to anything | 
					
						
							|  |  |  | %% (e.g. |brochure|, |magazine|, |presentation|, ...etc.) | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | \def\BookType{book} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-01 17:04:44 +03:00
										 |  |  | %% \DescribeMacro{BookTitle=<text>} | 
					
						
							| 
									
										
										
										
											2023-03-01 04:40:46 +03:00
										 |  |  | \def\BookTitle{} | 
					
						
							| 
									
										
										
										
											2023-03-01 17:04:44 +03:00
										 |  |  | %% \DescribeMacro{BookVersion=<text>} | 
					
						
							| 
									
										
										
										
											2023-03-01 04:40:46 +03:00
										 |  |  | \def\BookVersion{} | 
					
						
							| 
									
										
										
										
											2023-03-01 17:04:44 +03:00
										 |  |  | %% \DescribeMacro{BookAuthors=<text>} | 
					
						
							| 
									
										
										
										
											2023-03-01 04:40:46 +03:00
										 |  |  | \def\BookAuthors{} | 
					
						
							| 
									
										
										
										
											2023-03-01 17:04:44 +03:00
										 |  |  | %% \DescribeMacro{BookYear=<text>} | 
					
						
							| 
									
										
										
										
											2023-03-01 04:40:46 +03:00
										 |  |  | \def\BookYear{%
 | 
					
						
							|  |  |  | 	\the\year} | 
					
						
							| 
									
										
										
										
											2023-03-01 17:04:44 +03:00
										 |  |  | %% \DescribeMacro{ByNotice=<text>} | 
					
						
							| 
									
										
										
										
											2023-03-01 04:40:46 +03:00
										 |  |  | \def\ByNotice{} | 
					
						
							| 
									
										
										
										
											2023-03-01 17:04:44 +03:00
										 |  |  | %% \DescribeMacro{ThanksTo=<text>} | 
					
						
							| 
									
										
										
										
											2023-03-01 04:40:46 +03:00
										 |  |  | \def\ThanksTo{} | 
					
						
							| 
									
										
										
										
											2023-03-01 17:04:44 +03:00
										 |  |  | %% \DescribeMacro{ISBN=<text>} | 
					
						
							| 
									
										
										
										
											2023-03-01 04:40:46 +03:00
										 |  |  | \def\ISBN{} | 
					
						
							| 
									
										
										
										
											2023-03-01 17:04:44 +03:00
										 |  |  | %% \DescribeMacro{BookEdition=<text>} | 
					
						
							| 
									
										
										
										
											2023-03-01 05:07:53 +03:00
										 |  |  | \def\BookEdition{} | 
					
						
							| 
									
										
										
										
											2023-03-01 17:04:44 +03:00
										 |  |  | %% \DescribeMacro{License=<text>} | 
					
						
							| 
									
										
										
										
											2023-03-01 04:53:34 +03:00
										 |  |  | \def\License{} | 
					
						
							| 
									
										
										
										
											2023-03-01 17:04:44 +03:00
										 |  |  | %% \DescribeMacro{CopyrightNotice=<text>} | 
					
						
							| 
									
										
										
										
											2023-03-01 04:40:46 +03:00
										 |  |  | \def\CopyrightNotice{%
 | 
					
						
							| 
									
										
										
										
											2023-03-01 04:53:34 +03:00
										 |  |  | 	Copyright \textcopyright \ \BookYear \ \BookAuthors; All Rights Reserved. | 
					
						
							| 
									
										
										
										
											2023-03-01 04:40:46 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-01 04:53:34 +03:00
										 |  |  | 	\ifx \License \empty% | 
					
						
							| 
									
										
										
										
											2023-08-24 23:08:28 +03:00
										 |  |  | 		No part of this \BookType\ may be reproduced in any form without written permission | 
					
						
							| 
									
										
										
										
											2023-08-24 23:06:17 +03:00
										 |  |  | 		of the author except for use for brief quotation in a review. | 
					
						
							| 
									
										
										
										
											2023-03-01 04:53:34 +03:00
										 |  |  | 	\else% | 
					
						
							|  |  |  | 		\License\fi} | 
					
						
							| 
									
										
										
										
											2023-03-01 04:40:46 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-01 17:04:44 +03:00
										 |  |  | %% \DescribeMacro{OtherSoftware=<text>} | 
					
						
							| 
									
										
										
										
											2023-03-01 04:40:46 +03:00
										 |  |  | \def\OtherSoftware{} | 
					
						
							| 
									
										
										
										
											2023-03-01 17:04:44 +03:00
										 |  |  | %% \DescribeMacro{BookFonts=<text>} | 
					
						
							| 
									
										
										
										
											2023-03-01 04:40:46 +03:00
										 |  |  | \def\BookFonts{} | 
					
						
							| 
									
										
										
										
											2023-03-01 17:04:44 +03:00
										 |  |  | %% \DescribeMacro{SoftwareNotice=<text>} | 
					
						
							| 
									
										
										
										
											2023-03-01 04:40:46 +03:00
										 |  |  | \def\SoftwareNotice{%
 | 
					
						
							| 
									
										
										
										
											2023-08-24 23:08:28 +03:00
										 |  |  | 	This \BookType\ was designed and laid out using open source 
 | 
					
						
							| 
									
										
										
										
											2023-03-01 04:40:46 +03:00
										 |  |  | 	\ifx \BookFonts \empty\else
 | 
					
						
							|  |  |  | 		fonts and\fi  | 
					
						
							|  |  |  | 	software including:  | 
					
						
							|  |  |  | 		\ifx \BookFonts \empty\else% | 
					
						
							|  |  |  | 			\BookFonts, \fi | 
					
						
							|  |  |  | 		\ifx \OtherSoftware \empty\else% | 
					
						
							|  |  |  | 			\OtherSoftware, \fi | 
					
						
							|  |  |  | 		\href{https://ctan.org/pkg/photobook}{photobook} and 
 | 
					
						
							|  |  |  | 		\href{https://www.latex-project.org/}{\LATEX.}} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-01 17:04:44 +03:00
										 |  |  | %% These provide the default information used by the |\BookInfoPage| and
 | 
					
						
							|  |  |  | %% |\BookSoftwareInfoPage|. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2023-03-01 04:40:46 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | %% \DescribeMacro{\BookInfoPage} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% Generate book information page.  | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2023-03-01 17:04:44 +03:00
										 |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%   +---------------+ | 
					
						
							|  |  |  | %%   |               | | 
					
						
							|  |  |  | %%   |               | | 
					
						
							|  |  |  | %%   |               | | 
					
						
							|  |  |  | %%   | copyright     | | 
					
						
							|  |  |  | %%   | ISBN          | | 
					
						
							|  |  |  | %%   | info          | | 
					
						
							|  |  |  | %%   +---------------+ | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% This page is {\it usually} included near the start of the book, before | 
					
						
							|  |  |  | %% any of the logical sections of the book start, {\it usually} just after | 
					
						
							|  |  |  | %% the title pages but before any of the epigraphs, forewords, TOCs and 
 | 
					
						
							|  |  |  | %% prefaces. This can also in some cases be pushed to the rear of the book. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2023-03-01 04:40:46 +03:00
										 |  |  | % XXX add option to combine this with software info... | 
					
						
							| 
									
										
										
										
											2023-03-01 17:04:44 +03:00
										 |  |  | \def\BookInfo{%
 | 
					
						
							|  |  |  | 	\ifx \CopyrightNotice \empty\else% | 
					
						
							|  |  |  | 		{\setlength{\parskip}{0.5em}%
 | 
					
						
							|  |  |  | 			\CopyrightNotice} \\ | 
					
						
							|  |  |  | 		\vspace{1em} | 
					
						
							|  |  |  | 	\fi | 
					
						
							|  |  |  | 	\ifx \ByNotice \empty\else% | 
					
						
							|  |  |  | 		\ByNotice | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 	\fi | 
					
						
							|  |  |  | 	\ifx \ThanksTo \empty\else% | 
					
						
							|  |  |  | 		Special thanks to: \ThanksTo \\ \fi | 
					
						
							|  |  |  | 	\vspace{1em} | 
					
						
							|  |  |  | 	\ifx \ISBN \empty\else% | 
					
						
							|  |  |  | 		ISBN: \ISBN \\ | 
					
						
							|  |  |  | 		\vspace{1em}\fi | 
					
						
							|  |  |  | 	\ifx \Edition \empty\else% | 
					
						
							|  |  |  | 		Edition: \Edition | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	\fi | 
					
						
							|  |  |  | 	\ifx \BookVersion \empty\else% | 
					
						
							|  |  |  | 		Version: \BookVersion | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	\fi} | 
					
						
							| 
									
										
										
										
											2023-03-01 04:53:34 +03:00
										 |  |  | \newcommand\BookInfoPage[1][]{%
 | 
					
						
							| 
									
										
										
										
											2023-03-01 04:40:46 +03:00
										 |  |  | 	\begin{page}% | 
					
						
							|  |  |  | 		\vfill | 
					
						
							|  |  |  | 		\begin{flushleft}% | 
					
						
							| 
									
										
										
										
											2023-03-01 05:07:53 +03:00
										 |  |  | 			\footnotesize | 
					
						
							| 
									
										
										
										
											2023-03-01 04:53:34 +03:00
										 |  |  | 			#1 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-01 17:04:44 +03:00
										 |  |  | 			\BookInfo | 
					
						
							| 
									
										
										
										
											2023-03-01 04:40:46 +03:00
										 |  |  | 		\end{flushleft}% | 
					
						
							|  |  |  | 	\end{page}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | %% \DescribeMacro{\BookSoftwareInfoPage} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% Generate software info page. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2023-03-01 17:04:44 +03:00
										 |  |  | %% \begin{minipage}{\textwidth} | 
					
						
							|  |  |  | %% \begin{verbatim} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%   +---------------+ | 
					
						
							|  |  |  | %%   |               | | 
					
						
							|  |  |  | %%   |               | | 
					
						
							|  |  |  | %%   |               | | 
					
						
							|  |  |  | %%   |               | | 
					
						
							|  |  |  | %%   |               | | 
					
						
							|  |  |  | %%   | notice        | | 
					
						
							|  |  |  | %%   +---------------+ | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% \end{verbatim} | 
					
						
							|  |  |  | %% \end{minipage} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% This page if present is usually placed at the very rear of the book. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | \def\SoftwareInfo{%
 | 
					
						
							|  |  |  | 	\ifx \SoftwareNotice \empty\else% | 
					
						
							|  |  |  | 		\SoftwareNotice\fi} | 
					
						
							| 
									
										
										
										
											2023-03-01 04:53:34 +03:00
										 |  |  | \newcommand\BookSoftwareInfoPage[1][]{%
 | 
					
						
							| 
									
										
										
										
											2023-03-01 04:40:46 +03:00
										 |  |  | 	\begin{page}% | 
					
						
							|  |  |  | 		\vfill | 
					
						
							|  |  |  | 		\begin{flushleft}% | 
					
						
							| 
									
										
										
										
											2023-03-01 05:07:53 +03:00
										 |  |  | 			\footnotesize | 
					
						
							| 
									
										
										
										
											2023-03-01 04:53:34 +03:00
										 |  |  | 			#1 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-01 17:04:44 +03:00
										 |  |  | 			\SoftwareInfo | 
					
						
							|  |  |  | 		\end{flushleft}% | 
					
						
							|  |  |  | 	\end{page}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | %% \DescribeMacro{\BookFullInfoPage} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% This page combines the |\BookInfoPage| and |\BookSoftwareInfoPage|  | 
					
						
							|  |  |  | %% information into a single page. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | \newcommand\BookFullInfoPage[1][]{%
 | 
					
						
							|  |  |  | 	\begin{page}% | 
					
						
							|  |  |  | 		\vfill | 
					
						
							|  |  |  | 		\begin{flushleft}% | 
					
						
							|  |  |  | 			\footnotesize | 
					
						
							|  |  |  | 			#1 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			\BookInfo | 
					
						
							|  |  |  | 			\vspace{1em} | 
					
						
							|  |  |  | 			\SoftwareInfo | 
					
						
							| 
									
										
										
										
											2023-03-01 04:40:46 +03:00
										 |  |  | 		\end{flushleft}% | 
					
						
							|  |  |  | 	\end{page}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											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}{%
 | 
					
						
							| 
									
										
										
										
											2022-02-23 16:22:34 +03:00
										 |  |  | 	% XXX PRECLEAR do we need clear page here??? | 
					
						
							|  |  |  | 	%\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}{%
 | 
					
						
							| 
									
										
										
										
											2022-02-23 16:22:34 +03:00
										 |  |  | 	% XXX PRECLEAR do we need clear page here??? | 
					
						
							|  |  |  | 	%\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% | 
					
						
							| 
									
										
										
										
											2022-02-23 16:22:34 +03:00
										 |  |  | 			% XXX PRECLEAR do we need clear page here??? | 
					
						
							|  |  |  | 			%\clearpage% | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | 			\begin{page}% | 
					
						
							| 
									
										
										
										
											2021-09-12 03:29:50 +03:00
										 |  |  | 			% NOTE: this does not account for \bindingoffset... | 
					
						
							| 
									
										
										
										
											2023-09-11 18:53:49 +03:00
										 |  |  | 			% XXX should this be a page or a paper cell??? | 
					
						
							|  |  |  | 			\begin{papercell}% | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | 				\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}% | 
					
						
							| 
									
										
										
										
											2023-09-11 18:53:49 +03:00
										 |  |  | 			\end{papercell}% | 
					
						
							| 
									
										
										
										
											2021-09-08 04:37:44 +03:00
										 |  |  | 			\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
										 |  |  | %%  . . . . . . . . . . . . .  | 
					
						
							| 
									
										
										
										
											2021-10-09 16:09:39 +03:00
										 |  |  | %%  . +-----------------=      | 
					
						
							|  |  |  | %%  . |   .             =      | 
					
						
							|  |  |  | %%  . |       .         =      | 
					
						
							|  |  |  | %%  . |           .     =      | 
					
						
							|  |  |  | %%  . |               . =      | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | %%  . |               image
 | 
					
						
							| 
									
										
										
										
											2021-10-09 16:09:39 +03:00
										 |  |  | %%  . |               . =      | 
					
						
							|  |  |  | %%  . |           .     =      | 
					
						
							|  |  |  | %%  . |       .         =      | 
					
						
							|  |  |  | %%  . |   .           c =      | 
					
						
							|  |  |  | %%  . +-----------------=      | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | %%  . . . . . . . . . . . . .  | 
					
						
							| 
									
										
										
										
											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*}% | 
					
						
							|  |  |  | 	% | 
					
						
							| 
									
										
										
										
											2022-02-23 16:22:34 +03:00
										 |  |  | 	% XXX PRECLEAR do we need clear page here??? | 
					
						
							|  |  |  | 	%\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
										 |  |  | %%  . . . . . . . . . . . . . | 
					
						
							| 
									
										
										
										
											2021-10-09 16:09:39 +03:00
										 |  |  | %%      =-----------------+ . | 
					
						
							|  |  |  | %%      =             .   | . | 
					
						
							|  |  |  | %%      =         .       | . | 
					
						
							|  |  |  | %%      =     .           | . | 
					
						
							|  |  |  | %%      = .               | . | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | %%    image               | . | 
					
						
							| 
									
										
										
										
											2021-10-09 16:09:39 +03:00
										 |  |  | %%      = .               | . | 
					
						
							|  |  |  | %%      =     .           | . | 
					
						
							|  |  |  | %%      =         .       | . | 
					
						
							|  |  |  | %%      =             . c | . | 
					
						
							|  |  |  | %%      =-----------------+ . | 
					
						
							| 
									
										
										
										
											2021-08-29 17:05:28 +03:00
										 |  |  | %%  . . . . . . . . . . . . . | 
					
						
							| 
									
										
										
										
											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*}% | 
					
						
							|  |  |  | 	% | 
					
						
							| 
									
										
										
										
											2022-02-23 16:22:34 +03:00
										 |  |  | 	% XXX PRECLEAR do we need clear page here??? | 
					
						
							|  |  |  | 	%\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-10-09 16:09:39 +03:00
										 |  |  | %%    +---------------=---------------+  | 
					
						
							|  |  |  | %%    | +-------------=-------------+ |  | 
					
						
							|  |  |  | %%    | |  .          =          .  | |  | 
					
						
							|  |  |  | %%    | |      .      =      .      | |  | 
					
						
							|  |  |  | %%    | |          .  =  .          | |  | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | %%    | |           image           | |  | 
					
						
							| 
									
										
										
										
											2021-10-09 16:09:39 +03:00
										 |  |  | %%    | |          .  =  .          | |  | 
					
						
							|  |  |  | %%    | |      .      =      .      | |  | 
					
						
							|  |  |  | %%    | |  .          =          .  | |  | 
					
						
							|  |  |  | %%    | +-------------=-------------+ |  | 
					
						
							|  |  |  | %%    +---------------=---------------+  | 
					
						
							| 
									
										
										
										
											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-10-09 16:09:39 +03:00
										 |  |  | %%    +---------------=---------------+  +---------------=---------------+    | 
					
						
							|  |  |  | %%    | +-------------=-------------+ |  |               =               |    | 
					
						
							|  |  |  | %%    | |  .          =          .  | |  |  c            =               |    | 
					
						
							|  |  |  | %%    | |       .     =     .       | |  | +-------------=-------------+ |    | 
					
						
							|  |  |  | %%    | |           image           | |  | |  .          =          .  | |    | 
					
						
							|  |  |  | %%    | |       .    (T)    .       | |  | |       .     =     .       | |    | 
					
						
							|  |  |  | %%    | |  .          =          .  | |  | |           image           | |    | 
					
						
							|  |  |  | %%    | +-------------=-------------+ |  | |       .    (B)    .       | |    | 
					
						
							|  |  |  | %%    |               =            c  |  | |  .          =          .  | |    | 
					
						
							|  |  |  | %%    |               =               |  | +-------------=-------------+ |    | 
					
						
							|  |  |  | %%    +---------------=---------------+  +---------------=---------------+    | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%    +---------------=---------------+  +---------------=---------------+  | 
					
						
							|  |  |  | %%    | +-------------=---------+     |  |     +---------=-------------+ |  | 
					
						
							|  |  |  | %%    | |  .          =      .  |     |  |     |  .      =          .  | |  | 
					
						
							|  |  |  | %%    | |     .       =   .     |     |  |     |     .   =       .     | |  | 
					
						
							|  |  |  | %%    | |        .    =.        |     |  |     |        .=    .        | |  | 
					
						
							| 
									
										
										
										
											2021-09-04 05:18:06 +03:00
										 |  |  | %%    | |         image         |     |  |     |         image         | |  | 
					
						
							| 
									
										
										
										
											2021-10-09 16:09:39 +03:00
										 |  |  | %%    | |        . (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
										 |  |  | %%                                                  . . . . . . . . . . . | 
					
						
							| 
									
										
										
										
											2021-10-09 16:09:39 +03:00
										 |  |  | %%     +---------------=---------------+      +---------------=---------------+   | 
					
						
							|  |  |  | %%     |               =               |      |     |.        =        .|.    |   | 
					
						
							|  |  |  | %%   . |---------------=---------------| .    |     |  .      =      .  |     |   | 
					
						
							|  |  |  | %%   . |    .          =          .    | .    |     |    .    =    .    |     |   | 
					
						
							|  |  |  | %%   . |         .     =     .         | .    |     |      .  =  .      |     |   | 
					
						
							| 
									
										
										
										
											2021-09-10 03:27:33 +03:00
										 |  |  | %%   . |             image             | .    |     |       image       |     |   | 
					
						
							| 
									
										
										
										
											2021-10-09 16:09:39 +03:00
										 |  |  | %%   . |         .     =     .         | .    |     |      .  =  .      |     |   | 
					
						
							|  |  |  | %%   . |    .          =          .    | .    |     |    .    =    .    |     |   | 
					
						
							|  |  |  | %%   . |---------------=---------------| .    |     |  .      =      .  |     |   | 
					
						
							|  |  |  | %%     |               =             c |      |     |.        =        .| c   |   | 
					
						
							|  |  |  | %%     +---------------=---------------+      +---------------=---------------+   | 
					
						
							| 
									
										
										
										
											2021-09-10 03:27:33 +03:00
										 |  |  | %%                                                  . . . . . . . . . . . | 
					
						
							| 
									
										
										
										
											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
										 |  |  | %%                                            | 
					
						
							|  |  |  | %%  . . . . . . . . . . . . . . . . . . .            | 
					
						
							| 
									
										
										
										
											2021-10-09 16:09:39 +03:00
										 |  |  | %%  . +---------------=---------------+ .    +---------------=---------------+   | 
					
						
							|  |  |  | %%  . |   .           =           .   | .    | c             =               |   | 
					
						
							|  |  |  | %%  . |       .       =       .       | .  . |---------------=---------------| . | 
					
						
							|  |  |  | %%  . |           .   =   .           | .  . |   .           =           .   | . | 
					
						
							|  |  |  | %%  . |             image             | .  . |       .       =       .       | . | 
					
						
							|  |  |  | %%  . |           .  (T)   .          | .  . |           .   =   .           | . | 
					
						
							|  |  |  | %%  . |       .       =       .       | .  . |             image             | . | 
					
						
							|  |  |  | %%  . |   .           =           .   | .  . |           .  (B)  .           | . | 
					
						
							|  |  |  | %%  . |---------------=---------------| .  . |       .       =       .       | . | 
					
						
							|  |  |  | %%    |               =             c |    . |   .           =           .   | . | 
					
						
							|  |  |  | %%    +---------------=---------------+    . +---------------=---------------+ . | 
					
						
							| 
									
										
										
										
											2021-09-10 03:27:33 +03:00
										 |  |  | %%                                         . . . . . . . . . . . . . . . . . . . | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%  . . . . . . . . . . . . . . . .              . . . . . . . . . . . . . . . . | 
					
						
							| 
									
										
										
										
											2021-10-09 16:09:39 +03:00
										 |  |  | %%  . +---------------=---------------+      +---------------=---------------+ . | 
					
						
							|  |  |  | %%  . | .             =         . |   |      |   | .         =             . | . | 
					
						
							|  |  |  | %%  . |    .          =      .    |   |      |   |    .      =          .    | . | 
					
						
							|  |  |  | %%  . |       .       =   .       |   |      |   |       .   =       .       | . | 
					
						
							|  |  |  | %%  . |          .    =.          |   |      |   |          .=   .           | . | 
					
						
							| 
									
										
										
										
											2021-09-10 03:27:33 +03:00
										 |  |  | %%  . |           image           |   |      |   |          image            | . | 
					
						
							| 
									
										
										
										
											2021-10-09 16:09:39 +03:00
										 |  |  | %%  . |          . (L)=.          |   |      |   |          .(R) .           | . | 
					
						
							|  |  |  | %%  . |       .       =   .       |   |      |   |       .   =       .       | . | 
					
						
							|  |  |  | %%  . |    .          =      .    |   |      |   |    .      =          .    | . | 
					
						
							|  |  |  | %%  . | .             =         . | c |      | c | .         =             . | . | 
					
						
							|  |  |  | %%  . +---------------=---------------+      +---------------=---------------+ . | 
					
						
							| 
									
										
										
										
											2021-09-10 03:27:33 +03:00
										 |  |  | %%  . . . . . . . . . . . . . . . .              . . . . . . . . . . . . . . . . | 
					
						
							| 
									
										
										
										
											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
										 |  |  | %%  . . . . . . . . . . . . . . . . . . . | 
					
						
							| 
									
										
										
										
											2021-10-09 16:09:39 +03:00
										 |  |  | %%  . +---------------=---------------+ . | 
					
						
							|  |  |  | %%  . |   .           =           .   | . | 
					
						
							|  |  |  | %%  . |      .        =        .      | . | 
					
						
							|  |  |  | %%  . |         .     =     .         | . | 
					
						
							|  |  |  | %%  . |            .  =  .            | . | 
					
						
							| 
									
										
										
										
											2021-08-10 14:14:43 +03:00
										 |  |  | %%  . |             image             | . | 
					
						
							| 
									
										
										
										
											2021-10-09 16:09:39 +03:00
										 |  |  | %%  . |            .  =  .            | . | 
					
						
							|  |  |  | %%  . |         .     =     .         | . | 
					
						
							|  |  |  | %%  . |      .        =        .      | . | 
					
						
							|  |  |  | %%  . |   .           =           . c | . | 
					
						
							|  |  |  | %%  . +---------------=---------------+ . | 
					
						
							| 
									
										
										
										
											2021-08-10 14:14:43 +03:00
										 |  |  | %%  . . . . . . . . . . . . . . . . . . . | 
					
						
							| 
									
										
										
										
											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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-01 04:40:46 +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|. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2023-09-11 18:33:13 +03:00
										 |  |  | %% To change text color set |\textcolor{<color>}| the usual way and for
 | 
					
						
							|  |  |  | %% line and fill colors use |\textblockrulecolour{<color>}| and 
 | 
					
						
							|  |  |  | %% |\textblockcolour{<colour>}| respecitvely. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											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... | 
					
						
							| 
									
										
										
										
											2023-04-05 17:06:18 +03:00
										 |  |  | 		\ifspreadlayout% | 
					
						
							| 
									
										
										
										
											2021-08-29 03:01:01 +03:00
										 |  |  | 			\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... | 
					
						
							| 
									
										
										
										
											2023-04-05 17:06:18 +03:00
										 |  |  | 	\ifspreadlayout% | 
					
						
							| 
									
										
										
										
											2021-09-12 03:52:17 +03:00
										 |  |  | 		% 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
										 |  |  | %% | 
					
						
							| 
									
										
										
										
											2022-02-23 16:22:34 +03:00
										 |  |  | % XXX BUG: this takes up space... | 
					
						
							| 
									
										
										
										
											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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-03 15:54:40 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | %% \DescribeMacro{\pdfspreadstopages\{..\}} | 
					
						
							|  |  |  | % | 
					
						
							| 
									
										
										
										
											2023-04-05 17:06:18 +03:00
										 |  |  | %% \EXPERIMENTAL | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %%	Include spreads from a pdf block as pages | 
					
						
							| 
									
										
										
										
											2023-04-03 15:54:40 +03:00
										 |  |  | %% | 
					
						
							|  |  |  | %%	>>	\pdfspreadstopages[<delta>]{<block-pdf>} | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2023-04-05 17:06:18 +03:00
										 |  |  | %% |\pdfspreadstopages{..}| inserts an empty page before the first page 
 | 
					
						
							|  |  |  | %% in the block to push it to the right of the spread. | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% To display other pages consistently it is recommended to set the  | 
					
						
							|  |  |  | %% block width to |2\blockwidth| and set the |pdfpagelayout| to be  | 
					
						
							|  |  |  | %% set to |SinglePage|, a simple way to do both is to: | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | %% >> \ChangeLayout{spread} | 
					
						
							|  |  |  | %% | 
					
						
							|  |  |  | % XXX do we need to set the page format to double block width here??? | 
					
						
							| 
									
										
										
										
											2023-04-04 21:36:47 +03:00
										 |  |  | % XXX TEST... | 
					
						
							| 
									
										
										
										
											2023-04-05 17:06:18 +03:00
										 |  |  | \newcommand\pdfspreadstopages[2][0mm]{%
 | 
					
						
							| 
									
										
										
										
											2023-04-03 15:54:40 +03:00
										 |  |  | 	\includepdf[pages={{},1-}, nup=2x1, delta=#1 #1]{#2}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-05 17:06:18 +03:00
										 |  |  | % XXX include the cover with the foldouts removed...  | 
					
						
							|  |  |  | \newcommand\pdfcover[1]{%
 | 
					
						
							|  |  |  | 	% XXX crop to frontcover cell.. | 
					
						
							|  |  |  | 	\includepdf{#1}} | 
					
						
							|  |  |  | % XXX include cover cells.... | 
					
						
							| 
									
										
										
										
											2023-04-03 15:54:40 +03:00
										 |  |  | \newcommand\pdfcoverfront[1]{%
 | 
					
						
							|  |  |  | 	% XXX crop to frontcover cell.. | 
					
						
							|  |  |  | 	\includepdf{#1}} | 
					
						
							|  |  |  | \newcommand\pdfcoverback[1]{%
 | 
					
						
							|  |  |  | 	% XXX crop to backcover cell.. | 
					
						
							|  |  |  | 	\includepdf{#1}} | 
					
						
							|  |  |  | % XXX do we need this??? | 
					
						
							|  |  |  | %\newcommand\pdfendpaper[1]{%
 | 
					
						
							|  |  |  | %	\includepdf{#1}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | % XXX  | 
					
						
							| 
									
										
										
										
											2023-04-03 15:58:54 +03:00
										 |  |  | % XXX do we include endpapers??: | 
					
						
							| 
									
										
										
										
											2023-04-03 15:54:40 +03:00
										 |  |  | \newcommand\pdfweb[2]{%
 | 
					
						
							|  |  |  | 	\pdfcoverfront{#1}% | 
					
						
							|  |  |  | 	\pdfspreadstopages{#2}% | 
					
						
							|  |  |  | 	\pdfcoverback{#1}} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-05 17:06:18 +03:00
										 |  |  | %% \DescribeMacro{\TEX} | 
					
						
							|  |  |  | %% \DescribeMacro{\LATEX} | 
					
						
							|  |  |  | % | 
					
						
							|  |  |  | %% Convenience macros to display \TeX and \LaTeX in the correct font. | 
					
						
							|  |  |  | %% | 
					
						
							| 
									
										
										
										
											2023-03-01 04:40:46 +03:00
										 |  |  | \def\TEX{%
 | 
					
						
							|  |  |  | 	{\fontfamily{lmr}\selectfont \TeX}} | 
					
						
							|  |  |  | \def\LATEX{%
 | 
					
						
							|  |  |  | 	{\fontfamily{lmr}\selectfont \LaTeX}} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											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-12-07 01:12:39 +03:00
										 |  |  | % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 
					
						
							|  |  |  | %% \blankfootnote{%
 | 
					
						
							|  |  |  | %%		Why ASCII diagrams instead of normal graphics, you might ask? | 
					
						
							|  |  |  | %%		Well, for the same reason as photo-books in \LaTeX\ -- I liked  | 
					
						
							|  |  |  | %%		the idea of it, the simplicity, and thought that it would be fun to 
 | 
					
						
							|  |  |  | %%		see how far can I push things before it all	falling apart on me, and...  | 
					
						
							| 
									
										
										
										
											2022-01-29 02:54:52 +03:00
										 |  |  | %%		We are here, at the end, and it all is still here too :)} | 
					
						
							| 
									
										
										
										
											2021-12-07 01:12:39 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-08 01:54:37 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | %---------------------------------------------------------------------- | 
					
						
							| 
									
										
										
										
											2021-09-12 17:43:31 +03:00
										 |  |  | %% \end{document} %                         vim:set ts=4 sw=4 nowrap : |