如何在 LaTeX 中使用 IPA 和其他不常见的 Unicode 字符

如何在 LaTeX 中使用 IPA 和其他不常见的 Unicode 字符

我希望编写一些包含许多 IPA 字符以及一些更晦涩的 Unicode 字符的东西。

这是一个测试文档:

  \documentclass{article}
  \usepackage[utf8]{inputenc}
  \begin{document}
  This is a unicode character: ƿ.
  \end{document}

我使用 XelaTeX 编译它,编译正常,但字符不显示。这适用于部分 Unicode 字符,但不是全部。

这是运行 XelaTeX 时的输出:

This is XeTeX, Version 3.14159265-2.6-0.999991 (TeX Live 2019/Debian) (preloaded format=xelatex)
 restricted \write18 enabled.
entering extended mode
(./test2.tex
LaTeX2e <2020-02-02> patch level 2
L3 programming layer <2020-02-14>
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))
(/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty

Package inputenc Warning: inputenc package ignored with utf8 based engines.

) (/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-xdvipdfmx.def)
(./test2.aux) (/usr/share/texlive/texmf-dist/tex/latex/base/ts1cmr.fd) [1]
(./test2.aux) )
(see the transcript file for additional information)
Output written on test2.pdf (1 page).
Transcript written on test2.log.

注意:如果该字符未显示在您的屏幕上,则它是字符 Wynn (unicode ref: 01BF)。

答案1

您需要使用包含此字符的字体。例如,尝试:

\documentclass{article}
\usepackage{fontspec}
\setromanfont{DejaVu Serif}
\begin{document}
This is a unicode character: ƿ.
\end{document}

假设xelatex您已经DejaVu Serif在机器上安装了:

结果

相关内容