# "č" character in the word "Koláč" is not output

I am having problems with the "č" character in the word "Koláč" when typesetting cooking recipes. I am using XeTeX right now. Here is my MWE:

\documentclass[]{article}
\usepackage[T1]{fontenc}
\usepackage{a4wide}
\usepackage[czech]{babel}
\usepackage{ifxetex,ifluatex}
\usepackage{xcookybooky}

\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\usepackage[utf8]{inputenc}
\else % if luatex or xelatex
\usepackage{fontspec}
\ifxetex
\usepackage{xltxtra,xunicode}
\fi
\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
\fi

\title{Recepty}
\author{Václav Zeman a Ludmila Zemanová}
\date{\today}

calory = energetický obsah,
continuationfoot = Pokračování na další stránce
}

\begin{document}
\begin{recipe}[
]{Koláč bramborový}
\ingredients{
\unit[30]{dkg} & vařených brambor \\
}
\end{recipe}
\end{document}


The "č" character does not get output, while many other Czech national characters do. What can I do about it?

• What input encoding are you currently using? XeTeX and LuaTeX can handle UTF-8 only.
– Mico
Jun 3, 2013 at 20:55
• @Mico: I am using UTF-8 for the document.
– wilx
Jun 3, 2013 at 21:11
• In my case it was enough to use xltxtra package. But the font's are a bit different, I like more the ones which are without xltxtra :-(. Nov 17, 2015 at 10:59

The xcookybooky package makes wrong assumptions about fonts. But you're doing wrong too:

1. Don't use fontenc with XeLaTeX or LuaLaTeX (it can be used, but not in general cases)

2. Don't use the obsolete a4wide package. Use geometry if you want to modify the page parameters.

3. Don't load xltxtra and xunicode.

The fix is simple: use the default font and encoding for the recipe title:

\documentclass[a4paper]{article}
\usepackage{ifxetex,ifluatex}
\usepackage{xcookybooky}

\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[czech]{babel}
\else % if luatex or xelatex
\usepackage{fontspec}
\defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}
\ifluatex
\usepackage[czech]{babel}
\fi
\ifxetex
\usepackage{polyglossia}
\setmainlanguage{czech}
\fi
\fi

%%% Fix the setting by xcookybooky
\AtBeginDocument{
\setRecipenameFont{\familydefault}{\encodingdefault}{b}{n}
}

\title{Recepty}
\author{Václav Zeman a Ludmila Zemanová}
\date{\today}

calory = energetický obsah,
continuationfoot = Pokračování na další stránce
}

\begin{document}
\begin{recipe}[
]{Koláč bramborový}
\ingredients{
\unit[30]{dkg} & vařených brambor \\
}
\end{recipe}
\end{document}


I've used polyglossia for XeLaTeX, but babel would work too.

“Potato cake”? Should be good. ;-)

• BTW, in TeXLive 2013 one should be able to use Polyglossia with LuaTeX too, though I didn’t test it myself. Jun 3, 2013 at 22:32
• @KhaledHosny I know Élie Roux is doing work on it; I didn't test it myself. I will try. Jun 3, 2013 at 22:34