⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ctex.dtx

📁 编写必备的软件包
💻 DTX
📖 第 1 页 / 共 5 页
字号:
% \iffalse meta-comment
%
% Copyright 2003-2006
% CTEX.ORG and any individual authors listed elsewhere in this file.
%
% This file is part of the ctex package project.
% ----------------------------------------------
%
% It may be distributed under the conditions of the LaTeX Project Public
% License, either version 1.2 of this license or (at your option) any
% later version. The latest version of this license is in
%    http://www.latex-project.org/lppl.txt
% and version 1.2 or later is part of all distributions of LaTeX
% version 1999/12/01 or later.
%
%<*!(cfg|fd)>
% \fi
%
%% \CharacterTable
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
%%
%
% \CheckSum{3181}
%
% \iffalse meta-comment
%</!(cfg|fd)>
%
%<*driver>
\ProvidesFile{ctex.dtx}
%</driver>
%
%<sty|cls>\NeedsTeXFormat{LaTeX2e}[1995/12/01]
%<ctex>\ProvidesPackage{ctex}
%<ctexcap>\ProvidesPackage{ctexcap}
%<article>\ProvidesClass{ctexart}
%<report>\ProvidesClass{ctexrep}
%<book>\ProvidesClass{ctexbook}
%<cjk>\ProvidesFile{ctexcjk.clo}
%<cct>\ProvidesFile{ctexcct.clo}
%<def>\ProvidesFile{ctex.def}
%<cap>\ProvidesFile{ctexcap.cfg}
%<conf>\ProvidesFile{ctex.cfg}
%<rm&fd>\ProvidesFile{c19rm.fd}
%<sf&fd>\ProvidesFile{c19sf.fd}
%<tt&fd>\ProvidesFile{c19tt.fd}
  [2007/05/06 v0.8a ctex
%<sty>   macros package]
%<cls>   document class]
%<clo>   document class option]
%<cfg>   configuration file]
%<fd>   font definition file]
%
%<*driver>
   bundle source file]
%</driver>
%
%<*driver>
\documentclass{ltxdoc}
\usepackage{ctex}
\usepackage{texnames}
 \topmargin 0.5 true cm
 \oddsidemargin 2.5 true cm
 \evensidemargin 2.5 true cm
 \textheight 21 true cm
 \textwidth 14 true cm
\EnableCrossrefs
 %\DisableCrossrefs % Say \DisableCrossrefs if index is ready
\CodelineIndex
\RecordChanges      % Gather update information
 %\OnlyDescription  % comment out for implementation details
 %\OldMakeindex     % use if your MakeIndex is pre-v2.9
\begin{document}
  \DocInput{ctex.dtx}
\end{document}
%</driver>
%
%<*def>

%</def>
%
%<*cap>

%% Chinese captions
%%
%% character set: GBK
%% encoding: EUC

%</cap>
%
%<*conf>

%</conf>
%
%<*fd>

%% Chinese characters (extension of GB 2312)
%%
%% character set: GBK
%% font encoding: CJK (extended)

