diff options
author | Karl Berry <karl@freefriends.org> | 2015-02-04 22:14:06 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-02-04 22:14:06 +0000 |
commit | 22e2fa164b34a0ea2bdc4ffbdcd3eab070bd3876 (patch) | |
tree | 991173e6fb70cf6262fc956ad5c3eb47ae02b860 /Master/texmf-dist/tex | |
parent | ba6a5f77c55f21dbb9baa453c0d98255a00cba1f (diff) |
xcookybooky (4feb15)
git-svn-id: svn://tug.org/texlive/trunk@36212 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/xcookybooky/xcookybooky.cfg | 19 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/xcookybooky/xcookybooky.sty | 555 |
2 files changed, 395 insertions, 179 deletions
diff --git a/Master/texmf-dist/tex/latex/xcookybooky/xcookybooky.cfg b/Master/texmf-dist/tex/latex/xcookybooky/xcookybooky.cfg index ab134ec5d37..352b428e7b2 100644 --- a/Master/texmf-dist/tex/latex/xcookybooky/xcookybooky.cfg +++ b/Master/texmf-dist/tex/latex/xcookybooky/xcookybooky.cfg @@ -7,15 +7,19 @@ %% xcookybooky.dtx (with options: `config') %% \ProvidesFile{xcookybooky.cfg} - [2011/12/29 v1.0 'xcookybooky' configuration] + [2015/02/03 v1.1 'xcookybooky' configuration file] %% Change Layout \setRecipeColors {% recipename, + intro, ing, inghead, prep, prephead, + suggestion, + suggestionhead, + separationgraph, hint, hinthead, hintline, @@ -25,24 +29,28 @@ \setRecipeSizes {% recipename, + intro, ing, inghead, prep, prephead, + suggestion, hint, hinthead } \setRecipeLengths {% + pictureheight, + bigpicturewidth, + smallpicturewidth, + introductionwidth, preparationwidth, - ingredientswidth, - pictureheight + ingredientswidth } -\setRecipenameFont{fjd}{T1}{m}{n} +\setRecipenameFont{cmr}{T1}{m}{n} -%% Translation \setHeadlines {% inghead, @@ -58,6 +66,7 @@ calory, source } + \endinput %% %% End of file `xcookybooky.cfg'. diff --git a/Master/texmf-dist/tex/latex/xcookybooky/xcookybooky.sty b/Master/texmf-dist/tex/latex/xcookybooky/xcookybooky.sty index 73150d82898..0963e9bca8b 100644 --- a/Master/texmf-dist/tex/latex/xcookybooky/xcookybooky.sty +++ b/Master/texmf-dist/tex/latex/xcookybooky/xcookybooky.sty @@ -7,7 +7,7 @@ %% xcookybooky.dtx (with options: `package') %% %% This is a generated file. -%% Copyright (C) 2013 by Sven Harder +%% Copyright (C) 2015 by Sven Harder %% %% This file may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either @@ -20,7 +20,7 @@ %% LaTeX version 2005/12/01 or later. \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{xcookybooky} - [2013/03/10 v1.2 Easy typesetting (potentially long) recipes with pictures] + [2015/02/03 v1.4 Easy typesetting (potentially long) recipes with pictures] \newif\ifHandwrittenFont@required \HandwrittenFont@requiredfalse \DeclareOption{handwritten} @@ -51,13 +51,14 @@ \RequirePackage{tikz} % for creating the lines for the hint \RequirePackage{graphicx} \RequirePackage{xcolor} -\RequirePackage[clock, misc, weather]{ifsym} % Symbolpackage e.g. \Interval, \Wecker etc +\RequirePackage[clock, misc, weather]{ifsym} % Symbol package e.g. \Interval, \Wecker etc \RequirePackage{cookingsymbols} % Cookings symbols e.g. \Oven, \Dish etc \ifHandwrittenFont@required \RequirePackage{emerald} % Handwritten Fonts \fi \RequirePackage{wrapfig} % To wrap the tabular with the ingredients +\RequirePackage{iflang} % detecting the language \RequirePackage{ifthen} \RequirePackage{xkeyval} \RequirePackage{lettrine} % numbering the preparation steps @@ -65,7 +66,8 @@ \RequirePackage{units} \RequirePackage{eso-pic} % for background pictures \RequirePackage{picture} % for modfifying the position of the bg pictures -\RequirePackage{tabularx} % line breaks in tabular +\RequirePackage{tabulary} % line breaks in tabular +\RequirePackage{framed} % frame for the introduction \setlength{\parindent}{0cm} \setlength{\parskip}{2ex plus 0.5ex} @@ -89,26 +91,38 @@ \subsubsection[#1]{#2} } -\define@key{colorManagement}{recipename}[green]{\def\xcb@color@recipename{#1}} -\define@key{colorManagement}{ing}[gray]{\def\xcb@color@ing{#1}} -\define@key{colorManagement}{inghead}[gray]{\def\xcb@color@inghead{#1}} +\providecolor{DarkGreen}{rgb}{0,.5,0} +\providecolor{DarkBlue}{rgb}{0, 0, 0.7} +\providecolor{DarkGray}{rgb}{0.23, 0.23, 0.23} + +\define@key{colorManagement}{recipename}[DarkGreen]{\def\xcb@color@recipename{#1}} +\define@key{colorManagement}{intro}[black]{\def\xcb@color@intro{#1}} +\define@key{colorManagement}{ing}[DarkGray]{\def\xcb@color@ing{#1}} +\define@key{colorManagement}{inghead}[DarkGray]{\def\xcb@color@inghead{#1}} \define@key{colorManagement}{prep}[black]{\def\xcb@color@prep{#1}} \define@key{colorManagement}{prephead}[black]{\def\xcb@color@prephead{#1}} +\define@key{colorManagement}{suggestion}[black]{\def\xcb@color@suggestion{#1}} +\define@key{colorManagement}{suggestionhead}[black]{\def\xcb@color@suggestionhead{#1}} +\define@key{colorManagement}{separationgraph}[black]{\def\xcb@color@separationgraph{#1}} \define@key{colorManagement}{hint}[black]{\def\xcb@color@hint{#1}} \define@key{colorManagement}{hinthead}[red]{\def\xcb@color@hinthead{#1}} \define@key{colorManagement}{hintline}[red]{\def\xcb@color@hintline{#1}} \define@key{colorManagement}{numeration}[red]{\def\xcb@color@numeration{#1}} \savekeys{colorManagement} {% - recipename, % color of recipename - ing, % color of ingredients (text) - inghead, % color of headline of ingredients - prep, % color of preparation (text) - prephead, % color of headline of preparation - hint, % color of hint (text) - hinthead, % color of headline of hint - hintline, % color of lines of hint - numeration % color of numeration (preparation) + recipename, % color of recipename + intro, % color of introduction (text) + ing, % color of ingredients (text) + inghead, % color of headline of ingredients + prep, % color of preparation (text) + prephead, % color of headline of preparation + suggestion, % color of suggestions (text) + suggestionhead, % color of headline of suggestion + separationgraph, % color of graphical separator + hint, % color of hint (text) + hinthead, % color of headline of hint + hintline, % color of lines of hint + numeration % color of numeration (preparation) } \newcommand*{\setRecipeColors}[1] @@ -119,10 +133,14 @@ \setRecipeColors {% initialisation recipename, + intro, ing, inghead, prep, prephead, + suggestion, + suggestionhead, + separationgraph, hint, hinthead, hintline, @@ -130,35 +148,41 @@ } \define@key{sizeManagement}{recipename}[\fontsize{25pt}{30pt}]{\def\xcb@fontsize@recipename{#1}} +\define@key{sizeManagement}{intro}[\normalsize]{\def\xcb@fontsize@intro{#1}} \define@key{sizeManagement}{ing}[\normalsize]{\def\xcb@fontsize@ing{#1}} \define@key{sizeManagement}{inghead}[\normalsize]{\def\xcb@fontsize@inghead{#1}} \define@key{sizeManagement}{prep}[\normalsize]{\def\xcb@fontsize@prep{#1}} \define@key{sizeManagement}{prephead}[\normalsize]{\def\xcb@fontsize@prephead{#1}} +\define@key{sizeManagement}{suggestion}[\normalsize]{\def\xcb@fontsize@suggestion{#1}} \define@key{sizeManagement}{hint}[\normalsize]{\def\xcb@fontsize@hint{#1}} \define@key{sizeManagement}{hinthead}[\Large]{\def\xcb@fontsize@hinthead{#1}} \savekeys{sizeManagement} { - recipename, - ing, - inghead, - prep, - prephead, - hint, - hinthead + recipename, % font size of recipe name + intro, % font size of introduction (text) + ing, % font size of ingredients (text) + inghead, % font size of headline of ingredients + prep, % font size of preparation (text) + prephead, % font size of headline of preparation + suggestion, % font size of suggestion (text) + hint, % font size of hint (text) + hinthead % font size of headline of hint } \newcommand*{\setRecipeSizes}[1] -{ +{% \setkeys{sizeManagement}{#1} } \setRecipeSizes {% initialisation recipename, + intro, ing, inghead, prep, prephead, + suggestion, hint, hinthead } @@ -177,7 +201,7 @@ \selectfont } } -\setRecipenameFont{cmr}{T1}{b}{n} +\setRecipenameFont{\familydefault}{\encodingdefault}{b}{n} \newcounter{step} \setcounter{step}{0} @@ -186,36 +210,23 @@ \color{\xcb@color@numeration} } -\newcommand{\step} -{% - \lettrine - [% - lines=2, - lhang=0, % space into margin, value between 0 and 1 - loversize=0.15, % enlarges the height of the capital - slope=0em, - findent=1em, % gap between capital and intended text - nindent=0em % shifts all intended lines, begining with the second line - ]{\stepcounter{step}\thestep}{}% -} - -\define@key{headlines}{inghead}[Zutaten]{ +\define@key{headlines}{inghead}[Ingredients]{ \def\xcb@name@inghead{\textcolor{\xcb@color@inghead}{\textbf{\xcb@fontsize@inghead{#1}}\ }} } -\define@key{headlines}{prephead}[Zubereitung]{ +\define@key{headlines}{prephead}[Preparation]{ \def\xcb@name@prephead{\textcolor{\xcb@color@prephead}{\textbf{\xcb@fontsize@prephead{#1}}\ }} } -\define@key{headlines}{hinthead}[Tipp:]{ +\define@key{headlines}{hinthead}[Hint]{ \def\xcb@name@hinthead{\textcolor{\xcb@color@hinthead}{\xcb@fontsize@hinthead{#1}}} } -\define@key{headlines}{continuationhead}[Fortsetzung]{\def\xcb@name@continuationhead{#1}} -\define@key{headlines}{continuationfoot}[Fortsetzung auf n\"achster Seite]{\def\xcb@name@continuationfoot{#1}} +\define@key{headlines}{continuationhead}[Continuation]{\def\xcb@name@continuationhead{#1}} +\define@key{headlines}{continuationfoot}[Continuation on next page]{\def\xcb@name@continuationfoot{#1}} \define@key{headlines}{preparationtime}[\fontsize{14.5pt}{10pt}\Gloves]{\def\xcb@name@preparationtime{#1}} \define@key{headlines}{bakingtime}[\fontsize{14.5pt}{10pt}\Oven]{\def\xcb@name@bakingtime{#1}} \define@key{headlines}{bakingtemperature}[\Thermo{4}]{\def\xcb@name@bakingtemperature{#1}} \define@key{headlines}{portion}[\fontsize{14.5pt}{10pt}\Dish]{\def\xcb@name@portion{#1}} -\define@key{headlines}{portionvalue}[Personen]{\def\xcb@name@portionvalue{#1}} -\define@key{headlines}{calory}[Brennwert]{\def\xcb@name@calory{#1}} +\define@key{headlines}{portionvalue}[Portions]{\def\xcb@name@portionvalue{#1}} +\define@key{headlines}{calory}[Calorific value]{\def\xcb@name@calory{#1}} \define@key{headlines}{source}[\PaperPortrait]{\def\xcb@name@source{#1}} \savekeys{headlines} { @@ -252,18 +263,76 @@ source } -\define@key{recipelengths}{preparationwidth}[0.60\textwidth]{\def\xcb@preparationwidth{#1}} -\define@key{recipelengths}{ingredientswidth}[0.35\textwidth]{\def\xcb@ingredientswidth{#1}} +\IfLanguagePatterns{german} +{% German + \setHeadlines + {% translation + inghead = Zutaten, + prephead = Zubereitung, + hinthead = Tipp, + continuationhead = Fortsetzung, + continuationfoot = Fortsetzung auf n\"achster Seite, + portionvalue = Personen, + calory = Brennwert + } +}{} + +\IfLanguagePatterns{english} +{% English + \setHeadlines + {% translation + inghead = Ingredients, + prephead = Preparation, + hinthead = Hint, + continuationhead = Continuation, + continuationfoot = Continuation on next page, + portionvalue = Portions, + calory = Calorific value + } +}{} + +\IfLanguagePatterns{french} +{% French + \setHeadlines + {% translation + inghead = Ingrédients, + prephead = Préparation, + hinthead = Tuyau, + continuationhead = Suite, + continuationfoot = Suite page suivante, + portionvalue = Portions, + calory = Valeur calorifique + } +}{} + +\IfLanguagePatterns{spanish} +{% Spanish + \setHeadlines + {% translation + inghead = Ingredientes, + prephead = Preparación, + hinthead = Soplo, + continuationhead = Continuación, + continuationfoot = Continúa en la página siguiente, + portionvalue = Porción, + calory = Poder calorífico + } +}{} + \define@key{recipelengths}{pictureheight}[6cm]{\def\xcb@pictureheight{#1}} \define@key{recipelengths}{bigpicturewidth}[0.60\textwidth]{\def\xcb@bigpicturewidth{#1}} \define@key{recipelengths}{smallpicturewidth}[0.35\textwidth]{\def\xcb@smallpicturewidth{#1}} +\define@key{recipelengths}{introductionwidth}[\textwidth]{\def\xcb@introductionwidth{#1}} +\define@key{recipelengths}{preparationwidth}[0.60\textwidth]{\def\xcb@preparationwidth{#1}} +\define@key{recipelengths}{ingredientswidth}[0.35\textwidth]{\def\xcb@ingredientswidth{#1}} \savekeys{recipelengths} { - preparationwidth, - ingredientswidth, - pictureheight, - bigpicturewidth, - smallpicturewidth + pictureheight, % height of both pictures + bigpicturewidth, % width of the bigger picture + smallpicturewidth, % width of the smaller picture + introductionwidth, % width of introduction + preparationwidth, % width of preparation + ingredientswidth % width of ingredients } \newcommand*{\setRecipeLengths}[1] @@ -272,46 +341,114 @@ } \setRecipeLengths {% initialisation - preparationwidth, - ingredientswidth, pictureheight, bigpicturewidth, - smallpicturewidth + smallpicturewidth, + introductionwidth, + preparationwidth, + ingredientswidth } -\define@key{picture}{small}[]{ - \def\xcb@picture@small{ - \ifthenelse{\equal{#1}{}} - {% not set => not shown - } - { - \vspace{-0.6cm} - \includegraphics[width=\linewidth, height = \xcb@pictureheight, keepaspectratio]{#1} - } +%% MAIN COMMANDS +\newcommand{\introduction}[1] +{% Introduction before the preparation and ingredients + \def\xcb@introduction + {% + \color{\xcb@color@intro} + \begin{framed} + \xcb@fontsize@intro#1 + \end{framed} } } -\define@key{picture}{smallpicturewidth}[]{\def\xcb@picture@smallwidth{#1}} -\define@key{picture}{bigpicturewidth}[]{\def\xcb@picture@bigwidth{#1}} -\define@key{picture}{big}[]{ - \def\xcb@picture@big{ + +\newcommand*{\graph}[1] +{% + \setkeys{picture}{#1} +} + +\newcommand*{\ingredients}[1] +{% + \def\xcb@ingredients + {% + \xcb@name@inghead + \\[1em] + {\xcb@fontsize@ing\color{\xcb@color@ing} + \begin{tabulary}{\xcb@ingredientswidth}{rL} + #1 + \end{tabulary}} + } +} + +\newcommand{\preparation}[1] +{% + \def\xcb@preparation + {% + \xcb@name@prephead + %\\[4pt] + \xcb@fontsize@prep\color{\xcb@color@prep}#1 + } + \setcounter{step}{0} +} + +\newcommand{\suggestion}[2][] +{% + \g@addto@macro\xcb@suggestion + {% + \xcb@separationgraph{\xcb@color@separationgraph} \ifthenelse{\equal{#1}{}} - {% not set => not shown + {% + {\color{\xcb@color@suggestion}#2} } - { - \vspace{-0.6cm} - \includegraphics[width=\linewidth, height = \xcb@pictureheight, keepaspectratio]{#1} + {% + \textbf{{\color{\xcb@color@suggestionhead}#1}} + + {\color{\xcb@color@suggestion}#2} } } } -\define@key{recipe}{preparationtime}[]{\def\xcb@preparationtime{#1}} -\define@key{recipe}{bakingtime}[]{\def\xcb@bakingtime{#1}} -\define@key{recipe}{bakingtemperature}[]{\def\xcb@bakingtemperature{#1}} -\define@key{recipe}{portion}[]{\def\xcb@portion{#1}} -\define@key{recipe}{calory}[]{\def\xcb@calory{#1}} -\define@key{recipe}{source}[]{\def\xcb@source{#1}} +\newcommand{\hint}[1] +{% + \def\xcb@hint + {% + \pagebreak[1] % begin here a new page, if the space is small + \begin{tikzpicture}[line width = 1.5pt, \xcb@color@hintline] + \useasboundingbox (0,0) -- ++(right:3.5cm) -- ++(up:3mm) -- ++(left:3.5cm) -- cycle; + \draw (-3mm, 0mm) -- ++(right:3.5cm); + \draw (0, 3mm) -- ++(down:2.4cm); + \end{tikzpicture} + + \nopagebreak + + \begingroup % a group for the hint + \leftskip1em + \xcb@name@hinthead + \nopagebreak + + \itshape{\color{\xcb@color@hint}\xcb@fontsize@hint{#1}} + \par + \endgroup + } +} + +%% SUPPORTING COMMANDS +\newcommand{\step} +{% + \lettrine + [% + lines=2, + lhang=0, % space into margin, value between 0 and 1 + loversize=0.15, % enlarges the height of the capital + slope=0em, + findent=1em, % gap between capital and intended text + nindent=0em % shifts all intended lines, begining with the second line + ]{\stepcounter{step}\thestep}{}% +} -\newcommand*{\portion}[2][\xcb@name@portionvalue]{\unit[#2]{#1}} +\newcommand*{\portion}[2][\xcb@name@portionvalue] +{% + \unit[#2]{#1} +} \define@key{bakingtemperature}{fanoven}[]{\def\xcb@bakingtemperature@fanoven{#1}} \define@key{bakingtemperature}{topbottomheat}[]{\def\xcb@bakingtemperature@topbottomheat{#1}} @@ -357,123 +494,178 @@ \xcb@bakingtemperature@gasstove \ {\fontsize{14.5pt}{10pt}\Gasstove}% }% } -\newenvironment{recipe}[2][] + +%% INTERNAL COMMANDS +\newcommand{\xcb@cmd@recipeoverview} { - %% macros - \newcommand*{\graph}[1] - {% - \setkeys{picture}{##1} - } + \begin{tabular}{rl} + \ifthenelse{\equal{\xcb@preparationtime}{}} + {% not set => not shown + } + { + \xcb@name@preparationtime & \xcb@preparationtime\\ + } + \ifthenelse{\equal{\xcb@bakingtime}{}} + {% not set => not shown + } + { + \xcb@name@bakingtime & \xcb@bakingtime\ifthenelse{\equal{\xcb@bakingtemperature}{}} + { + \\ + } + {,\hspace{1em} \xcb@name@bakingtemperature \hspace{1ex} \xcb@bakingtemperature\\ + } + } + \ifthenelse{\equal{\xcb@portion}{}} + {% not set => not shown + } + { + \xcb@name@portion & \xcb@portion\\ + } + \ifthenelse{\equal{\xcb@calory}{}} + {% not set => not shown + } + { + \xcb@name@calory & \xcb@calory\\ + } + \ifthenelse{\equal{\xcb@source}{}} + {% not set => not shown + } + { + \xcb@name@source & \xcb@source + } + \end{tabular} +} + +\newcommand\xcb@cmd@wrapfill +{% Bug fix for wrapfigure package + \par + \ifx\parshape\WF@fudgeparshape + \nobreak + \vskip-\baselineskip + \vskip\c@WF@wrappedlines\baselineskip + \allowbreak + \WFclear + \fi +} - \newcommand*{\ingredients}[1] - {% - \def\xcb@ingredients - {% - \vspace{-1em} % same height of ingredients and preparation - \xcb@name@inghead - %\\[4pt] - \\[1em] - \xcb@fontsize@ing\color{\xcb@color@ing} - \begin{tabularx}{\xcb@ingredientswidth}{rX} - ##1 - \end{tabularx} +\define@key{picture}{small}[]{ + \def\xcb@picture@small{ + \ifthenelse{\equal{#1}{}} + {% not set => not shown + } + { + \vspace{-0.6cm} + \includegraphics[width=\linewidth, height = \xcb@pictureheight, keepaspectratio]{#1} + } + } +} +\define@key{picture}{smallpicturewidth}[]{\def\xcb@picture@smallwidth{#1}} +\define@key{picture}{bigpicturewidth}[]{\def\xcb@picture@bigwidth{#1}} +\define@key{picture}{big}[]{ + \def\xcb@picture@big{ + \ifthenelse{\equal{#1}{}} + {% not set => not shown + } + { + \vspace{-0.6cm} + \includegraphics[width=\linewidth, height = \xcb@pictureheight, keepaspectratio]{#1} } } +} - \newcommand*{\preparation}[1] +\define@key{recipe}{preparationtime}[]{\def\xcb@preparationtime{#1}} +\define@key{recipe}{bakingtime}[]{\def\xcb@bakingtime{#1}} +\define@key{recipe}{bakingtemperature}[]{\def\xcb@bakingtemperature{#1}} +\define@key{recipe}{portion}[]{\def\xcb@portion{#1}} +\define@key{recipe}{calory}[]{\def\xcb@calory{#1}} +\define@key{recipe}{source}[]{\def\xcb@source{#1}} + +\newcommand*{\xcb@separationgraph}[2][1.5] +{% Graphical separator + \begin{center} + \begin{tikzpicture}[scale=#1] + \fill[color=#2] (0,0) -- (-0.2, 0.1) -- (-4, 0) -- (-0.2, -0.1) -- cycle; + \fill[color=#2] (0,0) -- (0.2, 0.1) -- (4, 0) -- (0.2, -0.1) -- cycle; + \fill[color=#2] (0,0) circle (0.1); + \end{tikzpicture} + \end{center} +} + +%% HOOKS +\newcommand*{\pregraph}[1] +{% Hook: entered before the pictures + \def\xcb@hook@pregraph {% - \def\xcb@preparation - {% - \xcb@name@prephead - %\\[4pt] - \xcb@fontsize@prep\color{\xcb@color@prep}##1 - } - \setcounter{step}{0} + \begin{minipage}[T]{\textwidth} + #1 + \vspace{0.6cm} + \end{minipage} } +} - \newcommand*{\hint}[1] +\newcommand*{\pretitle}[1] +{% Hook: entered before the recipe title + \def\xcb@hook@pretitle {% - \def\xcb@hint - {% - \pagebreak[1] % begin here a new page, if the space is small - \begin{tikzpicture}[line width = 1.5pt, \xcb@color@hintline] - \useasboundingbox (0,0) -- ++(right:3.5cm) -- ++(up:3mm) -- ++(left:3.5cm) -- cycle; - \draw (-3mm, 0mm) -- ++(right:3.5cm); - \draw (0, 3mm) -- ++(down:2.4cm); - \end{tikzpicture} + #1 + } +} - \nopagebreak +\newcommand*{\prerecipeoverview}[1] +{% Hook: entered before the recipe overview + \def\xcb@hook@prerecipeoverview + {% + #1 + } +} - \begingroup % a group for the hint - \leftskip1em - \xcb@name@hinthead - \nopagebreak +\newcommand*{\prepreparation}[1] +{% Hook: entered before the preparation (steps) + \def\xcb@hook@prepreparation + {% + #1 + } +} - \itshape\textcolor{\xcb@color@hint}{\xcb@fontsize@hint{##1}} - \par - \endgroup - } +\newcommand*{\postpreparation}[1] +{% Hook: entered after the preparation (steps) + \def\xcb@hook@postpreparation + {% + #1 } +} - \newcommand{\xcb@cmd@recipeoverview} - { - \begin{tabular}{rl} - \ifthenelse{\equal{\xcb@preparationtime}{}} - {% not set => not shown - } - { - \xcb@name@preparationtime & \xcb@preparationtime\\ - } - \ifthenelse{\equal{\xcb@bakingtime}{}} - {% not set => not shown - } - { - \xcb@name@bakingtime & \xcb@bakingtime\ifthenelse{\equal{\xcb@bakingtemperature}{}} - { - \\ - } - {,\hspace{1em} \xcb@name@bakingtemperature \hspace{1ex} \xcb@bakingtemperature\\ - } - } - \ifthenelse{\equal{\xcb@portion}{}} - {% not set => not shown - } - { - \xcb@name@portion & \xcb@portion\\ - } - \ifthenelse{\equal{\xcb@calory}{}} - {% not set => not shown - } - { - \xcb@name@calory & \xcb@calory\\ - } - \ifthenelse{\equal{\xcb@source}{}} - {% not set => not shown - } - { - \xcb@name@source & \xcb@source - } - \end{tabular} +\newcommand*{\preingredients}[1] +{% Hook: entered before the ingredients + \def\xcb@hook@preingredients + {% + #1 } +} - \newcommand\xcb@cmd@wrapfill +\newcommand*{\postingredients}[1] +{% Hook: entered after the ingredients + \def\xcb@hook@postingredients {% - \par - \ifx\parshape\WF@fudgeparshape - \nobreak - \vskip-\baselineskip - \vskip\c@WF@wrappedlines\baselineskip - \allowbreak - \WFclear - \fi + #1 } - %% end of macros +} - % initialisation +\newenvironment{recipe}[2][] +{% initialisation \setkeys{recipe}{preparationtime, bakingtime, bakingtemperature, portion, calory, source} \setkeys{picture}{small, big, smallpicturewidth=\xcb@smallpicturewidth, bigpicturewidth=\xcb@bigpicturewidth} % load the default values - \ingredients{} + \def\xcb@hook@pregraph{} + \def\xcb@hook@pretitle{} + \def\xcb@introduction{} + \def\xcb@hook@prepreparation{} \preparation{} + \def\xcb@hook@postpreparation{} + \def\xcb@hook@preingredients{} + \ingredients{} + \def\xcb@hook@postingredients{} + \def\xcb@suggestion{} \def\xcb@hint{} \def\xcb@recipename{#2} @@ -484,6 +676,7 @@ } {% this part is executed at \end{recipe} %% FIRST BLOCK + \xcb@hook@pregraph \if@twoside \ifodd\arabic{page} \begin{minipage}[T]{\xcb@picture@bigwidth} @@ -513,18 +706,32 @@ \fi %% SECOND BLOCK + \xcb@hook@pretitle \recipesection[\normalsize\xcb@recipename]% {\hspace{-1em}\textcolor{\xcb@color@recipename}{\xcb@font@recipename\xcb@recipename}} \xcb@cmd@recipeoverview + \xcb@introduction + %% THIRD BLOCK \begin{wraptable}{r}{\xcb@ingredientswidth} { + \vspace{-1em} % same height of ingredients and preparation + \xcb@hook@preingredients + \xcb@ingredients + + \xcb@hook@postingredients } \end{wraptable} + \xcb@hook@prepreparation + \xcb@preparation + \xcb@hook@postpreparation + + \xcb@suggestion + \vfill \xcb@cmd@wrapfill |