-
Notifications
You must be signed in to change notification settings - Fork 178
/
ctex001.lvt
79 lines (62 loc) · 1.56 KB
/
ctex001.lvt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
%
% Copyright (C) 2015 Qing Lee
%
%% We use fandol fonts for testing. In pdftex, they can be only used with dvipdfmx
%% driver. Actually, dvipdfmx is preferred and more frequently used in Chinese
%% typesetting with pdftex.
\begingroup
\expandafter\ifx\csname pdfoutput\endcsname\relax
\def\next{}
\else
\expandafter\ifx\csname luatexversion\endcsname\relax
\def\next{\pdfoutput=0\relax}
\PassOptionsToPackage{driver=dvipdfmx}{expl3}
\else
\def\next{}
\fi
\fi
\expandafter\endgroup\next
\documentclass{book}
\input{regression-test}
\AUTHOR{Qing Lee}
% \usepackage[enable-debug]{expl3}
% \ExplSyntaxOn
% \debug_on:n { deprecation }
% \ExplSyntaxOff
\usepackage{xparse}
\usepackage{xtemplate}
\START
\ExplSyntaxOn
%% ctex only supports pdftex, xetex and luatex.
\bool_if:nF
{
\sys_if_engine_pdftex_p:
|| \sys_if_engine_xetex_p:
|| \sys_if_engine_luatex_p:
}
{
\msg_term:n { Not-supported-engine! }
\END
}
%% We omit every message in tex running, but write a marker to .tlg before the final
%% \@@end to indicate running without any errors since engine option "-halt-on-error"
%% is active.
\OMIT
\AtEndDocument
{
\tl_put_left:cn { @@end }
{
\TIMO
\msg_term:n { OK,~ctex-test-passed! }
}
}
\ExplSyntaxOff
% Make sure TU encoding is used by fontspec
\PassOptionsToPackage{tuenc}{fontspec}
%% Using fandol fonts for testing
\usepackage[UTF8, heading, fontset = fandol]{ctex}
\begin{document}
\chapter{测试(test)}
Hello world! 你好,世界!
一二三ABC
\end{document}