summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/xelatex/xecjk/examples/example-addspaces.tex
blob: 1aa511bb602deb4b3367597cfe7231a390a4aaf7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
%%
%% This is file `example-addspaces.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% xeCJK.dtx  (with options: `example-addspaces')
%% 
%%  Version 2.3.0 (30-June-2009)
%% 
%%  Copyright (C) Wenchang Sun <sunwch@hotmail.com>
%% 
%%  This file may be distributed and/or modified under the
%%  conditions of the LaTeX Project Public License, either version 1.3
%%  of this license or (at your option) any later version.
%%  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.
%% 
\documentclass{article}
\usepackage[boldfont,slantfont,CJKaddspaces]{xeCJK}
\usepackage{xcolor}
\setCJKmainfont{Bitstream CyberCJK}
\textwidth 190mm
\oddsidemargin 0pt
\def\usemacro#1{\csname#1\endcsname $\backslash$#1}
\begin{document}
\baselineskip 18pt
\parskip 10pt
\parindent 0em

\long\def\sometexts{\par{\color{\colora}
 这是 English 中文 {\itshape Chinese} 中文    \LaTeX\
  间隔 \textit{Italic} 中文\textbf{字体} a 数学 $b$ $c$ $d$
\\
 这是English中文{\itshape Chinese}中文\LaTeX\
 间隔\textit{Italic}中文\textbf{字体}a数学$b$ $c$ $d$\\
This is an example. 这是一个例子
}}

\def\colora{blue}
\usemacro{CJKaddspaces}
\CJKsetecglue{\hskip 0.15em plus 0.05em minus 0.05em}
\verb+\CJKsetecglue{\hskip 0.15em plus 0.05em minus 0.05em}+
\sometexts

\def\colora{red}
\usemacro{CJKaddspaces}
\CJKsetecglue{ }
\verb+\CJKsetecglue{ }+
\sometexts

\def\colora{blue!50!red}
\usemacro{CJKnormalspaces}
\sometexts

\end{document}

\endinput
%%
%% End of file `example-addspaces.tex'.