diff options
author | Karl Berry <karl@freefriends.org> | 2009-07-20 18:00:53 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-07-20 18:00:53 +0000 |
commit | 160531a5e2d0c9b532fb083d090e1f0c451a52f8 (patch) | |
tree | 3cd7622e75a050e7dc06dac94221eb8e999d1053 /Master/texmf-dist/tex/latex/ctex/engine | |
parent | 20db2dd2ad3cdd6e3720c1b5d7c4acc2a5de4f24 (diff) |
new chinese latex package ctex (5jul09)
git-svn-id: svn://tug.org/texlive/trunk@14341 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/ctex/engine')
4 files changed, 228 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/ctex/engine/ctex-cct-engine.def b/Master/texmf-dist/tex/latex/ctex/engine/ctex-cct-engine.def new file mode 100644 index 00000000000..cd54033ed97 --- /dev/null +++ b/Master/texmf-dist/tex/latex/ctex/engine/ctex-cct-engine.def @@ -0,0 +1,82 @@ +% ctex-cct-engine.def: for LaTeX engine with CCT +% vim:ft=tex + +\ifCTEX@cctfont + \RequirePackage{cctbase}[2003/04/05] +\else + \RequirePackage[CJK]{cctbase}[2003/04/05] +\fi +\ifCTEX@punct + \CCTpuncttrue +\else + \CCTpunctfalse +\fi +\ifCTEX@fntef + \RequirePackage{CCTfntef} + \normalem +\fi +\ifCTEX@space + \AtBeginDocument{\CCTspace} +\else + \AtBeginDocument{\CCTnospace} +\fi +\def\CTEXspace{\CCTspace} +\def\CTEXnospace{\CCTnospace} +\ifCTEX@cctfont\else + \CCTdefziti A song song % 宋体 + \CCTdefziti B hei song % 黑体 + \CCTdefziti C kai song % 楷体 + \CCTdefziti D fs song % 仿宋 + \CCTdefziti E bs hei % 标宋 + \CCTdefziti F li hei % 隶书 + \CCTdefziti G you kai % 幼圆 + \DeclareRobustCommand*{\songti}{\ziti{A}\relax} % 宋体 + \DeclareRobustCommand*{\heiti}{\ziti{B}\relax} % 黑体 + \DeclareRobustCommand*{\kaishu}{\ziti{C}\relax} % 楷书 + \DeclareRobustCommand*{\fangsong}{\ziti{D}\relax} % 仿宋 + \DeclareRobustCommand*{\biaosong}{\ziti{E}\relax} % 标宋 + \DeclareRobustCommand*{\lishu}{\ziti{F}\relax} % 隶书 + \DeclareRobustCommand*{\youyuan}{\ziti{G}\relax} % 幼圆 +\fi +\ifx\CCT@set@fontsize\undefined + \let\CCT@set@fontsize\oset@fontsize +\fi +\let\CTEX@save@set@fontsize\set@fontsize +\def\set@fontsize#1#2#3{% + \CCT@set@fontsize{#1}{#2}{#3}% + \zihaoAny{#2}% + \CTEXsetfont} +\let\CTEX@save@ziju\ziju +\renewcommand*\ziju[1]{% 字距 + \CTEX@save@ziju{#1}% + \CTEXsetfont} +\newcommand*\CTEXsetfont{% + \ifdim\parindent=0pt\else\parindent2\ccwd\fi} +\ifCTEX@fntef + \def\CTEXunderdot{\CCTunderdot} + \def\CTEXunderline{\CCTunderline} + \def\CTEXunderdblline{\CCTunderdblline} + \def\CTEXunderwave{\CCTunderwave} + \def\CTEXsout{\CCTsout} + \def\CTEXxout{\CCTxout} + \def\CTEXfilltwosides{\CCTfilltwosides} + \def\endCTEXfilltwosides{\endCCTfilltwosides} + \CTEX@replacecommand{CTEX}{CCT}{underdotbasesep} + \CTEX@replacecommand{CTEX}{CCT}{underdotsep} + \CTEX@replacecommand{CTEX}{CCT}{underlinebasesep} + \CTEX@replacecommand{CTEX}{CCT}{underlinesep} + \CTEX@replacecommand{CTEX}{CCT}{underdbllinebasesep} + \CTEX@replacecommand{CTEX}{CCT}{underdbllinesep} + \CTEX@replacecommand{CTEX}{CCT}{underwavebasesep} + \CTEX@replacecommand{CTEX}{CCT}{underwavesepa} + \CTEX@replacecommand{CTEX}{CCT}{underwavesep} + \CTEX@replacecommand{CTEX}{CCT}{southeight} + \CTEX@replacecommand{CTEX}{CCT}{xoutheight} + \CTEX@replacecommand{CTEX}{CCT}{underdotcolor} + \CTEX@replacecommand{CTEX}{CCT}{underwavecolor} + \CTEX@replacecommand{CTEX}{CCT}{underlinecolor} + \CTEX@replacecommand{CTEX}{CCT}{underdbllinecolor} + \CTEX@replacecommand{CTEX}{CCT}{soutcolor} + \CTEX@replacecommand{CTEX}{CCT}{xoutcolor} +\fi +\endinput diff --git a/Master/texmf-dist/tex/latex/ctex/engine/ctex-cjk-common.def b/Master/texmf-dist/tex/latex/ctex/engine/ctex-cjk-common.def new file mode 100644 index 00000000000..3f76fe44d4a --- /dev/null +++ b/Master/texmf-dist/tex/latex/ctex/engine/ctex-cjk-common.def @@ -0,0 +1,50 @@ +% ctex-cjk-common.def: common definitions shared by cjk-engine and xecjk-engine +% vim:ft=tex + +\ifCTEX@fntef + \RequirePackage{CJKfntef} + \normalem +\fi + +\def\CTEXspace{\CJKspace} +\def\CTEXnospace{\CJKnospace} + +\let\CTEX@save@set@fontsize\set@fontsize +\def\set@fontsize#1#2#3{% + \CTEX@save@set@fontsize{#1}{#2}{#3}% + \CTEXsetfont} +\newcommand*\ziju[1]{% 字距 + \settowidth\@tempdima{\CTEX@spaceChar}% + \renewcommand{\CJKglue}{\hskip #1\@tempdima\@plus.08\baselineskip\relax}% + \CTEXsetfont} % is it a good definition? +\newdimen\ccwd % 字宽 +\newcommand*\CTEXsetfont{% + \settowidth\ccwd{\CTEX@spaceChar\CJKglue}% + \ifdim\parindent=0pt\else\parindent2\ccwd\fi} +\ifCTEX@fntef + \def\CTEXunderdot{\CJKunderdot} + \def\CTEXunderline{\CJKunderline} + \def\CTEXunderdblline{\CJKunderdblline} + \def\CTEXunderwave{\CJKunderwave} + \def\CTEXsout{\CJKsout} + \def\CTEXxout{\CJKxout} + \def\CTEXfilltwosides{\CJKfilltwosides} + \def\endCTEXfilltwosides{\endCJKfilltwosides} + \CTEX@replacecommand{CTEX}{CJK}{underdotbasesep} + \CTEX@replacecommand{CTEX}{CJK}{underdotsep} + \CTEX@replacecommand{CTEX}{CJK}{underlinebasesep} + \CTEX@replacecommand{CTEX}{CJK}{underlinesep} + \CTEX@replacecommand{CTEX}{CJK}{underdbllinebasesep} + \CTEX@replacecommand{CTEX}{CJK}{underdbllinesep} + \CTEX@replacecommand{CTEX}{CJK}{underwavebasesep} + \CTEX@replacecommand{CTEX}{CJK}{underwavesep} + \CTEX@replacecommand{CTEX}{CJK}{southeight} + \CTEX@replacecommand{CTEX}{CJK}{underdotcolor} + \CTEX@replacecommand{CTEX}{CJK}{underwavecolor} + \CTEX@replacecommand{CTEX}{CJK}{underlinecolor} + \CTEX@replacecommand{CTEX}{CJK}{underdbllinecolor} + \CTEX@replacecommand{CTEX}{CJK}{soutcolor} + \CTEX@replacecommand{CTEX}{CJK}{xoutcolor} +\fi + +\endinput diff --git a/Master/texmf-dist/tex/latex/ctex/engine/ctex-cjk-engine.def b/Master/texmf-dist/tex/latex/ctex/engine/ctex-cjk-engine.def new file mode 100644 index 00000000000..ab3ebad6e3a --- /dev/null +++ b/Master/texmf-dist/tex/latex/ctex/engine/ctex-cjk-engine.def @@ -0,0 +1,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 diff --git a/Master/texmf-dist/tex/latex/ctex/engine/ctex-xecjk-engine.def b/Master/texmf-dist/tex/latex/ctex/engine/ctex-xecjk-engine.def new file mode 100644 index 00000000000..2ccbf1d2dba --- /dev/null +++ b/Master/texmf-dist/tex/latex/ctex/engine/ctex-xecjk-engine.def @@ -0,0 +1,27 @@ +% ctex-xecjk-engine.def: for XeTeX engine with xeCJK +% vim:ft=tex + +\CTEX@GBKfalse % XeTeX always use UTF-8 as default encoding + +\RequirePackage[BoldFont,CJKnumber]{xeCJK} +\defaultfontfeatures{Mapping=tex-text} + +\ifCTEX@punct + \punctstyle{quanjiao} +\else + \punctstyle{plain} +\fi + +\input{ctex-cjk-common.def} + +\ifCTEX@nofonts\else + \ifCTEX@cjkfonts + \input{ctex-xecjk-cjkfonts.def} + \else\ifCTEX@winfonts + \input{ctex-xecjk-winfonts.def} + \else\ifCTEX@adobefonts + \input{ctex-xecjk-adobefonts.def} + \fi\fi\fi +\fi + +\endinput |