mirror of
				https://github.com/flynx/photobook.git
				synced 2025-10-31 19:30:08 +00:00 
			
		
		
		
	removed innerbleed + cleanup tweaking and notes + working on layoutmodes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									3bb9fb87a2
								
							
						
					
					
						commit
						a17efc7025
					
				
							
								
								
									
										152
									
								
								photobook.cls
									
									
									
									
									
								
							
							
						
						
									
										152
									
								
								photobook.cls
									
									
									
									
									
								
							| @ -58,6 +58,7 @@ | |||||||
| %   |               | | %   |               | | ||||||
| %   |               | | %   |               | | ||||||
| %   |               | | %   |               | | ||||||
|  | %   |               | | ||||||
| %   +---------------+ | %   +---------------+ | ||||||
| % | % | ||||||
| % | % | ||||||
| @ -71,33 +72,61 @@ | |||||||
| %   |               .               | | %   |               .               | | ||||||
| %   |               .               | | %   |               .               | | ||||||
| %   |               .               | | %   |               .               | | ||||||
|  | %   |               .               | | ||||||
| %   +---------------+---------------+ | %   +---------------+---------------+ | ||||||
| %	 | %	 | ||||||
| % | % | ||||||
| % - endpaper: | % - cover: | ||||||
| % | % | ||||||
| %       blockwidth          blockwidth | %          blockwidth            blockwidth | ||||||
| %   <--------------->     <---------------> | %       <--------------->     <---------------> | ||||||
| % | %     <-> coverboerdgrow                      <-> coverboerdgrow | ||||||
| %   +---------------++---++---------------+ | %   <-> coverflap                             . <-> coverflap | ||||||
| %   |               ..   ..               | | %   . . .                                     . . . | ||||||
| %   |               ..   ..               | | %   +-------------------++---++-------------------+    --- | ||||||
| %   |               ..   ..               | | %   | + - - - - - - - - ++ - ++ - - - - - - - - + |    --^ coverflap                 | ||||||
| %   |               ..   ..               | | %   | . + - - - - - - - ++ - ++ - - - - - - - + . |    --^ coverboerdgrow   | ||||||
| %   +---------------++---++---------------+ | %   | . .               ..   ..               . . |     ^                   | ||||||
| %                    .   . | %   | . .               ..   ..               . . |     | blockheight       | ||||||
| %                   ^.   .^ spine fold | %   | . .     Back      ..   ..     Front     . . |     |                   | ||||||
| %                    .   . | %   | . .               ..   ..               . . |     |                   | ||||||
| %                    <---> spinewidth | %   | . .               ..   ..               . . |     v                   | ||||||
|  | %   | . + - - - - - - - ++ - ++ - - - - - - - + . |    --v coverboerdgrow   | ||||||
|  | %   | + - - - - - - - - ++ - ++ - - - - - - - - + |    --v coverflap                  | ||||||
|  | %   +-------------------++---++-------------------+    --- | ||||||
|  | %                        .   . | ||||||
|  | %                       ^.   .^ spinefold | ||||||
|  | %                        .   . | ||||||
|  | %                        <---> spinewidth | ||||||
| % | % | ||||||
| % | % | ||||||
| % NOTE: in endpaper and cover modes \innerbleed value is ignored and | % - jacket: (XXX) | ||||||
| %		\bleed is used instead... |  | ||||||
| %		...setting \innerbleed manually mid-document will lead to  |  | ||||||
| %		inconsistent results. |  | ||||||
| % | % | ||||||
| % XXX EXPERIMENTAL... | %   <---> jaketflap/jacketflapback                  <---> jaketflap/jacketflapback | ||||||
| % XXX need to force \innerbleed to be eqal to \bleed... | %   .   .                                           .   . | ||||||
|  | %   .   .     blockwidth            blockwidth      .   . | ||||||
|  | %   .   .  <--------------->     <--------------->  .   . | ||||||
|  | %   .   .<-> coverboerdgrow                      <-> coverboerdgrow | ||||||
|  | %   .   .  .                                     .  .   . | ||||||
|  | %   +---++-----------------++---++-----------------++---+    --- | ||||||
|  | %   |   .. + - - - - - - - ++ - ++ - - - - - - - + ..   |    --^ coverboerdgrow | ||||||
|  | %   |   .. .               ..   ..               . ..   |     ^ | ||||||
|  | %   |   .. .               ..   ..               . ..   |     | blockheight | ||||||
|  | %   |   .. .     Back      ..   ..     Front     . ..   |     | | ||||||
|  | %   |   .. .               ..   ..               . ..   |     | | ||||||
|  | %   |   .. .               ..   ..               . ..   |     v | ||||||
|  | %   |   .. + - - - - - - - ++ - ++ - - - - - - - + ..   |    --v coverboerdgrow | ||||||
|  | %   +---++-----------------++---++-----------------++---+    ---  | ||||||
|  | %       ..                  .   .                  .. | ||||||
|  | %       ^ jacketwrap        .   .                  ^ jacketwrap | ||||||
|  | %                          ^.   .^ spinefold | ||||||
|  | %                           .   . | ||||||
|  | %                           <---> spinewidth | ||||||
|  | % | ||||||
|  | % | ||||||
|  | % 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 | ||||||
| % XXX also need a way to: | % XXX also need a way to: | ||||||
| %			- setup front-cover | %			- setup front-cover | ||||||
| %			- setup pine | %			- setup pine | ||||||
| @ -110,17 +139,40 @@ | |||||||
| %		...I'm leaning towards the later... | %		...I'm leaning towards the later... | ||||||
| % XXX fold/cut marks??? | % XXX fold/cut marks??? | ||||||
| % XXX write all the dimensions to pdf comment... | % XXX write all the dimensions to pdf comment... | ||||||
|  | % XXX EXPERIMENTAL... | ||||||
| \DeclareStringOption[block]{layoutmode}[block] | \DeclareStringOption[block]{layoutmode}[block] | ||||||
| \@DeclareLiteralOptionTo{layoutmode}{block} | \@DeclareLiteralOptionTo{layoutmode}{block} | ||||||
|  | %\@DeclareLiteralOptionTo{layoutmode}{web} | ||||||
| \@DeclareLiteralOptionTo{layoutmode}{endpaper} | \@DeclareLiteralOptionTo{layoutmode}{endpaper} | ||||||
|  | % XXX add overhang... | ||||||
|  | % XXX minght be a good idea to add cover types as separate values and  | ||||||
|  | %		preset defeaults per type, e.g: | ||||||
|  | %			layoutmode=		hardcover	softcover | ||||||
|  | %		should also set:  | ||||||
|  | %			spinefold=		5mm			5mm | ||||||
|  | %			coverwrap=		17mm		0mm | ||||||
|  | %			bleed=			0mm			5mm | ||||||
| \@DeclareLiteralOptionTo{layoutmode}{cover} | \@DeclareLiteralOptionTo{layoutmode}{cover} | ||||||
|  | %\@DeclareLiteralOptionTo{layoutmode}{hardcover} | ||||||
|  | %\@DeclareLiteralOptionTo{layoutmode}{softcover} | ||||||
|  | % XXX add flap sizes... | ||||||
|  | % XXX not implemented... | ||||||
|  | \@DeclareLiteralOptionTo{layoutmode}{jacket} | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| % spine width and spine fold... | % spine width and spine fold... | ||||||
| % | % | ||||||
| % NOTE: this is only used when layoutmode=cover | % NOTE: this is only used when layoutmode=cover | ||||||
| \DeclareStringOption[0]{spinewidth}[0] | \DeclareStringOption[0]{spinewidth}[0] | ||||||
| \DeclareStringOption[0]{spinefold}[0] | \DeclareStringOption[0]{spinefold}[5mm] | ||||||
|  | \DeclareStringOption[0]{coverboerdgrow}[3mm] | ||||||
|  | % XXX defaults should depend on cover type... | ||||||
|  | % XXX not implemented... | ||||||
|  | \DeclareStringOption[0]{coverwrap}[17mm] | ||||||
|  | \DeclareStringOption[0]{jacketwrap}[1mm] | ||||||
|  | \DeclareStringOption[0]{jacketflap}[50mm] | ||||||
|  | \DeclareStringOption{jacketflapfront} | ||||||
|  | \DeclareStringOption{jacketflapback} | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| % pdf layout... | % pdf layout... | ||||||
| @ -137,7 +189,7 @@ | |||||||
| 
 | 
 | ||||||
