unicode in ctex

在英文Windows中,特别是使用了“用utf8提供全球语言支持”时,系统会把所有保存为GBK的api忽略掉,此时CTex只会识别utf8的文档,而utf16不会被编译识别。

同时在tex文件头部documentclass后要申明本文档为utf8格式。

%!Mode:: "TeX:UTF-8"
\documentclass[UTF8]{article}
\usepackage{CTEX}
\begin{document}
这是一个CTEX的utf-8编码例子,{\kaishu 这里是楷体显示},{\songti 这里是宋体显示},{\heiti 这里是黑体显示},{\fangsong 这里是仿宋显示},{\lishu 这里是隶书显示},{\youyuan 这里是幼圆显示}。
\end{document}

refer to:
冰原狼
https://www.pianshen.com/article/97651577419/

CTeX例子

test.tex

1
2
3
4
5
6
7
8
\documentclass{article}
\usepackage{ctex}
\usepackage{cite}
\begin{document}
Hello every one!\cite{articleA}大家还好么?
\bibliographystyle{plain}
\bibliography{refs}
\end{document}

refs.bib

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
@ARTICLE{articleA,
author = {Mr.Woodman},
title = {Woodman's Trueman},
journal = {IEEE magzine},
year = {11},
volume = {2(3)},
pages = {4-42},
owner = {trueman},
timestamp = {02}
}
 
@Inbook{Book1,
author="Mrs.Woodman",
editor="Editor Woodman",
title="Woman",
bookTitle="Woodman's woman",
year="1992",
publisher="Woodman House",
address="New York St.1",
pages="33--25",
isbn="111-222-1",
doi="10.1011/111-11-111-1111-1_11",
url="http://url.org/index.html"
}