CTEX(LaTeX) 编译 中文

本文介绍了使用CTEX处理中文编码问题的方法,包括GBK和UTF-8编码的配置方式,并提供了WinEdt和Eclipse环境下设置编码的具体步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

CTEX 中文编码&编译问题

#win10

tex 文档为 GBK 编码

https://zhidao.baidu.com/question/93645685.html

\documentclass{ctexart}
\usepackage{CJK}
%-------------------------------------------
\begin{document}
\begin{CJK*}{GBK}{song}
这是宋体!你现在可以看到中文了!!!!
\end{CJK*}
\end{document}

 

tex 文档为 UTF-8 编码 must no BOM

 http://www.cnblogs.com/dezheng/p/3874434.html

\documentclass[UTF8]{article}
\usepackage{CTEX}
\begin{document}
...
\end{document}

或者,直接使用ctexart

\documentclass[UTF8]{ctexart}
\begin{document}
...
\end{document}

 

tex源文件内容的开头可以加上一行编码标识 (winedt)
% !Mode:: "TeX:UTF-8"

或者
%# -*- coding:utf-8 -*-

 

IDE 设置

 

1. WinEdt

http://bbs.ctex.org/forum.php?mod=viewthread&tid=77888

http://albertcn.blog.163.com/blog/static/2094201452012619115333645/

 

修改winedt7缺省编码为utf-8的方法:

依次点击options ->preference->unicode,

把enable utf-8 format for modes改为

      *;UTF-8;EDT;INI|UNICODE;UTF-7;ACP;OEM

而enable ansi format for modes改为

      ACP|UNICODE;UTF-8;UTF-7;OEM

 

若不使用utf-8为缺省编码:

把enable utf-8 format for modes改为

      UTF-8;EDT;INI|UNICODE;UTF-7;ACP;OEM

而enable ansi format for modes改为

      *;ACP|UNICODE;UTF-8;UTF-7;OEM

 

 

2. eclipse

默认为 GBK 编码,可修改为 UTF-8

https://github.com/dracula/dracula-theme

 

 

https://jingyan.baidu.com/article/2009576193ee38cb0721b416.html

 

eclipse 转换文件编码的方法

 

 

 

TeXlipse

https://sourceforge.net/projects/texlipse/files/

download plugin and dictionaries, put plugin in eclipse plugin folder, and put the dict in TeXlipse plugin folder.

 

Right Click tex file content in eclipse editor   -> Source  ->Set As Main File , then when save the file , it will be auto compiled

 

转载于:https://www.cnblogs.com/squirrel2300/p/6731393.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值