Add a note about ERT environment

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).
This commit is contained in:
Georg Baum 2013-02-21 22:31:22 +01:00
parent eb53c60a8f
commit 84e176851d
6 changed files with 29 additions and 9 deletions

View File

@ -121,6 +121,21 @@ begin{CJK}{EUC-JP}{hei}
\end_inset
Japanese
(this CJK environment will be put in ERT because LyX supports only one CJK
font mapping per document, this environment uses the
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
\end_layout
\end_inset
texttt{hei} mapping,
and the first mapping is empty.
\begin_inset ERT
status collapsed
@ -245,7 +260,7 @@ begin{CJK}{JIS}{}
\end_inset
JIS-code 
JIS-code 
\begin_inset ERT
status collapsed

View File

@ -15,7 +15,10 @@ Japanese \end{CJK} \begin{CJK}{UTF8}{}Chinese traditional\end{CJK} \begin{CJK}{E
Japanese \end{CJK}
hello
\begin{CJK}{GB}{}%
Chinese simplified \end{CJK}\begin{CJK}{EUC-JP}{hei} Japanese \end{CJK} \begin{CJK}{GB}{}Chinese simplified
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.

View File

@ -1,5 +1,5 @@
#LyX file created by tex2lyx 2.1.0dev
\lyxformat 462
\lyxformat 463
\begin_document
\begin_header
\textclass article
@ -7,7 +7,7 @@
\maintain_unincluded_children false
\language english
\language_package none
\inputencoding latin9
\inputencoding iso8859-15
\fontencoding T1
\font_roman default
\font_sans default

View File

@ -1,5 +1,5 @@
#LyX file created by tex2lyx 2.1.0dev
\lyxformat 462
\lyxformat 463
\begin_document
\begin_header
\textclass article
@ -7,7 +7,7 @@
\maintain_unincluded_children false
\language english
\language_package none
\inputencoding latin9
\inputencoding iso8859-15
\fontencoding T1
\font_roman default
\font_sans default

View File

@ -1,5 +1,5 @@
#LyX file created by tex2lyx 2.1.0dev
\lyxformat 462
\lyxformat 463
\begin_document
\begin_header
\textclass article
@ -7,7 +7,7 @@
\maintain_unincluded_children false
\language english
\language_package none
\inputencoding latin9
\inputencoding iso8859-15
\fontencoding T1
\font_roman default
\font_sans default

View File

@ -1480,6 +1480,8 @@ void parse_environment(Parser & p, ostream & os, bool outer,
output_ert_inset(os, "\\", parent_context);
else if (*it == '$')
output_ert_inset(os, "$", parent_context);
else if (*it == '\n' && it + 1 != et && s.begin() + 1 != it)
os << "\n ";
else
os << *it;
}