]> git.lyx.org Git - features.git/commitdiff
New XHTML math options. Format change.
authorRichard Heck <rgheck@comcast.net>
Wed, 21 Apr 2010 15:18:25 +0000 (15:18 +0000)
committerRichard Heck <rgheck@comcast.net>
Wed, 21 Apr 2010 15:18:25 +0000 (15:18 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34250 a592a061-630c-0410-9148-cb99ea01b6c8

development/FORMAT
lib/lyx2lyx/lyx_2_0.py
src/Buffer.cpp
src/BufferParams.cpp
src/BufferParams.h

index f5ce5356abbc0f6c512071e104099dc4d39e160e..03d82413cbd60838f3cb8f1185e18d9b575d949c 100644 (file)
@@ -7,6 +7,11 @@ The good example would be 2010-01-10 entry.
 
 -----------------------
 
+2010-04-21 Richard heck <rgheck@comcast.net>
+       * Format incremented to 387: New options for XHTML math output.
+         New BufferParams: html_math_img_scale, html_latex_start,
+         html_latex_end.
+
 2010-04-17 Richard heck <rgheck@comcast.net>
        * Format incremented to 386: LyX version for InsetInfo:
          new parameters: type  "lyxinfo", arg   "version".
index 71489a11443e02a6eceab435f50ea5015bb54a68..57d0a1319b978c0a6040bf450ac0a11a37403127 100644 (file)
@@ -1512,6 +1512,20 @@ def revert_lyx_version(document):
         i = i+1
 
 
+def revert_math_scale(document):
+  " Remove math scaling and LaTeX options "
+  i = find_token(document.header, '\\html_math_img_scale', 0)
+  if i != -1:
+    del document.header[i]
+  i = find_token(document.header, '\\html_latex_start', 0)
+  if i != -1:
+    del document.header[i]
+  i = find_token(document.header, '\\html_latex_end', 0)
+  if i != -1:
+    del document.header[i]
+
+
+
 ##
 # Conversion hub
 #
@@ -1557,10 +1571,12 @@ convert = [[346, []],
            [383, []],
            [384, []],
            [385, []],
-           [386, []]
-          ]
+           [386, []],
+           [387, []],
+                                       ]
 
-revert =  [[385, [revert_lyx_version]],
+revert =  [[386, [revert_math_scale]],
+           [385, [revert_lyx_version]],
            [384, [revert_shadedboxcolor]],
            [383, [revert_fontcolor]],
            [382, [revert_turkmen]],
index 338757254d26536aa1c30afc8ccfea786ef70e06..53f331a920267441c18b85d1c748c28e08cc942c 100644 (file)
@@ -126,7 +126,7 @@ namespace {
 
 // Do not remove the comment below, so we get merge conflict in
 // independent branches. Instead add your own.
-int const LYX_FORMAT = 386; // rgh: LyX version for InsetInfo
+int const LYX_FORMAT = 387; // rgh: XHTML math options
 
 typedef map<string, bool> DepClean;
 typedef map<docstring, pair<InsetLabel const *, Buffer::References> > RefCache;
index a51b4a93f98bcf96539f14eeeffb42f18d1ed9a4..95f82a5464ed5c2c2f0c086df9f25c697ac9638a 100644 (file)
@@ -383,8 +383,11 @@ BufferParams::BufferParams()
        }
        // default index
        indiceslist().addDefault(B_("Index"));
-       html_be_strict = true;
+       html_be_strict = false;
        html_math_output = MathML;
+       html_math_img_scale = 1.0;
+       html_latex_start = "<span class='latex'>";
+       html_latex_end = "</span>";
 }
 
 
@@ -807,6 +810,12 @@ string BufferParams::readToken(Lexer & lex, string const & token,
                html_math_output = static_cast<MathOutput>(temp);
        } else if (token == "\\html_be_strict") {
                lex >> html_be_strict;
+       } else if (token == "\\html_math_img_scale") {
+               lex >> html_math_img_scale;
+       } else if (token == "\\html_latex_start") {
+               lex >> html_latex_start;
+       } else if (token == "\\html_latex_end") {
+               lex >> html_latex_end;
        } else {
                lyxerr << "BufferParams::readToken(): Unknown token: " << 
                        token << endl;
@@ -1024,10 +1033,13 @@ void BufferParams::writeFile(ostream & os) const
                }
        }
 
-       os << "\\tracking_changes " << convert<string>(trackChanges) << "\n"
-          << "\\output_changes " << convert<string>(outputChanges) << "\n"
-          << "\\html_math_output " << html_math_output << "\n"
-          << "\\html_be_strict " << convert<string>(html_be_strict) << "\n";
+       os << "\\tracking_changes " << convert<string>(trackChanges) << '\n'
+                << "\\output_changes " << convert<string>(outputChanges) << '\n'
+                << "\\html_math_output " << html_math_output << '\n'
+                << "\\html_be_strict " << convert<string>(html_be_strict) << '\n'
+                << "\\html_math_img_scale " << convert<string>(html_math_img_scale) << '\n'
+                << "\\html_latex_start \"" << html_latex_start << "\"\n"
+                << "\\html_latex_end \"" << html_latex_end << "\"\n";
 
        os << pimpl_->authorlist;
 }
index 1e8174d12c33f02d9adc1cf48095b807e3f0d40c..a4143a0c7e94d1b6196fb3abbc7f3f28ff7cb254 100644 (file)
@@ -393,6 +393,12 @@ public:
        /// whether to attempt to be XHTML 1.1 compliant or instead be
        /// a little more mellow
        bool html_be_strict;
+       ///
+       double html_math_img_scale;
+       ///
+       std::string html_latex_start;
+       ///
+       std::string html_latex_end;
 
 private:
        ///