Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/recipe-books.git

Remove page numbers on full page photos. To re-include them, use \documentclass[fullpagefooter]{recipe-book}.

Author liantze <email>
Date 2013-02-28 23:02:57 GMT+0800
Commit 9ed3097d6901f32f945a774985a96bcce6b4ab7a
Parent b9912ac
recipe-book.cls
\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}}{}
}
theme/Modern.tex
\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/latex.xsl
<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}&#xa;</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>\documentclass[print]{recipe-book}&#xa;</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}&#xa;</xsl:text>
<xsl:text>\usepackage{hyperref}&#xa;</xsl:text>
<xsl:value-of select="$preamble" />
<xsl:apply-templates select="book/overview" mode="book-overview" />
<xsl:if test="$recipe-toc">
- <xsl:text>\tableofcontents*&#xa;</xsl:text>
+ <xsl:text>\cleartoverso\tableofcontents*&#xa;</xsl:text>
</xsl:if>
<xsl:text>\mainmatter&#xa;</xsl:text>
Delta 28 lines added, 15 lines removed, 13-line increase