4

I am using xcookybooky to create my own cookbook in greek. Until now I was using iso-8859-7 encoding in all my documents and it was working fine. With xcookybooky there is an issue with this particular encoding. All the letters appear like "Chinese" and the weird thing is that there are no errors.

I tried to change the encoding to utf8 and something rather strange happened. All greek letters appeared as they should be, exept from the RecipeName. There are also some errors that have to do with greek letters and T1.

My code is

\documentclass{article}

\usepackage[english,greek]{babel}
\usepackage[utf8]{inputenc}
%\usepackage[iso-8859-7]{inputenc}
\usepackage{kerkis}

\usepackage{tikz} % for creating the lines for the hint
\usepackage{xcolor}
\usepackage{wrapfig} % To wrap the tabular with the ingredients
\usepackage{ifthen}
\usepackage{xkeyval}
\usepackage{lettrine} % numbering the preparation steps
\usepackage{fancyhdr}
\usepackage{units}
\usepackage{tabularx} % line breaks in tabular
\usepackage{xcookybooky}

\begin{document}
\begin{recipe}{Μπανάνα}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ingredients{
2 αυγά\\
3 & μπανάνες\\
\unit[200]{ml} & βούτυρο\\
\unit[40]{g} & ζάχαρη\\
\unit[50]{g} & κακάο
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\preparation{
\step Πρώτο βήμα
\step Δεύτερο Βήμα
\step Τρίτο Βήμα
\step Τέταρτο Βήμα
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\setRecipenameFont{cmr}{T1}{m}{n}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setHeadlines{
inghead = Υλικά,
prephead = Προετοιμασία,
hinthead = Μυστικό,
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{recipe}
\end{document}

My outputs are

utf8 encoding

enter image description here

iso-8859-7 encoding

enter image description here

Any ideas on that? Note that I'm using pdflatex.

3 Answers 3

5

You have to tell xcookybooky what's the font you want to use for the recipe title, using the correct parameters.

\documentclass{article}

\usepackage[english,greek]{babel}
\usepackage[utf8]{inputenc}
\usepackage{kerkis}

\usepackage{tikz} % for creating the lines for the hint
\usepackage{xcolor}
\usepackage{wrapfig} % To wrap the tabular with the ingredients
\usepackage{ifthen}
\usepackage{xkeyval}
\usepackage{lettrine} % numbering the preparation steps
\usepackage{fancyhdr}
\usepackage{units}
\usepackage{tabularx} % line breaks in tabular
\usepackage{xcookybooky}

\setRecipenameFont{mak}{\encodingdefault}{m}{n}

\begin{document}
\begin{recipe}{Μπανάνα}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ingredients{
2 αυγά\\
3 & μπανάνες\\
\unit[200]{ml} & βούτυρο\\
\unit[40]{g} & ζάχαρη\\
\unit[50]{g} & κακάο
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\preparation{
\step Πρώτο βήμα
\step Δεύτερο Βήμα
\step Τρίτο Βήμα
\step Τέταρτο Βήμα
}
\setHeadlines{
inghead = Υλικά,
prephead = Προετοιμασία,
hinthead = Μυστικό,
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{recipe}
\end{document}

enter image description here

8
  • Thank you very much for your answer! You code is working!!! However, I cannot use handwritten fonts for the recipe name. I tried \setRecipenameFont{fau}{\encodingdefault}{m}{n} but the output is i.imgur.com/6sSMeBJ.png
    – Thanos
    Oct 28, 2013 at 10:41
  • There is no fau font family that I know of, at least in TeX Live
    – egreg
    Oct 28, 2013 at 12:31
  • No? I found it on the xcookybooky's manual. mirror.math.ku.edu/tex-archive/macros/latex/contrib/xcookybooky/… on page 7 and this is actualy working. I've tested it in English and all of the suggested fonts are working.
    – Thanos
    Oct 28, 2013 at 12:48
  • @Thanos It's quite probable that the font doesn't have support for Greek.
    – egreg
    Oct 28, 2013 at 13:27
  • In that case what and how can I modify in order to use greek handwritten font in the recipename?
    – Thanos
    Oct 28, 2013 at 13:33
3

Use xelatex, it makes live easier ... The following was tested with up-to-date MikTeX under Win7. Choose another script font if you do not have segoesc.ttf:

\documentclass{article}
\usepackage{libertine}
\newfontface\rnFont[Scale=3]{segoesc.ttf}
\usepackage[english,greek]{babel}

\usepackage{fancyhdr}
\pagestyle{fancy}
\usepackage{xcookybooky}
\makeatletter
\let\xcb@font@recipename\rnFont
\makeatother

\begin{document}
\section{An example}
\begin{recipe}{Μπανάνα}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ingredients{
2 αυγά\\
3 & μπανάνες\\
\unit[200]{ml} & βούτυρο\\
\unit[40]{g} & ζάχαρη\\
\unit[50]{g} & κακάο
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\preparation{
\step Πρώτο βήμα
\step Δεύτερο Βήμα
\step Τρίτο Βήμα
\step Τέταρτο Βήμα
}
\setHeadlines{
inghead = Υλικά,
prephead = Προετοιμασία,
hinthead = Μυστικό,
}
\end{recipe}
\end{document}

enter image description here

19
  • Thank you very much for your answer! When I first started LaTeX, I wasn't able to work well with xelatex;I was using TXC that didn't xelatex compilation. Anyway, I tried your code but I get something weird. i.imgur.com/jHY3zcz.png How about the RecipeName? It's missing from your picture...
    – Thanos
    Oct 28, 2013 at 9:25
  • the problem with TXC is that old versions didn't support UTF8 which is the default for xelatex and lualatex. The latest version of TYC supports UTF8. And, of corse, you have to configure TXC to save the files in utf8.
    – user2478
    Oct 28, 2013 at 9:29
  • Indeed I use the TXC 2.0 beta and my document is saved as utf8. One more thing. Did your code produce a recipename as a heading? Because with utf8 that's my main problem...
    – Thanos
    Oct 28, 2013 at 9:36
  • see my edited answer, it has now my complete code.
    – user2478
    Oct 28, 2013 at 9:55
  • Still it's not working. i.imgur.com/aEyqUyg.png I get the example in "greeklish" but not what's inside the recipe environment.
    – Thanos
    Oct 28, 2013 at 10:06
0

I've managed to achieve greek hand-written fonts in the title. Unfortunately I cannot avoid XeLaTeX, so I am just changing locally the font style, in the RecipeName entry while having set a main font for the entire document(kerkis, that is). The code is

\documentclass{article}

\usepackage{fontspec}
\setmainfont{Kerkis}
\newfontfamily\kiki{Aka-AcidGR-Kiki}

\usepackage{tikz} % for creating the lines for the hint
\usepackage{xcolor}
\usepackage{wrapfig} % To wrap the tabular with the ingredients
\usepackage{ifthen}
\usepackage{xkeyval}
\usepackage{lettrine} % numbering the preparation steps
\usepackage{fancyhdr}
\usepackage{units}
\usepackage{tabularx} % line breaks in tabular
\usepackage{xcookybooky}

%\setRecipenameFont{fau}{T1}{m}{n}

\begin{document}
\begin{recipe}{\kiki  \Huge Μπανάνα}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ingredients{
2 αυγά\\
3 & μπανάνες\\
\unit[200]{ml} & βούτυρο\\
\unit[40]{g} & ζάχαρη\\
\unit[50]{g} & κακάο
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\preparation{
\step Πρώτο βήμα
\step Δεύτερο Βήμα
\step Τρίτο Βήμα
\step Τέταρτο Βήμα
}
\setHeadlines{
inghead = Υλικά,
prephead = Προετοιμασία,
hinthead = Μυστικό,
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setRecipenameFont{fau}{T1}{m}{n}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{recipe}
\end{document}

and the ouput is

enter image description here

You must log in to answer this question.

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