summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/ctex/engine/ctex-cjk-engine.def
blob: ab3ebad6e3a05af384e5e1bc3b06f9f9990e407a (plain)
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
% ctex-cjk-engine.def: for LaTeX engine with CJK
% vim:ft=tex

\ifCTEX@GBK
  \RequirePackage{CJK}[2003/03/28]
\else
  \RequirePackage{CJKutf8}[2003/03/28]
\fi
\RequirePackage{CJKnumb}[2003/03/28]

\ifCTEX@punct
  \RequirePackage{CJKpunct}[2009/05/06]
\fi

\AtEndOfPackage{\CJK@makeActive}

\ifCTEX@space
  \ifCTEX@GBK
    \def\CTEX@beginCJK{\begin{CJK}{GBK}{rm}}
  \else
    \def\CTEX@beginCJK{\begin{CJK}{UTF8}{rm}}
  \fi
  \def\CTEX@endCJK{\clearpage\end{CJK}}
\else
  \ifCTEX@GBK
    \def\CTEX@beginCJK{\begin{CJK*}{GBK}{rm}\CJKtilde}
  \else
    \def\CTEX@beginCJK{\begin{CJK*}{UTF8}{rm}\CJKtilde}
  \fi
  \def\CTEX@endCJK{\clearpage\end{CJK*}}
\fi

\let\CTEX@begindocumenthook\@begindocumenthook
\let\CTEX@enddocumenthook\@enddocumenthook
\def\AtBeginDocument{\g@addto@macro\CTEX@begindocumenthook}
\def\AtEndDocument{\g@addto@macro\CTEX@enddocumenthook}
\def\@begindocumenthook{\CTEX@begindocumenthook\CTEX@beginCJK}
\def\@enddocumenthook{\CTEX@endCJK\CTEX@enddocumenthook}

\input{ctex-cjk-common.def}

\providecommand*\CTEX@rm@family{}
\providecommand*\CTEX@sf@family{}
\providecommand*\CTEX@tt@family{}

\ifCTEX@nofonts
  \renewcommand*\CTEX@rm@family{gbsn}
  \renewcommand*\CTEX@sf@family{gbsn}
  \renewcommand*\CTEX@tt@family{gbsn}
\else
  \ifCTEX@cjkfonts
    \input{ctex-cjk-cjkfonts.def}
  \else\ifCTEX@winfonts
    \input{ctex-cjk-winfonts.def}
  \else\ifCTEX@adobefonts
    \input{ctex-cjk-adobefonts.def}
  \fi\fi\fi
\fi

\let\CTEX@save@rmfamily\rmfamily
\renewcommand*\rmfamily{\CTEX@save@rmfamily\CJKfamily{\CTEX@rm@family}}
\let\CTEX@save@sffamily\sffamily
\renewcommand*\sffamily{\CTEX@save@sffamily\CJKfamily{\CTEX@sf@family}}
\let\CTEX@save@ttfamily\ttfamily
\renewcommand*\ttfamily{\CTEX@save@ttfamily\CJKfamily{\CTEX@tt@family}}
\let\CTEX@save@normalfont\normalfont
\renewcommand*\normalfont{\CTEX@save@normalfont\CJKfamily{\CTEX@rm@family}}

\endinput