如何在 pdf 中显示 Unicode 单词

如何在 pdf 中显示 Unicode 单词
%% AMS-LaTeX Created by Wolfram Mathematica 9.0 : www.wolfram.com

\documentclass{article}
\usepackage{amsmath, amssymb, graphics, setspace}

\newcommand{\mathsym}[1]{{}}
\newcommand{\unicode}[1]{{}}

\newcounter{mathematicapage}
\begin{document}

$\unicode{8bbe}\unicode{6709}\unicode{4e8c}\unicode{6b21}\unicode{591a}\unicode{9879}\unicode{5f0f}$

\begin{equation}
f(x,y)=x^2+x y+y^2
\end{equation}

\end{document}

我看不到 Unicode 文字/中文文字。

我使用 WinEdt/CTex

答案1

如果您在现代 TeX 引擎(XeTeX 或 LuaTeX)中使用合适的字体,排版任何 Unicode 字形并不困难。

XeLaTeX 是中文的首选。要输入中文,你应该阅读这篇文章: 如何在 LaTeX 中输入中文?

Mathematica 的输出效果不是很好。如果可能的话,最好用 Mathematica 的某种方法修复这个问题。无论如何,这是针对您的代码的补丁:

% UTF-8 encoding!
% Compile with XeLaTeX!
\documentclass{article}
\usepackage{amsmath, amssymb, graphics, setspace}

\usepackage{xeCJK}
\setCJKmainfont{SimSun}

\newcommand{\unicode}[1]{\uppercase{\text{\symbol{"#1}}}}

\newcounter{mathematicapage}
\begin{document}

$\unicode{8bbe}\unicode{6709}\unicode{4e8c}\unicode{6b21}\unicode{591a}\unicode{9879}\unicode{5f0f}$

\begin{equation}
f(x,y)=x^2+x y+y^2
\end{equation}

\end{document}

相关内容