mirror of
				https://github.com/flynx/photobook.git
				synced 2025-10-31 11:20:10 +00:00 
			
		
		
		
	reworked imagecell -- now supports caption cell clearing parent cell + tweaks...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									d87935f49a
								
							
						
					
					
						commit
						a4e7e20acb
					
				
							
								
								
									
										307
									
								
								photobook.cls
									
									
									
									
									
								
							
							
						
						
									
										307
									
								
								photobook.cls
									
									
									
									
									
								
							| @ -28,6 +28,7 @@ | |||||||
| % | % | ||||||
| % XXX ASAP: \clearcaption support... | % XXX ASAP: \clearcaption support... | ||||||
| % XXX add marks -- \ShowMarks{..} | % XXX add marks -- \ShowMarks{..} | ||||||
|  | % XXX add fold support... | ||||||
| % XXX unify API -- see CellContent env... | % XXX unify API -- see CellContent env... | ||||||
| % XXX make this loadable both as a class and as a package... | % XXX make this loadable both as a class and as a package... | ||||||
| %		\@ifclassloaded{photobook}{<true>}{<false>} | %		\@ifclassloaded{photobook}{<true>}{<false>} | ||||||
| @ -639,7 +640,7 @@ | |||||||
| %% | %% | ||||||
| \edef\imageblockoffsettop{\photobook@imageblockoffsettop} | \edef\imageblockoffsettop{\photobook@imageblockoffsettop} | ||||||
| 
 | 
 | ||||||
| %% \DescribeMacro{\clearcaption=<ratio>} | %% \DescribeMacro{\clearcaption=<len>} | ||||||
| % | % | ||||||
| %% Block caption clearance from edge of parent cell. | %% Block caption clearance from edge of parent cell. | ||||||
| %% | %% | ||||||
| @ -648,7 +649,7 @@ | |||||||
| \newlength\clearcaption | \newlength\clearcaption | ||||||
| \setlength\clearcaption{0pt} | \setlength\clearcaption{0pt} | ||||||
| 
 | 
 | ||||||
