Dave Jarvis' Repositories

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

Added cover and copyright page (un-themed).

Author liantze <email>
Date 2013-02-11 00:01:22 GMT+0800
Commit 044122d72d43b653896fb28bcacbcea58cb846a5
Parent c64c054
Delta 67 lines added, 11 lines removed, 56-line increase
example-recipe.tex
%\input{theme/Notebook}
+\title{Recipes for People Who Can't Cook}
+\author{}
+\date{}
+
%%% Fonts, colours and header/footer selections:
%%% only ONCE in preamble, for consistency's sake
\begin{document}
\frontmatter
+\makecover[copyrightpage]
\tableofcontents*
recipe-book.cls
-\ifxetex
-\fi
-\ifpdf
+% 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}
-\fi
+\RequirePackage{ccicons}
+%\fi
%%%% Load packages here
\RequirePackage{graphicx}
\RequirePackage[xcolornames,svgnames,dvipsnames]{xcolor}
\RequirePackage[inline]{enumitem}
\RequirePackage{etoolbox}
-% haven't really figured out the xetex part yet. pdflatex only for now.
-\RequirePackage{ifxetex,ifpdf}
\RequirePackage{textcomp,wasysym,marvosym}
\RequirePackage{amssymb}
\RequirePackage{tikz}
\usetikzlibrary{shapes,decorations,decorations.pathmorphing}
\usetikzlibrary{shadows.blur}
\RequirePackage{multicol}
\RequirePackage{afterpage}
\RequirePackage{wallpaper}
\RequirePackage{microtype}
+
+\def\@frontcoverphoto{}
+\newcommand{\frontcoverphoto}[1]{%
+ \def\@frontcoverphoto{#1}
+}
+
+%%% Hook for cover page etc
+% TODO: change this to use key options
+\newcommand{\makecover}[1][]{%
+\begin{titlingpage}
+\ifdefempty{\@frontcoverphoto}{%
+}{%
+ \ThisCenterWallPaper{1}{\@frontcoverphoto}
+}
+\maketitle
+\thispagestyle{empty}
+\ifstrequal{#1}{copyrightpage}{\clearpage\makecrpage}{}
+\end{titlingpage}%
+}
+\newcommand{\makecrpage}{%
+%\begin{titlingpage}
+\mbox{}
+\vfill
+\small
+This recipe selection by \theauthor. \ccbysa (?)\\
+Generated with RecipeZeal (http://recipe-zeal) and \LaTeX\\
+with book theme designs by Lian Tze Lim (http://liantze.penguinattack.org)
+%\end{titlingpage}%
+}
%%% turn off sectional numberings
xsl/latex.xsl
<xsl:value-of select="$preamble" />
<xsl:text>\makeindex&#xa;</xsl:text>
+ <xsl:apply-templates select='book' />
<xsl:text>\begin{document}&#xa;</xsl:text>
+ <xsl:text>\frontmatter&#xa;</xsl:text>
+ <xsl:if test="$bookfrontcover">
+ <xsl:text>\makecover</xsl:text>
+ <xsl:if test="$book-copyright">
+ <xsl:text>[copyrightpage]</xsl:text>
+ </xsl:if>
+ <xsl:text>&#xa;</xsl:text>
+ </xsl:if>
<xsl:if test="$recipe-toc">
- <xsl:text>\frontmatter&#xa;</xsl:text>
<xsl:text>\tableofcontents*&#xa;</xsl:text>
</xsl:if>
<xsl:text>\mainmatter&#xa;</xsl:text>
- <xsl:apply-templates />
+ <xsl:apply-templates select="*[name()!='book']"/>
<xsl:if test="$ingredient-index">
<xsl:text>\printindex&#xa;</xsl:text>
</xsl:if>
<xsl:text>\end{document}&#xa;</xsl:text>
</xsl:template>
<xsl:template match="book">
- <xsl:apply-templates />
+ <xsl:text>\title{</xsl:text>
+ <xsl:apply-templates select="title" mode="escape-capitalize"/>
+ <xsl:text>}&#xa;</xsl:text>
+ <xsl:text>\date{</xsl:text>
+ <xsl:apply-templates select="created" mode="escape-capitalize"/>
+ <xsl:text>}&#xa;</xsl:text>
+ <xsl:text>\author{</xsl:text>
+ <xsl:apply-templates select="author" mode="escape-capitalize"/>
+ <xsl:text>}&#xa;</xsl:text>
+ <xsl:if test="photo[@use='front-cover']">
+ <xsl:text>\frontcoverphoto{</xsl:text>
+ <xsl:apply-templates select="photo[@use='front-cover']/uri" mode="escape"/>
+ <xsl:text>}&#xa;</xsl:text>
+ </xsl:if>
</xsl:template>
<xsl:template match="ingredients[descendant::text()]">
- <xsl:text>\begin{ingredients}</xsl:text>
+ <xsl:text>\begin{ingredients}&#xa;</xsl:text>
<xsl:apply-templates select="@label" />
<xsl:apply-templates select="ingredient"/>
<xsl:template match="directions[descendant::text()]">
- <xsl:text>\begin{instructions}</xsl:text>
+ <xsl:text>\begin{instructions}&#xa;</xsl:text>
<xsl:apply-templates select="@label" />
<xsl:apply-templates select="step" />