<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">% \iffalse
%&lt;*internal&gt;
\iffalse
%&lt;/internal&gt;
%&lt;*readme&gt;
CJKpunct
========

`CJKpunct` is a LaTeX2e macro package to be the companion
of `CJK` package by Werner Lemberg for punctuation location
and width adjustments.

Contributing
------------

This package is a part of the [ctex-kit](https://github.com/CTeX-org/ctex-kit) project.

Issues and pull requests are welcome.

Copyright and Licence
---------------------

    Copyright (C) 2003--2010 by Linbo Zhang &lt;zlb@lsec.cc.ac.cn&gt;
    Copyright (C) 2003--2010 by Wenchang Sun &lt;sunwch@nankai.edu.cn&gt;
    Copyright (C) 2010 by Leo Liu &lt;leoliu.pku@gmail.com&gt;
    Copyright (C) 2016 by Qing Lee &lt;sobenlee@gmail.com&gt;
    ----------------------------------------------------------------------

    This work may be distributed and/or modified under the
    conditions of the LaTeX Project Public License, either
    version 1.3c of this license or (at your option) any later
    version. This version of this license is in
       http://www.latex-project.org/lppl/lppl-1-3c.txt
    and the latest version of this license is in
       http://www.latex-project.org/lppl.txt
    and version 1.3 or later is part of all distributions of
    LaTeX version 2005/12/01 or later.

    This work has the LPPL maintenance status `maintained'.

    The Current Maintainer of this work is Qing Lee.

    This package consists of the files CJKpunct.dtx,
                                       CJKpunct.spa,
                                       setpunct-main.tex,
                                       setpunct-macros.tex,
                                       example-CJKfntef.tex,
                                       example-gb.tex,
                                       example-gbk.tex,
                                       example-utf8.tex,
                                       README.txt,
                 and the derived files CJKpunct.sty,
                                       CJKpunct.pdf,
                                       CJKpunct.ins, and
                                       README.md (this file).
%&lt;/readme&gt;
%&lt;*internal&gt;
\fi
\begingroup
  \def\temp{LaTeX2e}
\expandafter\endgroup\ifx\temp\fmtname\else
\csname fi\endcsname
%&lt;/internal&gt;
%&lt;*batchfile&gt;

\input docstrip %

\keepsilent
\askforoverwritefalse

\preamble

    Copyright (C) 2003--2010 by Linbo Zhang &lt;zlb@lsec.cc.ac.cn&gt;
    Copyright (C) 2003--2010 by Wenchang Sun &lt;sunwch@nankai.edu.cn&gt;
    Copyright (C) 2010 by Leo Liu &lt;leoliu.pku@gmail.com&gt;
    Copyright (C) 2016 by Qing Lee &lt;sobenlee@gmail.com&gt;
--------------------------------------------------------------------------

    This work may be distributed and/or modified under the
    conditions of the LaTeX Project Public License, either
    version 1.3c of this license or (at your option) any later
    version. This version of this license is in
       http://www.latex-project.org/lppl/lppl-1-3c.txt
    and the latest version of this license is in
       http://www.latex-project.org/lppl.txt
    and version 1.3 or later is part of all distributions of
    LaTeX version 2005/12/01 or later.

    This work has the LPPL maintenance status `maintained'.

    The Current Maintainer of this work is Qing Lee.

--------------------------------------------------------------------------

\endpreamble
\postamble

    This package consists of the files CJKpunct.dtx,
                                       CJKpunct.spa,
                                       setpunct-main.tex,
                                       setpunct-macros.tex,
                                       example-CJKfntef.tex,
                                       example-gb.tex,
                                       example-gbk.tex,
                                       example-utf8.tex,
                                       README.txt,
                 and the derived files CJKpunct.sty,
                                       CJKpunct.pdf,
                                       CJKpunct.ins, and
                                       README.md (this file).
\endpostamble

\generate
  {
    \usedir{tex/latex/cjkpunct}
    \file{CJKpunct.sty} {\from{\jobname.dtx}{CJKpunct}}
    \usedir{doc/latex/cjkpunct}
    \nopreamble\nopostamble
    \file{README.md}    {\from{\jobname.dtx}{readme}}
  }
%&lt;/batchfile&gt;
%&lt;batchfile&gt;\Msg{*************************************************************}
%&lt;batchfile&gt;\Msg{*}
%&lt;batchfile&gt;\Msg{* To finish the installation you have to move the following}
%&lt;batchfile&gt;\Msg{* files into a directory searched by LaTeX:}
%&lt;batchfile&gt;\Msg{*}
%&lt;batchfile&gt;\Msg{* \space\space\space  CJKpunct.sty}
%&lt;batchfile&gt;\Msg{*}
%&lt;batchfile&gt;\Msg{*************************************************************}
%&lt;batchfile&gt;\endbatchfile
%&lt;*internal&gt;
\generate{\file{CJKpunct.ins}{\from{\jobname.dtx}{batchfile}}}
\endbatchfile
\fi
%&lt;/internal&gt;
%&lt;*driver&gt;
\documentclass[a4paper,12pt]{ltxdoc}
\usepackage{xcolor}
\usepackage{CJKutf8}
\usepackage{CJKspace}
\usepackage{CJKpunct}
\PassOptionsToPackage{driverfallback=dvipdfmx}{hyperref}
\usepackage{hypdoc}
\hypersetup{pdfencoding=unicode,bookmarksopen=true,pdfstartview=FitH}
\AtBeginShipoutFirst{{%
  \MakePercentComment
  \input{zhwindowsfonts}}}
\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$}}
\setcounter{IndexColumns}{2}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\begin{document}
\begin{CJK*}{UTF8}{rm}
  \DocInput{CJKpunct.dtx}
  \PrintIndex
  \newpage
