mirror of
				https://github.com/flynx/photobook.git
				synced 2025-10-31 11:20:10 +00:00 
			
		
		
		
	cleanup and docs...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									e3d6cfff37
								
							
						
					
					
						commit
						ee43f4ec76
					
				
							
								
								
									
										174
									
								
								photobook.cls
									
									
									
									
									
								
							
							
						
						
									
										174
									
								
								photobook.cls
									
									
									
									
									
								
							| @ -1874,17 +1874,47 @@ | |||||||
| % | % | ||||||
| %% \EXPERIMENTAL | %% \EXPERIMENTAL | ||||||
| %% | %% | ||||||
|  | %% Upside-down caption cell. | ||||||
|  | %% | ||||||
| % XXX a bit off... | % XXX a bit off... | ||||||
| \newcommand\rcaptioncell[2][]{% | \newcommand\rcaptioncell[2][]{% | ||||||
| 		\captioncell[align=flushleft, #1]{% | 		\captioncell[align=flushleft, #1]{% | ||||||
| 			\begin{turn}{180}% | 			\begin{turn}{180}% | ||||||
| 				#2% | 				% XXX this is hackish -- need to shift by x-height... | ||||||
|  | 				%		...currently this is set to 1/(golden ratio) would | ||||||
|  | 				%		be nice to make this parametric / font-derived... | ||||||
|  | 				\raisebox{\heightof{a} * \real{-0.618033988749855}}{#2}% | ||||||
| 			\end{turn}}% | 			\end{turn}}% | ||||||
| 	\ignorespaces} | 	\ignorespaces} | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | % \begin{minipage}{\textwidth} | ||||||
|  | % \begin{verbatim} | ||||||
|  | % | ||||||
|  | %   <------>                    v celloffsetleft | ||||||
|  | %   .       <-------------->    <--------------> cellwidth | ||||||
|  | %   <---------------------->    <----------------------> cellparentwidth | ||||||
|  | %   .       .              .    ..             .       . | ||||||
|  | %   +----------------------+    +----------------------+  | ||||||
|  | %   |                      |    |                      |  | ||||||
|  | %   |                      |    |                      |  | ||||||
|  | %   +-------+ - - - - - - +|    |+ - - - - - - +-------+  | ||||||
|  | %   |       |             .|    |.             |       |  | ||||||
|  | %   |       |             .|    |.             |       |  | ||||||
|  | %   |  cap. |     cell    .|    |.    cell     |  cap. |  | ||||||
|  | %   |       |             .|    |.             |       |  | ||||||
|  | %   |       |             .|    |.             |       |  | ||||||
|  | %   +-------+ - - - - - - +|    |+ - - - - - - +-------+  | ||||||
|  | %   |                      |    |                      |  | ||||||
|  | %   |                      |    |                      |  | ||||||
|  | %   +----------------------+    +----------------------+  | ||||||
|  | %                               | ||||||
|  | % \end{verbatim} | ||||||
|  | % \end{minipage} | ||||||
| % 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  | ||||||
|  | %		appropriate width??? | ||||||
| \newcommand\captionblockcell[2][]{% | \newcommand\captionblockcell[2][]{% | ||||||
| 	% XXX | 	% XXX | ||||||
| } | } | ||||||
| @ -2313,7 +2343,7 @@ | |||||||
| 	\fontsize{6.5pt}{8pt}\selectfont} | 	\fontsize{6.5pt}{8pt}\selectfont} | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| %% \DescribeMacro{\captionsize\{..\}} | %% \DescribeMacro{\captionformat\{..\}} | ||||||
| % | % | ||||||
| %% | %% | ||||||
| %% | %% | ||||||
| @ -2326,11 +2356,31 @@ | |||||||
| 
 | 
 | ||||||
| %---------------------------------------------------------------------- | %---------------------------------------------------------------------- | ||||||
| %%%% Page Templates | %%%% Page Templates | ||||||
| 
 | % | ||||||
| \newsavebox\photobook@imagebox | %% This section contains a set of predefined configurable single-page | ||||||
| 
 | %% templates. | ||||||
