summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-07-20 00:38:10 +0000
committerKarl Berry <karl@freefriends.org>2009-07-20 00:38:10 +0000
commitbefa55daf259a7f10fdcfe9bc77813d9d0c46abe (patch)
tree0bcfe069cefaebec52f196bc6b519cd70c561e6c /Master/texmf-dist/source/latex
parent936650002a466929f2dd9d479166da2083e168a7 (diff)
new latex package cjkpunct (5jul09)
git-svn-id: svn://tug.org/texlive/trunk@14328 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex')
-rw-r--r--Master/texmf-dist/source/latex/cjkpunct/CJKpunct.dtx821
1 files changed, 821 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/latex/cjkpunct/CJKpunct.dtx b/Master/texmf-dist/source/latex/cjkpunct/CJKpunct.dtx
new file mode 100644
index 00000000000..654f2628a76
--- /dev/null
+++ b/Master/texmf-dist/source/latex/cjkpunct/CJKpunct.dtx
@@ -0,0 +1,821 @@
+% \iffalse
+%<*internal>
+\iffalse
+%</internal>
+%<*readme>
+
+CJKpunct is a LaTeX package for adjust spaces around full-width punctuation.
+
+%</readme>
+%<*internal>
+\fi
+%</internal>
+%
+%<*internal>
+\begingroup
+%</internal>
+%<*batchfile>
+\input docstrip.tex
+\keepsilent
+\usedir{tex/latex/CJK/CJKpunct}
+\preamble
+
+ Version 4.8.1-2 (30-Aug-2008)
+
+ This is the file CJKpunct.sty for the CJK package
+
+ Authors:
+ Linbo Zhang (zlb@lsec.cc.ac.cn)
+ Wenchang Sun (sunwch@nankai.edu.cn)
+
+
+\endpreamble
+\askforoverwritefalse
+\generate{\file{CJKpunct.sty}{\from{CJKpunct.dtx}{CJKpunct}}}
+%</batchfile>
+%<batchfile>\endbatchfile
+%<*internal>
+\generate{\file{CJKpunct.ins}{\from{CJKpunct.dtx}{batchfile}}}
+\nopreamble\nopostamble
+\generate{\file{README.txt}{\from{\jobname.dtx}{readme}}}
+\endgroup
+%</internal>
+%
+%<*driver>
+\documentclass[12pt]{ltxdoc}
+\usepackage{xcolor}
+\usepackage[bookmarks=true,CJKbookmarks,bookmarksopen=true,dvipdfm,pdfstartview=FitH]{hyperref}
+\usepackage{CJK}
+\usepackage{CJKspace}
+\usepackage{CJKpunct}
+\textheight 210mm
+\textwidth 150mm
+\oddsidemargin 0pt
+\evensidemargin 0pt
+
+% macros
+{\catcode`\|=0 \catcode`\\=12
+ |gdef|bslash{\}}
+
+\newcommand{\defmacro}[1]{% % Define a macro.
+ \textcolor{macrocolor}{$\backslash$#1}\index{\string\verb+\bslash#1+}%
+}
+
+\newcommand{\usemacro}[1]{% % Define a macro.
+ \textcolor{macrocolor}{\string#1}%
+ #1\index{\string\verb+\string#1+}%
+}
+
+\definecolor{parametercolor}{rgb}{1,0,1}
+\definecolor{optioncolor}{rgb}{0,0,1}
+\definecolor{macrocolor}{rgb}{0,0,0.63}
+
+\newcommand{\usepmacro}[3][]{%
+ \edef\tempa{#1}%
+ \textcolor{macrocolor}{\string#2}%
+ \string{\textcolor{parametercolor}{#3}\string}%
+ \ifx\tempa\@empty\else (#1)\fi%
+ #2{#3}\index{\string\verb+\string#2+}%
+}
+
+\newenvironment{decl}[1][]%
+ {\par\small\addvspace{4.5ex plus 1ex}%
+ \vskip -\parskip
+ \ifx\relax#1\relax
+ \def\@decl@date{}%
+ \else
+ \def\@decl@date{\NEWfeature{#1}}%
+ \fi
+ \noindent\hspace{-\leftmargini}%
+ \begin{tabular}{|l|}\hline\ignorespaces}%
+ {\\\hline\end{tabular}\nobreak\@decl@date\par\nobreak
+ \vspace{2.3ex}\vskip -\parskip}
+
+\renewcommand{\arg}[1]{{\tt\string{}\m{#1}{\tt\string}}}
+\newcommand{\m}[1]{\mbox{\color{parametercolor}$\langle$\it #1\/$\rangle$}}
+
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+\begin{document}
+\begin{CJK*}{GB}{gbsn}
+ \DocInput{CJKpunct.dtx}
+ \makeatletter
+ \c@IndexColumns = 2
+ \PrintIndex
+ \newpage
+\end{CJK*}
+\end{document}
+%</driver>
+%
+%<*CJKpunct>
+\def\fileversion{4.8.1-2}
+\def\filedate{2008/08/30}
+\ProvidesPackage{CJKpunct}[\filedate\space\fileversion]
+%</CJKpunct>
+%
+% \fi
+%
+% \makeatletter ^^A% To document @-cmds
+% \errorcontextlines=999 ^^A% Show up all my mistakes
+%
+% \GetFileInfo{CJKpunct.sty}
+%
+% \title{CJKpunct 使用说明}
+% \author{张林波 \quad 孙文昌}
+% \date{2008 年 8 月 12 日}
+% \maketitle
+%
+%
+% \def\CJKpunct{{\textcolor{blue}{\texttt{CJKpunct}}}}
+% \CJKpunct\ 是一个 \LaTeX\ 宏包, 用于排版中文标点,提供多种标点样式,以实现行末对齐、
+% 标点挤压等效果。 其基本方法来自 CCT。
+% \section{调用方式}
+% \parindent 2em
+% \parskip 5pt
+% \begin{decl}
+% \defmacro{usepackage}\{\textcolor{parametercolor}{CJKpunct}\}
+% \end{decl}
+%
+% \section{常用宏命令}
+% \begin{decl}
+% \defmacro{punctstyle}\arg{punct style}
+% \end{decl}
+%
+% 设置标点格式,有效值分别为
+%
+% \begin{tabular}{ll}
+% punct style & \\
+% \textcolor{parametercolor}{banjiao} & 半角式 \\
+% \textcolor{parametercolor}{quanjiao} & 全角式\\
+% \textcolor{parametercolor}{kaiming} & 开明式\\
+% \textcolor{parametercolor}{hangmobanjiao}& 行末半角式\\
+% \textcolor{parametercolor}{CCT} & CCT 格式\\
+% \textcolor{parametercolor}{plain} & CJK 缺省格式
+% \end{tabular}
+%
+%
+% 注意:为了得到最好的排版效果,需要制作字体相关的 CJKpunct.spa 文件。请参考
+% source/README.txt
+%
+%
+% \begin{decl}
+% \defmacro{CJKpunctallowbreakbetweenpuncts} \\
+% \defmacro{CJKpunctnobreakbetweenpuncts}
+% \end{decl}
+%
+% 缺省状态下,\CJKpunct\ 禁止在相邻的标点间换行(行末半角和 CJK 缺省格式除外)。 使用
+%
+% \defmacro{CJKpunctallowbreakbetweenpuncts}\newline
+% 改变这一设置。注意:行末半角和 CJK 缺省格式总是允许相邻标点间换行。
+%
+% \begin{decl}
+% \defmacro{CJKpunctsetkern}\arg{标点1}\arg{标点2}\arg{间距}
+% \end{decl}
+%
+% 设置标点 1 与标点 2 之间的距离。 例如,\defmacro{CJKpunctsetkern}\{:\}\{“\}\{0.4em\}
+%
+% \begin{decl}
+% \defmacro{CJKpunctmapfamily}\arg{font encoding}\arg{font family}\arg{font series}\arg{font shape}
+% \arg{punct family}
+% \end{decl}
+%
+% 缺省状态下, \CJKpunct\ 根据 CJKfamily 确定当前标点符号的实际字体。 但这对C19com等组合字体
+% 不适用。此命令提供一个解决方案:用户可以指定 \arg{font encoding}/ \arg{font family}/
+% \arg{font series}/ \arg{font shape} 所对应的标点符号字体。例如,对于C19rm, 可以做如下设置:
+%
+% \begin{verbatim}
+% \CJKpunctmapfamily{C19}{rm}{m}{n}{song}
+% \CJKpunctmapfamily{C19}{rm}{bx}{n}{hei}
+% \CJKpunctmapfamily{C19}{rm}{m}{sl}{song}
+% \CJKpunctmapfamily{C19}{rm}{bx}{sl}{hei}
+% \CJKpunctmapfamily{C19}{rm}{m}{it}{kai}
+% \CJKpunctmapfamily{C19}{rm}{bx}{it}{kai}
+% \end{verbatim}
+%
+% \section{制作 CJKpunct.spa 文件}
+%
+% 文件 CJKpunct.spa 保存了字体相关的标点符号宽度。制作方法请参考 source/REAME.txt
+% \StopEventually{}
+%
+%
+% \clearpage
+% \part{CJKpunct.sty}
+%
+%
+% \iffalse
+%<*CJKpunct>
+% \fi
+% \fontsize{10pt}{10pt}\selectfont
+% CJKpunct
+% \begin{macrocode}
+\endlinechar \m@ne
+
+\newif\if@CJKpunct
+\newif\if@CJKpunct@dokerning
+\newcount\CJKpunct@cnta
+\newcount\CJKpunct@cntb
+\newcount\CJKpunct@cntc
+\newcount\CJKpunct@cntd
+\newcount\CJKpunct@cnte
+% \end{macrocode}
+%
+% 为使 \CJKpunct\ 起作用,重定义一些 CJK 宏。
+%
+% \begin{macrocode}
+\let\CJKo@testLastCJK\CJK@testLastCJK
+\def\CJKpunct@testLastCJK{
+ \global\CJK@false
+ \global\edef\CJKpunct@lastkern{\number\lastkern}}
+
+\let\CJKo@testLastKern\CJK@testLastKern
+\def\CJKpunct@testLastKern{
+ \global\CJK@false}
+
+\let\CJKo@testPrePunct\CJK@testPrePunct
+\let\CJKo@testPostPunct\CJK@testPostPunct
+\def\CJKpunct@testPrePunct#1#2#3{}
+\def\CJKpunct@testPostPunct#1#2#3{}
+
+
+\let\CJKo@nobreakglue\CJK@nobreakglue
+\let\CJKoglue\CJKglue
+% \end{macrocode}
+%
+% \defmacro{CJKsymbol} 的定义中需要三重括号以保证兼容 CJKfntef 宏包。
+%
+% \begin{macrocode}
+
+\let\CJKosymbol\CJKsymbol
+\def\CJKpunct@CJKsymbol#1{
+ {{{
+ \ifnum\CJKpunct@lastkern>0\relax
+ \ifnum\CJKpunct@lastcharclass=0\relax
+ \CJKoglue
+ \else
+ \CJKpunct@ULspecials
+ \fi
+ \fi
+ \CJKosymbol{#1}
+ \gdef\CJKpunct@lastcharclass{0}}}}}
+
+\def\CJKpunct@lastcharclass{0}
+\def\CJKpunct@lastkern{0}
+% \end{macrocode}
+%
+% 标点符号的排版规则:
+%
+% \begin{macrocode}
+\let\CJKopunctsymbol\CJKpunctsymbol
+\def\CJKpunct@CJKpunctsymbol#1{
+ \CJKpunct@setfamily
+ \CJKpunct@setmarginkerning
+ \edef\CJKpunct@currentpunct{\CJK@plane/\the#1}
+ \ifcsname CJKpunct@\CJK@enc @\CJKpunct@currentpunct\endcsname
+ \edef\CJKpunct@currentcharclass{
+ \csname CJKpunct@\CJK@enc @\CJKpunct@currentpunct\endcsname}
+ {{{% We need three braces for CJKulem to work
+ \@CJKpunctfalse
+ \ifnum\CJKpunct@lastkern>0\relax
+ \ifnum\CJKpunct@lastcharclass>0\relax
+ \unkern
+ \unkern
+ \ifnum\CJKpunct@punctstyle>0\relax
+ \@CJKpuncttrue
+ \else
+ \ifcsname CJKpunct@specialpunct\CJK@enc \CJKpunct@currentpunct\endcsname
+ \@CJKpuncttrue
+ \fi
+ \fi
+ \fi
+ \fi
+ \if@CJKpunct
+ \CJKpunct@unskip
+ \CJKpunct@setkern{\CJKpunct@lastpunct}{\CJKpunct@currentpunct}
+ \kern \csname CJKpunct\CJKpunct@punctstyle @\CJK@enc @\CJKpunct@family
+ @kern\CJKpunct@lastpunct @\CJKpunct@currentpunct\endcsname
+ \CJKpunct@nobreak
+ \else
+ \CJKpunct@ULspecials
+ \ifnum\CJKpunct@currentcharclass=1\relax
+ \hskip \csname CJKpunct\CJKpunct@punctstyle @\CJK@enc @\CJKpunct@family
+ @lglue@\CJKpunct@currentpunct\endcsname plus 0.1em minus 0.1 em
+ \else
+ \ifcsname CJKpunct@specialpunct\CJK@enc \CJKpunct@currentpunct\endcsname
+ \CJKoglue % breakable
+ \else
+ \nobreak
+ \fi
+ \fi
+ \fi
+ \global\edef\CJKpunct@lastpunct{\CJKpunct@currentpunct}
+
+ \vrule width \csname CJKpunct\CJKpunct@punctstyle @\CJK@enc @\CJKpunct@family
+ @lrule@\CJKpunct@currentpunct\endcsname depth \z@ height \z@
+
+ \CJKopunctsymbol{#1}
+ \vrule width \csname CJKpunct\CJKpunct@punctstyle @\CJK@enc @\CJKpunct@family
+ @rrule@\CJKpunct@currentpunct\endcsname depth \z@ height \z@
+
+ \ifnum\CJKpunct@currentcharclass=2\relax
+ \hskip \csname CJKpunct\CJKpunct@punctstyle @\CJK@enc @\CJKpunct@family
+ @rglue@\CJKpunct@currentpunct\endcsname plus 0.1em minus 0.1 em
+ \fi
+ \global\let\CJKpunct@lastcharclass\CJKpunct@currentcharclass}}}
+ \else
+ \CJKsymbol{#1}
+ \global\def\CJKpunct@lastcharclass{0}
+ \fi}
+% \end{macrocode}
+%
+% 设置当前 font family.
+%
+% \begin{macrocode}
+\def\CJKpunct@setfamily{
+ \ifcsname \CJK@enc @\CJK@family @\f@series @\f@shape\endcsname
+ \global\edef\CJKpunct@family{\csname \CJK@enc @\CJK@family @\f@series @\f@shape\endcsname}
+ \else
+ \edef\CJKpunct@family{\CJK@family}
+ \fi}
+
+\def\CJKpunctmapfamily#1#2#3#4#5{
+ \expandafter\edef\csname #1@#2@#3@#4\endcsname{#5}}
+
+\CJKpunctmapfamily{C19}{rm}{m}{n}{song}
+\CJKpunctmapfamily{C19}{rm}{bx}{n}{hei}
+\CJKpunctmapfamily{C19}{rm}{m}{sl}{song}
+\CJKpunctmapfamily{C19}{rm}{bx}{sl}{hei}
+\CJKpunctmapfamily{C19}{rm}{m}{it}{kai}
+\CJKpunctmapfamily{C19}{rm}{bx}{it}{kai}
+
+\CJKpunctmapfamily{C19}{com}{m}{n}{song}
+\CJKpunctmapfamily{C19}{com}{bx}{n}{hei}
+\CJKpunctmapfamily{C19}{com}{m}{sl}{kai}
+\CJKpunctmapfamily{C19}{com}{bx}{sl}{kai}
+\CJKpunctmapfamily{C19}{com}{m}{it}{kai}
+\CJKpunctmapfamily{C19}{com}{bx}{it}{kai}
+
+\CJKpunctmapfamily{C19}{sf}{m}{n}{you}
+\CJKpunctmapfamily{C19}{sf}{bx}{n}{you}
+\CJKpunctmapfamily{C19}{sf}{m}{sl}{you}
+\CJKpunctmapfamily{C19}{sf}{bx}{sl}{you}
+\CJKpunctmapfamily{C19}{sf}{m}{it}{you}
+\CJKpunctmapfamily{C19}{sf}{bx}{it}{you}
+
+\CJKpunctmapfamily{C19}{tt}{m}{n}{fs}
+\CJKpunctmapfamily{C19}{tt}{bx}{n}{fs}
+\CJKpunctmapfamily{C19}{tt}{m}{sl}{fs}
+\CJKpunctmapfamily{C19}{tt}{bx}{sl}{fs}
+\CJKpunctmapfamily{C19}{tt}{m}{it}{fs}
+\CJKpunctmapfamily{C19}{tt}{bx}{it}{fs}
+% \end{macrocode}
+%
+% CJK 缺省标点符号格式
+%
+% \begin{macrocode}
+\def\CJKpunct@plainpunctsymbol#1#2{
+ \CJKpunctsymbol{#2}}
+% \end{macrocode}
+%
+% 设置标点符号边界宽度。
+%
+% \begin{macrocode}
+\def\CJKpunct@setmarginkerning{
+ \ifcsname CJKpunct @\CJKpunct@punctstyle @\CJK@enc @\CJKpunct@family\endcsname
+ \else
+ \expandafter\gdef\csname CJKpunct @\CJKpunct@punctstyle @\CJK@enc
+ @\CJKpunct@family\endcsname{}
+ \ifcsname CJKpunct@\CJKpunct@family @spaces\endcsname
+ \PackageInfo{CJKpunct}{use punctuation spaces for family '\CJKpunct@family'
+ \space with punctstyle (\CJKpunct@currentpunctstyle)}\relax
+ \edef\CJKpunct@spaces{\csname CJKpunct@\CJKpunct@family @spaces\endcsname}
+ \else
+ \ifcsname CJKpunct@spaces@\CJKpunct@family\endcsname
+ \else
+ \PackageInfo{CJKpunct}{punctuation spaces for family '\CJKpunct@family' do not exist.
+ \space Use family 'def' instead.}\relax
+ \global\expandafter\def\csname CJKpunct@spaces@\CJKpunct@family\endcsname{}
+ \fi
+ \edef\CJKpunct@spaces{\csname CJKpunct@def@spaces\endcsname}
+ \fi
+ \CJKpunct@cnta=0\relax
+ \expandafter\CJKpunct@@setmarginkerning\CJKpunct@spaces
+ \fi}
+
+\def\CJKpunct@@setmarginkerning#1,#2,{
+ \edef\CJKpunct@temp{#1}
+ \ifx\CJKpunct@temp\@empty
+ \def\CJKpunct@temp{}
+ \else
+ \def\CJKpunct@temp{\CJKpunct@@setmarginkerning}
+ \ifnum\CJKpunct@cnta<12
+ \def\CJKpunct@lr{l}
+ \else
+ \def\CJKpunct@lr{r}
+ \fi
+ \edef\CJKpunct@encpn{\csname CJKpunct@pn@\CJK@enc @\the\CJKpunct@cnta\endcsname}
+ \if l\CJKpunct@lr
+ \expandafter\gdef\csname CJKpunct@\CJK@enc @\CJKpunct@encpn\endcsname{1}
+ \else
+ \expandafter\gdef\csname CJKpunct@\CJK@enc @\CJKpunct@encpn\endcsname{2}
+ \fi
+
+ \@CJKpunct@dokerningtrue
+ \ifnum\CJKpunct@punctstyle=\CJKpunct@ps@plain\relax
+ \@CJKpunct@dokerningfalse
+ \else
+ \ifcsname CJKpunct@specialpunct\CJK@enc\CJKpunct@encpn\endcsname
+ \@CJKpunct@dokerningfalse
+ \fi
+ \fi
+
+ \ifnum\CJKpunct@punctstyle=\CJKpunct@ps@banjiao
+ \def\CJKpunct@sidespaces{12}
+ \else
+ \def\CJKpunct@sidespaces{15}
+ \fi
+
+ \ifnum\CJKpunct@cnta=12\relax
+ {\CJKpunct@cntb=#1\relax
+ \advance\CJKpunct@cntb #2\relax
+ \advance\CJKpunct@cntb 2\relax
+ \CJKpunct@numtostring{\CJKpunct@cntb}
+ \edef\CJKpunct@temp{\csname CJKpunct@pn@\CJK@enc @12\endcsname}
+ \CJKpunct@cntc=0\relax
+ \loop
+ \global\expandafter\edef\csname CJKpunct\CJKpunct@punctstyle
+ @\CJK@enc @\CJKpunct@family @kern\CJKpunct@temp @\CJKpunct@temp\endcsname{
+ -0.\CJKpunct@decimal em}
+ \advance \CJKpunct@cntc 1\relax
+ \ifnum\CJKpunct@cntc<6\repeat}
+ \fi
+ \if@CJKpunct@dokerning
+ \CJKpunct@cntb=#1\relax
+ \advance\CJKpunct@cntb -\CJKpunct@sidespaces\relax
+ \ifnum\CJKpunct@cntb<0\relax
+ \CJKpunct@cntb=0\relax
+ \fi
+ \CJKpunct@cntc=#2\relax
+ \advance\CJKpunct@cntc -\CJKpunct@sidespaces\relax
+ \ifnum\CJKpunct@cntc<0\relax
+ \CJKpunct@cntc=0\relax
+ \fi
+
+ \CJKpunct@cntd=\CJKpunct@cntb
+ \advance\CJKpunct@cntd\CJKpunct@cntc\relax
+
+ \ifcase\CJKpunct@punctstyle
+ % hangmobanjiao
+ \or % quanjiao
+ \or % banjiao
+ \advance\CJKpunct@cntd -50\relax
+ \or % kaiming
+ \ifcsname CJKpunct@kaiming\CJK@enc\CJKpunct@encpn\endcsname
+ \else
+ \advance\CJKpunct@cntd -50\relax
+ \fi
+ \or %CCT
+ \advance\CJKpunct@cntd -20\relax
+ \fi
+ \CJKpunct@cnte=\CJKpunct@cntd
+ \ifnum\CJKpunct@cntd<0\relax
+ \CJKpunct@cntd=0\relax
+ \fi
+ \else
+ \CJKpunct@cntb=0\relax
+ \CJKpunct@cntc=0\relax
+ \CJKpunct@cntd=0\relax
+ \CJKpunct@cnte=0\relax
+ \fi
+ \CJKpunct@numtostring{\CJKpunct@cntb}
+ \global\expandafter\edef\csname CJKpunct\CJKpunct@punctstyle
+ @\CJK@enc @\CJKpunct@family @lrule@\CJKpunct@encpn\endcsname{
+ -0.\CJKpunct@decimal em}
+ \CJKpunct@numtostring{\CJKpunct@cntc}
+ \global\expandafter\edef\csname CJKpunct\CJKpunct@punctstyle
+ @\CJK@enc @\CJKpunct@family @rrule@\CJKpunct@encpn\endcsname{
+ -0.\CJKpunct@decimal em}
+ \CJKpunct@numtostring{\CJKpunct@cntd}
+ \global\expandafter\edef\csname CJKpunct\CJKpunct@punctstyle
+ @\CJK@enc @\CJKpunct@family @\CJKpunct@lr glue@\CJKpunct@encpn\endcsname{
+ 0.\CJKpunct@decimal em}
+ \global\expandafter\edef\csname CJKpunct\CJKpunct@punctstyle
+ @\CJK@enc @\CJKpunct@family @\CJKpunct@lr oglue@\CJKpunct@encpn\endcsname{
+ \the\CJKpunct@cnte}
+ \fi
+ \advance \CJKpunct@cnta 1\relax
+ \CJKpunct@temp}
+
+\def\CJKpunct@numtostring#1{
+ \edef\CJKpunct@decimal{\the#1}
+ \ifnum\CJKpunct@decimal<10\relax
+ \edef\CJKpunct@decimal{0\CJKpunct@decimal}
+ \fi}
+% \end{macrocode}
+%
+% 设置相邻标点之间的距离
+%
+% \begin{macrocode}
+\def\CJKpunct@setkern#1#2{
+ \ifcsname CJKpunct\CJKpunct@punctstyle @\CJK@enc @\CJKpunct@family @kern#1@#2\endcsname
+ \else
+ \CJKpunct@cnta=0\relax
+ \ifcsname CJKpunct\CJKpunct@punctstyle @\CJK@enc @\CJKpunct@family @roglue@#1\endcsname
+ \advance\CJKpunct@cnta\csname
+ CJKpunct\CJKpunct@punctstyle @\CJK@enc @\CJKpunct@family @roglue@#1\endcsname
+ \fi
+ \ifcsname CJKpunct\CJKpunct@punctstyle @\CJK@enc @\CJKpunct@family @loglue@#2\endcsname
+ \advance\CJKpunct@cnta\csname CJKpunct\CJKpunct@punctstyle @\CJK@enc @\CJKpunct@family
+ @loglue@#2\endcsname
+ \fi
+ \relax
+ \ifcase\CJKpunct@punctstyle
+ % hangmobanjiao
+ \or % quanjiao
+ \advance\CJKpunct@cnta -50\relax
+ \or % banjiao
+ \or % kaiming
+ \ifcsname CJKpunct@kaiming#1\endcsname
+ \ifcsname CJKpunct\CJKpunct@punctstyle @\CJK@enc @\CJKpunct@family @loglue@#2\endcsname
+ \advance\CJKpunct@cnta -50\relax
+ \fi
+ \fi
+ \fi
+ \ifnum\CJKpunct@cnta<0\relax
+ \CJKpunct@cnta=0\relax
+ \fi
+ \CJKpunct@numtostring{\CJKpunct@cnta}
+ \global\expandafter\edef\csname
+ CJKpunct\CJKpunct@punctstyle @\CJK@enc @\CJKpunct@family @kern#1@#2\endcsname{
+ 0.\CJKpunct@decimal em}
+ \fi}
+% \end{macrocode}
+%
+% CJKfntef 宏包兼容命令:
+%
+% \begin{macrocode}
+
+\let\CJKpunct@unskip\unskip
+\def\CJKpunct@UL@unskip{
+ \ifcsname CJKpunct\CJKpunct@punctstyle @\CJK@enc @\CJKpunct@family
+ @rglue@\CJKpunct@lastpunct\endcsname
+ \hskip -\csname CJKpunct\CJKpunct@punctstyle @\CJK@enc @\CJKpunct@family
+ @rglue@\CJKpunct@lastpunct\endcsname \relax
+ \fi}
+
+\@ifundefined{UL@hskip}{\let\UL@hskip\relax}{}
+
+\def\CJKpunct@punctUL@group{
+ \ifx\hskip\UL@hskip
+ \egroup
+ \UL@stop
+ \UL@start
+ \bgroup
+ \fi}
+
+\def\CJKpunct@ULspecials{}
+
+\AtBeginDocument{
+ \ifcsname UL@hook\endcsname
+ \addto@hook\UL@hook{\let\CJK@ignorespaces\ignorespaces
+ \let\CJKpunct@unskip\CJKpunct@UL@unskip
+ \let\CJKpunct@ULspecials\CJKpunct@punctUL@group}
+ \fi}
+% \end{macrocode}
+%
+% 设置相邻标点间是否允许换行(缺省不允许)。
+%
+% \begin{macrocode}
+\def\CJKpunctallowbreakbetweenpuncts{
+ \def\CJKpunct@nobreak{
+ \ifnum\CJKpunct@lastcharclass=2
+ \hskip 0pt
+ \fi}}
+
+\def\CJKpunctnobreakbetweenpuncts{
+ \let\CJKpunct@nobreak\nobreak}
+\CJKpunctnobreakbetweenpuncts
+% \end{macrocode}
+%
+% 标点符号样式:
+%
+% \begin{macrocode}
+\def\CJKpunctstyle#1{
+ \ifcsname CJKpunct@ps@#1\endcsname
+ \edef\CJKpunct@currentpunctstyle{#1}
+ \edef\CJKpunct@punctstyle{\csname CJKpunct@ps@#1\endcsname}
+ \ifnum\CJKpunct@punctstyle=\CJKpunct@ps@plain\relax
+ \CJKpunctallowbreakbetweenpuncts
+ \let\CJK@testLastCJK\CJKo@testLastCJK
+ \let\CJK@testLastKern\CJKo@testLastKern
+ \let\CJK@testPrePunct\CJKo@testPrePunct
+ \let\CJK@testPostPunct\CJKo@testPostPunct
+ \let\CJKpunct@punctsymbol\CJKpunct@plainpunctsymbol
+ \let\CJKsymbol\CJKosymbol
+ \let\CJKpunctsymbol\CJKopunctsymbol
+ \let\CJKglue\CJKoglue
+ \let\CJK@nobreakglue\CJKo@nobreakglue
+ \let\CJKpunct@utfsymbol\CJKpunct@utfbsymbol
+ \else
+ \let\CJK@testLastCJK\CJKpunct@testLastCJK
+ \let\CJK@testLastKern\CJKpunct@testLastKern
+ \let\CJK@testPrePunct\CJKpunct@testPrePunct
+ \let\CJK@testPostPunct\CJKpunct@testPostPunct
+ \let\CJKpunct@punctsymbol\CJKpunct@@punctsymbol
+ \let\CJKsymbol\CJKpunct@CJKsymbol
+ \let\CJKpunctsymbol\CJKpunct@CJKpunctsymbol
+ \let\CJKglue\relax
+ \let\CJK@nobreakglue\relax
+ \let\CJKpunct@utfsymbol\CJKpunct@utfasymbol
+ \fi
+ \else
+ \PackageWarning{CJKpunct}{Punctstyle #1\space is not defined.}\relax
+ \fi}
+
+\let\punctstyle\CJKpunctstyle
+\def\CJKpunct@ps@hangmobanjiao{0}
+\def\CJKpunct@ps@marginkerning{0}
+\def\CJKpunct@ps@quanjiao{1}
+\def\CJKpunct@ps@fullwidth{1}
+\def\CJKpunct@ps@banjiao{2}
+\def\CJKpunct@ps@halfwidth{2}
+\def\CJKpunct@ps@kaiming{3}
+\def\CJKpunct@ps@mixedwidth{3}
+\def\CJKpunct@ps@CCT{4}
+\def\CJKpunct@ps@plain{5}
+\AtBeginDocument{\punctstyle{quanjiao}}
+
+\def\CJKplainout{\punctstyle{plain}}
+\let\CJKnormalout\relax
+% \end{macrocode}
+%
+% 允许用户使用 \defmacro{CJKpunctsetkern} 调整相邻标点之间的距离
+%
+% \begin{macrocode}
+\def\CJKpunctsetkern#1#2#3{
+ \CJKpunct@setplanenumber{#1}
+ \edef\CJKpunct@pna{\CJKpunct@char@pn}
+ \CJKpunct@setplanenumber{#2}
+ \edef\CJKpunct@pnb{\CJKpunct@char@pn}
+ \global\expandafter\edef\csname CJKpunct\CJKpunct@punctstyle
+ @\CJK@enc @\CJKpunct@family @kern\CJKpunct@pna @\CJKpunct@pnb\endcsname{
+ #3}}
+
+\def\CJKpunct@setplanenumber#1{{
+ \def\CJK@testPrePunct##1##2##3{
+ \global\edef\CJKpunct@charplane{\CJK@plane}
+ \global\edef\CJKpunct@charnumber{\the\@tempcnta}}
+ \savebox\voidb@x{#1}
+ \global\edef\CJKpunct@char@pn{\CJKpunct@charplane/\CJKpunct@charnumber}}}
+
+%
+% 标点符号表, 不能改变顺序!!
+% pre ‘“「『〔([{〈《〖【
+% post —…、。,.:;!?%〕)]}〉》〗】’”」』
+% \end{macrocode}
+%
+% 设置标点符号所对应 CJKplane 和 字符序号, 与编码有关。
+%
+% \begin{macrocode}
+\def\CJKpunct@punctlist#1{
+ \CJKpunct@cnta=0\relax
+ \def\CJKpunct@enc{#1}
+ \CJKpunct@setpunctfamilynumber}
+
+\def\CJKpunct@setpunctfamilynumber#1,{
+ \edef\CJKpunct@temp{#1}
+ \ifx\CJKpunct@temp\@empty
+ \def\CJKpunct@temp{}
+ \else
+ \expandafter\def\csname CJKpunct@pn@\CJKpunct@enc @\the\CJKpunct@cnta\endcsname{#1}
+ \advance \CJKpunct@cnta 1\relax
+ \def\CJKpunct@temp{\CJKpunct@setpunctfamilynumber}
+ \fi
+ \CJKpunct@temp}
+
+\CJKpunct@punctlist{C70}20/24,20/28,30/12,30/14,30/20,ff/8,ff/59,ff/91,%
+30/8,30/10,30/22,30/16,%
+20/20,20/38,30/1,30/2,ff/12,ff/14,ff/26,ff/27,ff/1,ff/31,ff/5,30/21,ff/9,%
+ff/61,ff/93,30/9,30/11,30/23,30/17,20/25,20/29,30/13,30/15,,
+
+%gb
+\CJKpunct@punctlist{C10}01/13,01/15,01/23,01/25,01/17,01/195,01/246,02/22,01/19,%
+01/21,01/27,01/29,%
+01/9,01/12,01/1,01/2,01/199,01/201,01/213,01/214,01/188,01/218,01/192,01/18,%
+01/196,01/248,02/24,01/20,01/22,01/28,01/30,01/14,01/16,01/24,01/26,,
+
+%gbk
+\CJKpunct@punctlist{C19}25/45,25/47,25/55,25/57,25/49,26/163,26/214,26/246,25/51,%
+25/53,25/59,25/61,%
+25/41,25/44,25/33,25/34,26/167,26/169,26/181,26/182,26/156,26/186,26/160,%
+25/50,26/164,26/216,26/248,25/52,25/54,25/60,25/62,25/46,25/48,25/56,25/58,,
+
+\def\CJKpunct@totalpuncts{35}
+% \end{macrocode}
+%
+% 恢复 CJKutf8 重定义的引号
+%
+% \begin{macrocode}
+\ifcsname DeclareUnicodeCharacter\endcsname
+ \DeclareUnicodeCharacter{2018}{\CJKpunct@utfsymbol{"80}{"98}}
+ \DeclareUnicodeCharacter{2019}{\CJKpunct@utfsymbol{"80}{"99}}
+ \DeclareUnicodeCharacter{201C}{\CJKpunct@utfsymbol{"80}{"9C}}
+ \DeclareUnicodeCharacter{201D}{\CJKpunct@utfsymbol{"80}{"9D}}
+ \DeclareUnicodeCharacter{2014}{\CJKpunct@utfsymbol{"80}{"94}}
+ \DeclareUnicodeCharacter{2026}{\CJKpunct@utfsymbol{"80}{"A6}}
+\fi
+\def\CJKpunct@utfasymbol#1#2{
+ \CJK@punctchar{\CJK@uniPunct}{0}{#1}{#2}}
+\def\CJKpunct@utfbsymbol#1#2{
+ \ifnum #2=148
+ \textemdash
+ \else
+ \ifnum #2=166
+ \textellipsis
+ \else
+ \ifnum #2=152
+ \textquoteleft
+ \else
+ \ifnum #2=153
+ \textquoteright
+ \else
+ \ifnum #2=156
+ \textquotedblleft
+ \else
+ \ifnum #2=157
+ \textquotedblright
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi}
+% \end{macrocode}
+%
+% 省略号和破折号:
+%
+% \begin{macrocode}
+\def\CJKpunct@setspecialpunct#1#2{
+ \expandafter\def\csname CJKpunct@specialpunct#1#2\endcsname{}}
+\CJKpunct@setspecialpunct{C70}{20/20}
+\CJKpunct@setspecialpunct{C70}{20/38}
+\CJKpunct@setspecialpunct{C19}{25/41}
+\CJKpunct@setspecialpunct{C19}{25/44}
+\CJKpunct@setspecialpunct{C10}{01/9}
+\CJKpunct@setspecialpunct{C10}{01/12}
+% \end{macrocode}
+%
+% 开明式中的全角标点。
+%
+% \begin{macrocode}
+\def\CJKpunct@setkaimingpunct#1#2{
+ \expandafter\def\csname CJKpunct@kaiming#1#2\endcsname{}}
+\CJKpunct@setkaimingpunct{C70}{30/02}
+\CJKpunct@setkaimingpunct{C70}{ff/1}
+\CJKpunct@setkaimingpunct{C70}{ff/31}
+\CJKpunct@setkaimingpunct{C19}{25/34}
+\CJKpunct@setkaimingpunct{C19}{26/156}
+\CJKpunct@setkaimingpunct{C19}{26/186}
+\CJKpunct@setkaimingpunct{C10}{01/2}
+\CJKpunct@setkaimingpunct{C10}{01/188}
+\CJKpunct@setkaimingpunct{C10}{01/218}
+% \end{macrocode}
+%
+% 缺省标点符号宽度
+%
+% \begin{macrocode}
+\def\CJKpunct@def@spaces{69,18,60,6,63,2,63,3,69,8,69,6,69,1,39,%
+37,63,4,56,2,63,5,63,6,6,6,12,11,23,50,24,54,16,71,20,69,12,76,13,%
+74,26,61,3,50,3,4,8,69,6,69,2,69,38,39,4,62,2,55,5,62,7,62,16,71,9,%
+58,3,62,3,62,,,}
+% \end{macrocode}
+
+%
+% 调入字体相关的设置
+%
+% \begin{macrocode}
+\IfFileExists{CJKpunct.spa}{\input{CJKpunct.spa}}{}
+
+\endlinechar `\^^M
+% \end{macrocode}
+%
+%
+%
+% \iffalse
+%</CJKpunct>
+% \fi
+
+
+%
+% \Finale
+%
+% \typeout{*************************************************************}
+% \typeout{*}
+% \typeout{* To finish the installation you have to move the following}
+% \typeout{* files into a directory searched by LaTeX:}
+% \typeout{*}
+% \typeout{* \space\space\space CJKpunct.sty}
+% \typeout{*}
+% \typeout{*************************************************************}
+% \Finale
+\endinput