Dave Jarvis' Repositories

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

Added commas for testing ingredient preconditions.

Author Dave Jarvis <email>
Date 2013-02-22 22:07:26 GMT-0800
Commit 6f05ca7c636c7369174a60d3784fc5a4546ea335
Parent c9d144b
Delta 549 lines added, 0 lines removed, 549-line increase
example-book.tex
+\documentclass{recipe-book}
+\usepackage{hyperref}
+\usepackage{chemarrow}
+
+% Serif = Linux Libertine; Sans serif = Linux Biolinum
+\renewcommand{\recipefamily}{\sffamily}
+\renewcommand{\headingfamily}{\sffamily}
+\renewcommand{\familydefault}{\rmdefault}
+
+% http://www.linuxlibertine.org/
+\usepackage[lf]{libertine}
+
+% http://www.colourlovers.com/palette/2634592/See_2
+\definecolor[named]{foggy}{HTML}{F5F6CE}
+\definecolor[named]{RosyAlpaca}{HTML}{DBB9A1}
+\definecolor[named]{LoveMeFour}{HTML}{A45F62}
+\definecolor[named]{one}{HTML}{71574B}
+\definecolor[named]{PlataMate}{HTML}{9A957A}
+\definecolor[named]{sky}{HTML}{1921D1}
+
+\renewcommand{\primarycolor}{PlataMate}
+\renewcommand{\secondarycolor}{RosyAlpaca!50}
+\renewcommand{\tertiarycolor}{foggy}
+\renewcommand{\primarycolorcomplement}{white}
+\renewcommand{\secondarycolorcomplement}{black}
+\renewcommand{\tertiarycolorcomplement}{black}
+\renewcommand{\darkhighlight}{one}
+\renewcommand{\brighthighlight}{LoveMeFour}
+\renewcommand{\highlightcolor}{\brighthighlight}
+\renewcommand{\externallinkcolor}{sky}
+\renewcommand{\headingmarker}{\tikz[baseline=-3pt]\node[diamond,draw=none,inner sep=2.25pt,fill=\headingcolor]{};}
+\renewcommand{\itemmarker}{\textcolor{\secondarycolor}{\scriptsize$\blacksquare$}}
+\renewcommand{\inlinelistmarker}{\makebox[1.5em][c]{\color{\secondarycolor}\tiny$\blacksquare$}}
+\renewcommand{\enumeratemarker}[1]{\framedNum{#1}}
+
+\renewenvironment{recipe}[1]{%
+ \clearpage%
+ \color{\maintextcolor}%
+ \raggedcolumns
+ \checkoddpage\strictpagecheck\ifoddpage\RLmulticolcolumns\else\LRmulticolcolumns\fi
+ \begin{multicols*}{2}[\section{#1}]%
+}{%
+ \end{multicols*}%
+}
+
+\renewcommand{\startinstructions}{\columnbreak}
+
+\renewcommand{\photo}[1]{\insetphoto{#1}}
+
+\normalingredients
+
+\makeevenhead{headings}{}{}{}
+\makeoddhead{headings}{}{}{}
+\makeevenfoot{headings}{\framedPage}{}{}
+\makeoddfoot{headings}{}{}{\framedPage}
+\makeevenfoot{plain}{\framedPage}{}{}
+\makeoddfoot{plain}{}{}{\framedPage}
+% Lian Tze LIM
+% http://liantze.penguinattack.org/
+% 16 January 2013
+%
+% Layout inspiration: &quot;100 Recipes from Japanese Cooking&quot;
+% Authors: Hata Koichiro and Kondo Kazuki
+% Publisher: Kodansha Books
+% ISBN: 978-4770020796
+
+\providecommand{\fullruled}[2][1pt]{#2\vskip-3pt\rule{\linewidth}{#1}}
+\providecommand{\halfruled}[2][.4pt]{\headingmarker\ #2\vskip-6pt\rule{.5\linewidth}{#1}\vskip-3pt}
+
+%%%% Text-only cover
+\renewcommand{\maketitle}{%
+\begin{tikzpicture}[overlay,remember picture]
+\fill[\primarycolor] ([xshift=-.5in]current page.north east) rectangle (current page.south east);
+\draw[\primarycolor,line width=6pt] ([xshift=-.65in]current page.north east) -- ([xshift=-.65in]current page.south east);
+\end{tikzpicture}
+\vspace*{.5in}\par
+\textcolor{\recipecolor}{\sffamily\fontsize{56pt}{58pt}\selectfont\fullruled[2pt]{\thetitle}}\par
+\vfill
+{\huge\itshape\color{\darkhighlight}A recipe compilation by \theauthor\par}
+}
+
+\setcolsepandrule{3em}{6pt}
+\renewcommand{\columnseprulecolor}{\color{\tertiarycolor}}
+
+\chapterstyle{bianchi}
+\patchcommand{\printchaptertitle}{\color{\recipecolor}}{}
+
+\renewcommand{\recipesize}{\Huge}
+\renewcommand{\recipestyle}{\bfseries\itshape\checkoddpage\strictpagecheck\ifoddpage\raggedleft\else\raggedright\fi\fullruled}
+\renewcommand{\headingsize}{\large}
+\renewcommand{\headingstyle}{\bfseries\halfruled}
+
+\renewcommand{\ovenstyle}{\itshape\par}
+
+\renewcommand{\ingredientsstyle}{%
+ nosep,%
+ label=\itemmarker,%
+ leftmargin=*
+}
+
+\renewcommand{\equipmentstyle}{%
+ mode=unboxed,%
+ leftmargin=*,%
+ itemjoin=\inlinelistmarker,
+ noitemsep
+}
+
+\renewcommand{\instructionsstyle}{%
+ leftmargin=*,%
+ itemsep=1pt,%
+ label={\enumeratemarker{\arabic*}}
+}
+
+\renewcommand{\insetphoto}[1]{%
+ \includegraphics[width=\linewidth]{#1}\par\bigskip
+}
+% PDF hyperlink style and configuration
+\hypersetup{
+ % Show bookmarks bar?
+ bookmarks=true,
+ % Non-Latin characters in Acrobat&#039;s bookmarks
+ unicode=true,
+ % Show Acrobat&#039;s toolbar?
+ pdftoolbar=true,
+ % Show Acrobat&#039;s menu?
+ pdfmenubar=true,
+ % Window fit to page when opened
+ pdffitwindow=false,
+ % Fit the width of the page to the window
+ pdfstartview={FitH},
+ % TODO: Title
+ %pdftitle={Recipe Title},
+ % TODO: author
+ %pdfauthor={Recipe Book Author},
+ % subject of the document
+ pdfsubject={Recipes},
+ % Creator of the document
+ pdfcreator={LianTze Lim},
+ % Producer of the document
+ pdfproducer={pdflatex},
+ % TODO: List of keywords
+ pdfkeywords={recipe},
+ % Links in new window
+ pdfnewwindow=true,
+ % false: boxed links; true: colored links
+ colorlinks=true,
+ % Color of internal links
+ linkcolor=\primarycolor,
+ % Color of links to bibliography
+ citecolor=black,
+ % Color of file links
+ filecolor=black,
+ % Color of external links
+ urlcolor=\externallinkcolor,
+ % No border around links
+ pdfborder={0 0 0}
+}
+\makeindex[flatingred]
+\makeindex[catingred]
+\title{Reddit's Recipes}
+\date{2013-02-12}
+\author{Dave Jarvis}
+\frontcoverphoto{/tmp/latex/4/4bcfb10d5029fe91c553a6cbdb3144f8.png}
+\begin{document}
+\frontmatter
+\makecover[copyrightpage]
+\tableofcontents*
+\mainmatter
+\begin{recipe}{Pizza Dough}
+\insetphoto{/tmp/latex/4/abcfb6ff8d0a390532af92904db4fbfa.jpg}
+\begin{equipment}
+ \item[Bakeware] Bowl
+ \item[Electric] Mixer
+\end{equipment}
+
+\begin{ingredients}
+[Ingredients]
+ \ingred{6.5}{cup}{bread flour}
+\index[catingred]{bread!bread flour}
+\index[catingred]{seed $\to$ grain $\to$ wheat $\to$ flour!bread flour}
+\index[flatingred]{bread flour}
+ \ingred{2}{teaspoon}{yeast}
+\index[catingred]{fungi $\to$ yeast!yeast}
+\index[flatingred]{yeast}
+ \ingred{3.25}{cup}{cold water}
+\index[catingred]{water!cold water}
+\index[flatingred]{cold water}
+ \ingred{6}{tablespoon}{olive oil}
+\index[catingred]{oil!olive oil}
+\index[flatingred]{olive oil}
+ \ingred{2--3}{teaspoon}{salt sugar}
+\index[flatingred]{sugar}
+\end{ingredients}
+
+\startinstructions
+
+\begin{instructions}
+[Instructions]
+ \item Mix yeast, sugar and salt together with a cup of water.
+ \item Put 5 cups of flour in mixer.
+ \item Add yeast mixture, olive oil and water.
+ \item Start mixing.
+ \item Add remaining flour until you get a moist ball of dough.
+ \item Do not put to much flour in because the dough will get too dry.
+ \item Knead dough for around 10 minutes.
+ \item Leave it in the mixer and let the dough hook do the trick.
+ \item Cut the dough ball into 8 individual balls.
+ \item Coat each ball with more olive oil, put them in a bowl and let them rise over night in the fridge.
+ \item Take them out of the fridge an hour prior to cooking.
+ \item Take 3 or 4 minutes to cook depending on toppings.
+\end{instructions}
+
+\end{recipe}
+
+\begin{recipe}{Ramen With Shiitake Mushroom Base}
+\insetphoto{/tmp/latex/4/68102d2d73303a676c9537aba9b48497.jpg}
+\begin{equipment}
+ \item[Cookware] Pot
+\end{equipment}
+
+\begin{ingredients}
+[Vegetables]
+ \ingred{1}{}{white onion}
+\index[flatingred]{white onion}
+ \ingred{5}{}{chianti mushroom}
+\index[catingred]{fungi $\to$ mushroom!chianti mushroom}
+\index[flatingred]{chianti mushroom}
+ \ingred{1}{}{garlic clove}
+\index[flatingred]{garlic clove}
+ \ingred{1}{cup}{water}
+\index[catingred]{water!water}
+\index[flatingred]{water}
+ \ingred{1}{}{carrot}
+\index[catingred]{vegetable!carrot}
+\index[flatingred]{carrot}
+ \ingred{2}{}{dried shiitake mushroom}
+\index[catingred]{fungi $\to$ mushroom!dried shiitake mushroom}
+\index[flatingred]{dried shiitake mushroom}
+ \ingred{1}{teaspoon}{sesame seed}
+\index[catingred]{seed!sesame seed}
+\index[flatingred]{sesame seed}
+ \ingred{1}{tablespoon}{sesame oil}
+\index[catingred]{oil!sesame oil}
+\index[flatingred]{sesame oil}
+ \ingred{1}{tablespoon}{chili oil}
+\index[catingred]{oil!chili oil}
+\index[flatingred]{chili oil}
+ \ingred{1}{tablespoon}{ginger}
+\index[catingred]{spice!ginger}
+\index[flatingred]{ginger}
+\end{ingredients}
+
+\begin{ingredients}
+[Broth]
+ \ingred{1}{tablespoon}{red miso}
+\index[catingred]{vegetable $\to$ legume!red miso}
+\index[flatingred]{red miso}
+ \ingred{1}{tablespoon}{white miso}
+\index[catingred]{vegetable $\to$ legume!white miso}
+\index[flatingred]{white miso}
+ \ingred{9}{cup}{cold water}
+\index[catingred]{water!cold water}
+\index[flatingred]{cold water}
+ \ingred{1}{package}{ramen noodle}
+\index[flatingred]{ramen noodle}
+\end{ingredients}
+
+\startinstructions
+
+\begin{instructions}
+[Vegetables]
+ \item Add onion, chianti mushrooms, and garlic to a pot of water.
+ \item Add salt and pepper to taste.
+ \item Cover and cook on medium heat for two minutes.
+ \item Add carrots, dried shiitake mushrooms, sesame seeds, sesame oil, and chili oil.
+ \item Cook for 10 minutes.
+ \item Combine ginger and both miso, then add them to the mix.
+ \item Cook for one to two minutes.
+ \item Pour 9 cups of cold water.
+ \item Bring to a boil.
+ \item Let simmer for two hours.
+\end{instructions}
+
+\begin{instructions}
+[Noodles]
+ \item Drain the vegetables and press to make a broth.
+ \item Boil broth with noodles and add toppings.
+\end{instructions}
+
+\end{recipe}
+
+\begin{recipe}{Candied Grapefruit Peel}
+\insetphoto{/tmp/latex/4/b1ede6618a139a7d0902b54155a7dcd4.jpg}
+\begin{equipment}
+ \item[Bakeware] Bowl
+ \item[Cookware] Pot
+\end{equipment}
+
+\begin{ingredients}
+[Ingredients]
+ \ingred{2}{cup}{sugar}
+\index[flatingred]{sugar}
+ \ingred{2}{cup}{water}
+\index[catingred]{water!water}
+\index[flatingred]{water}
+ \ingred{10}{}{peel,quarter grapefruit}
+\index[catingred]{fruit $\to$ citrus!grapefruit}
+\index[flatingred]{grapefruit}
+\end{ingredients}
+
+\startinstructions
+
+\begin{instructions}
+[Instructions]
+ \item Cut the fruit away from the peel.
+ \item Peel into slivers, approximately a centimeter wide.
+ \item Put sliced peels in cooking pot.
+ \item Add sugar and enough water to cover the peels.
+ \item Boil for a few hours until peels are translucent.
+ \item Cool in pot.
+ \item Roll in a bowl of granulated sugar when cool enough to handle yet still tacky.
+ \item Serve on fresh waxed paper.
+\end{instructions}
+
+\end{recipe}
+
+\begin{recipe}{Basic Guacamole}
+\insetphoto{/tmp/latex/4/2d11e535f831c86bbf00385b11b3208f.jpg}
+\begin{ingredients}
+[Ingredients]
+ \ingred{3--4}{}{avocado}
+\index[catingred]{fruit!avocado}
+\index[flatingred]{avocado}
+ \ingred{1}{}{dice onion}
+\index[flatingred]{onion}
+ \ingred{1}{}{mince garlic clove}
+\index[flatingred]{garlic clove}
+ \ingred{1}{}{chop tomato}
+\index[catingred]{fruit!tomato}
+\index[flatingred]{tomato}
+ \ingred{1}{teaspoon}{lime juice}
+\index[catingred]{fruit $\to$ citrus!lime juice}
+\index[flatingred]{lime juice}
+\end{ingredients}
+
+\startinstructions
+
+\begin{instructions}
+[Instructions]
+ \item Add salt and pepper to taste.
+ \item Combine and mash.
+\end{instructions}
+
+\end{recipe}
+
+\backmatter
+\renewcommand{\clearforchapter}{\newpage}
+\renewcommand{\indexname}{Ingredients in Alphabetic Order}
+\printindex[flatingred]
+\renewcommand{\indexname}{Ingredients by Categories}
+\printindex[catingred]
+\end{document}
example-book.xml
+<?xml version="1.0" standalone="yes"?>
+<recipe-book>
+ <book>
+ <title>Reddit's Recipes</title>
+ <author>Dave Jarvis</author>
+ <isbn/>
+ <created format="YYYY-MM-DD">2013-02-12</created>
+ <photo use="front-cover">
+ <uri>http://i.imgur.com/YlsIHBT.png</uri>
+ </photo>
+ </book>
+ <recipe>
+ <description>
+ <title>Pizza Dough</title>
+ <photo use="recipe-inset">
+ <uri>http://static.flickr.com/3005/2950536388_c7795e9af9_b.jpg</uri>
+ </photo>
+ </description>
+ <preparation/>
+ <equipment>
+ <bakeware>
+ <object id="2">bowl</object>
+ </bakeware>
+ <cookware/>
+ <kitchenware/>
+ <electric>
+ <object id="1">mixer</object>
+ </electric>
+ <miscellaneous/>
+ <utensils/>
+ </equipment>
+ <ingredients id="1" label="ingredients">
+ <ingredient id="1" min-quantity="6.5" unit="cup" condition="" optional="false">bread flour</ingredient>
+ <ingredient id="2" min-quantity="2" unit="teaspoon" condition="" optional="false">yeast</ingredient>
+ <ingredient id="3" min-quantity="3.25" unit="cup" condition="" optional="false">cold water</ingredient>
+ <ingredient id="4" min-quantity="6" unit="tablespoon" condition="" optional="false">olive oil</ingredient>
+ <ingredient id="5" min-quantity="2" max-quantity="3" unit="teaspoon" condition="salt" optional="false">sugar</ingredient>
+ </ingredients>
+ <directions/>
+ <directions label="instructions">
+ <step action="mix" min-time="1" seq="1">yeast, sugar and salt together with a cup of water</step>
+ <step action="put" min-time="1" seq="2">5 cups of flour in mixer</step>
+ <step action="add" min-time="1" seq="3">yeast mixture, olive oil and water</step>
+ <step action="start" min-time="1" seq="4">mixing</step>
+ <step action="add" min-time="1" seq="5">remaining flour until you get a moist ball of dough</step>
+ <step action="do" min-time="1" seq="6">not put to much flour in because the dough will get too dry</step>
+ <step action="knead" min-time="1" seq="7">dough for around 10 minutes</step>
+ <step action="leave" min-time="1" seq="8">it in the mixer and let the dough hook do the trick</step>
+ <step action="cut" min-time="1" seq="9">the dough ball into 8 individual balls</step>
+ <step action="coat" min-time="1" seq="10">each ball with more olive oil, put them in a bowl and let them rise over night in the fridge</step>
+ <step action="take" min-time="1" seq="11">them out of the fridge an hour prior to cooking</step>
+ <step action="take" min-time="1" seq="12">3 or 4 minutes to cook depending on toppings</step>
+ </directions>
+ <tags>
+ <tag category="type" sequence="6">pizza</tag>
+ </tags>
+ </recipe>
+ <recipe>
+ <description>
+ <title>Ramen With Shiitake Mushroom Base</title>
+ <photo use="recipe-inset">
+ <uri>http://static.flickr.com/7110/6878257218_19a31691df_h.jpg</uri>
+ </photo>
+ </description>
+ <preparation/>
+ <equipment>
+ <bakeware/>
+ <cookware>
+ <object id="1">pot</object>
+ </cookware>
+ <kitchenware/>
+ <electric/>
+ <miscellaneous/>
+ <utensils/>
+ </equipment>
+ <ingredients id="1" label="vegetables">
+ <ingredient id="1" min-quantity="1" condition="" optional="false">white onion</ingredient>
+ <ingredient id="2" min-quantity="5" condition="" optional="false">chianti mushroom</ingredient>
+ <ingredient id="3" min-quantity="1" condition="" optional="false">garlic clove</ingredient>
+ <ingredient id="4" min-quantity="1" unit="cup" condition="" optional="false">water</ingredient>
+ <ingredient id="5" min-quantity="1" condition="" optional="false">carrot</ingredient>
+ <ingredient id="6" min-quantity="2" condition="" optional="false">dried shiitake mushroom</ingredient>
+ <ingredient id="7" min-quantity="1" unit="teaspoon" condition="" optional="false">sesame seed</ingredient>
+ <ingredient id="8" min-quantity="1" unit="tablespoon" condition="" optional="false">sesame oil</ingredient>
+ <ingredient id="9" min-quantity="1" unit="tablespoon" condition="" optional="false">chili oil</ingredient>
+ <ingredient id="10" min-quantity="1" unit="tablespoon" condition="" optional="false">ginger</ingredient>
+ </ingredients>
+ <ingredients id="2" label="broth">
+ <ingredient id="11" min-quantity="1" unit="tablespoon" condition="" optional="false">red miso</ingredient>
+ <ingredient id="12" min-quantity="1" unit="tablespoon" condition="" optional="false">white miso</ingredient>
+ <ingredient id="13" min-quantity="9" unit="cup" condition="" optional="false">cold water</ingredient>
+ <ingredient id="14" min-quantity="1" unit="package" condition="" optional="false">ramen noodle</ingredient>
+ </ingredients>
+ <directions/>
+ <directions label="vegetables">
+ <step action="add" min-time="1" seq="1">onion, chianti mushrooms, and garlic to a pot of water</step>
+ <step action="add" min-time="1" seq="2">salt and pepper to taste</step>
+ <step action="cover" min-time="1" seq="3">and cook on medium heat for two minutes</step>
+ <step action="add" min-time="1" seq="4">carrots, dried shiitake mushrooms, sesame seeds, sesame oil, and chili oil</step>
+ <step action="cook" min-time="1" seq="5">for 10 minutes</step>
+ <step action="combine" min-time="1" seq="6">ginger and both miso, then add them to the mix</step>
+ <step action="cook" min-time="1" seq="7">for one to two minutes</step>
+ <step action="pour" min-time="1" seq="8">9 cups of cold water</step>
+ <step action="bring" min-time="1" seq="9">to a boil</step>
+ <step action="let" min-time="1" seq="10">simmer for two hours</step>
+ </directions>
+ <directions label="noodles">
+ <step action="drain" min-time="1" seq="11">the vegetables and press to make a broth</step>
+ <step action="boil" min-time="1" seq="12">broth with noodles and add toppings</step>
+ </directions>
+ <tags>
+ <tag category="type" sequence="6">soup</tag>
+ </tags>
+ </recipe>
+ <recipe>
+ <description>
+ <title>Candied Grapefruit Peel</title>
+ <photo use="recipe-inset">
+ <uri>http://static.flickr.com/2399/2231161820_cee7e9d100_b.jpg</uri>
+ </photo>
+ </description>
+ <preparation/>
+ <equipment>
+ <bakeware>
+ <object id="2">bowl</object>
+ </bakeware>
+ <cookware>
+ <object id="1">pot</object>
+ </cookware>
+ <kitchenware/>
+ <electric/>
+ <miscellaneous/>
+ <utensils/>
+ </equipment>
+ <ingredients id="1" label="ingredients">
+ <ingredient id="1" min-quantity="2" unit="cup" condition="" optional="false">sugar</ingredient>
+ <ingredient id="2" min-quantity="2" unit="cup" condition="" optional="false">water</ingredient>
+ <ingredient id="3" min-quantity="10" condition="peel,quarter,mince" optional="false">grapefruit</ingredient>
+ </ingredients>
+ <directions/>
+ <directions label="instructions">
+ <step action="cut" min-time="1" seq="1">the fruit away from the peel</step>
+ <step action="peel" min-time="1" seq="2">into slivers, approximately a centimeter wide</step>
+ <step action="put" min-time="1" seq="3">sliced peels in cooking pot</step>
+ <step action="add" min-time="1" seq="4">sugar and enough water to cover the peels</step>
+ <step action="boil" min-time="1" seq="5">for a few hours until peels are translucent</step>
+ <step action="cool" min-time="1" seq="6">in pot</step>
+ <step action="roll" min-time="1" seq="7">in a bowl of granulated sugar when cool enough to handle yet still tacky</step>
+ <step action="serve" min-time="1" seq="8">on fresh waxed paper</step>
+ </directions>
+ <tags>
+ <tag category="type" sequence="6">candy</tag>
+ </tags>
+ </recipe>
+ <recipe>
+ <description>
+ <title>Basic Guacamole</title>
+ <photo use="recipe-inset">
+ <uri>http://static.flickr.com/2794/4135509624_df3329d4fb_z.jpg?zz=1</uri>
+ </photo>
+ </description>
+ <preparation/>
+ <equipment>
+ <bakeware/>
+ <cookware/>
+ <kitchenware/>
+ <electric/>
+ <miscellaneous/>
+ <utensils/>
+ </equipment>
+ <ingredients id="1" label="ingredients">
+ <ingredient id="1" min-quantity="3" max-quantity="4" condition="" optional="false">avocado</ingredient>
+ <ingredient id="2" min-quantity="1" condition="dice" optional="false">onion</ingredient>
+ <ingredient id="3" min-quantity="1" condition="mince" optional="false">garlic clove</ingredient>
+ <ingredient id="4" min-quantity="1" condition="chop" optional="false">tomato</ingredient>
+ <ingredient id="5" min-quantity="1" unit="teaspoon" condition="" optional="false">lime juice</ingredient>
+ </ingredients>
+ <directions/>
+ <directions label="instructions">
+ <step action="add" min-time="1" seq="1">salt and pepper to taste</step>
+ <step action="combine" min-time="1" seq="2">and mash</step>
+ </directions>
+ <tags>
+ <tag category="type" sequence="6">condiment</tag>
+ </tags>
+ </recipe>
+</recipe-book>