From 72d110bb6ebba85d9a084d0a96d62f1b0339df6a Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Fri, 19 Mar 2010 15:02:12 +0000 Subject: [PATCH] Add a math-as-LaTeX option, and fix some issues with lyx2lyx. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33801 a592a061-630c-0410-9148-cb99ea01b6c8 --- development/FORMAT | 2 +- lib/lyx2lyx/lyx_2_0.py | 12 +++++++----- src/BufferParams.h | 3 ++- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/development/FORMAT b/development/FORMAT index 8ebcf5de22..e6720b443b 100644 --- a/development/FORMAT +++ b/development/FORMAT @@ -4,7 +4,7 @@ LyX file-format changes 2010-03-18: Richard Heck * Format incremented to 379: revise format 374 Replace boolean \html_use_mathml with \html_math_output, - which at the moment can be: MathML, HTML, or Images. + which at the moment can be: MathML, HTML, Images, or LaTeX. 2010-02-12 Pavel Sanda * Format incremented to 378: support for revision InsetInfo. diff --git a/lib/lyx2lyx/lyx_2_0.py b/lib/lyx2lyx/lyx_2_0.py index 64250f3109..982983031f 100644 --- a/lib/lyx2lyx/lyx_2_0.py +++ b/lib/lyx2lyx/lyx_2_0.py @@ -1225,14 +1225,16 @@ def revert_math_output(document): i = find_token(document.header, "\\html_math_output", 0) if i == -1: return - rgx = re.compile(r'\\html_math_output\s+(\w+)') + rgx = re.compile(r'\\html_math_output\s+(\d)') m = rgx.match(document.header[i]) + newval = "true" if rgx: - newval = "false" val = m.group(1) - if val != "MathML": - newval = "true" - document.header[i] = "\\html_use_mathml " + newval + if val == "1" or val == "2": + newval = "false" + else: + document.warning("Unable to match " + document.header[i]) + document.header[i] = "\\html_use_mathml " + newval ## diff --git a/src/BufferParams.h b/src/BufferParams.h index cbd1d70d4a..c1992aac59 100644 --- a/src/BufferParams.h +++ b/src/BufferParams.h @@ -378,7 +378,8 @@ public: enum MathOutput { MathML, HTML, - Images + Images, + LaTeX }; /// what to use for math output. present choices are above MathOutput html_math_output; -- 2.39.2