]> git.lyx.org Git - lyx.git/blobdiff - src/tex2lyx/Preamble.cpp
Cmake export tests: Ignore missing glyphs on some tests
[lyx.git] / src / tex2lyx / Preamble.cpp
index 894e29e25cd8fb0b944713b6c887c43818087f15..6650cf3fbbfc79cee7bb616c1a4653a360ba8a09 100644 (file)
@@ -183,9 +183,10 @@ const char * const known_xetex_packages[] = {"arabxetex", "fixlatvian",
 const char * const known_lyx_packages[] = {"amsbsy", "amsmath", "amssymb",
 "amstext", "amsthm", "array", "babel", "booktabs", "calc", "CJK", "color",
 "float", "fontspec", "framed", "graphicx", "hhline", "ifthen", "longtable",
-"makeidx", "multirow", "nomencl", "pdfpages", "prettyref", "refstyle", "rotating",
-"rotfloat", "splitidx", "setspace", "subscript", "textcomp", "tipa", "tipx",
-"tone", "ulem", "url", "varioref", "verbatim", "wrapfig", "xcolor", "xunicode", 0};
+"makeidx", "minted", "multirow", "nomencl", "pdfpages", "prettyref", "refstyle",
+"rotating", "rotfloat", "splitidx", "setspace", "subscript", "textcomp", "tipa",
+"tipx", "tone", "ulem", "url", "varioref", "verbatim", "wrapfig", "xcolor",
+"xunicode", 0};
 
 // codes used to remove packages that are loaded automatically by LyX.
 // Syntax: package_beg_sep<name>package_mid_sep<package loading code>package_end_sep
@@ -493,7 +494,8 @@ Preamble::Preamble() : one_language(true), explicit_babel(false),
        h_font_tt_scale[0]        = "100";
        h_font_tt_scale[1]        = "100";
        //h_font_cjk
-       h_is_formulaindent        = "0";
+       h_is_mathindent           = "0";
+       h_math_numbering_side     = "default";
        h_graphics                = "default";
        h_default_output_format   = "default";
        h_html_be_strict          = "false";
@@ -553,6 +555,7 @@ Preamble::Preamble() : one_language(true), explicit_babel(false),
        h_use_hyperref            = "false";
        h_use_microtype           = "false";
        h_use_refstyle            = false;
+       h_use_minted              = false;
        h_use_packages["amsmath"]    = "1";
        h_use_packages["amssymb"]    = "0";
        h_use_packages["cancel"]     = "0";
@@ -989,6 +992,8 @@ void Preamble::handle_package(Parser &p, string const & name,
        else if (is_known(name, known_lyx_packages) && options.empty()) {
                if (name == "splitidx")
                        h_use_indices = "true";
+               if (name == "minted")
+                       h_use_minted = "true";
                if (name == "refstyle")
                        h_use_refstyle = true;
                else if (name == "prettyref")
@@ -1260,7 +1265,8 @@ bool Preamble::writeLyXHeader(ostream & os, bool subdoc, string const & outfiled
           << "\\paperorientation " << h_paperorientation << '\n'
           << "\\suppress_date " << h_suppress_date << '\n'
           << "\\justification " << h_justification << '\n'
-          << "\\use_refstyle " << h_use_refstyle << '\n';
+          << "\\use_refstyle " << h_use_refstyle << '\n'
+          << "\\use_minted " << h_use_minted << '\n';
        if (!h_fontcolor.empty())
                os << "\\fontcolor " << h_fontcolor << '\n';
        if (!h_notefontcolor.empty())
@@ -1290,9 +1296,10 @@ bool Preamble::writeLyXHeader(ostream & os, bool subdoc, string const & outfiled
                os << "\\defskip " << h_defskip << "\n";
        else
                os << "\\paragraph_indentation " << h_paragraph_indentation << "\n";
-       os << "\\is_formula_indent " << h_is_formulaindent << "\n";
-       if (!h_formulaindentation.empty())
-               os << "\\formula_indentation " << h_formulaindentation << "\n";
+       os << "\\is_math_indent " << h_is_mathindent << "\n";
+       if (!h_mathindentation.empty())
+               os << "\\math_indentation " << h_mathindentation << "\n";
+       os << "\\math_numbering_side " << h_math_numbering_side << "\n";
        os << "\\quotes_style " << h_quotes_style << "\n"
           << "\\dynamic_quotes " << h_dynamic_quotes << "\n"
           << "\\papercolumns " << h_papercolumns << "\n"
@@ -1681,12 +1688,24 @@ void Preamble::parse(Parser & p, string const & forceclass,
                        handle_opt(opts, known_languages, h_language);
                        delete_opt(opts, known_languages);
 
-                       // formula indentation
+                       // math indentation
                        if ((it = find(opts.begin(), opts.end(), "fleqn"))
                                 != opts.end()) {
-                               h_is_formulaindent = "1";
+                               h_is_mathindent = "1";
                                opts.erase(it);
                        }
+                       // formula numbering side
+                       if ((it = find(opts.begin(), opts.end(), "leqno"))
+                                != opts.end()) {
+                               h_math_numbering_side = "left";
+                               opts.erase(it);
+                       }
+                       else if ((it = find(opts.begin(), opts.end(), "reqno"))
+                                != opts.end()) {
+                               h_math_numbering_side = "right";
+                               opts.erase(it);
+                       }
+                       
                        // paper orientation
                        if ((it = find(opts.begin(), opts.end(), "landscape")) != opts.end()) {
                                h_paperorientation = "landscape";
@@ -1845,7 +1864,7 @@ void Preamble::parse(Parser & p, string const & forceclass,
                                else
                                        h_defskip = translate_len(content);
                        } else if (name == "\\mathindent") {
-                               h_formulaindentation = translate_len(content);
+                               h_mathindentation = translate_len(content);
                        } else
                                h_preamble << "\\setlength{" << name << "}{" << content << "}";
                }