diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/cjkpunct/CJKpunct.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/cjkpunct/CJKpunct.sty | 490 |
1 files changed, 490 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/cjkpunct/CJKpunct.sty b/Master/texmf-dist/tex/latex/cjkpunct/CJKpunct.sty new file mode 100644 index 00000000000..759da8b9554 --- /dev/null +++ b/Master/texmf-dist/tex/latex/cjkpunct/CJKpunct.sty @@ -0,0 +1,490 @@ +%% +%% This is file `CJKpunct.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% CJKpunct.dtx (with options: `CJKpunct') +%% +%% Version 4.8.2 (06-May-2009) +%% +%% This is the file CJKpunct.sty for the CJK package +%% +%% Authors: +%% Linbo Zhang (zlb@lsec.cc.ac.cn) +%% Wenchang Sun (sunwch@nankai.edu.cn) +%% +%% +\def\fileversion{4.8.2} +\def\filedate{2009/05/06} +\ProvidesPackage{CJKpunct}[\filedate\space\fileversion] +\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 +\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\CJKosymbol\CJKsymbol +\def\CJKpunct@CJKsymbol#1{ + {{{ + \ifnum\CJKpunct@lastkern>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} +\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 + \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} +\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}} + +\def\CJKpunct@plainpunctsymbol#1#2{ + \CJKpunctsymbol{#2}} +\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} +\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} + +\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} +\def\CJKpunctallowbreakbetweenpuncts{ + \def\CJKpunct@nobreak{ + \ifnum\CJKpunct@lastcharclass=2 + \hskip 0pt + \fi}} + +\def\CJKpunctnobreakbetweenpuncts{ + \let\CJKpunct@nobreak\nobreak} +\CJKpunctnobreakbetweenpuncts +\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 +\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}}} + +\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,, + +\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,, + +\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} +\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} +\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} +\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} +\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,,,} + +\IfFileExists{CJKpunct.spa}{\input{CJKpunct.spa}}{} + +\endlinechar `\^^M + +\endinput +%% +%% End of file `CJKpunct.sty'. |