4

i recently started using latex to get all my recipes into a uniform format. Therefore i use the package xcookybooky. When i am entering a recipe and try to compile it i get an error stating "! Missing \endcsname inserted."

I am only getting this error when i am using \step to input the recipe steps. If i use an enumerate i don't get any problems. The failing code is below. I did not know what to keep and what to retain, so i just left all formatting-related things in it...

\documentclass[%
a4paper,
%twoside,
11pt
]{article}

% encoding, font, language
\usepackage[T1]{fontenc}
\usepackage[utf8x]{inputenc}
\usepackage{lmodern}
\usepackage[ngerman, english]{babel}

\usepackage{nicefrac}

\usepackage[]{xcookybooky}
\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            = {Sven Harder},
    pdftitle             = {Example Recipes for xcookybooky},
    pdfsubject           = {Recipes},
    pdfkeywords          = {example, recipes, cookbook, xcookybooky},
    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
\setHeadlines{
    inghead = Zutaten,
    prephead = Zubereitung,
    hinthead = Tipps,
    portionvalue = Portion(en)
}
\setRecipeColors{
    recipename = black,
    ing = black,
    inghead = black,
    hint = black,
    hinthead = black,
    hintline = black,
    numeration = black
}
\setRecipeLengths{
    preparationwidth = 0.65\textwidth,
    ingredientswidth = 0.45\textwidth
}
\begin{document}

% Complete recipe example
\begin{recipe}
[% 
    preparationtime = {\unit[50]{min}},
    bakingtime = {\unit[30]{min}},
    bakingtemperature={\protect\bakingtemperature{topbottomheat=\unit[200]{°C}}},
    portion = {\portion{2}}
]
{Kubanischer Bohnen-Gemüse-Reis}

    \ingredients[16]{%
        1 & Paprika(Gelb)\\
        1 & Paprika(Rot)\\
        \unit[1]{TL} & Räucherpaprika\\
        \unit[2+2]{EL} & Olivenöl\\

    }

    \preparation{%


       \step qfahflkj 
       \step afjlöfj
       \step ajlföja


    }


\end{recipe}
\end{document} 

Thank you a lot for your help!

1 Answer 1

6

lettrine changed some time ago, and the definition of \step in xcookybooky should be adapted. Make a bug report. I wouldn't use utf8x but utf8, but didn't remove it.

 \documentclass[%
a4paper,
%twoside,
11pt
]{article}

% encoding, font, language
\usepackage[T1]{fontenc}
\usepackage[utf8x]{inputenc}
\usepackage{lmodern}
\usepackage[ngerman, english]{babel}

\usepackage{nicefrac}

\usepackage[]{xcookybooky}
\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            = {Sven Harder},
    pdftitle             = {Example Recipes for xcookybooky},
    pdfsubject           = {Recipes},
    pdfkeywords          = {example, recipes, cookbook, xcookybooky},
    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
\setHeadlines{
    inghead = Zutaten,
    prephead = Zubereitung,
    hinthead = Tipps,
    portionvalue = Portion(en)
}
\setRecipeColors{
    recipename = black,
    ing = black,
    inghead = black,
    hint = black,
    hinthead = black,
    hintline = black,
    numeration = black
}
\setRecipeLengths{
    preparationwidth = 0.65\textwidth,
    ingredientswidth = 0.45\textwidth
}

% NEW
\renewcommand{\step}
{%
 \stepcounter{step}%shouldn't be in the argument of lettrine
    \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}{}%
}
\begin{document}

% Complete recipe example
\begin{recipe}
[%
    preparationtime = {\unit[50]{min}},
    bakingtime = {\unit[30]{min}},
    bakingtemperature={\protect\bakingtemperature{topbottomheat=\unit[200]{°C}}},
    portion = {\portion{2}}
]
{Kubanischer Bohnen-Gemüse-Reis}

    \ingredients[16]{%
        1 & Paprika(Gelb)\\
        1 & Paprika(Rot)\\
        \unit[1]{TL} & Räucherpaprika\\
        \unit[2+2]{EL} & Olivenöl
    }

    \preparation{%
       \step qfahflkj
       \step afjlöfj
       \step ajlföja
    }


\end{recipe}
\end{document} 
3
  • Thank you very much. Your little workaround worked perfectly nice. I think i will just import it to my little preample input, so it automatically gets loaded
    – Herbrert
    Commented Mar 27, 2019 at 13:43
  • 1
    If it works you could accept the answer by clicking the tick. Commented Mar 27, 2019 at 13:52
  • 1
    Possibly relevant: github.com/SvenHarder/xcookybooky/issues/13
    – moewe
    Commented Mar 28, 2019 at 10:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .