在参考书目中排版希腊字符

在参考书目中排版希腊字符

我一直在努力尝试在我的参考书目中排版希腊字符,但似乎找不到适合我的解决方案。

.tex以下是我正在合作的MWE :

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[backend=biber, bibencoding=utf8]{biblatex}
\addbibresource{library.bib}

\begin{document}
Here is the citation: \cite{duchowski_2012}

\printbibliography
\end{document}

相关条目如下library.bib

@inproceedings{duchowski_2012,
    title = {τεχνη Photons: Evolution of a Course in Data Structures},
    pages = {49-56},
    booktitle = {Eurographics 2012-Education Papers},
    author = {Duchowski, Andrew T.},
    date = {2012}
}

运行 XeLaTeX 和 Biber 后,.bbl文件中的希腊字符正确。但是,第二次运行 XeLaTeX 时,排版引用如下:

[1] AT Duchowski。“光子:数据结构课程的演变”。《欧洲图形学 2012-教育论文》。2012 年,第 49-56 页。

.log文件包含以下几行:

 [1]
Missing character: There is no τ in font cmr10!
Missing character: There is no ε in font cmr10!
Missing character: There is no χ in font cmr10!
Missing character: There is no ν in font cmr10!
Missing character: There is no η in font cmr10!

问题是,我只能使用 Times New Roman 或 Computer Modern 字体来显示大部分文档。我确信希腊字符的排版有例外,但我不想更改整个参考书目的字体。有什么解决方法吗?

答案1

使用 XeLaTeX 时,您不能使用inputenc; 以获得完整的 Unicode 支持,fontspec而是需要。但是,您获得的默认字体是 Latin Modern(非常类似于 Computer Modern),它没有希腊字母。您可以使用ucharclasses

% this is just for getting a self-contained example
% use you normal library.bib file also in \addbibresource
\begin{filecontents*}{\jobname.bib}
@inproceedings{duchowski_2012,
    title = {τεχνη Photons: Evolution of a Course in Data Structures},
    pages = {49-56},
    booktitle = {Eurographics 2012-Education Papers},
    author = {Duchowski, Andrew T.},
    date = {2012}
}
\end{filecontents*}

\documentclass[12pt]{article}

% load fontspec for OpenType support
\usepackage[no-math]{fontspec}

% Since the font has no lowercase Greek, load also ucharclasses
\usepackage[Greek]{ucharclasses}

% bibliography package
\usepackage{biblatex}

% define a font with Greek support
% depending on your setup you might need to type
% \newfontfamily{\greekfont}[Scale=MatchLowercase]{cmunrm.otf}
\newfontfamily{\greekfont}[Scale=MatchLowercase]{CMU Serif}

% when Greek is found, change to \greekfont    
\setTransitionsForGreek{\begingroup\greekfont}{\endgroup}

\addbibresource{\jobname.bib}

\begin{document}
Here is the citation: \cite{duchowski_2012}

\printbibliography
\end{document}

在此处输入图片描述

ucharclasses如果您使用具有希腊字形的 Times 的 OpenType 版本,则无需使用此技巧。

\begin{filecontents*}{\jobname.bib}
@inproceedings{duchowski_2012,
    title = {τεχνη Photons: Evolution of a Course in Data Structures},
    pages = {49-56},
    booktitle = {Eurographics 2012-Education Papers},
    author = {Duchowski, Andrew T.},
    date = {2012}
}
\end{filecontents*}

\documentclass[12pt]{article}
\usepackage[no-math]{fontspec}

\usepackage{biblatex}

\setmainfont[Ligatures=TeX]{Times New Roman}

\addbibresource{\jobname.bib}

\begin{document}
Here is the citation: \cite{duchowski_2012}

\printbibliography
\end{document}

在此处输入图片描述

相关内容