mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-17 10:07:27 +00:00
84e176851d
The LyX file format only supports one CJK font mapping per document. Therefore all CJK environments which use a different mapping than the main one are output in ERT. THis is now explained in the test case, and also the converion to ERT is improved (although it is still wrong e.g. for paragraphs).
55 lines
1.5 KiB
TeX
55 lines
1.5 KiB
TeX
\documentclass[english]{article}
|
||
\usepackage[T1]{fontenc}
|
||
\usepackage[utf8]{inputenc}
|
||
\usepackage{CJK}
|
||
\usepackage{babel}
|
||
|
||
% It is impossible to get the document language because the document could start with a command,
|
||
% whitespace, and English word or whatever and the rest is in Japanese. Checking for the first CJK
|
||
% environment is no solution because the document could be English and contain only some Japanese.
|
||
|
||
\begin{document}
|
||
|
||
\begin{CJK}{EUC-JP}{}%
|
||
Japanese \end{CJK} \begin{CJK}{UTF8}{}Chinese traditional\end{CJK} \begin{CJK}{EUC-JP}{}
|
||
Japanese \end{CJK}
|
||
hello
|
||
\begin{CJK}{GB}{}%
|
||
Chinese simplified \end{CJK}\begin{CJK}{EUC-JP}{hei} Japanese
|
||
(this CJK environment will be put in ERT because LyX supports only one CJK
|
||
font mapping per document, this environment uses the \texttt{hei} mapping,
|
||
and the first mapping is empty.\end{CJK} \begin{CJK}{GB}{}Chinese simplified
|
||
\end{CJK}
|
||
|
||
% The following Bg5 encoded text cannot be processed as is by latex.
|
||
% It needs to be preprocessed by bg5conv or bg5latex needs to be used.
|
||
% See the documentation of CJK.sty for details.
|
||
|
||
\begin{CJK}{Bg5}{}
|
||
Big5 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
\end{CJK}
|
||
|
||
\inputencoding{latin9}%
|
||
\selectlanguage{english}%
|
||
English
|
||
|
||
% The following SJIS encoded text cannot be processed as is by latex.
|
||
% It needs to be preprocessed by sjisconv or sjislatex needs to be used.
|
||
% See the documentation of CJK.sty for details.
|
||
|
||
\begin{CJK}{SJIS}{}
|
||
Shift\_JIS <20><><EFBFBD>{<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
\end{CJK}
|
||
|
||
hello
|
||
|
||
\begin{CJK}{JIS}{}
|
||
JIS-code 日本語の文章
|
||
\end{CJK}
|
||
|
||
\begin{CJK}{KS}{}%
|
||
Korean
|
||
\end{CJK}
|
||
|
||
\end{document}
|