| | \newcommand{\enumeratemarker}[1]{#1.} |
| | \newcommand{\inlinelistmarker}{\makebox[1.5em][c]{\textbullet}} |
| | - |
| | -\newcommand{\equipmentstyle}{leftmargin=*} |
| | -\newcommand{\ingredientsstyle}{label=\textbullet,leftmargin=*} |
| | -\newcommand{\preparationstyle}{label=\textbullet,leftmargin=*} |
| | -\newcommand{\substitutionstyle}{label=\textbullet,leftmargin=*} |
| | -\newcommand{\instructionsstyle}{label={\arabic*. },leftmargin=*} |
| | - |
| | - |
| | -%%%% 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}[2][]{% |
| | - \clearpage% |
| | - \parserecipecitation{#1} |
| | - \color{\maintextcolor}% |
| | - \section{#2} |
| | - \checkinlinecitation |
| | -}{} |
| | - |
| | -\renewcommand{\memsecinfo}[5]{% |
| | - \ifstrequal{#1}{section}{\renewcommand{\recipetitle}{#3}}{} |
| | -} |
| | - |
| | -\AtBeginEnvironment{recipe}{% |
| | - \def\@recipecredittext{} |
| | - \def\@recipelicensetext{} |
| | - \def\@photocredittext{} |
| | - \def\@photolicensetext{} |
| | - \def\citationtext{} |
| | -} |
| | - |
| | -\AtEndEnvironment{recipe}{% |
| | - \ifdefempty{\@recipecredittext}{}{\apptocmd{\citationtext}{\translate{preRecipeCourtesy}\@recipecredittext\ifdefempty{\@recipelicensetext}{}{\@recipelicensetext}\translate{postRecipeCourtesy}}{}{}} |
| | - \ifdefempty{\@photocredittext}{}{\apptocmd{\citationtext}{ \translate{prePhotoCourtesy}\@photocredittext\ifdefempty{\@photolicensetext}{}{\@photolicensetext}\translate{postPhotoCourtesy}}{}{}} |
| | - \iftoggle{footercitations}{% |
| | - \ifdefempty{\citationtext}{}{\blfootnote{\citationtext}} |
| | - }{} |
| | - \iftoggle{endcitations}{% |
| | - \ifdefempty{\citationtext}{}{\leavevmode\xpagenote{\textcolor{\darkhighlight}{\headingfamily\bfseries\recipetitle,}\space\noexpand\hyperlink{page.\thepage}{\thepage}.\enspace\citationtext}} |
| | - }{} |
| | -} |
| | - |
| | -\AfterEndEnvironment{recipe}{% |
| | - % Check if an ad should be inserted |
| | - \ifdef{\recipeAdCount}{ |
| | - \ifnumgreater{\theadvertTotal}{0}{ |
| | - \stepcounter{recipeIdx} |
| | - \pgfmathparse{mod(\therecipeIdx,\recipeAdCount)} |
| | - \pgfmathtruncatemacro{\recIdx}{\pgfmathresult} |
| | - \ifnumequal{\recIdx}{0}{\afterpage{\InsertAd}}{} |
| | - }{} |
| | - }{} |
| | -} |
| | - |
| | -\newcommand{\insetphoto}[2][width=.4\textwidth]{% |
| | - \parsephotocitation{#1} |
| | - \includegraphics[width=\@photowidth]{#2}\par |
| | -} |
| | - |
| | -\newcommand{\fullpagephoto}[2][]{% |
| | - \iftoggle{inlinecitations}{}{\parsephotocitation{#1}} |
| | - \afterpage{\iftoggle{inlinecitations}{\parsephotocitation{#1}}{}% |
| | - \ThisTileWallPaper{\paperwidth}{\paperheight}{#2} |
| | - \iftoggle{clearpn}{\thispagestyle{empty}}{} |
| | - \iftoggle{inlinecitations}{% |
| | - \ifdefempty{\@photocredittext}{}{% |
| | - \begin{tikzpicture}[overlay,remember picture] |
| | - \node[fill=white,fill opacity=.8,text opacity=1,font=\relsize{-1}\headingfamily\itshape, |
| | - anchor=north east,xshift=-.5in,yshift=-.5in] |
| | - at (current page.north east) |
| | - {\translate{prePhotoCourtesy}\@photocredittext\ifdefempty{\@photolicensetext}{}{\@photolicensetext}\translate{postPhotoCourtesy}}; |
| | - \end{tikzpicture} |
| | - } |
| | - }{} |
| | - \mbox{}\clearpage} |
| | -} |
| | - |
| | -\newcommand{\checkfiller}{% |
| | - \iftoggle{print}{% |
| | - \clearpage |
| | - \checkoddpage\strictpagecheck |
| | -% \ifoddpage\ThisTileWallPaper{\paperwidth}{\paperheight}{photo/filler1}\mbox{}\clearpage\fi |
| | - \ifoddpage\InsertAd\fi |
| | - }{} |
| | -} |
| | - |
| | - |
| | -\newcommand{\SpreadWallPaperLeft}[1]{% |
| | - \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}){% |
| | - \parbox[b][\paperheight]{\paperwidth}{% |
| | - \vfill |
| | - \centering |
| | - \includegraphics[width=\paperwidth,height=\paperheight,clip,trim={.5\wd0} 0 0 0]{#1}% |
| | - \vfill |
| | - }}} |
| | - \iftoggle{clearpn}{\thispagestyle{empty}}{} |
| | - \iftoggle{inlinecitations}{% |
| | - \ifdefempty{\@photocredittext}{no}{% |
| | - \begin{tikzpicture}[overlay,remember picture] |
| | - \node[fill=white,fill opacity=.8,text opacity=1,font=\relsize{-1}\headingfamily\itshape, |
| | - anchor=north east,xshift=-.5in,yshift=-.5in] |
| | - at (current page.north east) |
| | - {\translate{prePhotoCourtesy}\@photocredittext\ifdefempty{\@photolicensetext}{}{\@photolicensetext}\translate{postPhotoCourtesy}}; |
| | - \end{tikzpicture} |
| | - } |
| | - }{} |
| | - |
| | -} |
| | - |
| | -\newcommand{\landscapedphoto}[2][]{% |
| | - \parsephotocitation{#1} |
| | - \AddToShipoutPicture*{\put(\LenToUnit{\wpXoffset},\LenToUnit{\wpYoffset}){% |
| | - \parbox[b][\paperheight]{\paperwidth}{% |
| | - \vfill |
| | - \centering |
| | - \includegraphics[width=\paperheight,height=\paperwidth,angle=90]{#2}% |
| | - \vfill |
| | - }}} |
| | - \iftoggle{inlinecitations}{% |
| | - \ifdefempty{\@photocredittext}{}{% |
| | - \begin{tikzpicture}%[overlay,remember picture] |
| | - \node[fill=white,fill opacity=.8,text opacity=1,font=\relsize{-1}\headingfamily\itshape, |
| | - %anchor=north west,%xshift=.5in,yshift=-.5in |
| | - ] |
| | - %at (current page.north) |
| | - {Photo courtesy \@photocredittext\ifdefempty{\@photolicensetext}{}{\@photolicensetext}.}; |
| | - \end{tikzpicture} |
| | - } |
| | - }{} |
| | -} |
| | - |
| | -\newcommand{\preparespread}{% |
| | -\iftoggle{print}{}{% |
| | - \setlength{\paperwidth}{2\paperwidth} |
| | - \eject \pdfpagewidth=\paperwidth |
| | -} |
| | -} |
| | -\newcommand{\cancelspread}{% |
| | -\iftoggle{print}{}{% |
| | - \setlength{\paperwidth}{0.5\paperwidth} |
| | - \eject \pdfpagewidth=\paperwidth |
| | - } |
| | -} |
| | - |
| | -\newcommand{\twopagespreadphoto}[2][]{% |
| | - \iftoggle{inlinecitations}{}{\parsephotocitation{#1}}% |
| | - \iftoggle{print}{% |
| | - \SpreadWallPaperLeft{#2} |
| | - \afterpage{\iftoggle{inlinecitations}{\parsephotocitation{#1}}{} |
| | - \SpreadWallPaperRight{#2} |
| | - \mbox{}\clearpage} |
| | - }{% |
| | - \addtolength{\wpXoffset}{.5\paperwidth} |
| | - \ThisTileWallPaper{\paperwidth}{\paperheight}{#2}% |
| | - \iftoggle{inlinecitations}{% |
| | - \ifdefempty{\@photocredittext}{no}{% |
| | - \begin{tikzpicture}[overlay,remember picture] |
| | - \node[fill=white,fill opacity=.8,text opacity=1,font=\relsize{-1}\headingfamily\itshape, |
| | - anchor=north east,xshift=-.5in,yshift=-.5in] |
| | - at (current page.north east) |
| | - {\translate{prePhotoCourtesy}\@photocredittext\ifdefempty{\@photolicensetext}{}{\@photolicensetext}\translate{postPhotoCourtesy}}; |
| | - \end{tikzpicture} |
| | - } |
| | - }{} |
| | - } |
| | -%%%%%%%%%%% landscaped version %% |
| | -%{\afterpage{\iftoggle{inlinecitations}{\parsephotocitation{#1}}{} |
| | -% \begin{landscape} |
| | -% \thispagestyle{empty} |
| | -% \landscapedphoto[#1]{#2}\mbox{}\clearpage |
| | -% \end{landscape} |
| | -% }} |
| | -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| | -} |
| | - |
| | -\newcommand{\photo}[2][]{% |
| | -\parsephotocitation{#1} |
| | -\ifdefstring{\p@embed}{inset}{\insetphoto[#1]{#2}}{} |
| | -\ifdefstring{\p@embed}{fullpage}{\fullpagephoto[#1]{#2}}{} |
| | -\ifdefstring{\p@embed}{twopagespread}{\twopagespreadphoto[#1]{#2}}{} |
| | -} |
| | - |
| | -\AtBeginDocument{% |
| | - \iftoggle{inlinecitations}{% |
| | - % See http://tex.stackexchange.com/a/68741/226 |
| | - \expandafter\apptocmd\csname\string\insetphoto\endcsname{% |
| | - \ifdefempty{\@photocredittext}{}{\vskip-\afterinsetphotoskip |
| | - {\centering\relsize{-1}\headingfamily\itshape\translate{prePhotoCourtesy}\@photocredittext\ifdefempty{\@photolicensetext}{}{\@photolicensetext}\translate{postPhotoCourtesy}\par} |
| | - \vskip\afterinsetphotoskip |
| | - }% |
| | - }{}{} |
| | - }{} |
| | -} |
| | - |
| | -\newenvironment{equipment}[1][\translate{Equipment}]{% |
| | - \needspace{3\baselineskip} |
| | - \subsection{#1} |
| | - \expandafter\setlist\expandafter{\equipmentstyle}% |
| | - \begin{equipmentlist} |
| | -}{% |
| | - \end{equipmentlist} |
| | -} |
| | - |
| | -\newenvironment{equipmentlist}{% |
| | - \begin{description} |
| | -}{% |
| | - \end{description} |
| | -} |
| | - |
| | -\newcommand{\compactequipment}{% |
| | - \renewenvironment{equipmentlist}{% |
| | - \begin{description*}[mode=unboxed,leftmargin=*,itemjoin=\inlinelistmarker] |
| | - }{% |
| | - \end{description*}. |
| | - } |
| | -} |
| | - |
| | -\newcommand{\normalequipment}{% |
| | - \renewenvironment{equipmentlist}{% |
| | - \begin{description} |
| | - }{% |
| | - \end{description} |
| | - } |
| | -} |
| | - |
| | -\newenvironment{preparation}[1][\translate{Preparation}]{% |
| | - \needspace{3\baselineskip} |
| | - \subsection{#1} |
| | - \expandafter\setlist\expandafter{\preparationstyle}% |
| | - \begin{preparationlist} |
| | -}{% |
| | - \end{preparationlist} |
| | -} |
| | - |
| | -\newenvironment{preparationlist}{% |
| | - \begin{itemize} |
| | -}{% |
| | - \end{itemize} |
| | -} |
| | - |
| | -\newcommand{\normalpreparation}{% |
| | - \renewenvironment{preparationlist}{% |
| | - \begin{itemize} |
| | - }{% |
| | - \end{itemize} |
| | - } |
| | -} |
| | - |
| | -\newcommand{\compactpreparation}{% |
| | - \renewenvironment{preparationlist}{% |
| | - \begin{itemize*}[label={},afterlabel={},itemjoin=\inlinelistmarker] |
| | - }{% |
| | - \end{itemize*} |
| | - } |
| | -} |
| | - |
| | - |
| | -\newenvironment{ingredients}[1][\translate{Ingredients}]{% |
| | - \needspace{3\baselineskip} |
| | - \subsection{#1}% |
| | - \expandafter\setlist\expandafter{\ingredientsstyle}% |
| | - \begin{ingredientlist} |
| | -}{% |
| | - \end{ingredientlist} |
| | -} |
| | - |
| | -\newcommand{\ingred}[3]{% |
| | -\item {#1}\space\notblank{#2}{#2\space}{}{#3} |
| | -} |
| | - |
| | -\newenvironment{ingredientlist}{% |
| | - \renewcommand{\ingred}[3]{\item {##1}\space\notblank{##2}{##2\space}{}{##3}} |
| | - \begin{itemize} |
| | -}{% |
| | - \end{itemize} |
| | -} |
| | - |
| | -\newcommand{\tabularingredients}{% |
| | - \renewcommand{\ingred}[3]{{##1}\space\notblank{##2}{##2}{} & {##3}\\} |
| | - \renewenvironment{ingredientlist}{% |
| | - \begin{tabular}{r l} |
| | - }{% |
| | - \end{tabular} |
| | - } |
| | -} |
| | - |
| | -\newcommand{\compactingredients}{% |
| | - \renewcommand{\ingred}[3]{\item {##1}\space\notblank{##2}{##2\space}{}{##3}} |
| | - \renewenvironment{ingredientlist}{% |
| | - \begin{itemize*}[label={},afterlabel={},itemjoin={;\space},noitemsep] |
| | - }{% |
| | - \end{itemize*}. |
| | - } |
| | -} |
| | - |
| | -\newcommand{\normalingredients}{% |
| | - \renewcommand{\ingred}[3]{\item {##1}\space\notblank{##2}{##2\space}{}{##3}} |
| | - \renewenvironment{ingredientlist}{% |
| | - \begin{itemize} |
| | - }{% |
| | - \end{itemize} |
| | - } |
| | -} |
| | - |
| | -\newenvironment{substitution}[1][\translate{Substitutes}]{% |
| | - \needspace{3\baselineskip} |
| | - \subsection{#1}% |
| | - \expandafter\setlist\expandafter{\substitutionstyle}% |
| | - \begin{substitutionlist} |
| | -}{% |
| | - \end{substitutionlist} |
| | -} |
| | - |
| | -\newenvironment{substitutionlist}{% |
| | - \begin{itemize} |
| | -}{% |
| | - \end{itemize} |
| | -} |
| | - |
| | -\newcommand{\normalinsubstitutions}{% |
| | - \renewenvironment{substitutionlist}{% |
| | - \begin{itemize} |
| | - }{% |
| | - \end{itemize} |
| | - } |
| | -} |
| | - |
| | -\newcommand{\compactinsubstitutions}{% |
| | - \renewenvironment{substitutionlist}{% |
| | - \begin{itemize*}[label={},afterlabel={},itemjoin={;\space},noitemsep] |
| | - }{% |
| | - \end{itemize*}. |
| | +\newcommand{\inlinelistpunct}{;\space} |
| | + |
| | +\newcommand{\equipmentstyle}{leftmargin=*} |
| | +\newcommand{\ingredientsstyle}{label=\textbullet,leftmargin=*} |
| | +\newcommand{\preparationstyle}{label=\textbullet,leftmargin=*} |
| | +\newcommand{\substitutionstyle}{label=\textbullet,leftmargin=*} |
| | +\newcommand{\instructionsstyle}{label={\arabic*. },leftmargin=*} |
| | + |
| | + |
| | +%%%% 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}[2][]{% |
| | + \clearpage% |
| | + \parserecipecitation{#1} |
| | + \color{\maintextcolor}% |
| | + \section{#2} |
| | + \checkinlinecitation |
| | +}{} |
| | + |
| | +\renewcommand{\memsecinfo}[5]{% |
| | + \ifstrequal{#1}{section}{\renewcommand{\recipetitle}{#3}}{} |
| | +} |
| | + |
| | +\AtBeginEnvironment{recipe}{% |
| | + \def\@recipecredittext{} |
| | + \def\@recipelicensetext{} |
| | + \def\@photocredittext{} |
| | + \def\@photolicensetext{} |
| | + \def\citationtext{} |
| | +} |
| | + |
| | +\AtEndEnvironment{recipe}{% |
| | + \ifdefempty{\@recipecredittext}{}{\apptocmd{\citationtext}{\translate{preRecipeCourtesy}\@recipecredittext\ifdefempty{\@recipelicensetext}{}{\@recipelicensetext}\translate{postRecipeCourtesy}}{}{}} |
| | + \ifdefempty{\@photocredittext}{}{\apptocmd{\citationtext}{ \translate{prePhotoCourtesy}\@photocredittext\ifdefempty{\@photolicensetext}{}{\@photolicensetext}\translate{postPhotoCourtesy}}{}{}} |
| | + \iftoggle{footercitations}{% |
| | + \ifdefempty{\citationtext}{}{\blfootnote{\citationtext}} |
| | + }{} |
| | + \iftoggle{endcitations}{% |
| | + \ifdefempty{\citationtext}{}{\leavevmode\xpagenote{\textcolor{\darkhighlight}{\headingfamily\bfseries\recipetitle,}\space\noexpand\hyperlink{page.\thepage}{\thepage}.\enspace\citationtext}} |
| | + }{} |
| | +} |
| | + |
| | +\AfterEndEnvironment{recipe}{% |
| | + % Check if an ad should be inserted |
| | + \ifdef{\recipeAdCount}{ |
| | + \ifnumgreater{\theadvertTotal}{0}{ |
| | + \stepcounter{recipeIdx} |
| | + \pgfmathparse{mod(\therecipeIdx,\recipeAdCount)} |
| | + \pgfmathtruncatemacro{\recIdx}{\pgfmathresult} |
| | + \ifnumequal{\recIdx}{0}{\afterpage{\InsertAd}}{} |
| | + }{} |
| | + }{} |
| | +} |
| | + |
| | +\newcommand{\insetphoto}[2][width=.4\textwidth]{% |
| | + \parsephotocitation{#1} |
| | + \includegraphics[width=\@photowidth]{#2}\par |
| | +} |
| | + |
| | +\newcommand{\fullpagephoto}[2][]{% |
| | + \iftoggle{inlinecitations}{}{\parsephotocitation{#1}} |
| | + \afterpage{\iftoggle{inlinecitations}{\parsephotocitation{#1}}{}% |
| | + \ThisTileWallPaper{\paperwidth}{\paperheight}{#2} |
| | + \iftoggle{clearpn}{\thispagestyle{empty}}{} |
| | + \iftoggle{inlinecitations}{% |
| | + \ifdefempty{\@photocredittext}{}{% |
| | + \begin{tikzpicture}[overlay,remember picture] |
| | + \node[fill=white,fill opacity=.8,text opacity=1,font=\relsize{-1}\headingfamily\itshape, |
| | + anchor=north east,xshift=-.5in,yshift=-.5in] |
| | + at (current page.north east) |
| | + {\translate{prePhotoCourtesy}\@photocredittext\ifdefempty{\@photolicensetext}{}{\@photolicensetext}\translate{postPhotoCourtesy}}; |
| | + \end{tikzpicture} |
| | + } |
| | + }{} |
| | + \mbox{}\clearpage} |
| | +} |
| | + |
| | +\newcommand{\checkfiller}{% |
| | + \iftoggle{print}{% |
| | + \clearpage |
| | + \checkoddpage\strictpagecheck |
| | +% \ifoddpage\ThisTileWallPaper{\paperwidth}{\paperheight}{photo/filler1}\mbox{}\clearpage\fi |
| | + \ifoddpage\InsertAd\fi |
| | + }{} |
| | +} |
| | + |
| | + |
| | +\newcommand{\SpreadWallPaperLeft}[1]{% |
| | + \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}){% |
| | + \parbox[b][\paperheight]{\paperwidth}{% |
| | + \vfill |
| | + \centering |
| | + \includegraphics[width=\paperwidth,height=\paperheight,clip,trim={.5\wd0} 0 0 0]{#1}% |
| | + \vfill |
| | + }}} |
| | + \iftoggle{clearpn}{\thispagestyle{empty}}{} |
| | + \iftoggle{inlinecitations}{% |
| | + \ifdefempty{\@photocredittext}{no}{% |
| | + \begin{tikzpicture}[overlay,remember picture] |
| | + \node[fill=white,fill opacity=.8,text opacity=1,font=\relsize{-1}\headingfamily\itshape, |
| | + anchor=north east,xshift=-.5in,yshift=-.5in] |
| | + at (current page.north east) |
| | + {\translate{prePhotoCourtesy}\@photocredittext\ifdefempty{\@photolicensetext}{}{\@photolicensetext}\translate{postPhotoCourtesy}}; |
| | + \end{tikzpicture} |
| | + } |
| | + }{} |
| | + |
| | +} |
| | + |
| | +\newcommand{\landscapedphoto}[2][]{% |
| | + \parsephotocitation{#1} |
| | + \AddToShipoutPicture*{\put(\LenToUnit{\wpXoffset},\LenToUnit{\wpYoffset}){% |
| | + \parbox[b][\paperheight]{\paperwidth}{% |
| | + \vfill |
| | + \centering |
| | + \includegraphics[width=\paperheight,height=\paperwidth,angle=90]{#2}% |
| | + \vfill |
| | + }}} |
| | + \iftoggle{inlinecitations}{% |
| | + \ifdefempty{\@photocredittext}{}{% |
| | + \begin{tikzpicture}%[overlay,remember picture] |
| | + \node[fill=white,fill opacity=.8,text opacity=1,font=\relsize{-1}\headingfamily\itshape, |
| | + %anchor=north west,%xshift=.5in,yshift=-.5in |
| | + ] |
| | + %at (current page.north) |
| | + {Photo courtesy \@photocredittext\ifdefempty{\@photolicensetext}{}{\@photolicensetext}.}; |
| | + \end{tikzpicture} |
| | + } |
| | + }{} |
| | +} |
| | + |
| | +\newcommand{\preparespread}{% |
| | +\iftoggle{print}{}{% |
| | + \setlength{\paperwidth}{2\paperwidth} |
| | + \eject \pdfpagewidth=\paperwidth |
| | +} |
| | +} |
| | +\newcommand{\cancelspread}{% |
| | +\iftoggle{print}{}{% |
| | + \setlength{\paperwidth}{0.5\paperwidth} |
| | + \eject \pdfpagewidth=\paperwidth |
| | + } |
| | +} |
| | + |
| | +\newcommand{\twopagespreadphoto}[2][]{% |
| | + \iftoggle{inlinecitations}{}{\parsephotocitation{#1}}% |
| | + \iftoggle{print}{% |
| | + \SpreadWallPaperLeft{#2} |
| | + \afterpage{\iftoggle{inlinecitations}{\parsephotocitation{#1}}{} |
| | + \SpreadWallPaperRight{#2} |
| | + \mbox{}\clearpage} |
| | + }{% |
| | + \addtolength{\wpXoffset}{.5\paperwidth} |
| | + \ThisTileWallPaper{\paperwidth}{\paperheight}{#2}% |
| | + \iftoggle{inlinecitations}{% |
| | + \ifdefempty{\@photocredittext}{no}{% |
| | + \begin{tikzpicture}[overlay,remember picture] |
| | + \node[fill=white,fill opacity=.8,text opacity=1,font=\relsize{-1}\headingfamily\itshape, |
| | + anchor=north east,xshift=-.5in,yshift=-.5in] |
| | + at (current page.north east) |
| | + {\translate{prePhotoCourtesy}\@photocredittext\ifdefempty{\@photolicensetext}{}{\@photolicensetext}\translate{postPhotoCourtesy}}; |
| | + \end{tikzpicture} |
| | + } |
| | + }{} |
| | + } |
| | +%%%%%%%%%%% landscaped version %% |
| | +%{\afterpage{\iftoggle{inlinecitations}{\parsephotocitation{#1}}{} |
| | +% \begin{landscape} |
| | +% \thispagestyle{empty} |
| | +% \landscapedphoto[#1]{#2}\mbox{}\clearpage |
| | +% \end{landscape} |
| | +% }} |
| | +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| | +} |
| | + |
| | +\newcommand{\photo}[2][]{% |
| | +\parsephotocitation{#1} |
| | +\ifdefstring{\p@embed}{inset}{\insetphoto[#1]{#2}}{} |
| | +\ifdefstring{\p@embed}{fullpage}{\fullpagephoto[#1]{#2}}{} |
| | +\ifdefstring{\p@embed}{twopagespread}{\twopagespreadphoto[#1]{#2}}{} |
| | +} |
| | + |
| | +\AtBeginDocument{% |
| | + \iftoggle{inlinecitations}{% |
| | + % See http://tex.stackexchange.com/a/68741/226 |
| | + \expandafter\apptocmd\csname\string\insetphoto\endcsname{% |
| | + \ifdefempty{\@photocredittext}{}{\vskip-\afterinsetphotoskip |
| | + {\centering\relsize{-1}\headingfamily\itshape\translate{prePhotoCourtesy}\@photocredittext\ifdefempty{\@photolicensetext}{}{\@photolicensetext}\translate{postPhotoCourtesy}\par} |
| | + \vskip\afterinsetphotoskip |
| | + }% |
| | + }{}{} |
| | + }{} |
| | +} |
| | + |
| | +\newenvironment{equipment}[1][\translate{Equipment}]{% |
| | + \needspace{3\baselineskip} |
| | + \subsection{#1} |
| | + \expandafter\setlist\expandafter{\equipmentstyle}% |
| | + \begin{equipmentlist} |
| | +}{% |
| | + \end{equipmentlist} |
| | +} |
| | + |
| | +\newenvironment{equipmentlist}{% |
| | + \begin{description} |
| | +}{% |
| | + \end{description} |
| | +} |
| | + |
| | +\newcommand{\compactequipment}{% |
| | + \renewenvironment{equipmentlist}{% |
| | + \begin{description*}[mode=unboxed,leftmargin=*,itemjoin=\inlinelistpunct] |
| | + }{% |
| | + \end{description*} |
| | + } |
| | +} |
| | + |
| | +\newcommand{\normalequipment}{% |
| | + \renewenvironment{equipmentlist}{% |
| | + \begin{description} |
| | + }{% |
| | + \end{description} |
| | + } |
| | +} |
| | + |
| | +\newenvironment{preparation}[1][\translate{Preparation}]{% |
| | + \needspace{3\baselineskip} |
| | + \subsection{#1} |
| | + \expandafter\setlist\expandafter{\preparationstyle}% |
| | + \begin{preparationlist} |
| | +}{% |
| | + \end{preparationlist} |
| | +} |
| | + |
| | +\newenvironment{preparationlist}{% |
| | + \begin{itemize} |
| | +}{% |
| | + \end{itemize} |
| | +} |
| | + |
| | +\newcommand{\normalpreparation}{% |
| | + \renewenvironment{preparationlist}{% |
| | + \begin{itemize} |
| | + }{% |
| | + \end{itemize} |
| | + } |
| | +} |
| | + |
| | +\newcommand{\compactpreparation}{% |
| | + \renewenvironment{preparationlist}{% |
| | + \begin{itemize*}[label={},afterlabel={},itemjoin=\inlinelistpunct] |
| | + }{% |
| | + \end{itemize*} |
| | + } |
| | +} |
| | + |
| | + |
| | +\newenvironment{ingredients}[1][\translate{Ingredients}]{% |
| | + \needspace{3\baselineskip} |
| | + \subsection{#1}% |
| | + \expandafter\setlist\expandafter{\ingredientsstyle}% |
| | + \begin{ingredientlist} |
| | +}{% |
| | + \end{ingredientlist} |
| | +} |
| | + |
| | +\newcommand{\ingred}[3]{% |
| | +\item {#1}\space\notblank{#2}{#2\space}{}{#3} |
| | +} |
| | + |
| | +\newenvironment{ingredientlist}{% |
| | + \renewcommand{\ingred}[3]{\item {##1}\space\notblank{##2}{##2\space}{}{##3}} |
| | + \begin{itemize} |
| | +}{% |
| | + \end{itemize} |
| | +} |
| | + |
| | +\newcommand{\tabularingredients}{% |
| | + \renewcommand{\ingred}[3]{{##1}\space\notblank{##2}{##2}{} & {##3}\\} |
| | + \renewenvironment{ingredientlist}{% |
| | + \begin{tabular}{r l} |
| | + }{% |
| | + \end{tabular} |
| | + } |
| | +} |
| | + |
| | +\newcommand{\compactingredients}{% |
| | + \renewcommand{\ingred}[3]{\item {##1}\space\notblank{##2}{##2\space}{}{##3}} |
| | + \renewenvironment{ingredientlist}{% |
| | + \begin{itemize*}[label={},afterlabel={},itemjoin={\inlinelistpunct},noitemsep] |
| | + }{% |
| | + \end{itemize*} |
| | + } |
| | +} |
| | + |
| | +\newcommand{\normalingredients}{% |
| | + \renewcommand{\ingred}[3]{\item {##1}\space\notblank{##2}{##2\space}{}{##3}} |
| | + \renewenvironment{ingredientlist}{% |
| | + \begin{itemize} |
| | + }{% |
| | + \end{itemize} |
| | + } |
| | +} |
| | + |
| | +\newenvironment{substitution}[1][\translate{Substitutes}]{% |
| | + \needspace{3\baselineskip} |
| | + \subsection{#1}% |
| | + \expandafter\setlist\expandafter{\substitutionstyle}% |
| | + \begin{substitutionlist} |
| | +}{% |
| | + \end{substitutionlist} |
| | +} |
| | + |
| | +\newenvironment{substitutionlist}{% |
| | + \begin{itemize} |
| | +}{% |
| | + \end{itemize} |
| | +} |
| | + |
| | +\newcommand{\normalinsubstitutions}{% |
| | + \renewenvironment{substitutionlist}{% |
| | + \begin{itemize} |
| | + }{% |
| | + \end{itemize} |
| | + } |
| | +} |
| | + |
| | +\newcommand{\compactinsubstitutions}{% |
| | + \renewenvironment{substitutionlist}{% |
| | + \begin{itemize*}[label={},afterlabel={},itemjoin={;\space},noitemsep] |
| | + }{% |
| | + \end{itemize*} |
| | } |
| | } |