| | |
| | \ProvidesClass{recipe-book}[2013/01/14] |
| | -\LoadClass[twoside,11pt]{memoir} |
| | |
| | -%%%% Page Geometries |
| | -\setstocksize{10in}{8in} |
| | -\settrimmedsize{\stockheight}{\stockwidth}{*} |
| | -\setlrmarginsandblock{1.25in}{.75in}{*} |
| | -\setulmarginsandblock{.75in}{1in}{*} |
| | +\RequirePackage{etoolbox} |
| | + |
| | +\newtoggle{ebook}\togglefalse{ebook} |
| | +\DeclareOption{ebook}{\toggletrue{ebook}} |
| | +\ProcessOptions\relax |
| | + |
| | +\iftoggle{ebook}{% |
| | + \LoadClass[oneside,11pt]{memoir} |
| | + \setstocksize{11in}{8.5in} |
| | + \settrimmedsize{\stockheight}{\stockwidth}{*} |
| | + \setlrmarginsandblock{.75in}{.75in}{*} |
| | + \setulmarginsandblock{.75in}{1in}{*} |
| | +}{% |
| | + \LoadClass[twoside,11pt]{memoir} |
| | + \setstocksize{10in}{8in} |
| | + \settrimmedsize{\stockheight}{\stockwidth}{*} |
| | + \setlrmarginsandblock{1.25in}{.75in}{*} |
| | + \setulmarginsandblock{.75in}{1in}{*} |
| | +} |
| | \setlength{\footskip}{5em} |
| | \setlength{\parindent}{0pt} |
| | \checkandfixthelayout |
| | - |
| | |
| | -% haven't really figured out the xetex part yet. pdflatex only for now. |
| | -%\RequirePackage{ifxetex,ifpdf} |
| | -%\ifxetex |
| | -%\fi |
| | -%\ifpdf |
| | \RequirePackage[utf8]{inputenc} |
| | \RequirePackage[T1]{fontenc} |
| | \RequirePackage{mathpazo} |
| | \RequirePackage{avant} |
| | \RequirePackage{needspace} |
| | \RequirePackage{ccicons} |
| | -%\fi |
| | |
| | |
| | %%%% Load packages here |
| | \RequirePackage{graphicx} |
| | \RequirePackage[xcolornames,svgnames,dvipsnames,rgb]{xcolor} |
| | \RequirePackage[inline]{enumitem} |
| | -\RequirePackage{etoolbox} |
| | \RequirePackage{stringstrings} |
| | \RequirePackage{textcomp,wasysym,marvosym} |
 |
| | }{} |
| | }{} |
| | -} |
| | - |
| | - |
| | -\newcommand{\fullpagephoto}[1]{% |
| | -%\ThisTileWallPaper{.7in}{.6in}{photo/echeveria} |
| | -\ThisTileWallPaper{\paperwidth}{\paperheight}{#1} |
| | -\mbox{}\clearpage |
| | } |
| | |
| | \newcommand{\insetphoto}[1]{% |
| | \includegraphics[width=.4\textwidth]{#1}\par |
| | +} |
| | + |
| | +\newcommand{\fullpagephoto}[1]{% |
| | + \iftoggle{ebook}{ |
| | + %% photo will be displayed after instructions, may |
| | + %% not look nice. If possible, the XML itself should |
| | + %% have converted one-page to recipe-inset. |
| | + \vspace*{\baselineskip} |
| | + \insetphoto{#1} |
| | + }{%% \fullpagephoto needs to be given after instructions |
| | + %% to work nice |
| | + \afterpage{% |
| | + \ThisTileWallPaper{\paperwidth}{\paperheight}{#1} |
| | + \mbox{}\clearpage} |
| | + } |
| | } |
| | |
| | \newcommand{\checkfiller}{% |
| | - \clearpage |
| | - \checkoddpage\strictpagecheck |
| | - \ifoddpage\ThisTileWallPaper{\paperwidth}{\paperheight}{photo/filler1}\mbox{}\clearpage\fi |
| | + \iftoggle{ebook}{}{% |
| | + \clearpage |
| | + \checkoddpage\strictpagecheck |
| | + \ifoddpage\ThisTileWallPaper{\paperwidth}{\paperheight}{photo/filler1}\mbox{}\clearpage\fi |
| | + } |
| | } |
| | |
 |
| | |
| | \newcommand{\twopagespreadphoto}[1]{% |
| | -%\clearpage |
| | -%\sbox0{\includegraphics{#1}}% |
| | -\SpreadWallPaperLeft{#1} |
| | -\mbox{}\clearpage |
| | -\afterpage{\SpreadWallPaperRight{#1} |
| | -\mbox{}\clearpage} |
| | + \iftoggle{ebook}{% |
| | + \vspace*{\baselineskip} |
| | + \insetphoto{#1} |
| | + }{% |
| | + \SpreadWallPaperLeft{#1} |
| | + \mbox{}\clearpage |
| | + \afterpage{\SpreadWallPaperRight{#1} |
| | + \mbox{}\clearpage} |
| | + } |
| | } |
| | |