summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/xcookybooky
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-03-04 23:39:00 +0000
committerKarl Berry <karl@freefriends.org>2015-03-04 23:39:00 +0000
commit573282f0f4fef0d96cba479ecb98d96e585b9e54 (patch)
treeef69c49aa05a3f4433bcd181fe7ae92db15f7055 /Master/texmf-dist/source/latex/xcookybooky
parent363972203ff0e9b7cdcc2686cefbe401e392899b (diff)
xcookybooky (4mar15)
git-svn-id: svn://tug.org/texlive/trunk@36435 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/xcookybooky')
-rw-r--r--Master/texmf-dist/source/latex/xcookybooky/xcookybooky.dtx86
-rw-r--r--Master/texmf-dist/source/latex/xcookybooky/xcookybooky.ins2
2 files changed, 72 insertions, 16 deletions
diff --git a/Master/texmf-dist/source/latex/xcookybooky/xcookybooky.dtx b/Master/texmf-dist/source/latex/xcookybooky/xcookybooky.dtx
index e0ed4c9c323..e88dbae2373 100644
--- a/Master/texmf-dist/source/latex/xcookybooky/xcookybooky.dtx
+++ b/Master/texmf-dist/source/latex/xcookybooky/xcookybooky.dtx
@@ -18,7 +18,7 @@
% \iffalse
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{xcookybooky}
-%<package> [2015/02/03 v1.4 Easy typesetting (potentially long) recipes with pictures]
+%<package> [2015/03/03 v1.5 Easy typesetting (potentially long) recipes with pictures]
%<config>\ProvidesFile{xcookybooky.cfg}
%<config> [2015/02/03 v1.1 'xcookybooky' configuration file]
%
@@ -68,7 +68,7 @@
%</driver>
% \fi
%
-% \CheckSum{792}
+% \CheckSum{829}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -92,6 +92,7 @@
% \changes{v1.2}{2013/03/10}{Better way for displaying the ingredients (tabularx). Thanks to Bartosz Dziubaczyk for developing.}
% \changes{v1.3}{2013/06/04}{Fixed a problem with the default recipe name font. Thanks to Václav Zeman for reporting. New environment for the ingredients. Thanks to Andreas Pöge for this suggestion.}
% \changes{v1.4}{2015/02/03}{Added two commands for a introduction and recipe suggestions. Additional several hooks are implement in order to insert user-defined text blocks at different places in the recipe. Thanks to Heikki Lehvaslaiho for designing the graphical separator and sending suggestions. Added translations for German, English, French and Spanish.}
+% \changes{v1.5}{2015/03/03}{Adding translations for Portuguese and Brazilian. Thanks to Thiago de Melo for submitting. Adding optional argument for the ingredients part. Thanks to Benjamin Steinwender for submitting.}
%
% \GetFileInfo{xcookybooky.sty}
%
@@ -188,6 +189,17 @@
% }
% \end{lstlisting}
%
+% Unfortunately the package \texttt{wrapfig} has a problem to detect the length of a table. In order to get a better floating of the ingredients you have to insert the number of table lines as shown in the example below. Please note that you have to take the headline and line breaks of overlong ingredients into account.
+% \begin{lstlisting}[caption={Ingredients Command with Optional Argument}]
+% \ingredients[7]{
+% 2 bar & Dark Chocolate (above \unit[70]{\%})\\
+% 3 & Eggs\\
+% \unit[200]{ml} & Cream\\
+% \unit[40]{g} & Sugar\\
+% \unit[50]{g} & Butter
+% }
+% \end{lstlisting}
+%
% In the versions up to 1.1 there was also a method to enter ingredients with three columns. Due to the substitution of \texttt{tabular} with \texttt{tabulary} I decided that the three columns method is no longer supported, because it would mean a lot of work. This method has also the drawback it needs more space and in my opinion it also looks ugly.
% If you are using the three columns solution there are two options:
% \begin{enumerate}
@@ -872,6 +884,34 @@
}
}{}
+\IfLanguagePatterns{portuguese}
+{% Portuguese
+ \setHeadlines
+ {% translation
+ inghead = Ingredientes,
+ prephead = Prepara\c{c}\~{a}o,
+ hinthead = Dica,
+ continuationhead = Continua\c{c}\~{a}o,
+ continuationfoot = Continua na pr\'{o}xima p\'{a}gina,
+ portionvalue = Por\c{c}\~{o}es,
+ calory = Valor Cal\'{o}rico
+ }
+}{}
+
+\IfLanguagePatterns{brazil}
+{% Portuguese PT-BR
+ \setHeadlines
+ {% translation
+ inghead = Ingredientes,
+ prephead = Prepara\c{c}\~{a}o,
+ hinthead = Dica,
+ continuationhead = Continua\c{c}\~{a}o,
+ continuationfoot = Continua na pr\'{o}xima p\'{a}gina,
+ portionvalue = Por\c{c}\~{o}es,
+ calory = Valor Cal\'{o}rico
+ }
+}{}
+
% \end{macrocode}
%
% \subsection{Recipe Lengths}
@@ -955,17 +995,18 @@
% \end{macro}
%
% \begin{macro}{\ingredients}
-% The command is used to insert the ingredients, which are displayed as a table.
+% The command is used to insert the ingredients, which are displayed as a table. The optional argument conatins the number of table lines. It can be used to adjust the floating of the ingredients table. The package \texttt{wrapfig} has a problem to detect the length of the table, which is shown at \url{http://tex.stackexchange.com/questions/83231/text-not-spanning-full-page-after-wraptable} for example.
% \begin{macrocode}
-\newcommand*{\ingredients}[1]
-{%
+\newcommand*{\ingredients}[2][\empty]
+{% The optional argument contains the number of lines
+ \def\xcb@ingredientslines{#1}
\def\xcb@ingredients
{%
\xcb@name@inghead
\\[1em]
{\xcb@fontsize@ing\color{\xcb@color@ing}
\begin{tabulary}{\xcb@ingredientswidth}{rL}
- #1
+ #2
\end{tabulary}}
}
}
@@ -1423,16 +1464,31 @@
\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
+ \ifthenelse{\equal{\xcb@ingredientslines}{\empty}}%
+ {%
+ \begin{wraptable}{r}{\xcb@ingredientswidth}
+ {% No line number given by the user
+ \vspace{-1em} % same height of ingredients and preparation
+ \xcb@hook@preingredients
+
+ \xcb@ingredients
+
+ \xcb@hook@postingredients
+ }
+ \end{wraptable}
+ }
+ {%
+ \begin{wraptable}[\xcb@ingredientslines]{r}{\xcb@ingredientswidth}
+ {% Use the given line number by the user
+ \vspace{-1em} % same height of ingredients and preparation
+ \xcb@hook@preingredients
+
+ \xcb@ingredients
+
+ \xcb@hook@postingredients
+ }
+ \end{wraptable}
}
- \end{wraptable}
\xcb@hook@prepreparation
\xcb@preparation
diff --git a/Master/texmf-dist/source/latex/xcookybooky/xcookybooky.ins b/Master/texmf-dist/source/latex/xcookybooky/xcookybooky.ins
index 369691ddff6..105fe85886d 100644
--- a/Master/texmf-dist/source/latex/xcookybooky/xcookybooky.ins
+++ b/Master/texmf-dist/source/latex/xcookybooky/xcookybooky.ins
@@ -1,7 +1,7 @@
%% --------------------- xcookybooky.ins -------------------------
-\def\filedate{2015/02/03}
+\def\filedate{2015/03/03}
\def\batchfile{xcookybooky.ins}
\input docstrip