| Author | liantze <email> |
|---|---|
| Date | 2013-02-28 23:02:57 GMT+0800 |
| Commit | 9ed3097d6901f32f945a774985a96bcce6b4ab7a |
| Parent | b9912ac |
| \newtoggle{print}\togglefalse{print} | ||
| +\newtoggle{clearpn}\toggletrue{clearpn} | ||
| \DeclareOption{print}{\toggletrue{print}} | ||
| +\DeclareOption{fullpagefooter}{\togglefalse{clearpn}} | ||
| \ProcessOptions\relax | ||
| \afterpage{% | ||
| \ThisTileWallPaper{\paperwidth}{\paperheight}{#1} | ||
| + \iftoggle{clearpn}{\thispagestyle{empty}}{} | ||
| \mbox{}\clearpage} | ||
| } | ||
| \newcommand{\checkfiller}{% | ||
| \iftoggle{print}{% | ||
| \clearpage | ||
| \checkoddpage\strictpagecheck | ||
| - \ifoddpage\ThisTileWallPaper{\paperwidth}{\paperheight}{photo/filler1}\mbox{}\clearpage\fi | ||
| +% \ifoddpage\ThisTileWallPaper{\paperwidth}{\paperheight}{photo/filler1}\mbox{}\clearpage\fi | ||
| + \ifoddpage\InsertAd\fi | ||
| }{} | ||
| } | ||
| \newcommand{\photo}[1]{\insetphoto{#1}} | ||
| \newcommand{\SpreadWallPaperLeft}[1]{% | ||
| -\sbox0{\includegraphics{#1}}% | ||
| -\AddToShipoutPicture*{\put(\LenToUnit{\wpXoffset},\LenToUnit{\wpYoffset}){% | ||
| + \sbox0{\includegraphics{#1}}% | ||
| + \AddToShipoutPicture*{\put(\LenToUnit{\wpXoffset},\LenToUnit{\wpYoffset}){% | ||
| \parbox[b][\paperheight]{\paperwidth}{% | ||
| \vfill | ||
| \centering | ||
| \includegraphics[width=\paperwidth,height=\paperheight,clip,trim=0 0 {.5\wd0} 0]{#1}% | ||
| \vfill | ||
| }}} | ||
| +% \iftoggle{clearpn}{\thispagestyle{empty}}{} | ||
| } | ||
| \newcommand{\SpreadWallPaperRight}[1]{% | ||
| -\sbox0{\includegraphics{#1}}% | ||
| -\AddToShipoutPicture*{\put(\LenToUnit{\wpXoffset},\LenToUnit{\wpYoffset}){% | ||
| + \sbox0{\includegraphics{#1}}% | ||
| + \AddToShipoutPicture*{\put(\LenToUnit{\wpXoffset},\LenToUnit{\wpYoffset}){% | ||
| \parbox[b][\paperheight]{\paperwidth}{% | ||
| \vfill | ||
| \centering | ||
| \includegraphics[width=\paperwidth,height=\paperheight,clip,trim={.5\wd0} 0 0 0]{#1}% | ||
| \vfill | ||
| }}} | ||
| + \iftoggle{clearpn}{\thispagestyle{empty}}{} | ||
| } | ||
| \renewcommand{\recipesize}{\Huge} | ||
| -\renewcommand{\recipestyle}{\bfseries\itshape\iftoggle{print}{\checkoddpage\strictpagecheck\ifoddpage\raggedleft\else\raggedright\fi}{\raggedleft}\fullruled} | ||
| +\renewcommand{\recipestyle}{\bfseries\itshape\iftoggle{print}{\checkoddpage\strictpagecheck\ifoddpage\raggedleft\else\raggedright\fi}{\raggedright}\fullruled} | ||
| \renewcommand{\headingsize}{\large} | ||
| \renewcommand{\headingstyle}{\bfseries\halfruled} |
| <xsl:param name="ebook" select="true()" /> | ||
| +<!-- If true, no footer will appear on pages with full page photos. --> | ||
| +<xsl:param name="nofooter" select="true()" /> | ||
| + | ||
| <!-- These will come from the XML... | ||
| <xsl:param name="book-back-cover" select="true()" /> | ||
| --> | ||
| <!-- Keys --> | ||
| <xsl:key name="ingredient-id" match="/recipe-book/ingredients/ingredient" use="@id" /> | ||
| <xsl:key name="recipe-by-category" match="recipe" use="tags/tag[1]" /> | ||
| <xsl:template match="/recipe-book"> | ||
| - <xsl:choose> | ||
| - <xsl:when test="$ebook"> | ||
| - <xsl:text>\documentclass{recipe-book}
</xsl:text> | ||
| - </xsl:when> | ||
| - <xsl:otherwise> | ||
| - <xsl:text>\documentclass[print]{recipe-book}
</xsl:text> | ||
| - </xsl:otherwise> | ||
| - </xsl:choose> | ||
| + <xsl:text>\documentclass</xsl:text> | ||
| + <xsl:if test="not($ebook and $nofooter)"> | ||
| + <xsl:text>[</xsl:text> | ||
| + <xsl:if test="not($ebook)"> | ||
| + <xsl:text>print,</xsl:text> | ||
| + </xsl:if> | ||
| + <xsl:if test="not($nofooter)"> | ||
| + <xsl:text>fullpagefooter,</xsl:text> | ||
| + </xsl:if> | ||
| + <xsl:text>]</xsl:text> | ||
| + </xsl:if> | ||
| + <xsl:text>{recipe-book}
</xsl:text> | ||
| <xsl:text>\usepackage{hyperref}
</xsl:text> | ||
| <xsl:value-of select="$preamble" /> | ||
| <xsl:apply-templates select="book/overview" mode="book-overview" /> | ||
| <xsl:if test="$recipe-toc"> | ||
| - <xsl:text>\tableofcontents*
</xsl:text> | ||
| + <xsl:text>\cleartoverso\tableofcontents*
</xsl:text> | ||
| </xsl:if> | ||
| <xsl:text>\mainmatter
</xsl:text> | ||
| Delta | 28 lines added, 15 lines removed, 13-line increase |
|---|