Latex001 | 我走过的弯路之一——如何让Winedt编译中文内容

问题描述

最近我在学习使用 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}

效果:

如果对你有帮助的话就请点个赞吧!


欢迎大家关注我的博客!
我的 GitHub 账号: 欢迎 Fork + PR!
我的洛谷账号:这是我
我的洛谷团队:这是我的团队
欢迎大家关注我,并加入我的团队哦^ _ ^
  • 5
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值