| % page geometry... | % page geometry... | ||||||
| % | % | ||||||
| %   <---> bleed                                 <---> innerbleed | %   <---> bleed                                 <---> bleed | ||||||
| % | % | ||||||
| %   + - - - - - - - - - - - - - - - - - - - - - + - +   ^ | %   + - - - - - - - - - - - - - - - - - - - - - + - +   ^ | ||||||
| %   .                                           .   .   | bleed | %   .                                           .   .   | bleed | ||||||
| @ -160,13 +212,11 @@ | |||||||
| %       |   <-- textwidth -------------->   .   | | %       |   <-- textwidth -------------->   .   | | ||||||
| %                                               ^ binding line | %                                               ^ binding line | ||||||
| % | % | ||||||
| % NOTE: innerbleed defaults to bleed... |  | ||||||
| % NOTE: if blockwidth/blockheight are set they will force recalculations  | % NOTE: if blockwidth/blockheight are set they will force recalculations  | ||||||
| %		and overriding of the paperwidth/paperheight if they were changed | %		and overriding of the paperwidth/paperheight if they were changed | ||||||
| %		by the user code anywhere between \documentclass[..]{photobook} | %		by the user code anywhere between \documentclass[..]{photobook} | ||||||
| %		and \begin{document}... | %		and \begin{document}... | ||||||
| \DeclareStringOption[5mm]{bleed}[5mm] | \DeclareStringOption[5mm]{bleed}[5mm] | ||||||
| \DeclareStringOption{innerbleed} |  | ||||||
| \DeclareStringOption{blockwidth} | \DeclareStringOption{blockwidth} | ||||||
| \DeclareStringOption{blockheight} | \DeclareStringOption{blockheight} | ||||||
| \DeclareStringOption[0]{bindingoffset}[10mm] | \DeclareStringOption[0]{bindingoffset}[10mm] | ||||||
| @ -200,6 +250,9 @@ | |||||||
| \newlength\spinefold | \newlength\spinefold | ||||||
| \setlength\spinefold{\photobook@spinefold} | \setlength\spinefold{\photobook@spinefold} | ||||||
| 
 | 
 | ||||||
