%----------------------------------------------------------------------

\documentclass[
	layoutmode=block,
	% page size...
	blockwidth=240mm, blockheight=220mm,
	bleed=4mm,
	bindingoffset=5mm,
	% image block configuration...
	imageblockwidth=0.98, imageblockheight=0.98,
	imageblockoffsettop=0,
	% misc...
	9pt,final,openany
]{photobook}

\usepackage{lipsum}
\usepackage{ragged2e}


% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

% remove section numbering...
\setcounter{secnumdepth}{0}

\setlength\parindent{0pt}


% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

\edef\TestImage{DSC00403-2}
\edef\TestImageV{DSC00403-2vert}


\newcommand\Chapter[1]{
	\cleartoleftpage%
	\emptypage%
	\chapter{#1}}

\newcommand\Section[1]{
	\cleartoleftpage%
	\section{#1}%
	% XXX PRECLEAR...
	\clearpage}



%----------------------------------------------------------------------
\begin{document}

\Chapter{Page templates}

% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
\Section{ImagePage}

\ImagePage{Caption text}{\TestImage}


% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
\Section{ImagePageClear}

\ImagePageClear{ImagePageClear}{\TestImage}

\ImagePageClearT{ImagePageClearT}{\TestImage}
\ImagePageClearB{ImagePageClearB}{\TestImage}
\ImagePageClearL{ImagePageClearL}{\TestImageV}
\ImagePageClearR{ImagePageClearR}{\TestImageV}


% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
\Section{ImagePageFit}

\ImagePageFit{ImagePageFit}{\TestImage}

\cleartoleftpage
Special case: image that fits vertically will be offset by \verb+\bindingoffset+
\ImagePageFit{ImagePageFit}{\TestImageV}

\ImagePageFitT{ImagePageFitT}{\TestImage}
\ImagePageFitB{ImagePageFitB}{\TestImage}
\ImagePageFitL{ImagePageFitL}{\TestImageV}
\ImagePageFitR{ImagePageFitR}{\TestImageV}


% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
\Section{ImagePageFill}

\ImagePageFill{ImagePageFill}{\TestImage}


% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
\Section{ImageHalfPageL}

\ImageHalfPageL{ImageHalfPageL}{\TestImage}


% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
\Section{ImageHalfPageR}

\ImageHalfPageR{ImageHalfPageR}{\TestImage}


%----------------------------------------------------------------------
\Chapter{Foldouts}

% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
\Section{foldout}

\begin{foldout}
	\ImagePageFill{\PageInfo}{\TestImage}%}
	%
	\begin{foldoutcell}
	\begin{cliptocell}
	\begin{bottomup}
		\lipsum
		\lipsum
		\lipsum
	\end{bottomup}
	\end{cliptocell}
	\end{foldoutcell}
	%
	\begin{foldoutcell}
	\begin{cliptocell}
		\lipsum
		\lipsum
		\lipsum
	\end{cliptocell}
	\end{foldoutcell}
\end{foldout}

\begin{foldout}[in 10cm out 10cm]
	\begin{foldoutcell*}
	\begin{cliptocell}
		\imagecell[fill, right, offsetleft=\bleed]{}{\TestImage}
	\end{cliptocell}
	\end{foldoutcell*}
	%
	\begin{foldoutcell}
		\lipsum
		\lipsum
	\end{foldoutcell}
	%
	\begin{foldoutcell*}[3]
	\begin{cliptocell}
		\imagecell[fill, right]{}{\TestImage}
	\end{cliptocell}
	\end{foldoutcell*}
	%
	\ImagePageFill{\PageInfo}{\TestImage}%}
\end{foldout}



%----------------------------------------------------------------------
\Chapter{Spread templates}

% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
\Section{ImageSpread}
\ImageSpread{ImageSpread}{\TestImage}

\ImageSpreadT{ImageSpreadT}{\TestImage}
\ImageSpreadB{ImageSpreadB}{\TestImage}
\ImageSpreadL{ImageSpreadL}{\TestImage}
\ImageSpreadR{ImageSpreadR}{\TestImage}


% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
\Section{ImageSpreadFit}
\ImageSpreadFit{ImageSpreadFit}{\TestImage}

\ImageSpreadFitT{ImageSpreadFitT}{\TestImage}
\ImageSpreadFitB{ImageSpreadFitB}{\TestImage}
\ImageSpreadFitL{ImageSpreadFitL}{\TestImage}
\ImageSpreadFitR{ImageSpreadFitR}{\TestImage}


% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
\Section{ImageSpreadFill}
\ImageSpreadFill{ImageSpreadFill}{\TestImage}




%----------------------------------------------------------------------
\end{document} %                                    vim:set ts=4 sw=4 :
