Beef Rendang

This commit is contained in:
Michael Krayer 2020-10-28 15:12:14 +01:00
parent 0dd24ade8f
commit f295d0b24a
10 changed files with 3065 additions and 0 deletions

2
build/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

115
cookbook.tex Normal file
View File

@ -0,0 +1,115 @@
\documentclass[%
a4paper,
%twoside,
11pt
]{article}
% encoding, font, language
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[ngerman]{babel}
\usepackage{nicefrac}
\newcommand{\recipetarget}[1]{%
\phantomsection
\label{#1}
}
\newcommand{\reciperef}[1]{%
[Seite~\pageref{#1}]
}
\usepackage[
% handwritten,
nowarnings,
%myconfig
]
{xcookybooky}
\setHeadlines{
inghead = Zutaten,
prephead = Arbeitsschritte,
portionvalue = Portionen,
%hinthead = STip ,
%continuationhead = C \dots ,
}
%\setRecipeColors{
% separationgraph = black!0
%}
\setRecipeLengths{
preparationwidth = 0.4\textwidth,
ingredientswidth = 0.5\textwidth,
}
% Modify xcookybooky style
\makeatletter
% Remove separator
\renewcommand*{\xcb@separationgraph}[2][1.5]{}
\makeatother
\usepackage{blindtext} % only needed for generating test text
\DeclareRobustCommand{\textcelcius}{\ensuremath{^{\circ}\mathrm{C}}}
\setcounter{secnumdepth}{1}
\renewcommand*{\recipesection}[2][]
{%
\subsection[#1]{#2}
}
\renewcommand{\subsectionmark}[1]
{% no implementation to display the section name instead
}
\usepackage{hyperref} % must be the last package
\hypersetup{%
pdfauthor = {Michael Krayer},
pdftitle = {Ein Kochbuch voll mit Curries},
pdfsubject = {Recipes},
pdfkeywords = {recipes, cookbook},
pdfstartview = {FitV},
pdfview = {FitH},
pdfpagemode = {UseNone}, % Options; UseNone, UseOutlines
bookmarksopen = {true},
pdfpagetransition = {Glitter},
colorlinks = {true},
linkcolor = {black},
urlcolor = {blue},
citecolor = {black},
filecolor = {black},
}
\hbadness=10000 % Ignore underfull boxes
\begin{document}
\title{Ein Kochbuch voll mit Curries}
\author{Michael Krayer}
\maketitle
\begin{abstract}
%This is a curry cookbook.
\end{abstract}
\tableofcontents
\vspace{5em}
\section{Indisch}
\section{Thai (Kaeng)}
\section{Indonesisch / Malaiisch}
\include{recipes/BeefRendang}
\section{Beilagen und Spezialzutaten}
\include{recipes/CoconutRice}
\include{recipes/Kerisik}
% background graphic
%\setBackgroundPicture[x, y=-2cm, width=\paperwidth-4cm, height, orientation = pagecenter]
%{pic/background}
\end{document}

3
latexmkrc Normal file
View File

@ -0,0 +1,3 @@
$pdf_mode = 1; # tex -> pdf
$pdflatex="pdflatex -interaction=nonstopmode %O %S";
$out_dir = 'build';

77
recipes/BeefRendang.tex Normal file
View File

@ -0,0 +1,77 @@
% Complete recipe example
\begin{recipe}
[%
preparationtime = {\unit[30]{min}},
bakingtime={\unit[2]{h}},
%bakingtemperature={\protect\bakingtemperature{
%fanoven=\unit[230]{\textcelcius},
%topbottomheat=\unit[195]{C},
%topheat=\unit[195]{C},
%gasstove=Level 2}},
portion = {\portion{8}},
%calory={\unit[3]{kJ}},
source = {\href{https://rasamalaysia.com/beef-rendang-recipe-rendang-daging/}{Rasa Malaysia},
\href{https://www.recipetineats.com/beef-rendang/}{Recipe Tin Eats}}
]
{Beef Rendang}
%\graph
%{% pictures
% small=pic/glass, % small picture
% big=pic/ingredients % big picture
%}
%\introduction{%
% \blindtext
%}
\ingredients{%
\multicolumn{2}{l}{\textit{Würzpaste}}\\
\unit[3]{cm} & Galgant, gerieben\\
\unit[3]{cm} & Ingwer, gehackt\\
5 & Schalotten, grob gewürfelt\\
3 & Zitronengras, geschnitten\\
5 & Knoblauchzehen, grob gestückelt\\
12 & getrocknete Chilis, rehydriert\\
2 EL & Öl\\
\multicolumn{2}{l}{\textit{Curry}}\\
\unit[1]{kg} & Rinderschulter, \unit[4]{cm} Würfel\\
2 EL & Öl\\
1 & Zimtstange\\
3 & Nelken\\
3 & Sternanis\\
1/2 TL & Kardamon\\
1 & Zitronengras, zerdrückt und geschnitten\\
\unit[400]{ml} & Kokosmilch\\
2 TL & Tamarindenpürree\\
6 & Kaffirlimettenblätter, fein geschnitten\\
6 EL & Kerisik \reciperef{rec:Kerisik}\\
1 TL & Palmzucker\\
1,5 TL & Salz\\
}
\preparation{%
\step Zutaten der Würzpaste pürieren.
\step Fleisch in kleinen Mengen scharf in einem Topf mit Öl anbraten und danach zur Seite legen.
\step Hitze reduzieren, Würzpaste mit Zimtstange, Nelken, Sternanis und Kardamon für 2--3 Minuten in Öl anbraten.
\step Zitronengras und Fleisch hinzufügen, verrühren und mit Kokosmilch ablöschen.
\step Tamarindenpürree, Kaffirlimettenblätter, Kerisik, Palmzucker und Salz hinzufügen und für 1~1/4 Stunden mit Deckel bei kleiner Hitze köcheln lassen.
\step Fleisch überprüfen: falls es zerfällt rausnehmen.
\step Auf mittlerer Hitze ohne Deckel reduzieren für ca. 30 Minuten bis die Sauce nurnoch das Fleisch benetzt. Am Ende häufig umrühren.
\step Falls das Fleisch noch nicht zart genug ist, Wasser hinzufügen und wieder reduzieren.
}
\suggestion[Beilagen]
{
Kokosnussreis~\reciperef{rec:CoconutRice}
}
%
%\suggestion{%
% \blindtext
%}
%\hint{%
% Enjoy typesetting recipes with {\textbf{\Large\LaTeX}} and {\textbf{\Large xcookybooky!}}
%}
\end{recipe}

56
recipes/CoconutRice.tex Normal file
View File

@ -0,0 +1,56 @@
% Complete recipe example
\begin{recipe}
[%
preparationtime = {\unit[20]{min}},
bakingtime={\unit[30]{min}},
%bakingtemperature={\protect\bakingtemperature{
%fanoven=\unit[230]{\textcelcius},
%topbottomheat=\unit[195]{C},
%topheat=\unit[195]{C},
%gasstove=Level 2}},
portion = {\portion{4}},
%calory={\unit[3]{kJ}},
source = {\href{https://www.recipetineats.com/fluffy-coconut-rice/}{Recipe Tin Eats}}
]
{Kokosnussreis}
%\graph
%{% pictures
% small=pic/glass, % small picture
% big=pic/ingredients % big picture
%}
%\introduction{%
% \blindtext
%}
\ingredients{%
\unit[360]{g} & Jasminreis oder Basmatireis\\
\unit[400]{ml} & Kokosnussmilch\\
\unit[125]{ml} & Wasser\\
1 EL & raffinierter Zucker\\
1/2 TL & Salz\\
3 & Kaffirlimettenblätter
}
\preparation{%
\recipetarget{rec:CoconutRice}
\step Reis gründlich waschen und danach für 15~Minuten in kaltem Wasser einweichen lassen.
\step Kokosnussmilch, Wasser, Zucker, Salz und Kaffirlimettenblätter aufkochen.
\step Reis hinzufügen, einmal umrühren und Hitze sofort reduzieren. Ca.~15~Minuten köcheln lassen.
\step Vom Herd nehmen und 10~Minuten ruhen lassen.
}
%\suggestion[Beilagen]
%{
%}
%
%\suggestion{%
% \blindtext
%}
%\hint{%
% Enjoy typesetting recipes with {\textbf{\Large\LaTeX}} and {\textbf{\Large xcookybooky!}}
%}
\end{recipe}

26
recipes/Kerisik.tex Normal file
View File

@ -0,0 +1,26 @@
% Complete recipe example
\begin{recipe}{Kerisik}
\ingredients{%
& Kokosraspeln
}
\preparation{%
\recipetarget{rec:Kerisik}
\step
Kokosraspeln in heißer trockener Pfannen unter ständigem Rühren rösten bis
sie goldbraun sind.
}
%\suggestion[Headline]
%{%
% \blindtext
%}
%
%\suggestion{%
% \blindtext
%}
%\hint{%
% Enjoy typesetting recipes with {\textbf{\Large\LaTeX}} and {\textbf{\Large xcookybooky!}}
%}
\end{recipe}

54
recipes/example.tex Normal file
View File

@ -0,0 +1,54 @@
% Complete recipe example
\begin{recipe}
[%
preparationtime = {\unit[1]{h}},
bakingtime={\unit[1]{h}},
bakingtemperature={\protect\bakingtemperature{
fanoven=\unit[230]{\textcelcius},
topbottomheat=\unit[195]{C},
topheat=\unit[195]{C},
gasstove=Level 2}},
portion = {\portion{5-6}},
calory={\unit[3]{kJ}},
source = {Somebody you used know}
]
{Test Recipe}
%\graph
%{% pictures
% small=pic/glass, % small picture
% big=pic/ingredients % big picture
%}
\introduction{%
\blindtext
}
\ingredients{%
2 bar & Dark Chocolate (above \unit[70]{\%})\\
3 & Eggs\\
\unit[200]{ml} & Cream\\
40 g & Sugar\\
50 g & Butter
}
\preparation{%
\step \blindtext
\step \blindtext
\step \blindtext
}
\suggestion[Headline]
{%
\blindtext
}
\suggestion{%
\blindtext
}
\hint{%
Enjoy typesetting recipes with {\textbf{\Large\LaTeX}} and {\textbf{\Large xcookybooky!}}
}
\end{recipe}

928
xcookybooky.sty Normal file
View File

@ -0,0 +1,928 @@
%%
%% This is file `xcookybooky.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% xcookybooky.dtx (with options: `package')
%%
%% This is a generated file.
%% Copyright (C) 2015 by Sven Harder
%%
%% This file may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
%% version 1.3 of this license or (at your option) any later
%% version. The latest version of this license is in:
%%
%% http://www.latex-project.org/lppl.txt
%%
%% and version 1.3 or later is part of all distributions of
%% LaTeX version 2005/12/01 or later.
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{xcookybooky}
[2015/03/03 v1.5 Easy typesetting (potentially long) recipes with pictures]
\newif\ifHandwrittenFont@required
\HandwrittenFont@requiredfalse
\DeclareOption{handwritten}
{% displays the recipename in a handwitten font
\HandwrittenFont@requiredtrue
\AtEndOfPackage{
\setRecipeSizes{recipename = \fontsize{25pt}{30pt}}
\setRecipenameFont{fjd}{T1}{m}{n}
}
}
\DeclareOption{nowarnings}
{% tries to eliminate nasty warnings
\AtEndOfPackage{
\def\WF@conflict{}
%\def\@fancywarning#1{}
}
}
\DeclareOption{myconfig}
{% load personal configuration
\AtEndOfPackage{
\InputIfFileExists{xcookybooky.cfg}
{\PackageInfo{xcookybooky}{inputting 'xcookybooky.cfg'}}
{\PackageWarning{xcookybooky}{cannot find the configuration file 'xcookybooky.cfg'}}
}
}
\ProcessOptions\relax
\RequirePackage{tikz} % for creating the lines for the hint
\RequirePackage{graphicx}
\RequirePackage{xcolor}
\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
\RequirePackage{fancyhdr}
\RequirePackage{units}
\RequirePackage{eso-pic} % for background pictures
\RequirePackage{picture} % for modfifying the position of the bg pictures
\RequirePackage{tabulary} % line breaks in tabular
\RequirePackage{framed} % frame for the introduction
\setlength{\parindent}{0cm}
\setlength{\parskip}{2ex plus 0.5ex}
\setlength{\textwidth}{15.5cm}
\setlength{\textheight}{24.0cm}
\setlength{\topmargin}{-0.8cm}
\setlength{\headheight}{14pt} %0cm
\setlength{\headsep}{1cm}
\setlength{\topskip}{0cm}
\setlength{\footskip}{1.4cm}
\setlength{\evensidemargin}{-0.5cm}
\setlength{\oddsidemargin}{0.5cm}
\setlength{\voffset}{0cm}
\setlength{\hoffset}{0cm}
\setcounter{secnumdepth}{2} % subsubsections not numbered
\setcounter{tocdepth}{3} % subsubsections in the .toc file
\newcommand*{\recipesection}[2][]
{%
\subsubsection[#1]{#2}
}
\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
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]
{%
\setkeys{colorManagement}{#1}
}
\setRecipeColors
{% initialisation
recipename,
intro,
ing,
inghead,
prep,
prephead,
suggestion,
suggestionhead,
separationgraph,
hint,
hinthead,
hintline,
numeration
}
\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, % 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
}
%% Handwritten fonts: hlce, pbsi, hlcw, fjd, fau
%% Other fonts: fwb
\newcommand*{\setRecipenameFont}[4]
{% sets the font for the recipename
\def\xcb@font@recipename
{
\fontfamily{#1}
\fontencoding{#2}
\fontseries{#3} %x1
\fontshape{#4}
\xcb@fontsize@recipename
\selectfont
}
}
\setRecipenameFont{\familydefault}{\encodingdefault}{b}{n}
\newcounter{step}
\setcounter{step}{0}
\renewcommand{\LettrineFontHook}
{%
\color{\xcb@color@numeration}
}
\define@key{headlines}{inghead}[Ingredients]{
\def\xcb@name@inghead{\textcolor{\xcb@color@inghead}{\textbf{\xcb@fontsize@inghead{#1}}\ }}
}
\define@key{headlines}{prephead}[Preparation]{
\def\xcb@name@prephead{\textcolor{\xcb@color@prephead}{\textbf{\xcb@fontsize@prephead{#1}}\ }}
}
\define@key{headlines}{hinthead}[Hint]{
\def\xcb@name@hinthead{\textcolor{\xcb@color@hinthead}{\xcb@fontsize@hinthead{#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}[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}
{
inghead,
prephead,
hinthead,
continuationhead,
continuationfoot,
preparationtime,
bakingtime,
bakingtemperature,
portion,
portionvalue,
calory,
source
}
\newcommand*{\setHeadlines}[1]
{%
\setkeys{headlines}{#1}
}
\setHeadlines
{% initialisation
inghead,
prephead,
hinthead,
continuationhead,
continuationfoot,
preparationtime,
bakingtime,
bakingtemperature,
portion,
portionvalue,
calory,
source
}
\newcommand{\IfLangGerman}[2]{%
\IfLanguageName{ngerman}{#1}{%
\IfLanguageName{naustrian}{#1}{%
\IfLanguageName{german}{#1}{%
\IfLanguageName{austrian}{#1}{#2}}}}%
}
\newcommand{\IfLangEnglish}[2]{%
\IfLanguageName{american}{#1}{%
\IfLanguageName{australian}{#1}{%
\IfLanguageName{british}{#1}{%
\IfLanguageName{canadian}{#1}{%
\IfLanguageName{english}{#1}{%
\IfLanguageName{newzealand}{#1}{%
\IfLanguageName{UKenglish}{#1}{%
\IfLanguageName{USenglish}{#1}{#2}}}}}}}}%
}
\newcommand{\IfLangFrench}[2]{%
\IfLanguageName{french}{#1}{%
\IfLanguageName{frenchb}{#1}{%
\IfLanguageName{francais}{#1}{%
\IfLanguageName{acadian}{#1}{%
\IfLanguageName{canadien}{#1}{#2}}}}}%
}
\newcommand{\IfLangPortuges}[2]{%
\IfLanguageName{brazil}{#1}{%
\IfLanguageName{brazilian}{#1}{%
\IfLanguageName{portuges}{#1}{%
\IfLanguageName{portuguese}{#1}{#2}}}}%
}
\IfLangGerman
{% German
\setHeadlines
{% translation
inghead = Zutaten,
prephead = Zubereitung,
hinthead = Tipp,
continuationhead = Fortsetzung,
continuationfoot = Fortsetzung auf n\"achster Seite,
portionvalue = Personen,
calory = Brennwert
}
}{}
\IfLangEnglish
{% English
\setHeadlines
{% translation
inghead = Ingredients,
prephead = Preparation,
hinthead = Hint,
continuationhead = Continuation,
continuationfoot = Continuation on next page,
portionvalue = Portions,
calory = Calorific value
}
}{}
\IfLangFrench
{% French
\setHeadlines
{% translation
inghead = Ingr\'edients,
prephead = Pr\'eparation,
hinthead = Tuyau,
continuationhead = Suite,
continuationfoot = Suite page suivante,
portionvalue = Portions,
calory = Valeur calorifique
}
}{}
\IfLanguagePatterns{spanish}
{% Spanish
\setHeadlines
{% translation
inghead = Ingredientes,
prephead = Preparaci\'on,
hinthead = Soplo,
continuationhead = Continuaci\'on,
continuationfoot = Contin\'ua en la p\'agina siguiente,
portionvalue = Porci\'on,
calory = Poder calor\'{\i}fico
}
}{}
\IfLangPortuges
{% Portuguese and Brazil
\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
}
}{}
\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}
{
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]
{%
\setkeys{recipelengths}{#1}
}
\setRecipeLengths
{% initialisation
pictureheight,
bigpicturewidth,
smallpicturewidth,
introductionwidth,
preparationwidth,
ingredientswidth
}
%% 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}
}
}
\newcommand*{\graph}[1]
{%
\setkeys{picture}{#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}
#2
\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}{}}
{%
{\color{\xcb@color@suggestion}#2}
}
{%
\textbf{{\color{\xcb@color@suggestionhead}#1}}
{\color{\xcb@color@suggestion}#2}
}
}
}
\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}
{%
\stepcounter{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
]{\thestep}{}%
}
\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}}
\define@key{bakingtemperature}{topheat}[]{\def\xcb@bakingtemperature@topheat{#1}}
\define@key{bakingtemperature}{bottomheat}[]{\def\xcb@bakingtemperature@bottomheat{#1}}
\define@key{bakingtemperature}{gasstove}[]{\def\xcb@bakingtemperature@gasstove{#1}}
\newboolean{xcb@bakingtemperature@firstentry}
\newcommand*{\bakingtemperature}[1]
{%
\setboolean{xcb@bakingtemperature@firstentry}{true}%
\setkeys{bakingtemperature}{fanoven, topbottomheat, topheat, bottomheat, gasstove}%
\setkeys{bakingtemperature}{#1}%
\ifthenelse{\equal{\xcb@bakingtemperature@fanoven}{}}%
{}%
{%
\xcb@bakingtemperature@fanoven \ {\fontsize{14.5pt}{10pt}\Fanoven}%
\setboolean{xcb@bakingtemperature@firstentry}{false}%
}%
\ifthenelse{\equal{\xcb@bakingtemperature@topbottomheat}{}}%
{}%
{%
\ifthenelse{\boolean{xcb@bakingtemperature@firstentry}}{\setboolean{xcb@bakingtemperature@firstentry}{false}}{, }%
\xcb@bakingtemperature@topbottomheat \ {\fontsize{14.5pt}{10pt}\Topbottomheat}%
}%
\ifthenelse{\equal{\xcb@bakingtemperature@topheat}{}}%
{}%
{%
\ifthenelse{\boolean{xcb@bakingtemperature@firstentry}}{\setboolean{xcb@bakingtemperature@firstentry}{false}}{, }%
\xcb@bakingtemperature@topheat \ {\fontsize{14.5pt}{10pt}\Topheat}%
}%
\ifthenelse{\equal{\xcb@bakingtemperature@bottomheat}{}}%
{}%
{%
\ifthenelse{\boolean{xcb@bakingtemperature@firstentry}}{\setboolean{xcb@bakingtemperature@firstentry}{false}}{, }%
\xcb@bakingtemperature@bottomheat \ {\fontsize{14.5pt}{10pt}\Bottomheat}%
}%
\ifthenelse{\equal{\xcb@bakingtemperature@gasstove}{}}%
{}%
{%
\ifthenelse{\boolean{xcb@bakingtemperature@firstentry}}{\setboolean{xcb@bakingtemperature@firstentry}{false}}{, }%
\xcb@bakingtemperature@gasstove \ {\fontsize{14.5pt}{10pt}\Gasstove}%
}%
}
%% INTERNAL COMMANDS
\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\xcb@cmd@wrapfill
{% Bug fix for wrapfigure package
\par
\ifx\parshape\WF@fudgeparshape
\nobreak
\vskip-\baselineskip
\vskip\c@WF@wrappedlines\baselineskip
\allowbreak
\WFclear
\fi
}
\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}
}
}
}
\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
{%
\begin{minipage}[T]{\textwidth}
#1
\vspace{0.6cm}
\end{minipage}
}
}
\newcommand*{\pretitle}[1]
{% Hook: entered before the recipe title
\def\xcb@hook@pretitle
{%
#1
}
}
\newcommand*{\prerecipeoverview}[1]
{% Hook: entered before the recipe overview
\def\xcb@hook@prerecipeoverview
{%
#1
}
}
\newcommand*{\prepreparation}[1]
{% Hook: entered before the preparation (steps)
\def\xcb@hook@prepreparation
{%
#1
}
}
\newcommand*{\postpreparation}[1]
{% Hook: entered after the preparation (steps)
\def\xcb@hook@postpreparation
{%
#1
}
}
\newcommand*{\preingredients}[1]
{% Hook: entered before the ingredients
\def\xcb@hook@preingredients
{%
#1
}
}
\newcommand*{\postingredients}[1]
{% Hook: entered after the ingredients
\def\xcb@hook@postingredients
{%
#1
}
}
\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
\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}
\setkeys{recipe}{#1} % reading the optional parameters
\setcounter{xcb@newpagefoot}{1}
\setcounter{xcb@newpagehead}{\value{page}}
}
{% this part is executed at \end{recipe}
%% FIRST BLOCK
\xcb@hook@pregraph
\if@twoside
\ifodd\arabic{page}
\begin{minipage}[T]{\xcb@picture@bigwidth}
\xcb@picture@big
\end{minipage}
\hfill
\begin{minipage}[T]{\xcb@picture@smallwidth}
\xcb@picture@small
\end{minipage}
\else
\begin{minipage}[T]{\xcb@picture@smallwidth}
\xcb@picture@small
\end{minipage}
\hfill
\begin{minipage}[T]{\xcb@picture@bigwidth}
\xcb@picture@big
\end{minipage}
\fi
\else
\begin{minipage}[T]{\xcb@picture@bigwidth}
\xcb@picture@big
\end{minipage}
\hfill
\begin{minipage}[T]{\xcb@picture@smallwidth}
\xcb@picture@small
\end{minipage}
\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
\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}
}
\xcb@hook@prepreparation
\xcb@preparation
\xcb@hook@postpreparation
\xcb@suggestion
\vfill
\xcb@cmd@wrapfill
\xcb@hint
\setcounter{xcb@newpagefoot}{0}
}
\pagestyle{fancy}
\renewcommand{\sectionmark}[1]
{%
\markright{\MakeUppercase{\thesection.\ #1}}
}
\renewcommand{\headrulewidth}
{%
0.5pt
}
\fancyhf{}
\if@twoside
\fancyfoot[LE,RO]{\textbf{\thepage}}
\fancyhead[LE,RO]{\rightmark}
\else
\fancyfoot[R]{\textbf{\thepage}}
\fancyhead[R]{\rightmark}
\fi
\fancyhead[C]{\@newpagehint{head}}
\fancyfoot[C]{\@newpagehint{foot}}
\newcounter{xcb@newpagehead}
\setcounter{xcb@newpagehead}{0}
\newcounter{xcb@newpagefoot}
\setcounter{xcb@newpagefoot}{0}
\newcommand*{\@newpagehint}[1]
{
\ifthenelse{\equal{#1}{head}}
{
\ifnum \value{xcb@newpagehead} < \value{page}
\ifnum \value{xcb@newpagehead} > 0
\xcb@name@continuationhead
\fi
\fi
}
{
\ifthenelse{\value{xcb@newpagefoot} > 0}
{
\xcb@name@continuationfoot
}
{% if no message at the bottom is set, there is no need for a message on the next page
\setcounter{xcb@newpagehead}{0}
}
}
}
\define@key{background}{width}[\linewidth]{\def\xcb@background@width{#1}}
\define@key{background}{height}[\paperheight]{\def\xcb@background@height{#1}}
\define@key{background}{x}[0cm]{\def\xcb@background@x{#1}}
\define@key{background}{y}[0cm]{\def\xcb@background@y{#1}}
\define@key{background}{orientation}[default]{\def\xcb@background@orientation{#1}}
\savekeys{background}
{%
width,
height,
x,
y,
orientation
}
\newcommand*{\setBackgroundPicture}[2][]
{%
\ClearShipoutPictureBG
\setkeys{background}{width, height, x, y, orientation} % initialisation
\setkeys{background}{#1}
\AddToShipoutPicture
{%
\ifthenelse{\equal{\xcb@background@orientation}{default}}
{% default
\put(\xcb@background@x, \xcb@background@y)
{%
\parbox[b][\xcb@background@height]{\xcb@background@width}
{%
\vfill
\includegraphics[width=\xcb@background@width, height=\xcb@background@height, keepaspectratio]{#2}%
\vfill
}
}
}
{%
\ifthenelse{\equal{\xcb@background@orientation}{pagecenter}}
{% pagecenter
\AtPageCenter{%
\makebox(\xcb@background@x, \xcb@background@y)[c]
{%
\includegraphics[width=\xcb@background@width, height=\xcb@background@height, keepaspectratio]{#2}
}
}
}
{%
\ifthenelse{\equal{\xcb@background@orientation}{textcenter}}
{% textcenter
\AtTextCenter{%
\makebox(\xcb@background@x, \xcb@background@y)[c]
{%
\includegraphics[width=\xcb@background@width, height=\xcb@background@height, keepaspectratio]{#2}
}
}
}
{%
\ifthenelse{\equal{\xcb@background@orientation}{stockcenter}}
{% stockcenter
\AtStockCenter{%
\makebox(\xcb@background@x, \xcb@background@y)[c]
{%
\includegraphics[width=\xcb@background@width, height=\xcb@background@height, keepaspectratio]{#2}
}
}
}
{% error message
\PackageError{xcookybooky}
{There is no '\xcb@background@orientation' option for background picture orientation available!}
{The possible options are: default, pagecenter, textcenter or stockcenter}
}
}
}
}
}
}
\endinput
%%
%% End of file `xcookybooky.sty'.

1742
xcookybooky/xcookybooky.dtx Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,62 @@
%% --------------------- xcookybooky.ins -------------------------
\def\filedate{2015/03/03}
\def\batchfile{xcookybooky.ins}
\input docstrip
\ifx\generate\undefined
\obeyspaces
\Msg{************************************************}
\Msg{* *}
\Msg{* This installation requires docstrip *}
\Msg{* version 2.4 or later. *}
\Msg{* *}
\Msg{* An older version of docstrip has been input. *}
\Msg{* *}
\Msg{************************************************}
\errhelp{Move or rename old docstrip.tex and get a newer one.}
\errmessage{Old docstrip in input path}
\batchmode
\csname @@end\endcsname\end
\fi
\keepsilent
\askforoverwritefalse
\preamble
This is a generated file.
Copyright (C) 2015 by Sven Harder
This file may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either
version 1.3 of this license or (at your option) any later
version. The latest version of this license is in:
http://www.latex-project.org/lppl.txt
and version 1.3 or later is part of all distributions of
LaTeX version 2005/12/01 or later.
\endpreamble
\declarepreamble\configpreamble
\endpreamble
\generate
{%
\file{xcookybooky.sty}{\from{xcookybooky.dtx}{package}}
\usepreamble\configpreamble
\file{xcookybooky.cfg}{\from{xcookybooky.dtx}{config}}
}
\obeyspaces
\Msg{**********************************************************************}
\Msg{* *}
\Msg{* \space To finish the installation you have to copy the file *}
\Msg{* *}
\Msg{* \space *.sty and *.cfg into a directory in the search path by TeX *}
\Msg{* *}
\Msg{**********************************************************************}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\endinput