|  | %% | ||||||
| 
 | 
 | ||||||
| % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||
|  | %%%%% 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. | ||||||
|  | %% | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
| %% \DescribeMacro{\imagescale=<num>} | %% \DescribeMacro{\imagescale=<num>} | ||||||
| %% \DescribeMacro{\imageoffsettop=<len>} | %% \DescribeMacro{\imageoffsettop=<len>} | ||||||
| @ -2338,7 +2388,14 @@ | |||||||
| % | % | ||||||
| %% Tweak next image templates scale/offsettop/offsetleft | %% Tweak next image templates scale/offsettop/offsetleft | ||||||
| %% | %% | ||||||
|  | %% Note that |\imagescale| is not a length. | ||||||
|  | % | ||||||
|  | %%	>> \edef\imagescale{<scale>} | ||||||
|  | %%	>> \setlength\imageoffsettop{<len>} | ||||||
|  | %%	>> \setlength\imageoffsetleft{<len>} | ||||||
|  | %% | ||||||
| \edef\imagescale{1} | \edef\imagescale{1} | ||||||
|  | % NOTE: these are initialized later by \resetimagetweaks... | ||||||
| \newlength\imageoffsettop | \newlength\imageoffsettop | ||||||
| \newlength\imageoffsetleft | \newlength\imageoffsetleft | ||||||
| 
 | 
 | ||||||
