问题描述
最近我在学习使用 WinEdt 10.3 进行 LaTeX \LaTeX LATEX 排版的时候,遇到了一个棘手的问题——中文的内容,无论是标题还是正文,都编译不了。
! Package inputenc Error: Unicode character 你 (U+4F60)
(inputenc) not set up for use with LaTeX.
See the inputenc package documentation for explanation.
Type H <return> for immediate help.
...
l.3 你
好,世界
?
! Package inputenc Error: Unicode character 好 (U+597D)
(inputenc) not set up for use with LaTeX.
See the inputenc package documentation for explanation.
Type H <return> for immediate help.
...
l.3 你好
,世界
?
! Package inputenc Error: Unicode character , (U+FF0C)
(inputenc) not set up for use with LaTeX.
See the inputenc package documentation for explanation.
Type H <return> for immediate help.
...
l.3 你好,
世界
?
! Package inputenc Error: Unicode character 世 (U+4E16)
(inputenc) not set up for use with LaTeX.
See the inputenc package documentation for explanation.
Type H <return> for immediate help.
...
l.3 你好,世
界
?
! Package inputenc Error: Unicode character 界 (U+754C)
(inputenc) not set up for use with LaTeX.
See the inputenc package documentation for explanation.
Type H <return> for immediate help.
...
l.3 你好,世界
?
(show.aux) )
No pages of output.
Transcript written on show.log.
_____________________________________________________________________
PDFTeXify Compilation Report (Pages: 0)
Errors: 5 Warnings: 1 Bad Boxes: 0
_____________________________________________________________________
解决方案
总之,在报错之后,我在网上也搜索了大量的资料,有的是调设置,还有的是下载一堆包……但没有一个是适合 WinEdt10.3 这个版本的。因此,在经过了长时间摸索与诸多弯路之后,我终于找到了解决方法:把\documentclass{article}
改成\documentclass[UTF8]{ctexart}
。这种方法不仅适用于这个版本,而且对于更早的版本也是没有问题的。具体实现:
\documentclass[UTF8]{ctexart}
\begin{document}
你好,世界
\end{document}
效果:
如果对你有帮助的话就请点个赞吧!