]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathRoot.cpp
typo
[lyx.git] / src / mathed / InsetMathRoot.cpp
index 2c90e5ba5945b032050edab3bf4d55db83b270c3..6de085fc222c0aab283e2ffa7a01975c4b270eae 100644 (file)
@@ -23,6 +23,7 @@
 #include "frontends/Painter.h"
 
 #include "support/lassert.h"
+#include "support/lstrings.h"
 
 using namespace std;
 
@@ -135,7 +136,11 @@ void InsetMathRoot::draw(PainterInfo & pi, int x, int y) 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) << '}';
 }