|  | \newlength\coverboerdgrow | ||||||
|  | \setlength\coverboerdgrow{\photobook@coverboerdgrow} | ||||||
|  | 
 | ||||||
| % NOTE: page and bleed block sizes are set via \RecalculatePageLengths | % NOTE: page and bleed block sizes are set via \RecalculatePageLengths | ||||||
| \newlength\blockwidth | \newlength\blockwidth | ||||||
| \newlength\blockheight | \newlength\blockheight | ||||||
| @ -211,14 +264,6 @@ | |||||||
| \newlength\bleed | \newlength\bleed | ||||||
| \setlength\bleed{\photobook@bleed} | \setlength\bleed{\photobook@bleed} | ||||||
| 
 | 
 | ||||||
| \newlength\innerbleed |  | ||||||
| \setlength\innerbleed{ |  | ||||||
| 	\ifx\photobook@innerbleed\empty |  | ||||||
| 		\bleed |  | ||||||
| 	\else |  | ||||||
| 		\photobook@innerbleed |  | ||||||
| 	\fi } |  | ||||||
| 
 |  | ||||||
| \newlength\bindingoffset | \newlength\bindingoffset | ||||||
| \setlength\bindingoffset{\photobook@bindingoffset} | \setlength\bindingoffset{\photobook@bindingoffset} | ||||||
| 
 | 
 | ||||||
