summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/xelatex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-08-07 23:40:55 +0000
committerKarl Berry <karl@freefriends.org>2011-08-07 23:40:55 +0000
commit17adabfbf74165afccb1265d52eea3ad4383f6e1 (patch)
tree49ea03f8d92a9468b7057a8922c705d61af1971a /Master/texmf-dist/tex/xelatex
parent7822e32d4066bb81d8e6ed47697c93301b86fe9f (diff)
xecjk for ctex 2.4.2 (12jun11)
git-svn-id: svn://tug.org/texlive/trunk@23453 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/xelatex')
-rw-r--r--Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty60
1 files changed, 40 insertions, 20 deletions
diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty
index e97b05950d6..7fce8d8f86e 100644
--- a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty
+++ b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty
@@ -6,7 +6,7 @@
%%
%% xeCJK.dtx (with options: `xeCJK')
%%
-%% Version 2.3.19 (01-May-2011)
+%% Version 2.4.2 (12-June-2011)
%%
%% Copyright (C) Wenchang Sun <sunwch@hotmail.com>
%%
@@ -18,8 +18,8 @@
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
-\def\fileversion{2.3.19}
-\def\filedate{2011/05/01}
+\def\fileversion{2.4.2}
+\def\filedate{2011/06/12}
\ProvidesPackage{xeCJK}[\filedate\space\fileversion\space package for typesetting CJK scripts with XeLaTeX]
\RequirePackage{ifxetex}
\RequireXeTeX
@@ -38,6 +38,9 @@
\newif\ifxeCJK@indentfirst
\xeCJK@indentfirsttrue
+\newif\ifxeCJK@space@
+\xeCJK@space@false
+
\DeclareOption{boldfont}{\xeCJK@BoldFont@true}
\DeclareOption{BoldFont}{\ExecuteOptions{boldfont}}
\DeclareOption{slantfont}{\xeCJK@SlantFont@true}
@@ -46,18 +49,20 @@
\DeclareOption{CJKnumber}{\xeCJK@numtrue}
\DeclareOption{normalindentfirst}{\xeCJK@indentfirstfalse}
\DeclareOption{CJKchecksingle}{\AtEndOfPackage{\let\xeCJK@i@i\xeCJK@checksingle}}
+\DeclareOption{space}{\xeCJK@space@true}
+\DeclareOption{nospace}{\xeCJK@space@false}
-\DeclareOption{CJKnormalspaces}{\PackageWarning{%
+\DeclareOption{CJKnormalspaces}{\PackageWarning{xeCJK}{%
obsolete option 'CJKnormalspaces'. It may be removed in the future.}}
-\DeclareOption{CJKaddspaces}{\PackageWarning{%
+\DeclareOption{CJKaddspaces}{\PackageWarning{xeCJK}{%
obsolete option 'CJKaddspaces'. It may be removed in the future.}}
-\DeclareOption{CJKtextspaces}{\PackageWarning{%
+\DeclareOption{CJKtextspaces}{\PackageWarning{xeCJK}{%
obsolete option 'CJKtextspaces'. It may be removed in the future.}}
-\DeclareOption{CJKmathspaces}{\PackageWarning{%
+\DeclareOption{CJKmathspaces}{\PackageWarning{xeCJK}{%
obsolete option 'CJKmathspaces'. It may be removed in the future.}}
-\DeclareOption{CJKsetspaces}{\PackageWarning{%
+\DeclareOption{CJKsetspaces}{\PackageWarning{xeCJK}{%
obsolete option 'CJKsetspaces'. It may be removed in the future.}}
-\DeclareOption{CJKnospaces}{\PackageWarning{%
+\DeclareOption{CJKnospaces}{\PackageWarning{xeCJK}{%
obsolete option 'CJKnospaces'. It may be removed in the future.}}
\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{fontspec}}
@@ -82,7 +87,7 @@
\loop
\XeTeXcharclass \@tempcnta #3\relax
\advance\@tempcnta 1\relax
- \ifnum\the\@tempcnta<#2 \repeat
+ \unless\ifnum\the\@tempcnta>#2 \repeat
\xeCJK@setpunctcharclass}
\def\xeCJK@prePunct#1#2{\xeCJK@setPunct{2}{#1}{#2}}
@@ -141,11 +146,14 @@
\xeCJKsetcharclass{"3300}{"33FF}{1}
\xeCJKsetcharclass{"3400}{"4DBF}{1}
\xeCJKsetcharclass{"4E00}{"9FFF}{1}
+\xeCJKsetcharclass{"A000}{"A4CF}{1}
\xeCJKsetcharclass{"AC00}{"D7AF}{1}
\xeCJKsetcharclass{"F900}{"FAFF}{1}
\xeCJKsetcharclass{"FE30}{"FE4F}{1}
\xeCJKsetcharclass{"FF00}{"FFEF}{1}
\xeCJKsetcharclass{"20000}{"2A6DF}{1}
+\xeCJKsetcharclass{"2A700}{"2B73F}{1}
+\xeCJKsetcharclass{"2B740}{"2B81F}{1}
\xeCJKsetcharclass{"2F800}{"2FA1F}{1}
\def\CJK@stop{\CJK@stop}
@@ -470,7 +478,15 @@
\chardef\xeCJK@four=4
\chardef\xeCJK@ten=10
-\def\xeCJK@ignorespaces{
+\def\CJKspace{\let\xeCJK@ignorespaces\@empty}
+\def\CJKnospace{\let\xeCJK@ignorespaces\xeCJK@@ignorespaces}
+\ifxeCJK@space@
+ \AtEndOfPackage{\CJKspace}
+\else
+ \AtEndOfPackage{\CJKnospace}
+\fi
+
+\def\xeCJK@@ignorespaces{
\futurelet\xeCJK@nexttoken\xeCJK@checknext}
\def\xeCJK@checknext{
@@ -837,21 +853,25 @@
\csname\xeCJK@family/\f@series/\f@shape/\f@size\endcsname=\external@font
\fi}
+\def\CJKrmdefault{rm}
\def\setCJKmainfont{
- \xeCJK@newfontfamily{rm}}
+ \xeCJK@newfontfamily{\CJKrmdefault}}
\let\setCJKromanfont\setCJKmainfont
+\def\CJKsfdefault{sf}
\def\setCJKsansfont{
- \xeCJK@newfontfamily{sf}}
+ \xeCJK@newfontfamily{\CJKsfdefault}}
+\providecommand\CJKttdefault{tt}
\def\setCJKmonofont{
- \xeCJK@newfontfamily{tt}}
+ \xeCJK@newfontfamily{\CJKttdefault}}
\def\setCJKfamilyfont#1{
\xeCJK@newfontfamily{#1}}
+\def\CJKfamilydefault{\CJKrmdefault}
\DeclareRobustCommand\normalfont
- {\CJKfamily{rm}%
+ {\CJKfamily{\CJKfamilydefault}
\usefont\encodingdefault
\familydefault
\seriesdefault
@@ -861,15 +881,15 @@
\DeclareRobustCommand\rmfamily
{\not@math@alphabet\rmfamily\mathrm
- \fontfamily\rmdefault\CJKfamily{rm}\selectfont}
+ \fontfamily\rmdefault\CJKfamily{\CJKrmdefault}\selectfont}
\DeclareRobustCommand\sffamily
{\not@math@alphabet\sffamily\mathsf
- \fontfamily\sfdefault\CJKfamily{sf}\selectfont}
+ \fontfamily\sfdefault\CJKfamily{\CJKsfdefault}\selectfont}
\DeclareRobustCommand\ttfamily
{\not@math@alphabet\ttfamily\mathtt
- \fontfamily\ttdefault\CJKfamily{tt}\selectfont}
+ \fontfamily\ttdefault\CJKfamily{\CJKttdefault}\selectfont}
\newcommand*\xeCJK@newfontfamily[1]{
\@ifnextchar[
{\xeCJK@newfontfamily@{#1}}
@@ -962,7 +982,7 @@
\addCJKfontfeatures{#1}}
-\def\xeCJK@font@rm{}
+\expandafter\def\csname xeCJK@font@\CJKfamilydefault\endcsname{}
\DeclareRobustCommand\CJKfamily[1]{
\ifcsname xeCJK@font@#1\endcsname
@@ -976,7 +996,7 @@
\expandafter\gdef\csname xeCJK@#1@warned\endcsname{}
\fi
\fi}
-\CJKfamily{rm}
+\AtBeginDocument{\CJKfamily{\CJKfamilydefault}}
\def\xeCJKsetslantfactor#1{\edef\xeCJK@slantfactor{#1}}
\def\xeCJKsetemboldenfactor#1{\edef\xeCJK@emboldenfactor{#1}}