| @ -2348,6 +2405,12 @@ | |||||||
| % | % | ||||||
| %% Convenience commands | %% Convenience commands | ||||||
| %% | %% | ||||||
|  | %% These provide a uniform interface for tweaking. | ||||||
|  | % | ||||||
|  | %%	>> \tweakimagescale{<scale>} | ||||||
|  | %%	>> \tweakimageoffsettop{<len>} | ||||||
|  | %%	>> \tweakimageoffsetleft{<len>} | ||||||
|  | %% | ||||||
| \newcommand\tweakimagescale[1]{% | \newcommand\tweakimagescale[1]{% | ||||||
| 	\edef\imagescale{#1}} | 	\edef\imagescale{#1}} | ||||||
| \newcommand\tweakimageoffsettop[1]{% | \newcommand\tweakimageoffsettop[1]{% | ||||||
| @ -2371,7 +2434,6 @@ | |||||||
| % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||
| % meta-commands... | % meta-commands... | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| % \DescribeMacro{\ImagePageTemplate\{..\}} | % \DescribeMacro{\ImagePageTemplate\{..\}} | ||||||
| % | % | ||||||
| %	>> \ImagePageTemplate{<name>}{<code>} | %	>> \ImagePageTemplate{<name>}{<code>} | ||||||
| @ -2406,6 +2468,43 @@ | |||||||
| 
 | 
 | ||||||
| % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||
| 
 | 
 | ||||||
|  | \newsavebox\photobook@imagebox | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||
|  | %%%%% Templates | ||||||
|  | % | ||||||
|  | %% 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. | ||||||
|  | %% | ||||||
|  | 
 | ||||||
| %% \DescribeMacro{\ImagePage\{..\}} | %% \DescribeMacro{\ImagePage\{..\}} | ||||||
| %% \DescribeMacro{\ImagePageCaption\{..\}} | %% \DescribeMacro{\ImagePageCaption\{..\}} | ||||||
| %% \DescribeMacro{\resetImagePageCaption} | %% \DescribeMacro{\resetImagePageCaption} | ||||||
| @ -2433,22 +2532,10 @@ | |||||||
| %% \end{minipage} | %% \end{minipage} | ||||||
| %% | %% | ||||||
| %% Create an image page: | %% Create an image page: | ||||||
| % | %% | ||||||
| %%	>> \ImagePage{<caption>}{<path>} | %% Note that |\ImagePage{..}| only supports tweaking |scale|, this is  | ||||||
| % | %% intentional ad tweaking offset will mess up page alignment relative  | ||||||
| %% Image caption template used by |\ImagePage{..}|, this can be redefined | %% to other pages in a book. | ||||||
| %% to change the way |\ImagePage{..}| behaves: |  | ||||||
| % |  | ||||||
| %%	>> \ImagePageCaption{<caption>}{<path>} |  | ||||||
| % |  | ||||||
| %% Create image page with a custom caption, this will not use any caption  |  | ||||||
| %% templates: |  | ||||||
| % |  | ||||||
| %%	>> \ImagePage*{<caption>}{<path>} |  | ||||||
| % |  | ||||||
| %% Reset image caption to default: |  | ||||||
| % |  | ||||||
| %%	>> \resetImagePageCaption |  | ||||||
| %% | %% | ||||||
| \ResettableMacro{ImagePageCaption}[1]{% | \ResettableMacro{ImagePageCaption}[1]{% | ||||||
| 	\captioncell[under, align=flushright]{% | 	\captioncell[under, align=flushright]{% | ||||||
| @ -2480,7 +2567,7 @@ | |||||||
| %% \DescribeMacro{\resetImagePageFitCaption} | %% \DescribeMacro{\resetImagePageFitCaption} | ||||||
| %% \DescribeMacro{\ImagePageFit*\{..\}} | %% \DescribeMacro{\ImagePageFit*\{..\}} | ||||||
| % | % | ||||||
| %% Similar to |\ImagePage| but will fit an image into page... | %% Fit image into page... | ||||||
| % | % | ||||||
| %%	>> \ImagePageFit[<options>]{<caption>}{<image>} | %%	>> \ImagePageFit[<options>]{<caption>}{<image>} | ||||||
| %% | %% | ||||||
| @ -2504,11 +2591,6 @@ | |||||||
| %% \end{verbatim} | %% \end{verbatim} | ||||||
| %% \end{minipage} | %% \end{minipage} | ||||||
| %% | %% | ||||||
| %% |<options>| is the same as for |\imagecell{..}|. |  | ||||||
| %% |  | ||||||
| %% Note that fit/fill versions are split mainly to provide ability to  |  | ||||||
| %% configure the template defaults separately. |  | ||||||
| %% |  | ||||||
| %% Default image clearence (|clearimage| option value in |\imagecell{..}|)  | %% Default image clearence (|clearimage| option value in |\imagecell{..}|)  | ||||||
| %% is set by |\clearimage| global length. | %% is set by |\clearimage| global length. | ||||||
| %% | %% | ||||||
| @ -2559,8 +2641,6 @@ | |||||||
| %% \end{verbatim} | %% \end{verbatim} | ||||||
| %% \end{minipage} | %% \end{minipage} | ||||||
| %% | %% | ||||||
| %% |<options>| is the same as for |\imagecell{..}|. |  | ||||||
| %% |  | ||||||
| %% Default image clearence (|clearimage| option value in |\imagecell{..}|)  | %% Default image clearence (|clearimage| option value in |\imagecell{..}|)  | ||||||
| %% is set by |\clearimage| global length. | %% is set by |\clearimage| global length. | ||||||
| %% | %% | ||||||
| @ -2660,10 +2740,10 @@ | |||||||
| 	\newpage } | 	\newpage } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| %% \DescribeMacro{\ImageLeftHalfPage\{..\}} | %% \DescribeMacro{\ImageHalfPageL\{..\}} | ||||||
| %% \DescribeMacro{\ImageLeftHalfPageCaption\{..\}} | %% \DescribeMacro{\ImageHalfPageLCaption\{..\}} | ||||||
| %% \DescribeMacro{\resetImageLeftHalfPageCaption} | %% \DescribeMacro{\resetImageHalfPageLCaption} | ||||||
| %% \DescribeMacro{\ImageLeftHalfPage*\{..\}} | %% \DescribeMacro{\ImageHalfPageL*\{..\}} | ||||||
| % | % | ||||||
| %% Left half of image filling page with full bleed. | %% Left half of image filling page with full bleed. | ||||||
| % | % | ||||||
| @ -2691,13 +2771,12 @@ | |||||||
| %% | %% | ||||||
| % XXX TEST... | % XXX TEST... | ||||||
| % XXX do a better default... | % XXX do a better default... | ||||||
| \ResettableMacro{ImageLeftHalfPageCaption}[1]{% | \ResettableMacro{ImageHalfPageLCaption}[1]{% | ||||||
| 	\captioncell[bottom, align=flushright]{% | 	\captioncell[bottom, align=flushright]{% | ||||||
| 		\captionformat{#1}}} | 		\captionformat{#1}}} | ||||||
| 
 | 
 | ||||||
| % XXX add nudge/grow support... | \ImagePageTemplate{ImageHalfPageL}{% | ||||||
| \ImagePageTemplate{ImageLeftHalfPage}{% | 	\begin{spreadtopages*}[2]{photobook@ImageHalfPageL@cell}% | ||||||
| 	\begin{spreadtopages*}[2]{photobook@ImageLeftHalfPage@cell}% |  | ||||||
| 		\imagecell[fill,  | 		\imagecell[fill,  | ||||||
| 			clearance=\clearimage,  | 			clearance=\clearimage,  | ||||||
| 			scale=\imagescale, | 			scale=\imagescale, | ||||||
| @ -2707,14 +2786,14 @@ | |||||||
| 	\end{spreadtopages*}% | 	\end{spreadtopages*}% | ||||||
| 	% | 	% | ||||||
| 	\cleartoleftpage% | 	\cleartoleftpage% | ||||||
| 	\usespreadpage[1]{photobook@ImageLeftHalfPage@cell}} | 	\usespreadpage[1]{photobook@ImageHalfPageL@cell}} | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| %% \DescribeMacro{\ImageRightHalfPage\{..\}} | %% \DescribeMacro{\ImageHalfPageR\{..\}} | ||||||
| %% \DescribeMacro{\ImageRightHalfPageCaption\{..\}} | %% \DescribeMacro{\ImageHalfPageRCaption\{..\}} | ||||||
| %% \DescribeMacro{\resetImageRightHalfPageCaption} | %% \DescribeMacro{\resetImageHalfPageRCaption} | ||||||
| %% \DescribeMacro{\ImageRightHalfPage*\{..\}} | %% \DescribeMacro{\ImageHalfPageR*\{..\}} | ||||||
| % | % | ||||||
| %% Right half of image filling page with full bleed. | %% Right half of image filling page with full bleed. | ||||||
| % | % | ||||||
| @ -2742,13 +2821,12 @@ | |||||||
| %% | %% | ||||||
| % XXX TEST... | % XXX TEST... | ||||||
| % XXX do a better default... | % XXX do a better default... | ||||||
| \ResettableMacro{ImageRightHalfPageCaption}[1]{% | \ResettableMacro{ImageHalfPageRCaption}[1]{% | ||||||
| 	\captioncell[bottom, align=flushright]{% | 	\captioncell[bottom, align=flushright]{% | ||||||
| 		\captionformat{#1}}} | 		\captionformat{#1}}} | ||||||
| 
 | 
 | ||||||
| % XXX add nudge/grow support... | \ImagePageTemplate{ImageHalfPageR}{% | ||||||
| \ImagePageTemplate{ImageRightHalfPage}{% | 	\begin{spreadtopages*}[2]{photobook@ImageHalfPageR@cell}% | ||||||
| 	\begin{spreadtopages*}[2]{photobook@ImageRightHalfPage@cell}% |  | ||||||
| 		\imagecell[fill,  | 		\imagecell[fill,  | ||||||
| 			clearance=\clearimage,  | 			clearance=\clearimage,  | ||||||
| 			scale=\imagescale, | 			scale=\imagescale, | ||||||
| @ -2758,7 +2836,7 @@ | |||||||
| 	\end{spreadtopages*}% | 	\end{spreadtopages*}% | ||||||
| 	% | 	% | ||||||
| 	\cleartoleftpage% | 	\cleartoleftpage% | ||||||
| 	\usespreadpage[2]{photobook@ImageRightHalfPage@cell}} | 	\usespreadpage[2]{photobook@ImageHalfPageR@cell}} | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user