| @ -253,22 +298,22 @@ | |||||||
| 			\ifx\photobook@blockwidth\empty | 			\ifx\photobook@blockwidth\empty | ||||||
| 				\dimexpr  | 				\dimexpr  | ||||||
| 					\paperwidth  | 					\paperwidth  | ||||||
| 					- \bleed  | 					- 2\bleed  | ||||||
| 					- \innerbleed \relax | 				\relax | ||||||
| 			\else | 			\else | ||||||
| 				\photobook@blockwidth | 				\photobook@blockwidth | ||||||
| 			\fi}  | 			\fi}  | ||||||
| 		% layout: cover... | 		% layout: cover... | ||||||
| 		\ifdefstring{\layoutmode}{cover}{ | 		\ifdefstring{\layoutmode}{cover}{ | ||||||
| 			\setlength\innerbleed{\bleed} |  | ||||||
| 			\setlength\blockwidth{ | 			\setlength\blockwidth{ | ||||||
| 				\dimexpr  | 				\dimexpr  | ||||||
| 					2\blockwidth  | 					2\blockwidth  | ||||||
| 					+ 2\spinefold | 					+ 2\spinefold | ||||||
| 					+ \spinewidth \relax } }{} | 					+ \spinewidth  | ||||||
|  | 					+ 2\coverboerdgrow | ||||||
|  | 				\relax } }{} | ||||||
| 		% layout: endpaper... | 		% layout: endpaper... | ||||||
| 		\ifdefstring{\layoutmode}{endpaper}{ | 		\ifdefstring{\layoutmode}{endpaper}{ | ||||||
| 			\setlength\innerbleed{\bleed} |  | ||||||
| 			\setlength\blockwidth{ | 			\setlength\blockwidth{ | ||||||
| 				2\blockwidth } }{} | 				2\blockwidth } }{} | ||||||
| 	\fi | 	\fi | ||||||
| @ -278,16 +323,24 @@ | |||||||
| 				\dimexpr \paperheight - 2\bleed \relax | 				\dimexpr \paperheight - 2\bleed \relax | ||||||
| 			\else | 			\else | ||||||
| 				\photobook@blockheight | 				\photobook@blockheight | ||||||
| 			\fi} \fi | 			\fi}  | ||||||
|  | 		% layout: cover... | ||||||
|  | 		\ifdefstring{\layoutmode}{cover}{ | ||||||
|  | 			\setlength\blockheight{ | ||||||
|  | 				\dimexpr  | ||||||
|  | 					\blockheight | ||||||
|  | 					+ 2\coverboerdgrow | ||||||
|  | 				\relax } }{} | ||||||
|  | 	\fi | ||||||
| 	% page with bleeds... | 	% page with bleeds... | ||||||
| 	% NOTE: this is essentially \paperwidth and \paperheight but we do  | 	% NOTE: this is essentially \paperwidth and \paperheight but we do  | ||||||
| 	%		not rely on them being defined -- photobook settings take  | 	%		not rely on them being defined -- photobook settings take  | ||||||
| 	%		priority over \paperwidth and \paperwidth... | 	%		priority over \paperwidth and \paperwidth... | ||||||
| 	\setlength\bleedblockwidth{\dimexpr  | 	\setlength\bleedblockwidth{\dimexpr  | ||||||
| 		\bleed + \blockwidth + \innerbleed  | 			2\bleed + \blockwidth  | ||||||
| 		\relax} | 		\relax} | ||||||
| 	\setlength\bleedblockheight{\dimexpr  | 	\setlength\bleedblockheight{\dimexpr  | ||||||
| 		2\bleed + \blockheight  | 			2\bleed + \blockheight  | ||||||
| 		\relax} } | 		\relax} } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @ -534,6 +587,13 @@ | |||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | %---------------------------------------------------------------------- | ||||||
|  | % Cover/endpaper Templates... | ||||||
|  | 
 | ||||||