\end{CJK*}
\end{document}
%&lt;/driver&gt;
%
%&lt;*CJKpunct&gt;
\def\fileversion{4.8.4}
\def\filedate{2016/05/14}
\ProvidesPackage{CJKpunct}[\filedate\space\fileversion]
%&lt;/CJKpunct&gt;
%
% \fi
%
% \makeatletter                         ^^A% To document @-cmds
% \errorcontextlines=999                ^^A% Show up all my mistakes
%
% \CheckSum{936}
% \GetFileInfo{CJKpunct.sty}
%
% \title{CJKpunct ä½¿ç”¨è¯´æ˜Ž}
% \author{å¼&nbsp;æž—æ³¢ \quad å­™æ–‡æ˜Œ}
% \date{2016 å¹´ 5 æœˆ 14 æ—¥}
% \maketitle
%
%
% \def\CJKpunct{{\textcolor{blue}{\texttt{CJKpunct}}}}
% \CJKpunct\ æ˜¯ä¸€ä¸ª \LaTeX\ å®åŒ…ï¼Œ ç”¨äºŽæŽ’ç‰ˆä¸­æ–‡æ&nbsp;‡ç‚¹ï¼Œæä¾›å¤šç§æ&nbsp;‡ç‚¹æ&nbsp;·å¼ï¼Œä»¥å®žçŽ°è¡Œæœ«å¯¹é½ã€
% æ&nbsp;‡ç‚¹æŒ¤åŽ‹ç­‰æ•ˆæžœã€‚ å…¶åŸºæœ¬æ–¹æ³•æ¥è‡ª 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}
%
% è®¾ç½®æ&nbsp;‡ç‚¹æ&nbsp;¼å¼ï¼Œæœ‰æ•ˆå€¼åˆ†åˆ«ä¸º
%
% \begin{tabular}{ll}
%   punct style &amp; \\
%   \textcolor{parametercolor}{banjiao}       &amp; åŠè§’å¼ \\
%   \textcolor{parametercolor}{quanjiao}     &amp; å…¨è§’å¼\\
%   \textcolor{parametercolor}{kaiming}      &amp; å¼€æ˜Žå¼\\
%   \textcolor{parametercolor}{hangmobanjiao}&amp; è¡Œæœ«åŠè§’å¼\\
%   \textcolor{parametercolor}{CCT}          &amp;    CCT æ&nbsp;¼å¼\\
%   \textcolor{parametercolor}{plain}          &amp;   CJK ç¼ºçœæ&nbsp;¼å¼
% \end{tabular}
%
%
% æ³¨æ„ï¼šä¸ºäº†å¾—åˆ°æœ€å¥½çš„æŽ’ç‰ˆæ•ˆæžœï¼Œéœ€è¦åˆ¶ä½œå­—ä½“ç›¸å…³çš„ CJKpunct.spa æ–‡ä»¶ã€‚è¯·å‚è€ƒ
% \nolinkurl{TDS/doc/latex/cjkpunct/setpunct/README.txt}ã€‚
%
%
% \begin{decl}
%   \defmacro{CJKpunctallowbreakbetweenpuncts} \\
%   \defmacro{CJKpunctnobreakbetweenpuncts}
% \end{decl}
%
% ç¼ºçœçŠ¶æ€ä¸‹ï¼Œ\CJKpunct\ ç¦æ­¢åœ¨ç›¸é‚»çš„æ&nbsp;‡ç‚¹é—´æ¢è¡Œï¼ˆè¡Œæœ«åŠè§’å’Œ CJK ç¼ºçœæ&nbsp;¼å¼é™¤å¤–ï¼‰ã€‚ ä½¿ç”¨
%
% \defmacro{CJKpunctallowbreakbetweenpuncts}\newline
% æ”¹å˜è¿™ä¸€è®¾ç½®ã€‚æ³¨æ„ï¼šè¡Œæœ«åŠè§’å’Œ CJK ç¼ºçœæ&nbsp;¼å¼æ€»æ˜¯å…è®¸ç›¸é‚»æ&nbsp;‡ç‚¹é—´æ¢è¡Œã€‚
%
% \begin{decl}
%  \defmacro{CJKpunctsetkern}\arg{æ&nbsp;‡ç‚¹1}\arg{æ&nbsp;‡ç‚¹2}\arg{é—´è·}
% \end{decl}
%
%    è®¾ç½®æ&nbsp;‡ç‚¹ 1 ä¸Žæ&nbsp;‡ç‚¹ 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\ æ&nbsp;¹æ® CJKfamily ç¡®å®šå½“å‰æ&nbsp;‡ç‚¹ç¬¦å·çš„å®žé™…å­—ä½“ã€‚ ä½†è¿™å¯¹C19comç­‰ç»„åˆå­—ä½“
%  ä¸é€‚ç”¨ã€‚æ­¤å‘½ä»¤æä¾›ä¸€ä¸ªè§£å†³æ–¹æ¡ˆï¼šç”¨æˆ·å¯ä»¥æŒ‡å®š \arg{font encoding}/ \arg{font family}/
% \arg{font series}/ \arg{font shape} æ‰€å¯¹åº”çš„æ&nbsp;‡ç‚¹ç¬¦å·å­—ä½“ã€‚ä¾‹å¦‚ï¼Œå¯¹äºŽ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 ä¿å­˜äº†å­—ä½“ç›¸å…³çš„æ&nbsp;‡ç‚¹ç¬¦å·å®½åº¦ã€‚åˆ¶ä½œæ–¹æ³•è¯·å‚è€ƒ
%  \nolinkurl{TDS/doc/latex/cjkpunct/setpunct/README.txt}ã€‚
%
% \StopEventually{}
%
%
% \clearpage
% \part{CJKpunct.sty}
%
%
% \iffalse
%&lt;*CJKpunct&gt;
% \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
%    \end{macrocode}
%
%  \defmacro{CJKsymbol} çš„å®šä¹‰ä¸­éœ€è¦ä¸‰é‡æ‹¬å·ä»¥ä¿è¯å…¼å®¹ CJKfntef å®åŒ…ã€‚
%
%    \begin{macrocode}

\let\CJKosymbol\CJKsymbol
\def\CJKpunct@CJKsymbol#1{
  {{{
  \ifnum\CJKpunct@lastkern&gt;0\relax
    \ifnum\CJKpunct@lastcharclass=0\relax
      \CJKglue
    \else
      \CJKpunct@ULspecials
    \fi
  \fi
  \CJKosymbol{#1}
  \gdef\CJKpunct@lastcharclass{0}}}}}

\def\CJKpunct@lastcharclass{0}
\def\CJKpunct@lastkern{0}
%    \end{macrocode}
%
%  æ&nbsp;‡ç‚¹ç¬¦å·çš„æŽ’ç‰ˆè§„åˆ™ï¼š
%
%    \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&gt;0\relax
      \ifnum\CJKpunct@lastcharclass&gt;0\relax
        \unkern
        \unkern
        \ifnum\CJKpunct@punctstyle&gt;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
          \CJKglue  % 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
    \global\edef\CJKpunct@family{\CJK@family}
  \fi}

\def\CJKpunctmapfamily#1#2#3#4#5{
  \expandafter\edef\csname #1@#2@#3@#4\endcsname{#5}}

%    \end{macrocode}
%
%  CJK ç¼ºçœæ&nbsp;‡ç‚¹ç¬¦å·æ&nbsp;¼å¼
%
%    \begin{macrocode}
\def\CJKpunct@plainpunctsymbol#1#2{
  \CJKpunctsymbol{#2}}
%    \end{macrocode}
%
% è®¾ç½®æ&nbsp;‡ç‚¹ç¬¦å·è¾¹ç•Œå®½åº¦ã€‚
%
%    \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&lt;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\the\CJKpunct@cntc
          @\CJK@enc @\CJKpunct@family @kern\CJKpunct@temp @\CJKpunct@temp\endcsname{
            -0.\CJKpunct@decimal em}
        \advance \CJKpunct@cntc 1\relax
      \ifnum\CJKpunct@cntc&lt;6\repeat}
    \fi
    \if@CJKpunct@dokerning
      \CJKpunct@cntb=#1\relax
      \advance\CJKpunct@cntb -\CJKpunct@sidespaces\relax
      \ifnum\CJKpunct@cntb&lt;0\relax
        \CJKpunct@cntb=0\relax
      \fi
      \CJKpunct@cntc=#2\relax
      \advance\CJKpunct@cntc -\CJKpunct@sidespaces\relax
      \ifnum\CJKpunct@cntc&lt;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&lt;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&lt;10\relax
    \edef\CJKpunct@decimal{0\CJKpunct@decimal}
  \fi}
%    \end{macrocode}
%
%  è®¾ç½®ç›¸é‚»æ&nbsp;‡ç‚¹ä¹‹é—´çš„è·ç¦»
%
%    \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\CJK@enc#1\endcsname
        \advance\CJKpunct@cnta -\csname CJKpunct\CJKpunct@punctstyle @\CJK@enc
          @\CJKpunct@family @roglue@#1\endcsname
        \ifcsname CJKpunct\CJKpunct@punctstyle @\CJK@enc @\CJKpunct@family @loglue@#2\endcsname
          \advance\CJKpunct@cnta -50\relax
        \fi
      \fi
    \fi
    \ifnum\CJKpunct@cnta&lt;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}
%
%  è®¾ç½®ç›¸é‚»æ&nbsp;‡ç‚¹é—´æ˜¯å¦å…è®¸æ¢è¡Œï¼ˆç¼ºçœä¸å…è®¸ï¼‰ã€‚
%
%    \begin{macrocode}
\def\CJKpunctallowbreakbetweenpuncts{
  \def\CJKpunct@nobreak{
    \ifnum\CJKpunct@lastcharclass=2
      \hskip 0pt
    \fi}}

\def\CJKpunctnobreakbetweenpuncts{
  \let\CJKpunct@nobreak\nobreak}
\CJKpunctnobreakbetweenpuncts
%    \end{macrocode}
%
% æ&nbsp;‡ç‚¹ç¬¦å·æ&nbsp;·å¼ï¼š
%
%    \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\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\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} è°ƒæ•´ç›¸é‚»æ&nbsp;‡ç‚¹ä¹‹é—´çš„è·ç¦»
%
%    \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}}}

%
% æ&nbsp;‡ç‚¹ç¬¦å·è¡¨, ä¸èƒ½æ”¹å˜é¡ºåº!!
% pre â€˜â€œã€Œã€Žã€”ï¼ˆï¼»ï½›ã€ˆã€Šã€–ã€
% post  â€”â€¦ã€ã€‚ï¼Œï¼Žï¼šï¼›ï¼ï¼Ÿï¼…ã€•ï¼‰ï¼½ï½ã€‰ã€‹ã€—ã€‘â€™â€ã€ã€
%    \end{macrocode}
%
%  è®¾ç½®æ&nbsp;‡ç‚¹ç¬¦å·æ‰€å¯¹åº” CJKplane å’Œ å­—ç¬¦åºå·ï¼Œ ä¸Žç¼–ç&nbsp;æœ‰å…³ã€‚
%
%    \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}
%
% çœç•¥å·å’Œç&nbsp;´æŠ˜å·ï¼š
%
%    \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}
%
%  å¼€æ˜Žå¼ä¸­çš„å…¨è§’æ&nbsp;‡ç‚¹ã€‚
%
%    \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}
%
% ç¼ºçœæ&nbsp;‡ç‚¹ç¬¦å·å®½åº¦
%
%    \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}
\InputIfFileExists{CJKpunct.spa}{}{}

\endlinechar `\^^M
%    \end{macrocode}
%
% \iffalse
%&lt;/CJKpunct&gt;
% \fi
%
% \Finale
\endinput
</pre></body></html>