我正在用xcookybooky
希腊语创建自己的食谱。到目前为止,我iso-8859-7
在所有文档中使用编码,并且工作正常。但xcookybooky
这种特定的编码存在问题。所有字母都显示为“中文”,奇怪的是没有错误。
我尝试将编码更改为utf8
,结果发生了一些相当奇怪的事情。所有希腊字母都按应有的方式显示,但 RecipeName 除外。还有一些与希腊字母和 T1 有关的错误。
我的代码是
\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}
我的输出是
utf8 编码
iso-8859-7 编码
对此有什么想法吗?请注意,我正在使用pdflatex
。
答案1
您必须xcookybooky
使用正确的参数来告诉您想要在菜谱标题中使用的字体。
\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}
答案2
使用xelatex
,它让生活更轻松... 以下内容在 Win7 下使用最新的 MikTeX 进行了测试。如果您没有,请选择其他脚本字体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}
答案3
我已成功在标题中实现希腊手写字体。不幸的是,我无法避免XeLaTeX
,因此我只是在条目中本地更改字体样式,RecipeName
同时为整个文档设置主字体(kerkis
即)。代码是
\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}
输出是