如何处理 XeLaTeX 文档中的 unicode 字符串?
之前的一个问题让我想到了 XeLaTex(关于 LaTeX 和 Unicode)。所以我现在有了这个文档:
\documentclass[a4paper]{article}
\usepackage[cm-default]{fontspec}
\usepackage{xunicode}
\usepackage{xltxtra}
\setmainfont[Mapping=tex-text]{Arial}
\begin{document}
গ a ä ͷ
\end{document}
使用字体“Arial”时,仅显示 a 和 ä,其他两个字符仅显示一个框。如果我删除 \setmainfont-command,则仅显示 a。如果我将“Arial”更改为“Linux Libertine”,我会收到一条错误消息:
非法字体名“Linux Libertine”: 包含“”
这很令人恼火,因为有关 XeLaTeX 的 WikiPedia-Example 的字体名称包含空格。
我需要做什么才能使所有给定的字符出现在我的 pdf 文档中?
an earlier question led me to XeLaTex (it was about LaTeX and Unicode). So I've got now this document:
\documentclass[a4paper]{article}
\usepackage[cm-default]{fontspec}
\usepackage{xunicode}
\usepackage{xltxtra}
\setmainfont[Mapping=tex-text]{Arial}
\begin{document}
গ a ä ͷ
\end{document}
With the font "Arial" only the a and the ä are displayed, the other two characters are only a box each. If I remove the \setmainfont-command, only the a is displayed. If I change "Arial" to "Linux Libertine" I receive an error message:
Illegal fontname `Linux Libertine':
contains ' '
This is irritating, because the WikiPedia-Example about XeLaTeX has a font-name containing spaces.
What do I have to do to make all the given chars appear in my pdf-document?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
如果字体安装正确,它们应该按预期工作(至少它们对我有用)。但是,Arial 和 Linux Libertine 都不包含全部四个字符。特别是第一个字符仅受极少数字体支持(请参阅此列表)。以下示例使用 Code2000 并正确显示所有字符:
If the fonts are correctly installed, they should work as expected (at least they work for me). However, neither Arial nor Linux Libertine contain all four characters. Especially the first character is supported only by a tiny number of fonts (see this list). The following example uses Code2000 and displays all characters correctly:
啊,我明白了;我实际上应该尝试一下你的例子。该字体的 OpenType 名称不是
Linux Libertine
,而是Linux Libertine O
。或者,您可以使用 PostScript 名称:不过,该字体也不具有所有这四个字符。您可能很难找到一个能做到这一点的人。
Ah, I see; I should have actually tried out your example. The OpenType name of the font isn't
Linux Libertine
, it'sLinux Libertine O
. Alternatively, you can use the PostScript name:Still, this font doesn't have all those four characters either. You might have a hard time finding one that does.
显然你需要你的字体来支持你的 Unicode 字符。 TeX Gyre Pagella,如此处建议的,适用于一些中欧变音字符和西里尔字母。
Apparently you need your font to support your Unicode characters. TeX Gyre Pagella, as suggested here, works for me for some Central European diacritic characters and Cyrillic.
抱歉大家这么晚才回答,但我实际上做了我想做的事:
http://www.julianmoritz .de/dl/poster.pdf
问候!
sorry guys to answer so late, but I actually did what i wanted:
http://www.julianmoritz.de/dl/poster.pdf
regards!
您可能无法使用 XeTeX 或 XeLaTeX 加载 TeX Gyre Pagella。切换回常规 LaTeX 并在序言中执行此操作:
you probably won't be able to load TeX Gyre Pagella with XeTeX or XeLaTeX. Switch back to regular LaTeX and do this in your preamble: