diff options
author | Karl Berry <karl@freefriends.org> | 2014-06-27 22:02:22 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-06-27 22:02:22 +0000 |
commit | 27475d0962b08c48ad7b8b994507a7563b7830dc (patch) | |
tree | b140e0d329608907cd60e9bf76181a8c6a990e55 | |
parent | 7e0271fe9b567db0c855288f5a8591c3ba4ab033 (diff) |
cuisine (27jun14)
git-svn-id: svn://tug.org/texlive/trunk@34453 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/cuisine/cuisine.pdf | bin | 92648 -> 257398 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/cuisine/cuisine.dtx | 457 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/cuisine/cuisine.sty | 182 |
3 files changed, 478 insertions, 161 deletions
diff --git a/Master/texmf-dist/doc/latex/cuisine/cuisine.pdf b/Master/texmf-dist/doc/latex/cuisine/cuisine.pdf Binary files differindex 6811fa87caa..db46c86b33e 100644 --- a/Master/texmf-dist/doc/latex/cuisine/cuisine.pdf +++ b/Master/texmf-dist/doc/latex/cuisine/cuisine.pdf diff --git a/Master/texmf-dist/source/latex/cuisine/cuisine.dtx b/Master/texmf-dist/source/latex/cuisine/cuisine.dtx index 1b38b7a03a9..e68a15601bd 100644 --- a/Master/texmf-dist/source/latex/cuisine/cuisine.dtx +++ b/Master/texmf-dist/source/latex/cuisine/cuisine.dtx @@ -2,7 +2,7 @@ %% %% Recipe typesetting package `cuisine' by Ben Cohen. %% cuisine.dtx -%% Copyright 2000 Ben Cohen +%% Copyright 2000-2002, 2014 Ben Cohen % % This program may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.2 @@ -14,16 +14,16 @@ % % This program consists of the files cuisine.dtx and cuisine.ins % -% $Id: cuisine.dtx,v 1.73 2000/08/01 00:16:15 bjc23 Exp bjc23 $ +% $Id: cuisine.dtx,v 1.105 2014/06/26 20:12:05 ben Exp ben $ % ------------------------------------------------ % %<*driver> \documentclass{ltxdoc} -\usepackage{cuisine} +\usepackage[nonumber]{cuisine} \GetFileInfo{cuisine.sty} % defines \filename, \filedate, \fileversion, % \fileinfo from cuisine.sty \begin{document} - \def\myemailaddress{\texttt{benc@cus.org.uk}} + \def\myemailaddress{\texttt{ben\_c@tiscali.co.uk}} \title{The \texttt{cuisine} package} \author{Ben Cohen} \date{\filedate, \fileversion} @@ -35,7 +35,7 @@ % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% \CheckSum{549} +% \CheckSum{739} % % \begin{abstract} % This package provides an environment for typesetting recipes in steps @@ -46,9 +46,9 @@ % \MakeShortVerb{\|} % \section{Introduction} % There appear to be two styles of typesetting recipes in general use. The -% more common (at least in recipe books in the UK) +% more common (at least in recipe books in the U.K.) % is where the ingredients appear at the top above the method, -% like in the class |macros/latex/contrib/other/recipe|. Another +% as in the class |macros/latex/contrib/other/recipe|. Another % way is to have each ingredient next to the method step in which it appears, % as in the package |macros/latex/contrib/supported/cooking|; % the |cuisine| package also uses this style, but closer to the format in @@ -63,15 +63,21 @@ % recipe title. (This is the % default.) The recipe \emph{steps} will always be numbered. % \item{|nonumber|}\ \ Recipes will not be numbered. -% \item{|index|}\ \ Recipe titles will be written to the contents for the +% \item{|index|}\ \ Recipe titles will be written to the index for the % document. -% \item{|noindex|}\ \ Recipe titles will not be written to the document contents. +% \item{|noindex|}\ \ Recipe titles will not be written to the document +% index. +% (This is the default.) +% \item{|contents|}\ \ Recipe titles will be written to the contents for the +% document. +% \item{|nocontents|}\ \ Recipe titles will not be written to the document +% contents. % (This is the default.) % \end{itemize} % You will need the package |nicefrac|; % it comes % with current versions of te\TeX\ and is also -% available from CTAN as part of the |units| package in +% available from CTAN as part of the package |units| in % |macros/latex/|\hskip0cm|contrib/supported/|\hskip0cm|units|. % % @@ -85,7 +91,7 @@ % |\begin{recipe}{|\textit{Title}|}|% % |{|\textit{Number of servings}|}|% % |{|\textit{Preparation time}|}| -% \\\dots\\|\end{recipe}| +% \\$\vdots$\\|\end{recipe}| % \end{quote} % There is no reason why the descriptive fields cannot be used for other % things (such as the number of calories). @@ -119,16 +125,40 @@ % \end{quote} % % \medskip +% \DescribeMacro{\Ingredient} +% \DescribeMacro{\Ing} +% There is an alternative way to specify ingredients using a single +% description for both the quantity and the ingredient, as follows: +% \begin{quote} +% |\Ingredient{|\textit{Ingredient and quantity}|}| +% \end{quote} +% This can be used where describing awkward descriptions of units. It would +% also be preferable if you simply don't like the appearance of separating +% units from ingredients as required by |\ingredient|. (My taste has +% apparently changed over the last decade and a half!) For example: +% \begin{quote} +% |\Ingredient{zest and juice of 2 lemons}|\\ +% |\Ingredient{Worcestershire sauce, to taste}|\\ +% \end{quote} +% +% +% \medskip % \DescribeMacro{\fr} % Within the recipe you can use |\fr| to typeset fractions using % |\fr12| to get \nicefrac12, or |\fr{11}{12}| to typeset \nicefrac{11}{12}. % If the numerator or denominator of the fraction is more than one digit long -% then you will need to enclose it in braces otherwise they are optional. +% then you will need to enclose it in braces (otherwise they are optional). % % \DescribeMacro{\degrees} % \DescribeMacro{\0} +% \DescribeMacro{\X} +% \DescribeMacro{\%} % A degree symbol can be obtained using |\degrees| or the shorter form |\0|; % for example |120\0| gives 120${}^\circ$. +% A times symbol, ${}\times{}$, can be obtained using |\X|. +% As is usual with \LaTeX, to obtain a percent sign, \%, you must use |\%| +% since |%| on its own starts a comment. +% % % \section{More advanced usage} % The |cuisine| package has been designed so that it is easy to vary the @@ -144,8 +174,8 @@ % \LaTeX\ commands for changing the page layout. It is used as follows: % \begin{quote} % |\RecipeWidths{|\textit{Total recipe width}|}|% -% |{|\textit{Recipe number width}|}|% % |{|\textit{Number of servings width}|}|% +% |{|\textit{Step number width}|}|% % |{|\textit{Ingredient width}|}|% % |{|\textit{Quantity width}|}|% % |{|\textit{Units width}|}| @@ -168,10 +198,11 @@ % |\newpage| ends the current step (as for |\newstep|) but also tells the % environment that the next step will appear on % the next page. +% It is not normally necessary to use this command since page breaking after +% each method step will be done automatically by \LaTeX\ as necessary. % Page breaks can only % occur between method steps; method steps will not be split across pages. -% It is not normally necessary to use this command since page breaking after -% each step will be done automatically by \LaTeX\ as necessary. +% (Consequently, it may be advisable to keep method steps fairly short.) % % \medskip % \DescribeMacro{\freeform} @@ -179,6 +210,21 @@ % width of the method, use the |\freeform| command. This is equivalent to % |\noalign| in tables. Freeform text is not given a step number. % +% \medskip +% The recipe environment has an optional first parameter with which you can +% assign a label to a recipe. +% \begin{quote} +% |\begin{recipe}[|\textit{Label}|]{|\textit{Title}|}|% +% |{|\textit{Servings}|}|% +% |{|\textit{Preparation time}|}| +% \\$\vdots$\\|\end{recipe}| +% \end{quote} +% |\pageref| and |\ref| then refer to the recipe page number +% and recipe number respectively of the recipe with that label. For example, +% the label in the recipe below will make |\ref{Zabaglione}| give recipe +% number \ref{Zabaglione}. (Note that you cannot use |\label| for this +% purpose within the environment because it breaks the formatting.) +% % \section{Fonts} % The fonts used in the different parts of a recipe can be altered by % changing the definition of the following macros; this should be done @@ -207,7 +253,7 @@ % there been text before the first ingredient, that text would become the first % step and the heating instruction would be the second step.) The fourth % |\ingredient| signals the end of the method text and starts a new step. The -% final |\end{recipe}| finishes that step. +% final |\end{recipe}| finishes that step. % \medskip % % \begin{small}\noindent @@ -235,16 +281,38 @@ % Add the remaining eggs and whisk again. Cook at 220\0C % for about 1 hour. % \end{recipe} +% +% \bigskip +% The recipe below is the same but using the single-argument |\Ingredient| +% command. As you can see, the alignment is different from that of +% |\ingredient| and mixing them probably won't produce a pleasing output. +% If you are using only |\Ingredient| then the ingredients column can probably +% be made narrower (remember that this is still the sum of the quantity, unit +% and ingredient widths). +% \begin{recipe}{Yorkshire Pudding}{4 portions}{1\fr12 hours} +% \Ingredient{\fr12 pt milk} +% \Ingredient{2 oz butter} +% \Ingredient{5 oz self-raising flour} +% Heat the milk and butter until nearly boiling. Add flour and +% allow to seeth over. +% \Ingredient{3 eggs} +% \Ingredient{salt and pepper, to taste} +% Add the remaining eggs and whisk again. Cook at 220\0C +% for about 1 hour. +% \end{recipe} % +% \bigskip +% % \subsection{A more complex example} % We can change the widths of the columns using, for example, % \begin{quote} -% |\RecipeWidths{.75\textwidth}{0.5cm}{3cm}{1.75cm}{.75cm}{.75cm}| +% |\RecipeWidths{.75\textwidth}{3cm}{0.5cm}{1.75cm}{.75cm}{.75cm}| % \end{quote} % \noindent and the |small| environment to produce a different layout. % We can also change the fonts, for example: % \begin{quote} % |\renewcommand*{\recipetitlefont}{\large\bfseries\sffamily}|\\ +% |\renewcommand*{\recipenumberfont}{\large\bfseries\sffamily}|\\ % |\renewcommand*{\recipequantityfont}{\sffamily\bfseries}|\\ % |\renewcommand*{\recipeunitfont}{\sffamily}|\\ % |\renewcommand*{\recipeingredientfont}{\sffamily}|\\ @@ -254,12 +322,13 @@ % The example below demostrates the |\newstep| and |\newpage| commands, and % also how to use |\freeform| to create freeform text. |\freeform| can also % be used to create rules in the same way as when using |\noalign| in tables. -% In this case, recipe numbering has been turned off, and the |small| -% environment is being used. +% In this case, recipe numbering has been turned on, and the |small| +% environment is being used. Note the label declaration +% ``Zabaglione''. % % \medskip % \begin{small}\noindent -% |\begin{recipe}{Zabaglione alla Marsala}{4 Portions}{\fr12 hour}|\\ +% |\begin{recipe}[Zabaglione]{Zabaglione alla Marsala}{4 Portions}{\fr12 hour}|\\ % |\freeform This is a well-known Italian recipe which is |\\ % |great for piling on the calories.|\\ % |\ingredient[6]{}{egg yolks}|\\ @@ -293,14 +362,16 @@ % \medskip % \begin{center} % \renewcommand*{\recipetitlefont}{\large\bfseries\sffamily} +% \renewcommand*{\recipenumberfont}{\large\bfseries\sffamily} % \renewcommand*{\recipequantityfont}{\sffamily\bfseries} % \renewcommand*{\recipeunitfont}{\sffamily} % \renewcommand*{\recipeingredientfont}{\sffamily} % \renewcommand*{\recipefreeformfont}{\itshape} -% \RecipeWidths{.75\textwidth}{0.5cm}{3cm}{1.75cm}{.75cm}{.75cm} -% \makeatletter\numb@ringfalse\makeatother ^^A Cheap trick +% \RecipeWidths{.75\textwidth}{3cm}{0.5cm}{1.75cm}{.75cm}{.75cm} +% \makeatletter\numb@ringtrue\makeatother ^^A Cheap trick +% \ResetRecipeCounter % -% \begin{recipe}{Zabaglione alla Marsala}{4 Portions}{\fr12 hour} +% \begin{recipe}[Zabaglione]{Zabaglione alla Marsala}{4 Portions}{\fr12 hour} % \freeform This is a well-known Italian recipe which is % great for piling on the calories. % \ingredient[6]{}{egg yolks} @@ -335,23 +406,38 @@ % % \section{Bugs, Issues, Features, \dots} % \begin{itemize} -% \item{Vertical spacing of the boxes: the ingredients are not uniformly -% spaced and nor are the method steps. I currently -% have no idea how to solve this problem. (It is better than it was before I -% added a few extra |\strut|s but if you compare the baselines of the -% ingedients to the adjacent method baselines, they are still not all properly -% aligned.)} -% \item{Vertical alignment of the recipe title: see |\r@cipetitle| on page -% \pageref{rectitlealign}.} -% \item{Support for dual sets of quantities, for example using a command like -% \verb|\ingredient{1}{oz}{25}{g}{butter}|. This could be used where two -% systems of measurement are used or for different numbers of servings. The -% display would then have to have two extra columns or else (more likely) -% there would have to be an option to select which one to display.} +% \item{Method steps can't be split across pages. This means you can get +% lots of empty white space at the bottom of pages, especially if you have +% long methods.} +% \item{There may be alignment problems if the recipe fonts differ much in +% height.} +% \item{Formatting doesn't work very well when the ingredient quantity is +% too wide for its box.} +% \item{There is no support for dual sets of quantities, for example where two +% systems of measurement are used or for different numbers of servings. +% You can write \verb|\ingredient{<4 oz>/<100 g>}{butter}|, or use +% |\Ingredient| but I don't think implementing commands such as +% \verb|\ingredient[1]{oz}[25]{g}{butter}| would be worthwhile.} % \end{itemize} % Please e-mail me at \myemailaddress\ if you can help find or solve any % problems with this package. % +% \section{Change History} +% \begin{small} +% \begin{itemize} +% \item[\sl v0.5]Written---release on CTAN. +% \item[\sl v0.6]Fixed a couple of vertical alignment problems. +% Labelling of recipes for |\ref|. |\X| (times) macro. +% Added different index and contents options, and corrected a +% bug that sometimes gave the wrong page number. +% If |recipe|'s |#4| is empty, don't leave a blank line. +% The step number width can be changed but the recipe number +% width varies. +% \item[\sl v0.7]Added the |\Ingredient| command for single-argument +% ingredients. +% \end{itemize} +% \end{small} +% % \StopEventually{} % \newpage % \setlength{\parindent}{0cm} @@ -360,7 +446,7 @@ % The package declaration follows the standard form. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{cuisine}[2000/08/01 v0.5 recipe typesetting] +\ProvidesPackage{cuisine}[2014/06/26 v0.7 recipe typesetting] % \end{macrocode} % % We use the |nicefrac| package for ``nice'' fractions. @@ -405,6 +491,12 @@ \newif\ifnumb@ring % \end{macrocode} % +% |ifc@ntentsing| determines whether we are +% writing the recipes to an contents file or not. +% \begin{macrocode} +\newif\ifc@ntentsing +% \end{macrocode} +% % |ifind@xing| determines whether we are % writing the recipes to an index file or not. % \begin{macrocode} @@ -429,7 +521,7 @@ % % The following are, respectively, the widths of the recipe number box, the % recipe title box, the recipe number-of-servings box, and the total of the -% recipe title and number-of-servings boxes. +% recipe title and number-of-servings boxes. % \begin{macrocode} \newlength{\R@cipeNumberWidth} \newlength{\R@cipeTitleWidth} @@ -442,6 +534,13 @@ \newlength{\R@cipeOutdent} % \end{macrocode} % +% These are the horizontal spaces between the quantity and units, and between +% the unit and the ingredient. +% \begin{macrocode} +\newlength{\R@cipeIngQUSpace} +\newlength{\R@cipeIngUISpace} +% \end{macrocode} +% % These are the vertical distances for the recipe title-to-rule adjustments % (usually negative). % \begin{macrocode} @@ -458,6 +557,7 @@ \newlength{\R@cipeQandUWidth} \newlength{\R@cipeIandUWidth} \newlength{\R@cipeIQUWidth} +\newlength{\R@cipeSingleIngWidth} % \end{macrocode} % % |\R@cipeMethodWidth| is the width of the method text. @@ -465,8 +565,10 @@ \newlength{\R@cipeMethodWidth} % \end{macrocode} % -% |\R@cipeStepWidth| is the width of everything but the step number. +% |\St@pNumberWidth| is the width of the step number and |\R@cipeStepWidth| is +% the width of everything within a step. % \begin{macrocode} +\newlength{\St@pNumberWidth} \newlength{\R@cipeStepWidth} % \end{macrocode} % @@ -476,16 +578,16 @@ % \begin{macro}{\R@cipeMethodWidths} % |\R@cipeMethodWidths| is to set the widths of the boxes/columns used in the % recipe steps. -% There are three parameters: |#1| is the ingredient width, -% |#2| the quantity width, |#3| the units width. -% The other lengths below are deduced -% from these and |\R@cipeMethodWidth|. +% There are four parameters: |#1| is the step number width, |#2| is the +% ingredient width, |#3| the quantity width, |#4| the units width. +% The other lengths below are deduced from these and |\R@cipeMethodWidth|. % The |0.5cm| values are to leave a little space between the columns. % \begin{macrocode} -\DeclareRobustCommand*{\R@cipeMethodWidths}[3]{% - \setlength{\R@cipeIngredientWidth}{#1}% - \setlength{\R@cipeQuantityWidth}{#2}% - \setlength{\R@cipeUnitsWidth}{#3}% +\DeclareRobustCommand*{\R@cipeMethodWidths}[4]{% + \setlength{\St@pNumberWidth}{#1}% + \setlength{\R@cipeIngredientWidth}{#2}% + \setlength{\R@cipeQuantityWidth}{#3}% + \setlength{\R@cipeUnitsWidth}{#4}% \setlength{\R@cipeQandUWidth}{\R@cipeQuantityWidth}% \addtolength{\R@cipeQandUWidth}{\R@cipeUnitsWidth}% \setlength{\R@cipeIQUWidth}{\R@cipeQandUWidth}% @@ -494,17 +596,21 @@ \setlength{\R@cipeIandUWidth}{\R@cipeIQUWidth}% \addtolength{\R@cipeIandUWidth}{-\R@cipeQuantityWidth}% \setlength{\R@cipeStepWidth}{\R@cipeWidth}% - \addtolength{\R@cipeStepWidth}{-\R@cipeNumberWidth}% + \addtolength{\R@cipeStepWidth}{-\St@pNumberWidth}% \setlength{\R@cipeMethodWidth}{\R@cipeStepWidth}% \addtolength{\R@cipeMethodWidth}{-\R@cipeIngredientWidth}% \addtolength{\R@cipeMethodWidth}{-\R@cipeQandUWidth}% \addtolength{\R@cipeMethodWidth}{-0.5cm}% + \setlength{\R@cipeSingleIngWidth}{\R@cipeIQUWidth}% % \end{macrocode} % Allow for the ingredient paragraph outdenting. % \begin{macrocode} \addtolength{\R@cipeIngredientWidth}{-\R@cipeOutdent} \addtolength{\R@cipeUnitsWidth}{-\R@cipeOutdent} \addtolength{\R@cipeQandUWidth}{-\R@cipeOutdent} + \addtolength{\R@cipeSingleIngWidth}{-\R@cipeOutdent} + \addtolength{\R@cipeSingleIngWidth}{-\R@cipeIngQUSpace} + \addtolength{\R@cipeSingleIngWidth}{-\R@cipeIngUISpace} }% % \end{macrocode} % \end{macro} @@ -512,21 +618,15 @@ % \begin{macro}{\R@cipeTitleWidths} % |\R@cipeTitleWidths| is to set the widths of the boxes/columns used in % the recipe title. -% There are two parameters: |#1| is the recipe number width, -% |#2| the number of servings width. -% The title width is deduced from there. The method widths are also updated -% with the new recipe number width. -% \begin{macrocode} -\DeclareRobustCommand*{\R@cipeTitleWidths}[2]{% - \setlength{\R@cipeNumberWidth}{#1}% - \setlength{\R@cipeServingsWidth}{#2}% +% There are two parameters: |#1| is the number of servings width. +% The title width is deduced from that. +% \begin{macrocode} +\DeclareRobustCommand*{\R@cipeTitleWidths}[1]{% + \setlength{\R@cipeServingsWidth}{#1}% \setlength{\R@cipeTitleWidth}{\R@cipeWidth}% - \addtolength{\R@cipeTitleWidth}{-\R@cipeNumberWidth}% \addtolength{\R@cipeTitleWidth}{-\R@cipeServingsWidth}% \setlength{\R@cipeTandSWidth}{\R@cipeServingsWidth}% \addtolength{\R@cipeTandSWidth}{\R@cipeTitleWidth}% - \R@cipeMethodWidths{\R@cipeIngredientWidth}{\R@cipeQuantityWidth}% - {\R@cipeUnitsWidth}% } % \end{macrocode} % \end{macro} @@ -534,15 +634,14 @@ % \begin{macro}{\RecipeWidths} % |\RecipeWidths| combines the above macros in a useable form. There are six % parameters: -% |#1| is the recipe width, |#2| the recipe number width, |#3| the number -%of servings width, -% |#4| the ingredient width, |#5| the quantity width, |#6| the units width. -% The order of the three commands here is very important. +% |#1| is the recipe width, |#2| the number of servings width, |#3| the step +% number width, |#4| the ingredient width, |#5| the quantity width, |#6| the +% units width. % \begin{macrocode} \DeclareRobustCommand*{\RecipeWidths}[6]{% \setlength{\R@cipeWidth}{#1}% - \R@cipeTitleWidths{#2}{#3}% - \R@cipeMethodWidths{#4}{#5}{#6}% + \R@cipeTitleWidths{#2}% + \R@cipeMethodWidths{#3}{#4}{#5}{#6}% }% % \end{macrocode} % \end{macro} @@ -554,9 +653,11 @@ % I don't think the LaTeX default width is good for a recipe book though! % \begin{macrocode} \setlength{\R@cipeOutdent}{0.3cm}% +\setlength{\R@cipeIngQUSpace}{0.1cm}% +\setlength{\R@cipeIngUISpace}{0.2cm}% \setlength{\R@cipeTitleVerticalAdjustTop}{-0.25cm} -\setlength{\R@cipeTitleVerticalAdjustBot}{-0.04cm} -\RecipeWidths{\textwidth}{0.8cm}{3cm}{3.5cm}{1cm}{1.7cm} +\setlength{\R@cipeTitleVerticalAdjustBot}{-0.25cm} +\RecipeWidths{\textwidth}{3cm}{0.8cm}{3.5cm}{1cm}{1.7cm} % \end{macrocode} % %^^A ------------------------------------------------ @@ -582,12 +683,13 @@ % %^^A ------------------------------------------------ % \section{Boxes} -% |\st@pingrbox| is to hold the ingredients cumulatively as each -% |\ingredient| command is processed; |\st@pingrtmpbox| is used as a -% temporary transfer box. +% |\st@pingrbox| is to hold the ingredients cumulatively as each |\ingredient| +% command is processed; |\st@pingrtmpbox| and |\titl@tmpbox| are used as +% temporary transfer boxes. % \begin{macrocode} \newsavebox{\st@pingrbox} \newsavebox{\st@pingrtmpbox} +\newsavebox{\titl@tmpbox} % \end{macrocode} % This is used to hold a single ingredient as it is being processed: % \begin{macrocode} @@ -607,6 +709,12 @@ \DeclareOption{nonumber}{\numb@ringfalse} % \end{macrocode} % +% |contents| --- Should recipes be indexed to a file? (The default is no.) +% \begin{macrocode} +\DeclareOption{contents}{\c@ntentsingtrue} +\DeclareOption{nocontents}{\c@ntentsingfalse} +% \end{macrocode} +% % |index| --- Should recipes be indexed to a file? (The default is no.) % \begin{macrocode} \DeclareOption{index}{\ind@xingtrue} @@ -615,7 +723,7 @@ % % Process the options, using the defaults if necessary. % \begin{macrocode} -\ExecuteOptions{number,noindex} +\ExecuteOptions{number,noindex,nocontents} \ProcessOptions\relax % \end{macrocode} % @@ -637,7 +745,7 @@ % Display this step. % \begin{macrocode} \makebox[\R@cipeWidth]{% - \makebox[\R@cipeNumberWidth][l]{\recipestepnumberfont\arabic{st@pnumber}}% + \makebox[\St@pNumberWidth][l]{\recipestepnumberfont\arabic{st@pnumber}}% \usebox{\st@pingrbox}% \usebox{\st@pmethodbox}% }% @@ -682,45 +790,76 @@ %\end{macro} % %\begin{macro}{\r@cipetitle} -% |\r@cipetitle| displays the recipe title constrution, given the parameters +% |\r@cipetitle| displays the recipe title construction, given the parameters % |#1| the title, |#2| the number of servings and |#3| the preparation time. % -% \label{rectitlealign} -% Note: I want to get the recipe number aligned with the TOP of the title -% in the case of multi-line titles. % \begin{macrocode} -\DeclareRobustCommand{\r@cipetitle}[3]{ - - \bigskip - \pagebreak[0] +\DeclareRobustCommand{\r@cipetitle}[3]{% % \end{macrocode} -% The following displays the text line above the rule: +% The |\parskip| ensures that the distance between the rule and the text above +% and below does not change when the page's vertical glue ``sets''. +% The following displays the text line above the rule; the recipe number width +% is automatically determined here. % \begin{macrocode} \mbox{% - \ifnumb@ring% - \makebox[\R@cipeNumberWidth][l]{\recipenumberfont\arabic{r@cipenumber}}% - \parbox[b]{\R@cipeTitleWidth}{\recipetitlefont #1}% - \else% - \parbox[b]{\R@cipeTitleWidth}{\recipetitlefont #1}% - \makebox[\R@cipeNumberWidth]{}% - \fi% - \parbox[b]{\R@cipeServingsWidth}{\hfill\recipeservingsfont #2}% + \makebox[\R@cipeWidth][t]{% + \parbox[t]{\R@cipeWidth}{% + \ifnumb@ring% + \savebox{\titl@tmpbox}{% + {\recipenumberfont\arabic{r@cipenumber}\ \ }% + }% + \setlength{\R@cipeNumberWidth}{\wd\titl@tmpbox}% + \addtolength{\R@cipeTitleWidth}{-\R@cipeNumberWidth}% + \addtolength{\R@cipeTandSWidth}{-\R@cipeNumberWidth}% + \lineskip0pt\mbox{}\\[-\baselineskip]% + \parbox[b]{\R@cipeNumberWidth}{% + \rule{0pt}{\baselineskip}% + \strut\usebox{\titl@tmpbox}% + \strut% + }% + \makebox[\R@cipeTandSWidth][t]{% + \parbox[t]{\R@cipeTandSWidth}{% + \lineskip0pt\mbox{}\\[-\baselineskip]% + \parbox[b]{\R@cipeTitleWidth}{% + \rule{0pt}{\baselineskip}% + \strut{\recipetitlefont #1}\strut\hfill}% + \parbox[b]{\R@cipeServingsWidth}{% + \strut{\hfill\recipeservingsfont #2}\strut}% + }% + }% + \addtolength{\R@cipeTandSWidth}{\R@cipeNumberWidth}% + \addtolength{\R@cipeTitleWidth}{\R@cipeNumberWidth}% + \else% + \lineskip0pt\mbox{}\\[-\baselineskip]% + \parbox[b]{\R@cipeTitleWidth}{% + \rule{0pt}{\baselineskip}% + \strut{\recipetitlefont #1}\strut\hfill}% + \parbox[b]{\R@cipeServingsWidth}{% + \strut{\hfill\recipeservingsfont #2}\strut}% + \fi% + }% + }% }\par% % \end{macrocode} -% Next we display the rule, being careful not to allow +% Next we display the rule, being careful not to allow % page breaks during the title, using the adjustments as specified above. +% (This is a bit vague and nasty...) % \begin{macrocode} - \nopagebreak - \vspace{\R@cipeTitleVerticalAdjustTop}% +%% \nopagebreak +%% \vspace{\R@cipeTitleVerticalAdjustTop}% \nopagebreak - \rule{\R@cipeWidth}{0.4pt}\par% + \rule[-\R@cipeTitleVerticalAdjustTop]{\R@cipeWidth}{0.4pt}\par% \nopagebreak - \vspace{\R@cipeTitleVerticalAdjustBot}% + \vskip\R@cipeTitleVerticalAdjustBot% +%% \vspace{\R@cipeTitleVerticalAdjustBot}% \nopagebreak % \end{macrocode} -% Finally we display the text line below the rule: +% Finally we display the text line below the rule if it isn't empty: % \begin{macrocode} - \makebox[\R@cipeWidth][r]{\recipetimefont #3}\par% + \ifx\relax#3\relax% + \else + \makebox[\R@cipeWidth][r]{\recipetimefont #3}\par% + \fi \nopagebreak }% % \end{macrocode} @@ -913,7 +1052,7 @@ \strut #2\hfill\strut% \fi% }% - \rule{0.2cm}{0cm}% + \rule{\R@cipeIngUISpace}{0cm}% \rule{\R@cipeOutdent}{0cm}% \parbox[t]{\R@cipeIngredientWidth}{\raggedright% \recipeingredientfont% @@ -937,7 +1076,7 @@ \setlength{\parindent}{-\R@cipeOutdent}% \rule{0pt}{\baselineskip}% \strut #2\strut\hfill}% - \rule{0.2cm}{0cm}% + \rule{\R@cipeIngUISpace}{0cm}% \rule{\R@cipeOutdent}{0cm}% \parbox[t]{\R@cipeIngredientWidth}{% \raggedright\recipeingredientfont% @@ -952,21 +1091,75 @@ \hfill % \raggedright\recipequantityfont% \strut #1\strut% - \rule{0.1cm}{0cm}}% + \rule{\R@cipeIngQUSpace}{0cm}}% \usebox{\st@pingrtmpbox}% }% }% \fi% % \end{macrocode} -% Use |\st@pingrtmpbox| as a temporary holding box: +% Use |\st@pingrtmpbox| as a temporary holding box. The |\lineskip0pt| +% and the |\strut|s +% ensure that the ingredients' and the method text's baselines +% are aligned correctly. +% \begin{macrocode} + \savebox{\st@pingrtmpbox}[\R@cipeIQUWidth][t]{\usebox{\st@pingrbox}}% + \savebox{\st@pingrbox}[\R@cipeIQUWidth][t]{% + \begin{minipage}[t]{\R@cipeIQUWidth}% + \lineskip0pt% + \ifnum\value{ingr@dnumber}>0% + \usebox{\st@pingrtmpbox}\par% + \usebox{\st@pIQUbox}\strut% + \else% + \usebox{\st@pIQUbox}\strut% + \fi% + \end{minipage}% + }% +% \usebox{\st@pingrbox} % For testing: show cumulative boxes. + \stepcounter{ingr@dnumber}% + \p@stingred% +}% +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\Ingr@dient} +%The |\Ingr@dient| command takes just one parameter. It fits in the same +%final box as |\ingr@dient| but is much simpler. Start by ending the method +%box. +% \begin{macrocode} +\DeclareRobustCommand{\Ingr@dient}[1]{% + \pr@ingred% +% \end{macrocode} +% +%We typeset |#1| in the single ingredient width, which is the IQU width minus +%the outdent. Use ragged right because the +%column is too narrow for flush right. +% \begin{macrocode} + \savebox{\st@pIQUbox}[\R@cipeSingleIngWidth][t]{% + \parbox[t]{\R@cipeSingleIngWidth}{% + \lineskip0pt\mbox{}\\[-\baselineskip]% + \rule{\R@cipeOutdent}{0cm}% + \parbox[t]{\R@cipeSingleIngWidth}{\raggedright% + \recipeingredientfont% + \setlength{\parindent}{-\R@cipeOutdent}% + \strut #1\strut}% + }% + }% +% \end{macrocode} +% Use |\st@pingrtmpbox| as a temporary holding box. The |\lineskip0pt| +% and the |\strut|s +% ensure that the ingredients' and the method text's baselines +% are aligned correctly. % \begin{macrocode} \savebox{\st@pingrtmpbox}[\R@cipeIQUWidth][t]{\usebox{\st@pingrbox}}% \savebox{\st@pingrbox}[\R@cipeIQUWidth][t]{% \begin{minipage}[t]{\R@cipeIQUWidth}% + \lineskip0pt% \ifnum\value{ingr@dnumber}>0% \usebox{\st@pingrtmpbox}\par% - \fi% - \usebox{\st@pIQUbox}\strut% + \usebox{\st@pIQUbox}\strut% + \else% + \usebox{\st@pIQUbox}\strut% + \fi% \end{minipage}% }% % \usebox{\st@pingrbox} % For testing: show cumulative boxes. @@ -979,41 +1172,65 @@ %^^A ------------------------------------------------ %\section{The recipe environment} %\begin{environment}{recipe} -%This is the main environment in the package. Its 3 parameters are -%|#1| is the recipe title, |#2| is the number of portions, and |#3| the preparation -%time. Of course, |#2| and |#3| can be whatever you like but that is one way of -%using them. +%This is the main environment in the package. Its 3 parameters are |#2| is +%the recipe title, |#3| is the number of portions, and |#3| the preparation +%time. Of course, |#3| and |#4| can be whatever you like but that is one way +%of using them. |#1| is the label. % \begin{macrocode} -\newenvironment{recipe}[3]{% +\newenvironment{recipe}[4][]{% % \end{macrocode} % These are the things that are put at the start of the recipe environment. -% First, set things up. Increment the recipe counter, make command aliases -% and empty the boxes. +% First, set things up. Increment the recipe counter (which can be used in +% |\label|), make command aliases and empty the boxes. +% Note that |\label| is set through |#1|, {\bf not} |\label|. % \begin{macrocode} - \stepcounter{r@cipenumber} + \refstepcounter{r@cipenumber} + \ifx\relax#1\relax + \else + \label{#1} + \fi + \let\label\relax \let\newstep\m@thodend \let\recipen@wpage\newpage \let\newpage\r@cipen@wpage \let\0\d@grees + \let\X\tim@s \let\degrees\d@grees \let\fr\fr@ction \let\ing\ingr@dient \let\ingredient\ingr@dient + \let\Ing\Ingr@dient + \let\Ingredient\Ingr@dient \let\freeform\fr@eform \n@wpagingfalse% \setlength{\parindent}{0pt} \savebox{\st@pingrbox}[\R@cipeIQUWidth]{} \savebox{\st@pmethodbox}[\R@cipeMethodWidth]{} % \end{macrocode} -% Next deal with the index entry if we need to. +% Make sure that the recipe is spaced appropriately from the preceding text +% and start a new page if necessary. This is not part of |\r@cipetitle| +% because putting the break after |\addcontentsline| might yield the wrong +% page number. The blank line below is intentional. % \begin{macrocode} - \ifind@xing - \addcontentsline{toc}{subsection}{#1} - \fi + + \bigskip\medskip + \pagebreak[0] + \parskip0pt% +% \end{macrocode} +% Next deal with the contents/index entry if we need to. Again, the +% |\nopagebreak| prevents the contents line occurring on the previous page. +% \begin{macrocode} + \ifc@ntentsing% + \addcontentsline{toc}{subsection}{#2}% + \fi% + \ifind@xing% + \index{#2 (\arabic{r@cipenumber})}% + \fi% + \nopagebreak% % \end{macrocode} % Display the title and start the method box. % \begin{macrocode} - \r@cipetitle{#1}{#2}{#3} + \r@cipetitle{#2}{#3}{#4} \vskip0.2cm% \p@stingred% }% @@ -1053,9 +1270,19 @@ % \end{macrocode} %\end{macro} % +%\begin{macro}{\tim@s} +% This is to typeset a times symbol (like ${}\times\!$). +% \begin{macrocode} +\DeclareRobustCommand{\tim@s}{% + \relax${}\times{}$\relax% +}% +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\fr@ction} % This is to typeset fractions, currently using package |nicefrac|. % \begin{macrocode} +% \begin{macrocode} \DeclareRobustCommand{\fr@ction}[2]{% \nicefrac#1#2% }% diff --git a/Master/texmf-dist/tex/latex/cuisine/cuisine.sty b/Master/texmf-dist/tex/latex/cuisine/cuisine.sty index e7cf8a8a35a..68f32fd7cb6 100644 --- a/Master/texmf-dist/tex/latex/cuisine/cuisine.sty +++ b/Master/texmf-dist/tex/latex/cuisine/cuisine.sty @@ -23,9 +23,9 @@ %% %% Recipe typesetting package `cuisine' by Ben Cohen. %% cuisine.dtx -%% Copyright 2000 Ben Cohen +%% Copyright 2000-2002, 2014 Ben Cohen \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{cuisine}[2000/08/01 v0.5 recipe typesetting] +\ProvidesPackage{cuisine}[2014/06/26 v0.7 recipe typesetting] \RequirePackage{nicefrac} \newcounter{r@cipenumber} \DeclareRobustCommand{\ResetRecipeCounter}{% @@ -34,6 +34,7 @@ \newcounter{st@pnumber}[r@cipenumber] \newcounter{ingr@dnumber}[st@pnumber] \newif\ifnumb@ring +\newif\ifc@ntentsing \newif\ifind@xing \newif\iffr@eforming \newif\ifn@wpaging @@ -43,6 +44,8 @@ \newlength{\R@cipeServingsWidth} \newlength{\R@cipeTandSWidth} \newlength{\R@cipeOutdent} +\newlength{\R@cipeIngQUSpace} +\newlength{\R@cipeIngUISpace} \newlength{\R@cipeTitleVerticalAdjustTop} \newlength{\R@cipeTitleVerticalAdjustBot} \newlength{\R@cipeIngredientWidth} @@ -51,12 +54,15 @@ \newlength{\R@cipeQandUWidth} \newlength{\R@cipeIandUWidth} \newlength{\R@cipeIQUWidth} +\newlength{\R@cipeSingleIngWidth} \newlength{\R@cipeMethodWidth} +\newlength{\St@pNumberWidth} \newlength{\R@cipeStepWidth} -\DeclareRobustCommand*{\R@cipeMethodWidths}[3]{% - \setlength{\R@cipeIngredientWidth}{#1}% - \setlength{\R@cipeQuantityWidth}{#2}% - \setlength{\R@cipeUnitsWidth}{#3}% +\DeclareRobustCommand*{\R@cipeMethodWidths}[4]{% + \setlength{\St@pNumberWidth}{#1}% + \setlength{\R@cipeIngredientWidth}{#2}% + \setlength{\R@cipeQuantityWidth}{#3}% + \setlength{\R@cipeUnitsWidth}{#4}% \setlength{\R@cipeQandUWidth}{\R@cipeQuantityWidth}% \addtolength{\R@cipeQandUWidth}{\R@cipeUnitsWidth}% \setlength{\R@cipeIQUWidth}{\R@cipeQandUWidth}% @@ -65,35 +71,37 @@ \setlength{\R@cipeIandUWidth}{\R@cipeIQUWidth}% \addtolength{\R@cipeIandUWidth}{-\R@cipeQuantityWidth}% \setlength{\R@cipeStepWidth}{\R@cipeWidth}% - \addtolength{\R@cipeStepWidth}{-\R@cipeNumberWidth}% + \addtolength{\R@cipeStepWidth}{-\St@pNumberWidth}% \setlength{\R@cipeMethodWidth}{\R@cipeStepWidth}% \addtolength{\R@cipeMethodWidth}{-\R@cipeIngredientWidth}% \addtolength{\R@cipeMethodWidth}{-\R@cipeQandUWidth}% \addtolength{\R@cipeMethodWidth}{-0.5cm}% + \setlength{\R@cipeSingleIngWidth}{\R@cipeIQUWidth}% \addtolength{\R@cipeIngredientWidth}{-\R@cipeOutdent} \addtolength{\R@cipeUnitsWidth}{-\R@cipeOutdent} \addtolength{\R@cipeQandUWidth}{-\R@cipeOutdent} + \addtolength{\R@cipeSingleIngWidth}{-\R@cipeOutdent} + \addtolength{\R@cipeSingleIngWidth}{-\R@cipeIngQUSpace} + \addtolength{\R@cipeSingleIngWidth}{-\R@cipeIngUISpace} }% -\DeclareRobustCommand*{\R@cipeTitleWidths}[2]{% - \setlength{\R@cipeNumberWidth}{#1}% - \setlength{\R@cipeServingsWidth}{#2}% +\DeclareRobustCommand*{\R@cipeTitleWidths}[1]{% + \setlength{\R@cipeServingsWidth}{#1}% \setlength{\R@cipeTitleWidth}{\R@cipeWidth}% - \addtolength{\R@cipeTitleWidth}{-\R@cipeNumberWidth}% \addtolength{\R@cipeTitleWidth}{-\R@cipeServingsWidth}% \setlength{\R@cipeTandSWidth}{\R@cipeServingsWidth}% \addtolength{\R@cipeTandSWidth}{\R@cipeTitleWidth}% - \R@cipeMethodWidths{\R@cipeIngredientWidth}{\R@cipeQuantityWidth}% - {\R@cipeUnitsWidth}% } \DeclareRobustCommand*{\RecipeWidths}[6]{% \setlength{\R@cipeWidth}{#1}% - \R@cipeTitleWidths{#2}{#3}% - \R@cipeMethodWidths{#4}{#5}{#6}% + \R@cipeTitleWidths{#2}% + \R@cipeMethodWidths{#3}{#4}{#5}{#6}% }% \setlength{\R@cipeOutdent}{0.3cm}% +\setlength{\R@cipeIngQUSpace}{0.1cm}% +\setlength{\R@cipeIngUISpace}{0.2cm}% \setlength{\R@cipeTitleVerticalAdjustTop}{-0.25cm} -\setlength{\R@cipeTitleVerticalAdjustBot}{-0.04cm} -\RecipeWidths{\textwidth}{0.8cm}{3cm}{3.5cm}{1cm}{1.7cm} +\setlength{\R@cipeTitleVerticalAdjustBot}{-0.25cm} +\RecipeWidths{\textwidth}{3cm}{0.8cm}{3.5cm}{1cm}{1.7cm} \newcommand*\recipefont{\normalfont} \newcommand*\recipetitlefont{\recipefont} \newcommand*\recipenumberfont{\recipefont} @@ -107,18 +115,21 @@ \newcommand*\recipefreeformfont{\recipefont} \newsavebox{\st@pingrbox} \newsavebox{\st@pingrtmpbox} +\newsavebox{\titl@tmpbox} \newsavebox{\st@pIQUbox} \newsavebox{\st@pmethodbox} \DeclareOption{number}{\numb@ringtrue} \DeclareOption{nonumber}{\numb@ringfalse} +\DeclareOption{contents}{\c@ntentsingtrue} +\DeclareOption{nocontents}{\c@ntentsingfalse} \DeclareOption{index}{\ind@xingtrue} \DeclareOption{noindex}{\ind@xingfalse} -\ExecuteOptions{number,noindex} +\ExecuteOptions{number,noindex,nocontents} \ProcessOptions\relax \DeclareRobustCommand{\Displ@ySt@p}{% \stepcounter{st@pnumber}% \makebox[\R@cipeWidth]{% - \makebox[\R@cipeNumberWidth][l]{\recipestepnumberfont\arabic{st@pnumber}}% + \makebox[\St@pNumberWidth][l]{\recipestepnumberfont\arabic{st@pnumber}}% \usebox{\st@pingrbox}% \usebox{\st@pmethodbox}% }% @@ -141,28 +152,58 @@ \fi% \n@wpagingfalse% }% -\DeclareRobustCommand{\r@cipetitle}[3]{ - - \bigskip - \pagebreak[0] +\DeclareRobustCommand{\r@cipetitle}[3]{% \mbox{% - \ifnumb@ring% - \makebox[\R@cipeNumberWidth][l]{\recipenumberfont\arabic{r@cipenumber}}% - \parbox[b]{\R@cipeTitleWidth}{\recipetitlefont #1}% - \else% - \parbox[b]{\R@cipeTitleWidth}{\recipetitlefont #1}% - \makebox[\R@cipeNumberWidth]{}% - \fi% - \parbox[b]{\R@cipeServingsWidth}{\hfill\recipeservingsfont #2}% + \makebox[\R@cipeWidth][t]{% + \parbox[t]{\R@cipeWidth}{% + \ifnumb@ring% + \savebox{\titl@tmpbox}{% + {\recipenumberfont\arabic{r@cipenumber}\ \ }% + }% + \setlength{\R@cipeNumberWidth}{\wd\titl@tmpbox}% + \addtolength{\R@cipeTitleWidth}{-\R@cipeNumberWidth}% + \addtolength{\R@cipeTandSWidth}{-\R@cipeNumberWidth}% + \lineskip0pt\mbox{}\\[-\baselineskip]% + \parbox[b]{\R@cipeNumberWidth}{% + \rule{0pt}{\baselineskip}% + \strut\usebox{\titl@tmpbox}% + \strut% + }% + \makebox[\R@cipeTandSWidth][t]{% + \parbox[t]{\R@cipeTandSWidth}{% + \lineskip0pt\mbox{}\\[-\baselineskip]% + \parbox[b]{\R@cipeTitleWidth}{% + \rule{0pt}{\baselineskip}% + \strut{\recipetitlefont #1}\strut\hfill}% + \parbox[b]{\R@cipeServingsWidth}{% + \strut{\hfill\recipeservingsfont #2}\strut}% + }% + }% + \addtolength{\R@cipeTandSWidth}{\R@cipeNumberWidth}% + \addtolength{\R@cipeTitleWidth}{\R@cipeNumberWidth}% + \else% + \lineskip0pt\mbox{}\\[-\baselineskip]% + \parbox[b]{\R@cipeTitleWidth}{% + \rule{0pt}{\baselineskip}% + \strut{\recipetitlefont #1}\strut\hfill}% + \parbox[b]{\R@cipeServingsWidth}{% + \strut{\hfill\recipeservingsfont #2}\strut}% + \fi% + }% + }% }\par% +%% \nopagebreak +%% \vspace{\R@cipeTitleVerticalAdjustTop}% \nopagebreak - \vspace{\R@cipeTitleVerticalAdjustTop}% - \nopagebreak - \rule{\R@cipeWidth}{0.4pt}\par% + \rule[-\R@cipeTitleVerticalAdjustTop]{\R@cipeWidth}{0.4pt}\par% \nopagebreak - \vspace{\R@cipeTitleVerticalAdjustBot}% + \vskip\R@cipeTitleVerticalAdjustBot% +%% \vspace{\R@cipeTitleVerticalAdjustBot}% \nopagebreak - \makebox[\R@cipeWidth][r]{\recipetimefont #3}\par% + \ifx\relax#3\relax% + \else + \makebox[\R@cipeWidth][r]{\recipetimefont #3}\par% + \fi \nopagebreak }% \def\r@cipesloppy{% @@ -237,7 +278,7 @@ \strut #2\hfill\strut% \fi% }% - \rule{0.2cm}{0cm}% + \rule{\R@cipeIngUISpace}{0cm}% \rule{\R@cipeOutdent}{0cm}% \parbox[t]{\R@cipeIngredientWidth}{\raggedright% \recipeingredientfont% @@ -255,7 +296,7 @@ \setlength{\parindent}{-\R@cipeOutdent}% \rule{0pt}{\baselineskip}% \strut #2\strut\hfill}% - \rule{0.2cm}{0cm}% + \rule{\R@cipeIngUISpace}{0cm}% \rule{\R@cipeOutdent}{0cm}% \parbox[t]{\R@cipeIngredientWidth}{% \raggedright\recipeingredientfont% @@ -270,7 +311,7 @@ \hfill % \raggedright\recipequantityfont% \strut #1\strut% - \rule{0.1cm}{0cm}}% + \rule{\R@cipeIngQUSpace}{0cm}}% \usebox{\st@pingrtmpbox}% }% }% @@ -278,34 +319,80 @@ \savebox{\st@pingrtmpbox}[\R@cipeIQUWidth][t]{\usebox{\st@pingrbox}}% \savebox{\st@pingrbox}[\R@cipeIQUWidth][t]{% \begin{minipage}[t]{\R@cipeIQUWidth}% + \lineskip0pt% \ifnum\value{ingr@dnumber}>0% \usebox{\st@pingrtmpbox}\par% + \usebox{\st@pIQUbox}\strut% + \else% + \usebox{\st@pIQUbox}\strut% \fi% - \usebox{\st@pIQUbox}\strut% \end{minipage}% }% \stepcounter{ingr@dnumber}% \p@stingred% }% -\newenvironment{recipe}[3]{% - \stepcounter{r@cipenumber} +\DeclareRobustCommand{\Ingr@dient}[1]{% + \pr@ingred% + \savebox{\st@pIQUbox}[\R@cipeSingleIngWidth][t]{% + \parbox[t]{\R@cipeSingleIngWidth}{% + \lineskip0pt\mbox{}\\[-\baselineskip]% + \rule{\R@cipeOutdent}{0cm}% + \parbox[t]{\R@cipeSingleIngWidth}{\raggedright% + \recipeingredientfont% + \setlength{\parindent}{-\R@cipeOutdent}% + \strut #1\strut}% + }% + }% + \savebox{\st@pingrtmpbox}[\R@cipeIQUWidth][t]{\usebox{\st@pingrbox}}% + \savebox{\st@pingrbox}[\R@cipeIQUWidth][t]{% + \begin{minipage}[t]{\R@cipeIQUWidth}% + \lineskip0pt% + \ifnum\value{ingr@dnumber}>0% + \usebox{\st@pingrtmpbox}\par% + \usebox{\st@pIQUbox}\strut% + \else% + \usebox{\st@pIQUbox}\strut% + \fi% + \end{minipage}% + }% + \stepcounter{ingr@dnumber}% + \p@stingred% +}% +\newenvironment{recipe}[4][]{% + \refstepcounter{r@cipenumber} + \ifx\relax#1\relax + \else + \label{#1} + \fi + \let\label\relax \let\newstep\m@thodend \let\recipen@wpage\newpage \let\newpage\r@cipen@wpage \let\0\d@grees + \let\X\tim@s \let\degrees\d@grees \let\fr\fr@ction \let\ing\ingr@dient \let\ingredient\ingr@dient + \let\Ing\Ingr@dient + \let\Ingredient\Ingr@dient \let\freeform\fr@eform \n@wpagingfalse% \setlength{\parindent}{0pt} \savebox{\st@pingrbox}[\R@cipeIQUWidth]{} \savebox{\st@pmethodbox}[\R@cipeMethodWidth]{} - \ifind@xing - \addcontentsline{toc}{subsection}{#1} - \fi - \r@cipetitle{#1}{#2}{#3} + + \bigskip\medskip + \pagebreak[0] + \parskip0pt% + \ifc@ntentsing% + \addcontentsline{toc}{subsection}{#2}% + \fi% + \ifind@xing% + \index{#2 (\arabic{r@cipenumber})}% + \fi% + \nopagebreak% + \r@cipetitle{#2}{#3}{#4} \vskip0.2cm% \p@stingred% }% @@ -322,6 +409,9 @@ \DeclareRobustCommand{\d@grees}{% ${}^\circ$% }% +\DeclareRobustCommand{\tim@s}{% + \relax${}\times{}$\relax% +}% \DeclareRobustCommand{\fr@ction}[2]{% \nicefrac#1#2% }% |