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