This commit is contained in:
Enrico Forestieri 2021-02-27 14:49:55 +01:00
parent a3e10cd067
commit 195b928f92

View File

@ -23,6 +23,7 @@
#include "frontends/Painter.h"
#include "support/lassert.h"
#include "support/lstrings.h"
using namespace std;
@ -135,6 +136,10 @@ void InsetMathRoot::draw(PainterInfo & pi, int x, int y) const
void InsetMathRoot::write(TeXMathStream & os) const
{
MathEnsurer ensurer(os);
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) << '}';
}