]> git.lyx.org Git - features.git/commitdiff
Some math font changing commands only work in math mode, so let's
authorEnrico Forestieri <forenr@lyx.org>
Wed, 4 May 2011 13:07:32 +0000 (13:07 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Wed, 4 May 2011 13:07:32 +0000 (13:07 +0000)
assure to switch to math mode if needed. This helps avoiding latex
errors (see http://thread.gmane.org/gmane.editors.lyx.general/69580)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@38580 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/InsetMathNest.cpp
status.20x

index 21bfdfeea225ed913261ee1ab7834cc937a04f0d..8e04e2a5d99df83eae328ef58cb37afa162f8141 100644 (file)
@@ -371,6 +371,7 @@ MathData InsetMathNest::glue() const
 
 void InsetMathNest::write(WriteStream & os) const
 {
+       MathEnsurer ensurer(os, currentMode() == MATH_MODE);
        ModeSpecifier specifier(os, currentMode(), lockedMode());
        docstring const latex_name = name();
        os << '\\' << latex_name;
index 06b71aa0721ce375fdbaf1a9266fcf2283111f69..7da2e1ed0d4d41ba77b14678de495cad62420634 100644 (file)
@@ -46,6 +46,8 @@ What's new
 
 * DOCUMENT INPUT/OUTPUT
 
+- Avoid LaTeX errors if font changing commands are used in the wrong mode
+  by assuring to switch to the right mode on export.
 
 
 * USER INTERFACE