]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathRoot.cpp
typo
[lyx.git] / src / mathed / InsetMathRoot.cpp
index 55da0086bf4d109ce356540a3c422d98e7499176..6de085fc222c0aab283e2ffa7a01975c4b270eae 100644 (file)
@@ -23,6 +23,7 @@
 #include "frontends/Painter.h"
 
 #include "support/lassert.h"
+#include "support/lstrings.h"
 
 using namespace std;
 
@@ -132,10 +133,14 @@ void InsetMathRoot::draw(PainterInfo & pi, int x, int y) const
 }
 
 
-void InsetMathRoot::write(WriteStream & os) const
+void InsetMathRoot::write(TeXMathStream & os) const
 {
        MathEnsurer ensurer(os);
-       os << "\\sqrt[" << cell(1) << "]{" << cell(0) << '}';
+       if (os.latex() && !cell(1).empty() && !cell(1).front()->asBraceInset()
+           && support::contains(asString(cell(1)), '['))
+               os << "\\sqrt[{" << cell(1) << "}]{" << cell(0) << '}';
+       else
+               os << "\\sqrt[" << cell(1) << "]{" << cell(0) << '}';
 }
 
 
@@ -216,7 +221,7 @@ void InsetMathRoot::octave(OctaveStream & os) const
 }
 
 
-void InsetMathRoot::mathmlize(MathStream & ms) const
+void InsetMathRoot::mathmlize(MathMLStream & ms) const
 {
        ms << MTag("mroot") << cell(0) << cell(1) << ETag("mroot");
 }