| %% \DescribeMacro{\captioncellspacing=<ratio>} | %% \DescribeMacro{\captioncellspacing=<len>} | ||||||
| % | % | ||||||
| %% Block caption spacing from parent cell. | %% Block caption spacing from parent cell. | ||||||
| %% | %% | ||||||
| @ -659,6 +660,12 @@ | |||||||
| \setlength\captioncellspacing{5pt} | \setlength\captioncellspacing{5pt} | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | %% \DescribeMacro{\captionclearpage=<len>} | ||||||
|  | % | ||||||
|  | %% | ||||||
|  | \def\captionclearpage{\clearimage} | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
| %---------------------------------------------------------------------- | %---------------------------------------------------------------------- | ||||||
| %%%% Initialization | %%%% Initialization | ||||||
| @ -1589,6 +1596,7 @@ | |||||||
| 	\end{clipbox*}} | 	\end{clipbox*}} | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
| %% \DescribeMacro{\imagecell\{..\}} | %% \DescribeMacro{\imagecell\{..\}} | ||||||
| % | % | ||||||
| %% Place image in cell. | %% Place image in cell. | ||||||
| @ -1727,6 +1735,11 @@ | |||||||
| %% |<caption-cell>| occupies the same space as the image clipped by the  | %% |<caption-cell>| occupies the same space as the image clipped by the  | ||||||
| %% containing cell and provides all the cell functionality. | %% containing cell and provides all the cell functionality. | ||||||
| %% | %% | ||||||
|  | %% If |captionclearparent| is set, the |<caption-cell>| will fit into an  | ||||||
|  | %% intersection between the image area and the parent cell padded by  | ||||||
|  | %% |captionclearparent|. | ||||||
|  | %% | ||||||
|  | % XXX do we need captionclearparent to be directional (a-la margin in adjustbox)??? | ||||||
| % XXX might be a good idea to split this into two parts: | % XXX might be a good idea to split this into two parts: | ||||||
| %		- \aligncell{..} | %		- \aligncell{..} | ||||||
| %		- \imagecell{caption}{image} | %		- \imagecell{caption}{image} | ||||||
| @ -1825,6 +1838,7 @@ | |||||||
| 	\setlength\photobook@imagecell@clearance{#1}}% | 	\setlength\photobook@imagecell@clearance{#1}}% | ||||||
| 
 | 
 | ||||||
| % offsettop=<len> / offsetleft=<len>... | % offsettop=<len> / offsetleft=<len>... | ||||||
|  | % XXX DOC!!! | ||||||
| \newlength\photobook@imagecell@offsettop% | \newlength\photobook@imagecell@offsettop% | ||||||
| \setlength\photobook@imagecell@offsettop{0pt}% | \setlength\photobook@imagecell@offsettop{0pt}% | ||||||
| \define@key{imagecell@args}{offsettop}[0pt]{% | \define@key{imagecell@args}{offsettop}[0pt]{% | ||||||
| @ -1844,10 +1858,14 @@ | |||||||
| \define@choicekey{imagecell@args}{captionalign}{t,c,b}[t]{% | \define@choicekey{imagecell@args}{captionalign}{t,c,b}[t]{% | ||||||
| 	\def\photobook@imagecell@captionalign{#1}} | 	\def\photobook@imagecell@captionalign{#1}} | ||||||
| 
 | 
 | ||||||
| % XXX add offset support... | % captionclearparent=<len>... | ||||||
| %		...i.e. an argument that will shift the image v/h from base position. | % XXX DOC!!! | ||||||
| %		also need to shift the caption box accordingly but still keep it  | \newif\ifphotobook@imagecell@captionclearparent | ||||||
| %		within the cell... | \newlength\photobook@imagecell@captionclearparent | ||||||
|  | \define@key{imagecell@args}{captionclearparent}[0pt]{% | ||||||
|  | 	\setlength\photobook@imagecell@captionclearparent{#1}% | ||||||
|  | 	\photobook@imagecell@captionclearparenttrue} | ||||||
|  | 
 | ||||||
| % XXX can we make this an env??? | % XXX can we make this an env??? | ||||||
| \newcommand\imagecell[3][]{% | \newcommand\imagecell[3][]{% | ||||||
| 	\begingroup% | 	\begingroup% | ||||||
| @ -1896,64 +1914,113 @@ | |||||||
| 							+ \cellheight  | 							+ \cellheight  | ||||||
| 							- ((\photobook@imagecell@clearance) * 2) \relax]{#3}}% | 							- ((\photobook@imagecell@clearance) * 2) \relax]{#3}}% | ||||||
| 		\fi\fi\fi% | 		\fi\fi\fi% | ||||||
|  | 		% | ||||||
|  | 		\setlength\celloffsetleft{% | ||||||
|  | 			\dimexpr  | ||||||
|  | 				\photobook@imagecell@offsetleft  | ||||||
|  | 				+ \photobook@imagecell@left \relax}% | ||||||
|  | 		\setlength\celloffsettop{% | ||||||
|  | 			\dimexpr  | ||||||
|  | 				\photobook@imagecell@offsettop | ||||||
|  | 				+ \photobook@imagecell@top \relax}% | ||||||
|  | 		% | ||||||
|  | 		% | ||||||
| 		% place image box... | 		% place image box... | ||||||
| 		% XXX for some odd reason without this the alignment completely breaks... | 		% XXX for some odd reason without this the alignment completely breaks... | ||||||
| 		\vspace{0pt}% | 		\vspace{0pt}% | ||||||
|  | 		\smash{\makebox[0pt][l]{% | ||||||
| 			\adjustbox{% | 			\adjustbox{% | ||||||
| 				%fbox=0.1pt 0pt 0pt,  | 					margin={\celloffsetleft} 0pt 0pt {\celloffsettop}, | ||||||
| 				margin= | 					valign=T}{% | ||||||
| 					{\dimexpr  | 				\usebox\photobook@imagebox}}}% | ||||||
| 						\photobook@imagecell@offsetleft  |  | ||||||
| 						+ \photobook@imagecell@left \relax}  |  | ||||||
| 					0pt 0pt  |  | ||||||
| 					{\dimexpr  |  | ||||||
| 						\photobook@imagecell@offsettop |  | ||||||
| 						+ \photobook@imagecell@top \relax}}{% |  | ||||||
| 			% image.... |  | ||||||
| 			\usebox\photobook@imagebox% |  | ||||||
| 		%  | 		%  | ||||||
| 			% caption cell... | 		% | ||||||
| 			% XXX make this conditional -- if caption is not empty... | 		% prepare for caption cell... | ||||||
| 			\begingroup% |  | ||||||
| 				% setup the cell env... |  | ||||||
| 				\setlength\clearance{\photobook@imagecell@clearance}% |  | ||||||
| 				% NOTE: this needs the original \cellwidth... |  | ||||||
| 				\setlength\celloffsetleft{% |  | ||||||
| 					\mindim{% |  | ||||||
| 							\wd\photobook@imagebox |  | ||||||
| 						}{% |  | ||||||
| 							+\cellwidth  |  | ||||||
| 							-\photobook@imagecell@captionleft |  | ||||||
| 							-0.5\dimexpr  |  | ||||||
| 								+\cellwidth  |  | ||||||
| 								-\wd\photobook@imagebox \relax}}% |  | ||||||
| 		\setlength\cellparentwidth{\cellwidth}% | 		\setlength\cellparentwidth{\cellwidth}% | ||||||
| 		\setlength\cellparentheight{\cellheight}% | 		\setlength\cellparentheight{\cellheight}% | ||||||
| 		\setlength\cellwidth{% | 		\setlength\cellwidth{% | ||||||
| 					\mindim{\wd\photobook@imagebox}{\cellwidth}}% | 			\mindim{ | ||||||
|  | 				\wd\photobook@imagebox | ||||||
|  | 				+ \mindim{\celloffsetleft}{0pt} | ||||||
|  | 			}{ | ||||||
|  | 				\cellwidth}}% | ||||||
| 		\setlength\cellheight{% | 		\setlength\cellheight{% | ||||||
| 					\mindim{\ht\photobook@imagebox}{\cellheight}}%  | 			\mindim{ | ||||||
| 				% NOTE: this needs the new \cellheight... | 				\ht\photobook@imagebox | ||||||
|  | 				+ \mindim{\celloffsettop}{0pt} | ||||||
|  | 			}{ | ||||||
|  | 				\cellheight}}%  | ||||||
|  | 		\setlength\celloffsetleft{% | ||||||
|  | 			\maxdim{\celloffsetleft}{0pt}}% | ||||||
| 		\setlength\celloffsettop{% | 		\setlength\celloffsettop{% | ||||||
| 					\mindim{% | 			\maxdim{\celloffsettop}{0pt}}% | ||||||
| 							0pt | 		\setlength\clearance{\photobook@imagecell@clearance}% | ||||||
| 						}{% | 		% clear parent... | ||||||
| 							+ 0.5\dimexpr  | 		% XXX might be a good idea to put this into a special reusable cell... | ||||||
| 								+\cellheight  | 		\ifphotobook@imagecell@captionclearparent% | ||||||
| 								-\ht\photobook@imagebox  | 			% trim vertical... | ||||||
| 								-\photobook@imagecell@captiontop \relax}}% | 			% 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 the caption cell... | 		% | ||||||
|  | 		% place caption box... | ||||||
| 		\smash{\makebox[0pt][l]{% | 		\smash{\makebox[0pt][l]{% | ||||||
| 					\hspace{-\celloffsetleft}{% | 			\adjustbox{% | ||||||
| 						\setlength\fboxsep{0pt}% | 					%cfbox=gray 0.5pt 0pt 0pt, | ||||||
| 						% adjust top if image is taller than cell... | 					margin={\celloffsetleft} 0pt 0pt {\celloffsettop}, | ||||||
| 						\raisebox{-\celloffsettop}{% | 					minipage=[b][\cellheight][\photobook@imagecell@captionalign]{\cellwidth}, | ||||||
| 							\begin{minipage}[b][\cellheight][\photobook@imagecell@captionalign]{\cellwidth}% | 					valign=T}{% | ||||||
| 				\ignorespaces% | 				\ignorespaces% | ||||||
| 								#2% | 				#2}}}% | ||||||
| 							\end{minipage}}}}}% |  | ||||||
| 			\endgroup}% |  | ||||||
| 	\endgroup} | 	\endgroup} | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @ -2024,11 +2091,6 @@ | |||||||
| %% in the same cell that takes up space, e.g. text, pictures, ...etc. | %% in the same cell that takes up space, e.g. text, pictures, ...etc. | ||||||
| %% Captions are mainly suited to play well with image cells. | %% Captions are mainly suited to play well with image cells. | ||||||
| %% | %% | ||||||
| % XXX make captions clear left/right of page... |  | ||||||
| % XXX need a way to make caption boxes independent of other cell content... |  | ||||||
| %		...two ways to do this that come to mind: |  | ||||||
| %			- place cell content into a 0-space cell |  | ||||||
| %			- place captions outside of the actual cell... |  | ||||||
| 
 | 
 | ||||||
| % over / top / center / bottom / under... | % over / top / center / bottom / under... | ||||||
| \define@boolkey{captioncell@args}{over}[true]{% | \define@boolkey{captioncell@args}{over}[true]{% | ||||||
| @ -2120,7 +2182,7 @@ | |||||||
| %% | %% | ||||||
| %% See samples for better illustration. | %% See samples for better illustration. | ||||||
| %% | %% | ||||||
| % XXX make captions clear top/bottom of page... | 
 | ||||||
| % bottomup / topdown... | % bottomup / topdown... | ||||||
| \def\photobook@vcaptioncell@orientation{bottomup} | \def\photobook@vcaptioncell@orientation{bottomup} | ||||||
| \define@boolkey{vcaptioncell@args}{bottomup}[true]{% | \define@boolkey{vcaptioncell@args}{bottomup}[true]{% | ||||||
| @ -2216,7 +2278,7 @@ | |||||||
| 
 | 
 | ||||||
| %% \DescribeMacro{\captionblockcell\{..\}} | %% \DescribeMacro{\captionblockcell\{..\}} | ||||||
| % | % | ||||||
| %% \EXPERIMENTAL | %% Add caption into a box left/right of current cell. | ||||||
| %% | %% | ||||||
| %% \begin{minipage}{\textwidth} | %% \begin{minipage}{\textwidth} | ||||||
| %% \begin{verbatim} | %% \begin{verbatim} | ||||||
| @ -2246,7 +2308,6 @@ | |||||||
| %% \end{minipage} | %% \end{minipage} | ||||||
| %%                               | %%                               | ||||||
| % XXX make captions clear top/bottom of page... | % XXX make captions clear top/bottom of page... | ||||||
| % XXX add cell spacing... |  | ||||||
| % XXX need to do a caption block -- a cell to one side of an image to the  | % XXX need to do a caption block -- a cell to one side of an image to the  | ||||||
| % 		end of the page... | % 		end of the page... | ||||||
| % XXX can we use the normal caption and simply insert a minipage of the  | % XXX can we use the normal caption and simply insert a minipage of the  | ||||||
| @ -2281,6 +2342,16 @@ | |||||||
| \define@key{captionblockcell@args}{clearance}{% | \define@key{captionblockcell@args}{clearance}{% | ||||||
| 	\setlength\photobook@captionblockcell@clearance{#1}} | 	\setlength\photobook@captionblockcell@clearance{#1}} | ||||||
| 
 | 
 | ||||||
|  | % 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} | ||||||
|  | 
 | ||||||
| % spacing=<len> (default: \captioncellspacing) | % spacing=<len> (default: \captioncellspacing) | ||||||
| \newlength\photobook@captionblockcell@spacing | \newlength\photobook@captionblockcell@spacing | ||||||
| \setlength\photobook@captionblockcell@spacing{0pt} | \setlength\photobook@captionblockcell@spacing{0pt} | ||||||
| @ -2296,13 +2367,20 @@ | |||||||
| % showbox | % showbox | ||||||
| \define@boolkey{captionblockcell@args}{showbox}[true]{} | \define@boolkey{captionblockcell@args}{showbox}[true]{} | ||||||
| 
 | 
 | ||||||
| \newcommand\photobook@captionblockcell@content[1]{% | \newcommand\photobook@captionblockcell@content[2][0pt]{% | ||||||
| 	\begin{minipage}[t][\cellheight][\photobook@captionblockcell@valign]{\cellwidth}% | 	\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}% | 		\begin{\photobook@captionblockcell@align}% | ||||||
| 			\ignorespaces% | 			\ignorespaces% | ||||||
| 		#1% | 			#2% | ||||||
| 		\end{\photobook@captionblockcell@align}% | 		\end{\photobook@captionblockcell@align}% | ||||||
| 	\end{minipage}} | 		\end{adjustbox}}} | ||||||
| 
 | 
 | ||||||
| % XXX revise how \clearance is handled... | % XXX revise how \clearance is handled... | ||||||
| % XXX do we need top/bottom boxes??? | % XXX do we need top/bottom boxes??? | ||||||
| @ -2312,7 +2390,7 @@ | |||||||
| % XXX add tweak support... | % XXX add tweak support... | ||||||
| \newcommand\captionblockcell[2][]{% | \newcommand\captionblockcell[2][]{% | ||||||
| 	% XXX should this be within the group??? | 	% XXX should this be within the group??? | ||||||
| 	\setkeys{captionblockcell@args}{ | 	\setkeys{captionblockcell@args}{% | ||||||
| 		left,  | 		left,  | ||||||
| 		valign=b, | 		valign=b, | ||||||
| 		clearance=\clearcaption,  | 		clearance=\clearcaption,  | ||||||
| @ -2322,7 +2400,8 @@ | |||||||
| 	\smash{\makebox[0pt][l]{% | 	\smash{\makebox[0pt][l]{% | ||||||
| 		\begingroup% | 		\begingroup% | ||||||
| 			% setup cell context... | 			% setup cell context... | ||||||
| 			\setlength\clearcaption{\photobook@captionblockcell@clearance}% | 			\setlength\clearcaption{% | ||||||
|  | 				\photobook@captionblockcell@clearance}% | ||||||
| 			\setlength\photobook@captionblockcell@tmplen{\cellwidth}% | 			\setlength\photobook@captionblockcell@tmplen{\cellwidth}% | ||||||
| 			\setlength\cellwidth{% | 			\setlength\cellwidth{% | ||||||
| 				\ifnum \photobook@captionblockcell@width = 0% | 				\ifnum \photobook@captionblockcell@width = 0% | ||||||
| @ -2335,7 +2414,8 @@ | |||||||
| 						- \clearance \relax% | 						- \clearance \relax% | ||||||
| 				\else% | 				\else% | ||||||
| 					\photobook@captionblockcell@width\fi}% | 					\photobook@captionblockcell@width\fi}% | ||||||
| 			\setlength\cellparentwidth{\photobook@captionblockcell@tmplen}% | 			\setlength\cellparentwidth{% | ||||||
|  | 				\photobook@captionblockcell@tmplen}% | ||||||
| 			\setlength\celloffsetleft{% | 			\setlength\celloffsetleft{% | ||||||
| 				\ifKV@captionblockcell@args@left% | 				\ifKV@captionblockcell@args@left% | ||||||
| 					\dimexpr | 					\dimexpr | ||||||
| @ -2346,25 +2426,59 @@ | |||||||
| 						\cellparentwidth | 						\cellparentwidth | ||||||
| 						+ \photobook@captionblockcell@spacing \relax% | 						+ \photobook@captionblockcell@spacing \relax% | ||||||
| 					\fi}% | 					\fi}% | ||||||
| 			% | 			% clear parent... | ||||||
| 			\hspace{\celloffsetleft}{% | 			% XXX do we need this here??? | ||||||
| 				\ifKV@captionblockcell@args@showbox% | 			\ifKV@captionblockcell@args@constraintoparent% | ||||||
| 					\fbox{% | 				% offset top... | ||||||
| 						\photobook@captionblockcell@content{#2}}% | 				\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% | 			\else% | ||||||
| 					\photobook@captionblockcell@content{#2}\fi}% | 				\setlength\celloffsettop{0pt}\fi% | ||||||
|  | 			% | ||||||
|  | 			% place... | ||||||
|  | 			\ifKV@captionblockcell@args@showbox% | ||||||
|  | 				\photobook@captionblockcell@content[0.1pt]{#2}% | ||||||
|  | 			\else% | ||||||
|  | 				\photobook@captionblockcell@content{#2}\fi% | ||||||
| 		\endgroup}}% | 		\endgroup}}% | ||||||
| 	\ignorespaces} | 	\ignorespaces} | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||
| %%%%% Paper cells | %%%%% Paper cells | ||||||
|  | % | ||||||
|  | %% 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|. | ||||||
|  | %% | ||||||
| 
 | 
 | ||||||
| %% \DescribeEnv{papercell} | %% \DescribeEnv{papercell} | ||||||
| % | % | ||||||
| %% Paper cell. | %% Paper cell. | ||||||
| %% | %% | ||||||
| %% This does not include bleeds and is independent of |layoutmode|. | %% This does not include bleeds. | ||||||
| %% | %% | ||||||
| \newenvironment{papercell}{% | \newenvironment{papercell}{% | ||||||
| 	\begin{cell*}{\bleed, \bleed}{\blockwidth}{\blockheight}% | 	\begin{cell*}{\bleed, \bleed}{\blockwidth}{\blockheight}% | ||||||
| @ -2386,6 +2500,10 @@ | |||||||
| 
 | 
 | ||||||
| % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||
| %%%%% Page cells | %%%%% Page cells | ||||||
|  | % | ||||||
|  | %% Page cells always correspond to the page block size, i.e. |layoutmode=block|  | ||||||
|  | %% regardless of the actual |layoutmode| set currently. | ||||||
|  | %% | ||||||
| 
 | 
 | ||||||
| %% \DescribeEnv{pagecell} | %% \DescribeEnv{pagecell} | ||||||
| %% \DescribeEnv{pagecell*} | %% \DescribeEnv{pagecell*} | ||||||
| @ -2416,8 +2534,10 @@ | |||||||
| %% The star version accounts for |\bindingoffset|.  | %% The star version accounts for |\bindingoffset|.  | ||||||
| %% | %% | ||||||
| %% Note that |layoutmode|'s other than block will change the paper size  | %% Note that |layoutmode|'s other than block will change the paper size  | ||||||
| %% but will not affect this. | %% but will not affect this either in size (block size) or in position  | ||||||
|  | %% (top-left). | ||||||
| %% | %% | ||||||
|  | % XXX should there be a way to position this is layout modes other than block??? | ||||||
| \newenvironment{pagecell}{% | \newenvironment{pagecell}{% | ||||||
| 	\begin{cell*}{\bleed,\bleed}{\pageblockwidth}{\pageblockheight}% | 	\begin{cell*}{\bleed,\bleed}{\pageblockwidth}{\pageblockheight}% | ||||||
| }{% | }{% | ||||||
| @ -2455,8 +2575,7 @@ | |||||||
| %% \end{verbatim} | %% \end{verbatim} | ||||||
| %% \end{minipage} | %% \end{minipage} | ||||||
| %% | %% | ||||||
| %% Note that |layoutmode|'s other than block will change the paper size  | %% Note that as with |pagecell| this is not affected by |layoutmode|. | ||||||
| %% but will not affect this. |  | ||||||
| %% | %% | ||||||
| \newenvironment{pagebleedcell}{% | \newenvironment{pagebleedcell}{% | ||||||
| 	\begin{cell*}{0mm, 0mm}{\bleedblockwidth}{\bleedblockheight}% | 	\begin{cell*}{0mm, 0mm}{\bleedblockwidth}{\bleedblockheight}% | ||||||
| @ -2550,7 +2669,8 @@ | |||||||
| %%	>> \begin{spreadtopages} .. \end{spreadtopages} | %%	>> \begin{spreadtopages} .. \end{spreadtopages} | ||||||
| %%	>> \begin{spreadtopages}[<page-count>] .. \end{spreadtopages} | %%	>> \begin{spreadtopages}[<page-count>] .. \end{spreadtopages} | ||||||
| %% | %% | ||||||
| %% |spreadtopages*| creates a named save cell. | %% |spreadtopages*| creates a named save cell only allowing the pages  | ||||||
|  | %% to be placed manually via |\usespreadpage{..}|. | ||||||
| %% | %% | ||||||
| %%	>> \begin{spreadtopages*}{<name>} .. \end{spreadtopages*} | %%	>> \begin{spreadtopages*}{<name>} .. \end{spreadtopages*} | ||||||
| %%	>> \begin{spreadtopages*}[<page-count>]{<name>} .. \end{spreadtopages*} | %%	>> \begin{spreadtopages*}[<page-count>]{<name>} .. \end{spreadtopages*} | ||||||
| @ -2564,7 +2684,7 @@ | |||||||
| %%	not use a |page| environment, enabling the user to populate the page | %%	not use a |page| environment, enabling the user to populate the page | ||||||
| %%	with other elements. | %%	with other elements. | ||||||
| %% | %% | ||||||
| %% Page numbers a re 1-based. | %% Page numbers are 1-based. | ||||||
| %% | %% | ||||||
| %% Note that the cell created by |spreadtopages*| env is a normal save  | %% Note that the cell created by |spreadtopages*| env is a normal save  | ||||||
| %% cell and can be manipulated via |\usecell{..}| and |\usecell*{..}|. | %% cell and can be manipulated via |\usecell{..}| and |\usecell*{..}|. | ||||||
| @ -3008,7 +3128,6 @@ | |||||||
| \ResettableMacro{ImagePageCaption}[1]{% | \ResettableMacro{ImagePageCaption}[1]{% | ||||||
| 	\captioncell[under, align=flushright]{% | 	\captioncell[under, align=flushright]{% | ||||||
| 		\captionformat{#1}}} | 		\captionformat{#1}}} | ||||||
| 
 |  | ||||||
| \ImagePageTemplate{ImagePage}{% | \ImagePageTemplate{ImagePage}{% | ||||||
| 	\clearpage% | 	\clearpage% | ||||||
| 	\begin{page}% | 	\begin{page}% | ||||||
| @ -3021,6 +3140,7 @@ | |||||||
| 					{\imageblockheight\pagetextheight}% | 					{\imageblockheight\pagetextheight}% | ||||||
| 				\imagecell[fit, | 				\imagecell[fit, | ||||||
| 					scale=\imagescale, | 					scale=\imagescale, | ||||||
|  | 					%captionclearparent=\captionclearpage, | ||||||
| 					#1]{#2}{#3}% | 					#1]{#2}{#3}% | ||||||
| 			\end{inlinecell*}% | 			\end{inlinecell*}% | ||||||
| 		\end{center}% | 		\end{center}% | ||||||
| @ -3064,7 +3184,6 @@ | |||||||
| \ResettableMacro{ImagePageClearCaption}[1]{% | \ResettableMacro{ImagePageClearCaption}[1]{% | ||||||
| 	\captioncell[under, align=flushright]{% | 	\captioncell[under, align=flushright]{% | ||||||
| 		\captionformat{#1}}} | 		\captionformat{#1}}} | ||||||
| 
 |  | ||||||
| \ImagePageTemplate{ImagePageClear}{% | \ImagePageTemplate{ImagePageClear}{% | ||||||
| 	\clearpage% | 	\clearpage% | ||||||
| 	\begin{page}% | 	\begin{page}% | ||||||
| @ -3076,6 +3195,7 @@ | |||||||
| 			scale=\imagescale, | 			scale=\imagescale, | ||||||
| 			offsettop=\imageoffsettop, | 			offsettop=\imageoffsettop, | ||||||
| 			offsetleft=\imageoffsetleft, | 			offsetleft=\imageoffsetleft, | ||||||
|  | 			captionclearparent=\captionclearpage, | ||||||
| 			#1]{#2}{#3}% | 			#1]{#2}{#3}% | ||||||
| 	\end{pagecell*}% | 	\end{pagecell*}% | ||||||
| 	\end{page}} | 	\end{page}} | ||||||
| @ -3138,7 +3258,7 @@ | |||||||
| 		#1]{#2}{#3}} | 		#1]{#2}{#3}} | ||||||
| 
 | 
 | ||||||
| \ResettableMacro{ImagePageClearLCaption}[1]{% | \ResettableMacro{ImagePageClearLCaption}[1]{% | ||||||
| 	\captionblockcell[right]{% | 	\captionblockcell[right, clearance=\captionclearpage]{% | ||||||
| 		\captionformat{#1}}} | 		\captionformat{#1}}} | ||||||
| \ImagePageTemplate{ImagePageClearL}{% | \ImagePageTemplate{ImagePageClearL}{% | ||||||
| 	\ImagePageClear*[% | 	\ImagePageClear*[% | ||||||
| @ -3146,7 +3266,7 @@ | |||||||
| 		#1]{#2}{#3}} | 		#1]{#2}{#3}} | ||||||
| 
 | 
 | ||||||
| \ResettableMacro{ImagePageClearRCaption}[1]{% | \ResettableMacro{ImagePageClearRCaption}[1]{% | ||||||
| 	\captionblockcell[left]{% | 	\captionblockcell[left, clearance=\captionclearpage]{% | ||||||
| 		\captionformat{#1}}} | 		\captionformat{#1}}} | ||||||
| \ImagePageTemplate{ImagePageClearR}{% | \ImagePageTemplate{ImagePageClearR}{% | ||||||
| 	\ImagePageClear*[% | 	\ImagePageClear*[% | ||||||
| @ -3247,6 +3367,7 @@ | |||||||
| 					scale=\imagescale, | 					scale=\imagescale, | ||||||
| 					offsettop=\imageoffsettop, | 					offsettop=\imageoffsettop, | ||||||
| 					offsetleft=\imageoffsetleft, | 					offsetleft=\imageoffsetleft, | ||||||
|  | 					captionclearparent=\captionclearpage, | ||||||
| 					#1]{#2}{#3}% | 					#1]{#2}{#3}% | ||||||
| 			\end{pagecell}% | 			\end{pagecell}% | ||||||
| 			\end{page}% | 			\end{page}% | ||||||
| @ -3318,7 +3439,7 @@ | |||||||
| 		#1]{#2}{#3}} | 		#1]{#2}{#3}} | ||||||
| 
 | 
 | ||||||
| \ResettableMacro{ImagePageFitLCaption}[1]{% | \ResettableMacro{ImagePageFitLCaption}[1]{% | ||||||
| 	\captionblockcell[right]{% | 	\captionblockcell[right, clearance=\captionclearpage]{% | ||||||
| 		\captionformat{#1}}} | 		\captionformat{#1}}} | ||||||
| \ImagePageTemplate{ImagePageFitL}{% | \ImagePageTemplate{ImagePageFitL}{% | ||||||
| 	\ImagePageFit*[% | 	\ImagePageFit*[% | ||||||
| @ -3326,7 +3447,7 @@ | |||||||
| 		#1]{#2}{#3}} | 		#1]{#2}{#3}} | ||||||
| 
 | 
 | ||||||
| \ResettableMacro{ImagePageFitRCaption}[1]{% | \ResettableMacro{ImagePageFitRCaption}[1]{% | ||||||
| 	\captionblockcell[left]{% | 	\captionblockcell[left, clearance=\captionclearpage]{% | ||||||
| 		\captionformat{#1}}} | 		\captionformat{#1}}} | ||||||
| \ImagePageTemplate{ImagePageFitR}{% | \ImagePageTemplate{ImagePageFitR}{% | ||||||
| 	\ImagePageFit*[% | 	\ImagePageFit*[% | ||||||
| @ -3371,7 +3492,6 @@ | |||||||
| \ResettableMacro{ImagePageFillCaption}[1]{% | \ResettableMacro{ImagePageFillCaption}[1]{% | ||||||
| 	\captioncell[top, align=flushright]{% | 	\captioncell[top, align=flushright]{% | ||||||
| 		\captionformat{#1}}} | 		\captionformat{#1}}} | ||||||
| 
 |  | ||||||
| \ImagePageTemplate{ImagePageFill}{% | \ImagePageTemplate{ImagePageFill}{% | ||||||
| 	\ImagePageFit*[% | 	\ImagePageFit*[% | ||||||
| 		fill,  | 		fill,  | ||||||
| @ -3412,7 +3532,6 @@ | |||||||
| \ResettableMacro{ImageHalfPageLCaption}[1]{% | \ResettableMacro{ImageHalfPageLCaption}[1]{% | ||||||
| 	\captioncell[bottom, align=flushright]{% | 	\captioncell[bottom, align=flushright]{% | ||||||
| 		\captionformat{#1}}} | 		\captionformat{#1}}} | ||||||
| 
 |  | ||||||
| \ImagePageTemplate{ImageHalfPageL}{% | \ImagePageTemplate{ImageHalfPageL}{% | ||||||
| 	\begin{spreadtopages*}[2]{photobook@ImageHalfPageL@cell}% | 	\begin{spreadtopages*}[2]{photobook@ImageHalfPageL@cell}% | ||||||
| 		\imagecell[% | 		\imagecell[% | ||||||
| @ -3421,6 +3540,7 @@ | |||||||
| 			scale=\imagescale, | 			scale=\imagescale, | ||||||
| 			offsettop=\imageoffsettop, | 			offsettop=\imageoffsettop, | ||||||
| 			offsetleft=\imageoffsetleft, | 			offsetleft=\imageoffsetleft, | ||||||
|  | 			captionclearparent=\captionclearpage, | ||||||
| 			#1]{#2}{#3}% | 			#1]{#2}{#3}% | ||||||
| 	\end{spreadtopages*}% | 	\end{spreadtopages*}% | ||||||
| 	% | 	% | ||||||
| @ -3463,7 +3583,6 @@ | |||||||
| \ResettableMacro{ImageHalfPageRCaption}[1]{% | \ResettableMacro{ImageHalfPageRCaption}[1]{% | ||||||
| 	\captioncell[bottom, align=flushright]{% | 	\captioncell[bottom, align=flushright]{% | ||||||
| 		\captionformat{#1}}} | 		\captionformat{#1}}} | ||||||
| 
 |  | ||||||
| \ImagePageTemplate{ImageHalfPageR}{% | \ImagePageTemplate{ImageHalfPageR}{% | ||||||
| 	\begin{spreadtopages*}[2]{photobook@ImageHalfPageR@cell}% | 	\begin{spreadtopages*}[2]{photobook@ImageHalfPageR@cell}% | ||||||
| 		\imagecell[% | 		\imagecell[% | ||||||
| @ -3472,6 +3591,7 @@ | |||||||
| 			scale=\imagescale, | 			scale=\imagescale, | ||||||
| 			offsettop=\imageoffsettop, | 			offsettop=\imageoffsettop, | ||||||
| 			offsetleft=\imageoffsetleft, | 			offsetleft=\imageoffsetleft, | ||||||
|  | 			captionclearparent=\captionclearpage, | ||||||
| 			#1]{#2}{#3}% | 			#1]{#2}{#3}% | ||||||
| 	\end{spreadtopages*}% | 	\end{spreadtopages*}% | ||||||
| 	% | 	% | ||||||
| @ -3520,7 +3640,6 @@ | |||||||
| \ResettableMacro{ImageSpreadCaption}[1]{% | \ResettableMacro{ImageSpreadCaption}[1]{% | ||||||
| 	\captioncell[under]{% | 	\captioncell[under]{% | ||||||
| 		\captionformat{#1}}} | 		\captionformat{#1}}} | ||||||
| 
 |  | ||||||
| \ImagePageTemplate{ImageSpread}{% | \ImagePageTemplate{ImageSpread}{% | ||||||
| 	\cleartoleftpage% | 	\cleartoleftpage% | ||||||
| 	\begin{spreadtopages}[2]% | 	\begin{spreadtopages}[2]% | ||||||
| @ -3530,6 +3649,7 @@ | |||||||
| 			scale=\imagescale, | 			scale=\imagescale, | ||||||
| 			offsettop=\imageoffsettop, | 			offsettop=\imageoffsettop, | ||||||
| 			offsetleft=\imageoffsetleft, | 			offsetleft=\imageoffsetleft, | ||||||
|  | 			captionclearparent=\captionclearpage, | ||||||
| 			#1]{#2}{#3}% | 			#1]{#2}{#3}% | ||||||
| 	\end{spreadtopages}} | 	\end{spreadtopages}} | ||||||
| 
 | 
 | ||||||
| @ -3589,7 +3709,7 @@ | |||||||
| 		#1]{#2}{#3}} | 		#1]{#2}{#3}} | ||||||
| 
 | 
 | ||||||
| \ResettableMacro{ImageSpreadLCaption}[1]{% | \ResettableMacro{ImageSpreadLCaption}[1]{% | ||||||
| 	\captionblockcell[right]{% | 	\captionblockcell[right, clearance=\captionclearpage]{% | ||||||
| 		\captionformat{#1}}} | 		\captionformat{#1}}} | ||||||
| \ImagePageTemplate{ImageSpreadL}{% | \ImagePageTemplate{ImageSpreadL}{% | ||||||
| 	\ImageSpread*[% | 	\ImageSpread*[% | ||||||
| @ -3597,7 +3717,7 @@ | |||||||
| 		#1]{#2}{#3}} | 		#1]{#2}{#3}} | ||||||
| 
 | 
 | ||||||
| \ResettableMacro{ImageSpreadRCaption}[1]{% | \ResettableMacro{ImageSpreadRCaption}[1]{% | ||||||
| 	\captionblockcell[left]{% | 	\captionblockcell[left, clearance=\captionclearpage]{% | ||||||
| 		\captionformat{#1}}} | 		\captionformat{#1}}} | ||||||
| \ImagePageTemplate{ImageSpreadR}{% | \ImagePageTemplate{ImageSpreadR}{% | ||||||
| 	\ImageSpread*[% | 	\ImageSpread*[% | ||||||
| @ -3648,6 +3768,7 @@ | |||||||
| 			scale=\imagescale, | 			scale=\imagescale, | ||||||
| 			offsettop=\imageoffsettop, | 			offsettop=\imageoffsettop, | ||||||
| 			offsetleft=\imageoffsetleft, | 			offsetleft=\imageoffsetleft, | ||||||
|  | 			captionclearparent=\captionclearpage, | ||||||
| 			#1]{#2}{#3}% | 			#1]{#2}{#3}% | ||||||
| 	\end{spreadtopages}} | 	\end{spreadtopages}} | ||||||
| 
 | 
 | ||||||
| @ -3711,13 +3832,13 @@ | |||||||
| 	\ImageSpreadFit*[bottom, #1]{#2}{#3}} | 	\ImageSpreadFit*[bottom, #1]{#2}{#3}} | ||||||
| 
 | 
 | ||||||
| \ResettableMacro{ImageSpreadFitLCaption}[1]{% | \ResettableMacro{ImageSpreadFitLCaption}[1]{% | ||||||
| 	\captionblockcell[right]{% | 	\captionblockcell[right, clearance=\captionclearpage]{% | ||||||
| 		\captionformat{#1}}} | 		\captionformat{#1}}} | ||||||
| \ImagePageTemplate{ImageSpreadFitL}{% | \ImagePageTemplate{ImageSpreadFitL}{% | ||||||
| 	\ImageSpreadFit*[left, #1]{#2}{#3}} | 	\ImageSpreadFit*[left, #1]{#2}{#3}} | ||||||
| 
 | 
 | ||||||
| \ResettableMacro{ImageSpreadFitRCaption}[1]{% | \ResettableMacro{ImageSpreadFitRCaption}[1]{% | ||||||
| 	\captionblockcell[left]{% | 	\captionblockcell[left, clearance=\captionclearpage]{% | ||||||
| 		\captionformat{#1}}} | 		\captionformat{#1}}} | ||||||
| \ImagePageTemplate{ImageSpreadFitR}{% | \ImagePageTemplate{ImageSpreadFitR}{% | ||||||
| 	\ImageSpreadFit*[right, #1]{#2}{#3}} | 	\ImageSpreadFit*[right, #1]{#2}{#3}} | ||||||
| @ -3760,7 +3881,6 @@ | |||||||
| \ResettableMacro{ImageSpreadFillCaption}[1]{% | \ResettableMacro{ImageSpreadFillCaption}[1]{% | ||||||
| 	\captioncell[bottom, align=flushright]{% | 	\captioncell[bottom, align=flushright]{% | ||||||
| 		\captionformat{#1}}} | 		\captionformat{#1}}} | ||||||
| 
 |  | ||||||
| \ImagePageTemplate{ImageSpreadFill}{% | \ImagePageTemplate{ImageSpreadFill}{% | ||||||
| 	\cleartoleftpage% | 	\cleartoleftpage% | ||||||
| 	\begin{spreadtopages}[2]% | 	\begin{spreadtopages}[2]% | ||||||
| @ -3770,6 +3890,7 @@ | |||||||
| 			scale=\imagescale, | 			scale=\imagescale, | ||||||
| 			offsettop=\imageoffsettop, | 			offsettop=\imageoffsettop, | ||||||
| 			offsetleft=\imageoffsetleft, | 			offsetleft=\imageoffsetleft, | ||||||
|  | 			captionclearparent=\captionclearpage, | ||||||
| 			#1]{#2}{#3}% | 			#1]{#2}{#3}% | ||||||
| 	\end{spreadtopages}} | 	\end{spreadtopages}} | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -20,6 +20,7 @@ | |||||||
| \setlength\parindent{0pt} | \setlength\parindent{0pt} | ||||||
| 
 | 
 | ||||||
| \edef\TestImage{DSC00403-2} | \edef\TestImage{DSC00403-2} | ||||||
|  | \edef\TestImageV{DSC00403-2vert} | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||
| @ -30,6 +31,19 @@ | |||||||
| 
 | 
 | ||||||
| \begin{document} | \begin{document} | ||||||
| 
 | 
 | ||||||
|  | \ImagePageClearR{ImagePageClearR}{\TestImageV} | ||||||
|  | %\ImagePageClearL[captionclearparent=2cm]{ImagePageClearL}{\TestImage} | ||||||
|  | \ImagePageClearL[center, captionclearparent=15mm]{ImagePageClearL}{\TestImageV} | ||||||
|  | \ImagePageClearL[captionclearparent=15mm]{ImagePageClearL}{\TestImageV} | ||||||
|  | 
 | ||||||
|  | \ImagePageFitL[captionclearparent=15mm]{ImagePageFitL}{\TestImageV} | ||||||
|  | \ImagePageFitR[captionclearparent=15mm]{ImagePageFitR}{\TestImageV} | ||||||
|  | 
 | ||||||
|  | \ImagePageFitT[captionclearparent=15mm]{ImagePageFitT}{\TestImage} | ||||||
|  | \ImagePageFitB[captionclearparent=15mm]{ImagePageFitB}{\TestImage} | ||||||
|  | 
 | ||||||
|  | \ImagePageFill{ImagePageFill}{\TestImageV} | ||||||
|  | \ImagePageFill[captionclearparent=15mm]{ImagePageFill}{\TestImageV} | ||||||
| 
 | 
 | ||||||
| \end{document} | \end{document} | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user