]> git.lyx.org Git - lyx.git/blobdiff - src/tex2lyx/Preamble.cpp
Make undo action no-ops when the buffer is read-only
[lyx.git] / src / tex2lyx / Preamble.cpp
index f15a9f178418f9da2b75a6efdf98979e6a6a55b2..3588086cfa3c23b1ebffea778e92031e0d95db29 100644 (file)
@@ -554,6 +554,7 @@ Preamble::Preamble() : one_language(true), explicit_babel(false),
        h_html_css_as_file        = "0";
        h_html_math_output        = "0";
        h_docbook_table_output    = "0";
+       h_docbook_mathml_prefix   = "1";
        h_index[0]                = "Index";
        h_index_command           = "default";
        h_inputencoding           = "auto-legacy";
@@ -1949,6 +1950,11 @@ bool Preamble::writeLyXHeader(ostream & os, bool subdoc, string const & outfiled
           << "\\save_transient_properties " << h_save_transient_properties << "\n"
           << "\\origin " << origin << "\n"
           << "\\textclass " << h_textclass << "\n";
+       if (!h_doc_metadata.empty()) {
+               os << "\\begin_metadata\n"
+                  << h_doc_metadata
+                  << "\n\\end_metadata\n";
+       }
        string const raw = subdoc ? empty_string() : h_preamble.str();
        if (!raw.empty()) {
                os << "\\begin_preamble\n";
@@ -2129,6 +2135,7 @@ bool Preamble::writeLyXHeader(ostream & os, bool subdoc, string const & outfiled
           << "\\html_css_as_file " << h_html_css_as_file << "\n"
           << "\\html_be_strict " << h_html_be_strict << "\n"
           << "\\docbook_table_output " << h_docbook_table_output << "\n"
+          << "\\docbook_mathml_prefix " << h_docbook_mathml_prefix << "\n"
           << authors_
           << "\\end_header\n\n"
           << "\\begin_body\n";
@@ -2791,6 +2798,11 @@ void Preamble::parse(Parser & p, string const & forceclass,
                        continue;
                }
 
+               if (t.cs() == "DocumentMetadata") {
+                       h_doc_metadata = trimSpaceAndEol(p.getArg('{', '}'));
+                       continue;
+               }
+
                if (t.cs() == "usepackage") {
                        string const options = p.getArg('[', ']');
                        string const name = p.getArg('{', '}');