|  | % XXX | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| %---------------------------------------------------------------------- | %---------------------------------------------------------------------- | ||||||
| % Page Templates... | % Page Templates... | ||||||
| 
 | 
 | ||||||
| @ -553,13 +613,6 @@ | |||||||
| % XXX broblems with captions: | % XXX broblems with captions: | ||||||
| %		- vertical offset is floating depending on image proportions... | %		- vertical offset is floating depending on image proportions... | ||||||
| %		- width is a bit off... | %		- width is a bit off... | ||||||
| % XXX this does not account for \innerbleed... |  | ||||||
| %		- image:  |  | ||||||
| %			% odd/left  |  | ||||||
| %			\hspace{\dimexpr \bleed - \innerbleed \relax}{\usebox\photobook@imagebox} |  | ||||||
| %			% even/right |  | ||||||
| %			\hspace{\dimexpr -(\bleed - \innerbleed) \relax}{\usebox\photobook@imagebox} |  | ||||||
| %		- do the same for caption... |  | ||||||
| % XXX BUG: vertical alignment falls apart if page head is changed... | % XXX BUG: vertical alignment falls apart if page head is changed... | ||||||
| % XXX replace \ifthenelse\isodd .. with etoolbox equivalent.... | % XXX replace \ifthenelse\isodd .. with etoolbox equivalent.... | ||||||
| %		...this is the only dependency on \RequirePackage{ifthen} | %		...this is the only dependency on \RequirePackage{ifthen} | ||||||
| @ -665,7 +718,6 @@ | |||||||
| 		% XXX this for some reason not at -\bleed horizontally... | 		% XXX this for some reason not at -\bleed horizontally... | ||||||
| 		\AtPageLowerLeft{% | 		\AtPageLowerLeft{% | ||||||
| 			\hspace*{\dimexpr  | 			\hspace*{\dimexpr  | ||||||
| 					% XXX need to set this to bleed or innerbleed depending on page... |  | ||||||
| 					% XXX when \AtPageCenter{ .. }for some reason -\bleed puts  | 					% XXX when \AtPageCenter{ .. }for some reason -\bleed puts  | ||||||
| 					%		the image in the center but adding -0.5\ht\photobook@imagebox  | 					%		the image in the center but adding -0.5\ht\photobook@imagebox  | ||||||
| 					%		to it offsets the image to the left -- scaling????!! | 					%		to it offsets the image to the left -- scaling????!! | ||||||
| @ -966,7 +1018,7 @@ | |||||||
| 					-(\nudgeimageby) | 					-(\nudgeimageby) | ||||||
| 					+#1  | 					+#1  | ||||||
| 					-\blockwidth  | 					-\blockwidth  | ||||||
| 					+\innerbleed  | 					+\bleed  | ||||||
| 				\relax}{ | 				\relax}{ | ||||||
| 			\raisebox{\dimexpr  | 			\raisebox{\dimexpr  | ||||||
| 						#1  | 						#1  | ||||||
| @ -1028,7 +1080,7 @@ | |||||||
| 				+0.5\OFFSETFIX | 				+0.5\OFFSETFIX | ||||||
| 				+(\nudgeimageby) | 				+(\nudgeimageby) | ||||||
| 				+\blockwidth | 				+\blockwidth | ||||||
| 				+\innerbleed | 				+\bleed | ||||||
| 				-\wd\photobook@imagebox \relax}{ | 				-\wd\photobook@imagebox \relax}{ | ||||||
| 			\raisebox{\dimexpr  | 			\raisebox{\dimexpr  | ||||||
| 					#1 + \bleed  | 					#1 + \bleed  | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user