%</fd>
%
% \fi
%
%
% \changes{v0.0}{2003/04/26}{Initial version}
% \changes{v0.1}{2003/08/15}{First beta release}
% \changes{v0.2}{2004/01/16}{Add support for CCT}
% \changes{v0.2c}{2004/02/13}{Add CJKpunct as standard configuration}
% \changes{v0.2d}{2004/04/23}{Change option c5size to base on 10pt basic class}
% \changes{v0.5}{2004/08/23}{Move Chinese definitions from ctex.cfg to ctex.def}
% \changes{v0.6}{2005/09/24}{Adapt to cct-0.6180-0}
% \changes{v0.7}{2005/11/25}{Read configuration files before preamble}
% \changes{v0.8}{2006/06/09}{Split ctex.sty to ctex.sty and ctexcap.sty}
%
%
% \DoNotIndex{\begin,\end,\begingroup,\endgroup}
% \DoNotIndex{\ifx,\ifdim,\ifnum,\ifcase,\else,\or,\fi}
% \DoNotIndex{\let,\def,\xdef,\newcommand,\renewcommand}
% \DoNotIndex{\expandafter,\csname,\endcsname,\relax,\protect}
% \DoNotIndex{\Huge,\huge,\LARGE,\Large,\large,\normalsize}
% \DoNotIndex{\small,\footnotesize,\scriptsize,\tiny}
% \DoNotIndex{\normalfont,\bfseries,\slshape,\interlinepenalty}
% \DoNotIndex{\hfil,\par,\vskip,\vspace,\quad}
% \DoNotIndex{\centering,\raggedright}
% \DoNotIndex{\c@secnumdepth,\@startsection,\@setfontsize}
% \DoNotIndex{\ ,\@plus,\@minus,\p@,\z@,\@m,\@M,\@ne,\m@ne}
% \DoNotIndex{\@@par}
%
%
% \GetFileInfo{ctex.dtx}
%
%
% \MakeShortVerb{\|}
% \setcounter{StandardModuleDepth}{1}
%
%
% \newcommand{\ctex}{\texttt{ctex}}
% \newcommand{\ctexorg}{\texttt{ctex.org}}
%
%
% \setlength{\parskip}{0.75ex plus .2ex minus .5ex}
% \renewcommand{\baselinestretch}{1.2}
%
%
% \makeatletter
% \def\parg#1{\mbox{$\langle${\it #1\/}$\rangle$}}
% \def\@smarg#1{{\tt\string{}\parg{#1}{\tt\string}}}
% \def\@marg#1{{\tt\string{}{\rm #1}{\tt\string}}}
% \def\marg{\@ifstar\@smarg\@marg}
% \def\@soarg#1{{\tt[}\parg{#1}{\tt]}}
% \def\@oarg#1{{\tt[}{\rm #1}{\tt]}}
% \def\oarg{\@ifstar\@soarg\@oarg}
% \makeatother
%
%
% \title{\bf \ctex{}~宏包说明\thanks
%   {本文件版本号为~\fileversion{},最后修改日期~\filedate{}。}}
% \author{\it 吴凌云\thanks{aloft@ctex.org}}
% \date{\small 打印日期:~\today}
% \maketitle
%
%
% \begin{abstract}
% \ctex{}~宏包提供了一个统一的中文~\LaTeX{}~文档框架,底层支持~CCT~和
% ~CJK~两种中文~\LaTeX{}~系统。\ctex{}~宏包提供了编写中文~\LaTeX{}~文档
% 常用的一些宏定义和命令。
%
% \ctex{}~宏包需要~CCT~系统或者~CJK~宏包的支持。
% 主要文件包括~\texttt{ctexart.cls}、
% ~\texttt{ctexrep.cls}、~\texttt{ctexbook.cls}~和
% ~\texttt{ctex.sty}、~\texttt{ctexcap.sty}。
%
% \ctex{}~宏包由~\ctexorg{}~制作并负责维护。
% \end{abstract}
%
%
% \tableofcontents
%
%
% \section{简介}
%
% 这个宏包的部分原始代码来自于由王磊编写~\texttt{cjkbook.cls}~文档类,
% 还有一小部分原始代码来自于吴凌云编写的~\texttt{GB.cap}~文件。
% 原来的这些工作都是零零碎碎编写的,没有认真、系统的设计,
% 也没有用户文档,非常不利于维护和改进。所以我们用~\texttt{doc}~
% 和~\texttt{docstrip}~工具重新编写了整个文档,并增加了许多新的功能。
%
% 最初~Knuth~设计开发~\TeX{}~的时候没有考虑到支持多国语言,
% 特别是多字节的中日韩语言。这使得~\TeX{}~以至后来的
% ~\LaTeX{}~对中文的支持一直不是很好。即使在~CJK~解决了中文字符
% 处理的问题以后,中文用户使用~\LaTeX{}~仍然要面对许多困难。
% 最常见的就是中文化的标题。由于中文习惯和西方语言的不同,
% 使得很难直接使用原有的标题结构来表示中文标题。因此需要对
% 标准~\LaTeX{}~宏包做较大的修改。此外,还有诸如中文字号的对应
% 关系等等。~\ctex{}~宏包正是尝试着解决这些问题。中间很多地方
% 用到了在~\ctexorg{}~论坛上的讨论结果,在此对参与讨论的
% 朋友们表示感谢。
%
% \ctex{}~宏包由五个主要文件构成:
% ~\texttt{ctexart.cls}、~\texttt{ctexrep.cls}、~\texttt{ctexbook.cls}~和
% ~\texttt{ctex.sty}、~\texttt{ctexcap.sty}。~\texttt{ctex.sty}~主要是提供整合的
% 中文环境,可以配合大多数文档类使用。而~\texttt{ctexcap.sty}~则是对~\LaTeX{}~
% 的三个标准文档类的格式进行修改以符合中文习惯,该宏包只能配合这三个标准文档类使用。
% ~\texttt{ctexart.cls}、~\texttt{ctexrep.cls}、~\texttt{ctexbook.cls}~则是
% ~\texttt{ctex.sty}、\texttt{ctexcap.sty}~分别和三个标准文档类结合产生的新文档类,
% 除了包含~\texttt{ctex.sty}、\texttt{ctexcap.sty}~的所有功能,还加入了一些修改文档类
% 缺省设置的内容(如使用五号字体为缺省字体)。
%
% \vskip 10pt
% {\kaishu
% 这份说明文档可以通过用~\LaTeX{}~编译~\texttt{ctex.dtx}~文件来得到。
% 编译说明文档需要~CJK~宏包和~\ctex{}~宏包。
% 为了生成正确的索引和版本记录,需要使用如下命令
% \begin{verbatim}
% makeindex -s gind.ist -o ctex.ind ctex.idx
% makeindex -s gglo.ist -o ctex.gls ctex.glo
% \end{verbatim}
% }
%
%
% \section{使用帮助}
%
% \ctex{}~宏包的使用十分简单。如果是使用~\ctex{}~的文档类,只需用
% ~\texttt{ctexart}、~\texttt{ctexrep}~或者~\texttt{ctexbook}~替换原来的
% 文档类就可以了。你也可以继续使用原来的文档类,而用~\texttt{ctex.sty}~和
% ~\texttt{ctexcap.sty}~宏包来配合使用,两者的效果是一样的
% (除了不能修改一些文档设置如缺省字体大小)。
%
% \subsection{使用~CJK}
%
% 这是~\ctex{}~宏包的缺省设置。\ctex{}~宏包会自动调用~CJK~宏包,你无需再自己调用。
% 此外,\ctex{}~宏包会在~|\begin{document}|~和~|\end{document}|~
% 之间自动加入一个~CJK~环境,你无需再添加~CJK~环境。~CJK~宏包的命令都可以
% 在~|\begin{document}|~和~|\end{document}|~之间正常使用。
%
% 例子1:使用文档类宏包
% \begin{verbatim}
% \documentclass{ctexart}
% \begin{document}
% 中文宏包测试
% \end{document}
% \end{verbatim}
%
% 例子2:使用普通宏包
% \begin{verbatim}
% \documentclass{article}
% \usepackage{ctex}
% \begin{document}
% 中文宏包测试
% \end{document}
% \end{verbatim}
%
% \subsection{使用~CCT}
% \ctex{}~宏包也可以配合新版的~CCT~使用,只需在使用~\ctex{}~宏包时加上~CCT~选项即可。
% 缺省~CCT~会使用~CJK~字库,因为这种字库方式比传统~CCT~字库更方便,兼容性也更好。
% 如果要使用传统~CCT~字库,则还要加上~CCTfont~选项。
%
% 例子3:使用~CJK~方式字库
% \begin{verbatim}
% \documentclass[CCT]{ctexart}
% \begin{document}
% 中文宏包测试
% \end{document}
% \end{verbatim}
%
% 例子2:使用~CCT~方式字库
% \begin{verbatim}
% \documentclass[CCT,CCTfont]{ctexart}
% \begin{document}
% 中文宏包测试
% \end{document}
% \end{verbatim}
%
%
% \subsection{选项}
%
% 宏包的选项用于改变一些缺省风格的设置。缺省的设置已经针对中文
% 的习惯进行了尽量的修改,所以一般用户无需使用这些选项。
% 如果你觉得某些设置不合适,可以向作者反映。我们会考虑在后面的
% 版本中予以改进。我们也欢迎关于增加或者删减选项的建议。
%
%
% 下面的选项可能会是最经常使用的。但是它们只能用于文档类
% (\texttt{ctexart}、~\texttt{ctexrep}~和~\texttt{ctexbook})。
% \begin{description}
% \item[cs4size] 使用小四字号为缺省字体大小。
% \item[c5size] 使用五号字为缺省字体大小。{\heiti 这个是
% ~\ctex{}~文档类的缺省格式。}
% \end{description}
%
%
% 下面这些则可以在文档类宏包和~\texttt{ctex.sty}~上使用。
% \begin{description}
% \item[CCT] 使用~CCT~代替~CJK~做为底层的中文支持系统。
%
% \item[CCTfont] 使用传统的~CCT~字库方式,该选项会自动激活~CCT~选项。
%
% \item[punct] 对中文标点的位置(宽度)进行调整。
%
% \item[nopunct] 不对中文标点的位置进行调整(每个标点占有相同的宽度)。
% \item[space] 使用~CJK~的保留空格模式,保留中文字符间的空格(类似英文的
% 习惯)。你需要自己处理中文字符间的空格以及换行产生的空格(在行尾加上
% ~\%~符号可以避免),否则排版结果可能不符合中文习惯。这种模式可以通过
% ~|\CTEXnospace|~转换到~nospace~模式。
%
% \item[nospace] 使用~CJK~的忽略空格模式,也就是~CJK*~环境的模式。
% ~CJK~会自动忽略中文字符间的空格,比较符合中文习惯。在这种模式下,
% 可以使用~\textasciitilde~来分隔中英文字符,产生的间距稍小于普通空格,
% 排版效果比较美观。这种模式可以通过~|\CTEXspace|~命令转换到~space~模式。
% {\heiti 这个是~\ctex{}~宏包的缺省模式。}
%
% \item[cap] 使用中文的标题样式。{\heiti 这个是文档类宏包的缺省模式。}
%
% \item[nocap] 保留使用英文的标题样式。
%
% \item[indent] 使用中文的段首缩进模式,即缩进两个汉字宽度,同时每个段落
% 都缩进。{\heiti 这个是~\ctex{}~宏包的缺省模式。}
%
% \item[noindent] 使用原来的段首缩进模式,章节标题后的第一段不缩进。
%
% \item[psfont] 使用~PostScript~字库来代替~CM~字库。这个选项只影响英文
% 字库的使用,对中文没有作用。
%
% \item[fancyhdr] 保持和~\texttt{fancyhdr}~宏包的兼容性。该选项将使得
% ~\texttt{fancyhdr}~宏包被自动调用。
%
% \item[amstex] 保持和~\AMSLaTeX{}~宏包的兼容性。
%
% \item[fntef] 为~\texttt{CJKfntef}~宏包和~\texttt{CCTfntef}~宏包提供统一接口。
% 该选项将使得~\texttt{CJKfntef}~宏包或者~\texttt{CCTfntef}~宏包被自动调用。
% \end{description}
%
%
% 下面这些则可以在文档类宏包和~\texttt{ctexcap.sty}~上使用。
% \begin{description}
% \item[cap] 使用中文的标题样式,缺省格式由~\texttt{ctexcap.cfg}~配置文件
% 内的定义给出。{\heiti 这个是文档类宏包的缺省模式。}
%
% \item[nocap] 保留使用英文的标题样式。
%
% \item[sub3section] 将~|\paragraph|~命令产生的标题改为~section~类格式。
% 此时~|\subparagraph|~命令产生的标题会具有原来~|\paragraph|~的格式。
%
% \item[sub4section] 将~|\paragraph|~和~|\subparagraph|~命令产生的标题
% 都改为~section~类格式。
% \end{description}
%
%
% \vskip 10pt
% {\kaishu
% 总结:\ctex{}~宏包的缺省选项是~nospace cap indent,文档类
% 的缺省选项是~nospace cap indent c5size。
% }
%
%
% \subsection{基本命令}
%
% \ctex{}~宏包给用户提供一个通用的文档框架,使得用户可以自由地在不同的
% 底层中文系统间切换。为此,我们为~CJK~定制了一些模拟~CCT~的命令,
% 也对部分~CCT~命令进行了修改,使得两者保持一致。
% 此外,我们还定义了用于设置文档参数的高级设置命令。
%
% \subsubsection{字体设置}
%

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -