This commit is contained in:
Enrico Forestieri 2021-02-27 23:31:25 +01:00
parent 95aef13dc6
commit 999831043e
2 changed files with 10 additions and 1 deletions

View File

@ -22,6 +22,8 @@
#include "frontends/Painter.h"
#include "support/lstrings.h"
using namespace std;
@ -134,7 +136,11 @@ void InsetMathRoot::draw(PainterInfo & pi, int x, int y) const
void InsetMathRoot::write(WriteStream & os) const
{
MathEnsurer ensurer(os);
os << "\\sqrt[" << cell(0) << "]{" << cell(1) << '}';
if (os.latex() && !cell(0).empty() && !cell(0).front()->asBraceInset()
&& support::contains(asString(cell(0)), '['))
os << "\\sqrt[{" << cell(0) << "}]{" << cell(1) << '}';
else
os << "\\sqrt[" << cell(0) << "]{" << cell(1) << '}';
}

View File

@ -60,6 +60,9 @@ What's new
immediately following nested itemize environment when loading documents
created with version 2.1 or earlier (bug 12148).
- Fix export of the optional argument of \sqrt when it contains other
commands with optional arguments (bug 3294).
* USER INTERFACE