Dave Jarvis' Repositories

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

Merge branch 'master' of https://bitbucket.org/djarvis/recipe-books

AuthorDave Jarvis <email>
Date2013-02-25 08:32:39 GMT-0800
Commiteeca0bf18674fbf97d3b79147910768bf363c043
Parentfed55d6
list/squares.tex
-\renewcommand{\headingmarker}{\tikz[baseline=-3pt]\node[diamond,draw=none,inner sep=2.25pt,fill=\headingcolor]{};}
+%\renewcommand{\headingmarker}{\tikz[baseline=-3pt]\node[diamond,draw=none,inner sep=2.25pt,fill=\headingcolor]{};}
+\makeatletter
+\renewcommand{\headingmarker}{\setlength{\tmplength}{\f@size pt}\tikz[baseline=-.26\tmplength]\node[diamond,draw=none,inner sep=.19\tmplength,fill=\headingcolor]{};}
+\makeatother
\renewcommand{\itemmarker}{\textcolor{\secondarycolor}{\scriptsize$\blacksquare$}}
\renewcommand{\inlinelistmarker}{\makebox[1.5em][c]{\color{\secondarycolor}\tiny$\blacksquare$}}
photo/echeveria.png
Binary files differ
recipe-book.cls
This book is available under a \href{http://creativecommons.org/licenses/by-sa/3.0/}{Creative Commons Attribution-ShareAlike License}.\\
Generated using \href{http://recipezeal.com}{Recipe Zeal} and \LaTeX.\\
-Theme designs by \href{http://liantze.penguinattack.org}{Lian Tze Lim}.
+Book design and themes by \href{http://liantze.penguinattack.org}{Lian Tze Lim}.
%\end{titlingpage}%
}
%%%% Basic structures, redefine as needed in theme files using titlesec and enumitem.
+\newcommand{\recipecategory}[1]{%
+\clearforchapter
+\formatcategorypage{#1}
+\phantomsection\addcontentsline{toc}{chapter}{#1}
+\clearpage
+}
+
+\newcommand{\formatcategorypage}[1]{%
+\thispagestyle{empty}
+\vspace*{\stretch{1}}
+\begin{center}
+\fontsize{48pt}{50pt}\headingfamily\bfseries\selectfont\color{\recipecolor}#1
+\end{center}
+\vspace*{\stretch{2}}
+}
+
\newenvironment{recipe}[1]{%
\clearpage%
\color{\maintextcolor}%
\section{#1}
}{}
\newcommand{\fullpagephoto}[1]{%
+\ThisTileWallPaper{.7in}{.6in}{photo/echeveria}
\ThisCenterWallPaper{1}{#1}
+\mbox{}\clearpage
}
\newcommand{\insetphoto}[1]{%
\includegraphics[width=.4\textwidth]{#1}\par
+}
+
+\newcommand{\checkfiller}{%
+ \clearpage
+ \checkoddpage\strictpagecheck\ifoddpage\ThisCenterWallPaper{1}{photo/filler1}\mbox{}\clearpage\fi
}
%\newcommand{\lettergroup}[1]{\item{\item\textbf{#1}}}
%\let\lettergroupDefault\lettergroup
-\newcommand\sssubitem{\@idxitem \hspace*{40\p@}}
-\newcommand\sssssubitem{\@idxitem \hspace*{50\p@}}
-\newcommand\sssssssubitem{\@idxitem \hspace*{60\p@}}
+\renewcommand\subitem{\@idxitem }
+\renewcommand\subsubitem{\@idxitem \hspace*{10\p@}}
+\newcommand\sssubitem{\@idxitem \hspace*{20\p@}}
+\newcommand\sssssubitem{\@idxitem \hspace*{30\p@}}
+\newcommand\sssssssubitem{\@idxitem \hspace*{40\p@}}
%% placeholders
theme/Modern.tex
\providecommand{\vhrulefill}[1]{\leavevmode\leaders\hrule\@height#1\hfill \kern\z@}
\makeatother
-%\providecommand{\fullruled}[2][1pt]{#2\vskip-3pt\rule{\linewidth}{#1}}
\providecommand{\fullruled}[2][1pt]{#2\vskip-4pt\vhrulefill{#1}}
\providecommand{\halfruled}[2][.4pt]{\headingmarker\ #2\vskip-6pt\rule{.5\linewidth}{#1}\vskip-4pt}
\end{tikzpicture}
\vspace*{.5in}\par
-\textcolor{\recipecolor}{\sffamily\fontsize{56pt}{58pt}\selectfont\fullruled[2pt]{\thetitle}}\par
+\textcolor{\recipecolor}{\sffamily\fontsize{56pt}{58pt}\selectfont\raggedright\fullruled[2pt]{\thetitle}}\par
\vfill
{\huge\itshape\color{\darkhighlight}A recipe compilation by \theauthor\par}
\patchcommand{\printchaptertitle}{\color{\recipecolor}}{}
\setlength\beforechapskip{-\baselineskip}
+
+\renewcommand{\formatcategorypage}[1]{%
+\thispagestyle{empty}
+\begin{tikzpicture}[overlay,remember picture]
+\fill[\primarycolor,opacity=.5] ([xshift=-.6in]current page.north east) rectangle (current page.south east);
+\draw[\primarycolor,opacity=.5,line width=6pt] ([xshift=-.8in]current page.north east) -- ([xshift=-.8in]current page.south east);
+\end{tikzpicture}
+\vfill
+{\raggedleft%
+\tikz[overlay]\node[font=\fontsize{160pt}{162pt}\itshape\selectfont,opacity=.2,text=\primarycolor,yshift=20pt]{\substring{#1}{1}{1}};
+\fontsize{48pt}{50pt}\headingfamily\bfseries\itshape\selectfont\color{\recipecolor}#1\hspace*{.3in}\par}
+\vskip6pt
+\tikz[overlay,remember picture]\draw[line width=6pt,\primarycolor] (0,0 -| current page.east) -- (0,0 -| current page.west);
+}
\renewcommand{\ovenstyle}{\itshape\par}
leftmargin=*,%
itemsep=1pt,%
- label={\enumeratemarker{\arabic*}}
+ label={\enumeratemarker{\arabic*}},%
+ after*={\vspace{-\topsep}}
}
xsl/latex.xsl
-->
-<!-- -->
-<xsl:key name="preg" match="/recipe-book/ingredients/ingredient" use="@id" />
+<!-- 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:if>
<xsl:text>\mainmatter&#xa;</xsl:text>
+
+ <!--
<xsl:apply-templates select="*[name()!='book']" />
+ -->
+ <!--
+ | "Muenchian Method" as described in
+ | XSLT Cookbook, by Sal Mangano, O'Reilly, pg195
+ +-->
+ <xsl:for-each select="recipe[count(. | key('recipe-by-category',tags/tag[1])[1]) = 1]">
+ <xsl:variable name="current-grouping-key" select="tags/tag[1]"/>
+ <xsl:text>&#xa;\recipecategory{</xsl:text>
+ <xsl:apply-templates select="$current-grouping-key" mode="escape-capitalize"/>
+ <xsl:text>}&#xa;&#xa;</xsl:text>
+ <xsl:variable name="current-group"
+ select="key('recipe-by-category',
+ $current-grouping-key)" />
+ <xsl:for-each select="$current-group">
+ <xsl:apply-templates select="." />
+ </xsl:for-each>
+</xsl:for-each>
+
<xsl:text>\backmatter&#xa;</xsl:text>
<xsl:text>\renewcommand{\clearforchapter}{\newpage}&#xa;</xsl:text>
+-->
<xsl:template match="recipe">
+ <!--
+ | If a facing full-page photo is used, check whether
+ | a filler photo (advert) is required to make up
+ | the page number.
+ +-->
+ <xsl:if test="description/photo[@use='recipe-page']">
+ <xsl:text>\checkfiller&#xa;</xsl:text>
+ </xsl:if>
<xsl:text>\begin{recipe}{</xsl:text>
<xsl:apply-templates select="description/title" />
<xsl:text>}&#xa;</xsl:text>
- <xsl:apply-templates select="description/photo" mode="recipe" />
+ <xsl:apply-templates select="description/photo[@use='recipe-inset']" mode="recipe" />
<xsl:apply-templates />
+ <xsl:apply-templates select="description/photo[@use='recipe-page']" mode="recipe" />
<xsl:text>\end{recipe}&#xa;&#xa;</xsl:text>
</xsl:template>
+
<xsl:template match="photo[@use='front-cover']" mode="book">
<xsl:apply-templates select="uri" mode="book" />
</xsl:template>
<xsl:template match="photo[@use='recipe-inset']" mode="recipe">
<xsl:apply-templates select="uri" mode="recipe-inset" />
+</xsl:template>
+
+<xsl:template match="photo[@use='recipe-page']" mode="recipe">
+ <xsl:apply-templates select="uri" mode="recipe-page" />
</xsl:template>
<xsl:apply-templates />
<xsl:text>}&#xa;</xsl:text>
+</xsl:template>
+
+<xsl:template match="uri" mode="recipe-page">
+ <xsl:text>\afterpage{\fullpagephoto{</xsl:text>
+ <xsl:apply-templates />
+ <xsl:text>}}&#xa;</xsl:text>
</xsl:template>
+
<xsl:template match="description/title">
<xsl:value-of select="@unit" />
<xsl:text>}{</xsl:text>
- <xsl:apply-templates select="key('preg', @id)/@name" />
+ <xsl:apply-templates select="key('ingredient-id', @id)/@name" />
<xsl:text>}%&#xa;</xsl:text>
<!-- Put the ingredients in a categorized list. -->
- <xsl:if test="key('preg',@id)/categories/category">
- <xsl:for-each select="key('preg',@id)/categories/category">
+ <xsl:if test="key('ingredient-id',@id)/categories/category">
+ <xsl:for-each select="key('ingredient-id',@id)/categories/category">
<xsl:text> \index[catingred]{</xsl:text>
<xsl:call-template name="split">
<!-- Put the ingredients in a flat list. -->
<xsl:text> \index[flatingred]{</xsl:text>
- <xsl:apply-templates select="key('preg', @id)/@name" />
+ <xsl:apply-templates select="key('ingredient-id', @id)/@name" />
<xsl:text>}%&#xa;</xsl:text>
</xsl:template>
<xsl:apply-templates select="@condition" mode="prep" />
<xsl:text> the </xsl:text>
- <xsl:apply-templates select="key('preg', @id)/@name" />
+ <xsl:apply-templates select="key('ingredient-id', @id)/@name" />
<xsl:text>.&#xa;</xsl:text>
</xsl:for-each>
Delta100 lines added, 16 lines removed, 84-line increase