summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/cjk/texinput/CJKfntef.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/cjk/texinput/CJKfntef.sty')
-rw-r--r--Master/texmf-dist/tex/latex/cjk/texinput/CJKfntef.sty229
1 files changed, 161 insertions, 68 deletions
diff --git a/Master/texmf-dist/tex/latex/cjk/texinput/CJKfntef.sty b/Master/texmf-dist/tex/latex/cjk/texinput/CJKfntef.sty
index 922cc96db4b..32a643b740c 100644
--- a/Master/texmf-dist/tex/latex/cjk/texinput/CJKfntef.sty
+++ b/Master/texmf-dist/tex/latex/cjk/texinput/CJKfntef.sty
@@ -4,7 +4,7 @@
% created by Wenchang Sun <sunwch@hotmail.com>
% Werner Lemberg <wl@gnu.org>
%
-% Version 4.8.2 (29-Dec-2008)
+% Version 4.8.3 (07-May-2012)
%
% Macros:
% \CJKunderdot{...}
@@ -13,6 +13,9 @@
% \CJKunderwave[*]{...}
% \CJKsout[*]{...}
% \CJKxout[*]{...}
+% \varCJKunderline
+% \CJKunderanyline
+% \CJKunderanysymbol
%
% The following nesting combinations are allowed:
%
@@ -30,8 +33,16 @@
%
% Environment:
% CJKfilltwosides
+%
+%
+% Here an example which shows how to use \CJKunderanysymbol.
+%
+% \def\varCJKunderdot{%
+% \CJKunderanysymbol{0.5em}{$\cdot$}%
+% }
+%
-% Copyright (C) 1994-2008 Werner Lemberg <wl@gnu.org>
+% Copyright (C) 1994-2012 Werner Lemberg <wl@gnu.org>
%
% This program is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
@@ -49,8 +60,8 @@
% MA 02110-1301 USA
\NeedsTeXFormat{LaTeX2e}[1998/06/01]
-\def\fileversion{4.8.2}
-\def\filedate{2008/12/29}
+\def\fileversion{4.8.3}
+\def\filedate{2012/05/07}
\ProvidesPackage{CJKfntef}[\filedate\space\fileversion]
\RequirePackage{CJK}
@@ -59,6 +70,7 @@
\endlinechar \m@ne
+
\ifx\CJKpunctsymbol\undefined
\PackageWarning{CJKfntef}{
You need to download the last version of the CJK package\MessageBreak
@@ -89,6 +101,7 @@
\newcommand{\CJKunderwavesep}{0.00em}
\newcommand{\CJKsoutheight}{0.35em}
+\let\CJKf@global\global
\ifx\color\undefined
\def\CJKunderdotcolor{}
@@ -119,38 +132,48 @@
\def\CJK@preUnderdot{
\ifnum\CJK@nest = \z@
- \global\advance\CJK@fntefSkip \CJKunderdotbasesep
+ \CJKf@global\advance\CJK@fntefSkip \CJKunderdotbasesep
\fi
- \global\advance\CJK@nest \@ne
+ \CJKf@global\advance\CJK@nest \@ne
\xdef\CJK@underdotSkip{\the\CJK@fntefSkip}
- \global\advance\CJK@fntefSkip \CJKunderdotsep
+ \CJKf@global\advance\CJK@fntefSkip \CJKunderdotsep
- \global\setbox\CJK@underdotBox\hbox{{
+ \CJKf@global\setbox\CJK@underdotBox\hbox{{
\CJKunderdotcolor
{$\cdot$}}}
- \global\advance\CJK@fntefSkip \ht\CJK@underdotBox
- \global\advance\CJK@fntefSkip \dp\CJK@underdotBox}
+ \CJKf@global\advance\CJK@fntefSkip \ht\CJK@underdotBox
+ \CJKf@global\advance\CJK@fntefSkip \dp\CJK@underdotBox}
\def\CJK@postUnderdot{
- \global\advance\CJK@fntefSkip -\CJKunderdotsep
- \global\advance\CJK@fntefSkip -\ht\CJK@underdotBox
- \global\advance\CJK@fntefSkip -\dp\CJK@underdotBox
- \gdef\CJK@underdotSkip{\z@}
+ \CJKf@global\advance\CJK@fntefSkip -\CJKunderdotsep
+ \CJKf@global\advance\CJK@fntefSkip -\ht\CJK@underdotBox
+ \CJKf@global\advance\CJK@fntefSkip -\dp\CJK@underdotBox
+ \CJKf@global\def\CJK@underdotSkip{\z@}
- \global\advance\CJK@nest \m@ne
+ \CJKf@global\advance\CJK@nest \m@ne
\ifnum\CJK@nest = \z@
- \global\advance\CJK@fntefSkip -\CJKunderdotbasesep
+ \CJKf@global\advance\CJK@fntefSkip -\CJKunderdotbasesep
\fi}
+
+\ifcsname XeTeXinterchartokenstate\endcsname
+ \def\XeTeX@CJKfntef@hook{
+ \XeTeXinterchartokenstate=0}
+\else
+ \let\XeTeX@CJKfntef@hook\relax
+\fi
+
\newcommand{\CJKunderdot}[1]{
\CJK@preUnderdot
- \global\let\CJK@underdotSymbol \CJKsymbol
- \gdef\CJKsymbol##1{
+ \CJKf@global\let\CJK@underdotSymbol \CJKsymbol
+ \CJKf@global\def\CJKsymbol##1{
\CJK@underdotSymbol{##1}
- \settowidth\CJK@fntefDimen{\CJK@underdotSymbol{##1}}
+ \settowidth\CJK@fntefDimen{{
+ \XeTeX@CJKfntef@hook
+ \CJK@underdotSymbol{##1}}}
\leavevmode
\rlap{
\vbox to \z@ {
@@ -160,10 +183,9 @@
\hss
\copy\CJK@underdotBox
\hss}
- \hskip -\CJK@fntefDimen
\vss}}}
#1
- \global\let\CJKsymbol \CJK@underdotSymbol
+ \CJKf@global\let\CJKsymbol \CJK@underdotSymbol
\CJK@postUnderdot
\ignorespaces}
@@ -183,14 +205,14 @@
\fi}
\def\CJK@fntefSave{
- \global\let\UL@UL@CJKnobreakglue \UL@CJKnobreakglue
- \global\let\UL@CJKsymbol \CJKsymbol
- \global\let\UL@CJKpunctsymbol \CJKpunctsymbol}
+ \CJKf@global\let\UL@UL@CJKnobreakglue \UL@CJKnobreakglue
+ \CJKf@global\let\UL@CJKsymbol \CJKsymbol
+ \CJKf@global\let\UL@CJKpunctsymbol \CJKpunctsymbol}
\def\CJK@fntefRestore{
- \global\let\UL@CJKnobreakglue \UL@UL@CJKnobreakglue
- \global\let\CJKsymbol \UL@CJKsymbol
- \global\let\CJKpunctsymbol \UL@CJKpunctsymbol}
+ \CJKf@global\let\UL@CJKnobreakglue \UL@UL@CJKnobreakglue
+ \CJKf@global\let\CJKsymbol \UL@CJKsymbol
+ \CJKf@global\let\CJKpunctsymbol \UL@CJKpunctsymbol}
\def\CJK@preUL{
\ifCJK@UL@
@@ -200,36 +222,36 @@
\string\CJKsout[*], \string\CJKxout[*],\MessageBreak
or \string\CJKunderdblline[*] is not supported.}
\else
- \global\CJK@UL@true
+ \CJKf@global\CJK@UL@true
\fi
\ifCJK@sxout@
- \gdef\CJK@ULskip{\z@}
+ \CJKf@global\def\CJK@ULskip{\z@}
\else
\ifnum\CJK@nest = \z@
- \global\advance\CJK@fntefSkip \CJK@ULbasesep
+ \CJKf@global\advance\CJK@fntefSkip \CJK@ULbasesep
\fi
- \global\advance\CJK@nest \@ne
+ \CJKf@global\advance\CJK@nest \@ne
- \global\advance\CJK@fntefSkip \ht\CJK@ULbox
- \global\advance\CJK@fntefSkip \dp\CJK@ULbox
+ \CJKf@global\advance\CJK@fntefSkip \ht\CJK@ULbox
+ \CJKf@global\advance\CJK@fntefSkip \dp\CJK@ULbox
\xdef\CJK@ULskip{\the\CJK@fntefSkip}
- \global\advance\CJK@fntefSkip \CJK@ULsep
+ \CJKf@global\advance\CJK@fntefSkip \CJK@ULsep
\fi}
\def\CJK@postUL{
- \global\CJK@UL@false
+ \CJKf@global\CJK@UL@false
\ifCJK@sxout@
- \global\CJK@sxout@false
+ \CJKf@global\CJK@sxout@false
\else
- \global\advance\CJK@fntefSkip -\CJK@ULsep
- \global\advance\CJK@fntefSkip -\ht\CJK@ULbox
- \global\advance\CJK@fntefSkip -\dp\CJK@ULbox
+ \CJKf@global\advance\CJK@fntefSkip -\CJK@ULsep
+ \CJKf@global\advance\CJK@fntefSkip -\ht\CJK@ULbox
+ \CJKf@global\advance\CJK@fntefSkip -\dp\CJK@ULbox
- \global\advance\CJK@nest \m@ne
+ \CJKf@global\advance\CJK@nest \m@ne
\ifnum\CJK@nest = \z@
- \global\advance\CJK@fntefSkip -\CJK@ULbasesep
+ \CJKf@global\advance\CJK@fntefSkip -\CJK@ULbasesep
\fi
\fi}
@@ -237,12 +259,12 @@
\CJK@preUL
\CJK@fntefSave
- \global\let\UL@CJKnobreakglue \UL@CJKpunctnobreakglue
- \gdef\CJKsymbol{
- \gdef\UL@leadtype{\leaders\copy\ULC@box}
+ \CJKf@global\let\UL@CJKnobreakglue \UL@CJKpunctnobreakglue
+ \CJKf@global\def\CJKsymbol{
+ \CJKf@global\def\UL@leadtype{\leaders\copy\ULC@box}
\UL@CJKsymbol}
- \gdef\CJKpunctsymbol{
- \gdef\UL@leadtype{}
+ \CJKf@global\def\CJKpunctsymbol{
+ \CJKf@global\def\UL@leadtype{}
\UL@CJKpunctsymbol}
\bgroup
@@ -272,9 +294,9 @@
% The same as \CJKunderwave* but ignoring CJK punctuation characters.
%
\newcommand{\CJKunderwave}{
- \global\let\CJK@ULsep \CJKunderwavesep
- \global\let\CJK@ULbasesep \CJKunderwavebasesep
- \global\setbox\CJK@ULbox\hbox{{
+ \CJKf@global\let\CJK@ULsep \CJKunderwavesep
+ \CJKf@global\let\CJK@ULbasesep \CJKunderwavebasesep
+ \CJKf@global\setbox\CJK@ULbox\hbox{{
\CJKunderwavecolor
\sixly
\char 58}}
@@ -293,9 +315,9 @@
% The same as \CJKunderline* but ignoring CJK punctuation characters.
%
\newcommand{\CJKunderline}{
- \global\let\CJK@ULsep \CJKunderlinesep
- \global\let\CJK@ULbasesep \CJKunderlinebasesep
- \global\setbox\CJK@ULbox\hbox{{
+ \CJKf@global\let\CJK@ULsep \CJKunderlinesep
+ \CJKf@global\let\CJK@ULbasesep \CJKunderlinebasesep
+ \CJKf@global\setbox\CJK@ULbox\hbox{{
\CJKunderlinecolor
\vtop{\hrule \@height \ULthickness \@width .2em}}}
@@ -308,10 +330,10 @@
% underlining.
%
\newcommand{\CJKunderdblline}{
- \global\let\CJK@ULsep \CJKunderdbllinesep
- \global\let\CJK@ULbasesep \CJKunderdbllinebasesep
+ \CJKf@global\let\CJK@ULsep \CJKunderdbllinesep
+ \CJKf@global\let\CJK@ULbasesep \CJKunderdbllinebasesep
- \global\setbox\CJK@ULbox\hbox{{
+ \CJKf@global\setbox\CJK@ULbox\hbox{{
\CJKunderdbllinecolor
\vtop{
\kern -.07em
@@ -332,8 +354,8 @@
% The same as \CJKsout* but ignoring CJK punctuation characters.
%
\def\CJKsout{
- \global\CJK@sxout@true
- \global\setbox\CJK@ULbox\hbox{{
+ \CJKf@global\CJK@sxout@true
+ \CJKf@global\setbox\CJK@ULbox\hbox{{
\CJKsoutcolor
\vtop{
\kern -\CJKsoutheight
@@ -351,8 +373,8 @@
% The same as \CJKxout* but ignoring CJK punctuation characters.
%
\def\CJKxout{
- \global\CJK@sxout@true
- \global\setbox\CJK@ULbox\hbox{{
+ \CJKf@global\CJK@sxout@true
+ \CJKf@global\setbox\CJK@ULbox\hbox{{
\kern -0.1em
{\CJKxoutcolor $/$}
\kern -0.1em}}
@@ -373,19 +395,19 @@
% \end{CJKfilltwosides}
%
\newif\ifCJK@fillbegin@
-\global\CJK@fillbegin@false
+\CJKf@global\CJK@fillbegin@false
\newif\ifCJK@filltwosides@
-\global\CJK@filltwosides@false
+\CJKf@global\CJK@filltwosides@false
\newenvironment{CJKfilltwosides}[1]{
\leavevmode
\vbox\bgroup
- \global\CJK@filltwosides@true
- \global\let\CJK@filltwosidesSymbol \CJKsymbol
+ \CJKf@global\CJK@filltwosides@true
+ \CJKf@global\let\CJK@filltwosidesSymbol \CJKsymbol
\def\CJK@ftscr{
\egroup
- \global\CJK@fillbegin@false
+ \CJKf@global\CJK@fillbegin@false
\hbox to #1\bgroup
\ignorespaces}
@@ -397,7 +419,7 @@
\CJK@filltwosidesSymbol{##1}
\else
\CJK@filltwosidesSymbol{##1}
- \global\CJK@fillbegin@true
+ \CJKf@global\CJK@fillbegin@true
\fi}
\hbox to #1\bgroup
@@ -406,9 +428,80 @@
\egroup
\egroup
- \global\let\CJKsymbol \CJK@filltwosidesSymbol
- \global\CJK@fillbegin@false
- \global\CJK@filltwosides@false}
+ \CJKf@global\let\CJKsymbol \CJK@filltwosidesSymbol
+ \CJKf@global\CJK@fillbegin@false
+ \CJKf@global\CJK@filltwosides@false}
+
+
+%
+% \varCJKunderline:
+% The same as \CJKunderline but leaving spaces between two consecutive
+% \varCJKunderline calls. The separation on the left and right can be
+% controlled by redefining \CJKulineleftskip and \CJKulinerightskip,
+% respectively.
+%
+\def\CJKulineleftskip{0.2em}
+\def\CJKulinerightskip{0.2em}
+
+\def\varCJKunderline#1{
+ {\null
+ \hskip\CJKulineleftskip}
+ \CJKunderline{
+ {\hskip-\CJKulineleftskip}
+ #1
+ {\hskip-\CJKulinerightskip}}
+ {\hskip\CJKulinerightskip}}
+
+
+%
+% \CJKunderanyline:
+% The same as \varCJKunderline but using a user-defined underline shape.
+% The first argument gives the distance to the baseline, the second
+% argument the object used for underlining.
+%
+\def\CJK@underanyline#1#2{
+ \setbox\UL@box\hbox{{#2}}
+ \bgroup\markoverwith{\lower #1\copy\UL@box}\ULon}
+
+\def\CJKunderanyline#1#2#3{
+ {\null
+ \hskip\CJKulineleftskip}
+ \CJK@underanyline{#1}{#2}{
+ {\hskip-\CJKulineleftskip}
+ #3
+ {\hskip-\CJKulinerightskip}}
+ {\hskip\CJKulinerightskip}}
+
+
+%
+% \CJKunderanysymbol:
+% The same as \CJKunderdot but using a user-defined underline shape.
+% The first argument gives the distance to the baseline, the second
+% argument the object used for `underdotting'.
+%
+\newdimen\CJK@underanyskip
+
+\def\CJKunderanysymbol#1#2#3{{
+ \CJK@underanyskip #1\relax
+ \setbox\CJK@underdotBox\hbox{{#2}}
+ \CJKf@global\let\CJK@underanysymbol\CJKsymbol
+ \CJKf@global\def\CJK@fntefglue{
+ \CJKf@global\let\CJK@fntefglue\CJKglue}
+ \CJKf@global\def\CJKsymbol##1{
+ \CJK@fntefglue
+ \CJK@underanysymbol{##1}
+ \leavevmode
+ \rlap{
+ \lower \CJK@underanyskip
+ \hbox to \z@ {
+ \hskip -1em
+ \hss
+ \copy\CJK@underdotBox
+ \hss}
+ \hskip -1em}
+ \ignorespaces}
+ #3
+ \CJKf@global\let\CJKsymbol\CJK@underanysymbol}}
\endlinechar `\^^M