Hello,
I'm using Chinese characters an the pinyin-package as well. It works
well unless I make a second section in the text. The cjk-environment
always ends after the first section. It is not possible to copy and past
the text into the environment. Still it end after the first section. I
tried to remove the cjk-environment and to start it again. No success.
I'm using LyX 2.0.6. The OS is Ubuntu.
This is the preamble:
\usepackage [notextcomp,oldstylenums] {kpfonts}
\usepackage {caption}
\DeclareCaptionLabelSeparator{colonenskip}{:\enskip{}}
\captionsetup [figure]
{name=Abb.,font={sf,footnotesize},labelfont=bf,labelsep=colonenskip,singlelinecheck=false,justification=RaggedRight
}
\captionsetup [table]
{name=Tab.,font={sf,small},labelfont=bf,labelsep=colonenskip,singlelinecheck=false,justification=RaggedRight}
\author{Karl Linek}
\usepackage{microtype}
% Definitions of Pinyin
\makeatletter
\def\py@yunpriv#1{%
\if a#1 10\else
\if o#1 9\else
\if e#1 8\else
\if i#1 7\else
\if u#1 6\else
\if v#1 5\else
\if A#1 4\else
\if O#1 3\else
\if E#1 2\fi\fi\fi\fi\fi\fi\fi\fi\fi0
}
\def\py@init{%
\edef\py@befirst{}%
\edef\py@char{}\edef\py@tuneletter{}%
\def\py@last{}%
\def\py@tune{5}%
}
% Usage:
% \pinyin{Hao3hao3\ xue2xi2} (????)
\def\pinyin#1{%
\edef\py@postscan{#1}%
\py@init
% scan
\loop
\edef\py@char{\expandafter\@car\py@postscan\@nil}%
\edef\py@postscan{\expandafter\@cdr\py@postscan\@nil}%
\ifnum 0 < 0\py@char
\edef\py@tune{\py@char}%
\py@first \py@tuneat\py@tuneletter\py@tune \py@last\kern -4sp\kern
4sp{}\py@init
\else
\ifnum\py@yunpriv\py@char > \py@yunpriv\py@tuneletter
\edef\py@tuneletter{\py@char}\edef\py@first{\py@befirst}\def
\py@last{}%
\else
\edef\py@last{\py@last\if v\py@char\"u\else\py@char\fi}%
\fi
\edef\py@befirst{\py@befirst\if v\py@char\"u\else\py@char\fi}%
\fi
\ifx\py@postscan\@empty\else
\repeat
}
\let\py@macron \=
\let\py@acute \'
\let\py@hacek \v
\let\py@grave \`
%% \py@tuneat{Letter}{tune}
\def\py@tuneat#1#2{%
\if v#1%
\py@tune@v #2%
\else
\if i#1%
\py@tune@i #2%
\else
\ifcase#2%
\or\py@macron #1\or\py@acute #1\or\py@hacek #1\or\py@grave #1\else
#1%
\fi
\fi\fi
}
\def\py@tune@v#1{{%
\dimen@ii 1ex%
\fontdimen5\font 1.1ex%
\rlap{\"u}%
\fontdimen5\font .6ex%
\ifcase#1%
\or\py@macron u\or\py@acute u\or\py@hacek u\or\py@grave u\else u%
\fi
\fontdimen5\font\dimen@ii
}}
\def\py@tune@i#1{%
\ifcase#1
\or\py@macron \i\or\py@acute \i\or\py@hacek \i\or\py@grave \i\else i
%
\fi
}
Can anyone help me? Thanks in advance.
Karl