]> git.lyx.org Git - lyx.git/blobdiff - src/tex2lyx/tex2lyx.cpp
More no-math fonts
[lyx.git] / src / tex2lyx / tex2lyx.cpp
index d890130b6bed7bb44836a7a29cf5ba390a7b89bf..a049aab6f5fdb85d280741e2e785cc87a9ffe581 100644 (file)
@@ -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.
@@ -765,6 +771,8 @@ bool tex2tex(string const & infilename, FileName const & outfilename,
                command += " -f none";
        if (pdflatex)
                command += " -e pdflatex ";
+       else if (xetex)
+               command += " -e xetex ";
        else
                command += " -e latex ";
        command += quoteName(outfilename.toFilesystemEncoding());