X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ftex2lyx%2Ftex2lyx.cpp;h=a7f83c25a34c41c449753b3b080e301cc7ea21f2;hb=f0335cef1e21810e2d020801f06364ac462e7899;hp=d890130b6bed7bb44836a7a29cf5ba390a7b89bf;hpb=ead697d4b6c7122a2144b96712e6d2a3184f6fd8;p=lyx.git diff --git a/src/tex2lyx/tex2lyx.cpp b/src/tex2lyx/tex2lyx.cpp index d890130b6b..a7f83c25a3 100644 --- a/src/tex2lyx/tex2lyx.cpp +++ b/src/tex2lyx/tex2lyx.cpp @@ -332,6 +332,8 @@ bool checkModule(string const & name, bool command) bool noweb_mode = false; bool pdflatex = false; bool xetex = false; +bool have_CJK = false; +bool is_nonCJKJapanese = false; bool roundtrip = false; @@ -669,6 +671,10 @@ bool tex2lyx(idocstream & is, ostream & os, string encoding) active_environments.push_back("document"); Context context(true, textclass); stringstream ss; + // store the document language in the context to be able to handle the + // commands like \foreignlanguage and \textenglish etc. + context.font.language = preamble.language(); + // parse the main text parse_text(p, ss, FLAG_END, true, context); if (Context::empty) // Empty document body. LyX needs at least one paragraph.