# Question:adding space after sqrt to improve the Latex?

## Question:adding space after sqrt to improve the Latex?

Maple 2020

What do folks think about adding \, space automatically after Maple's Latex output for sqrt command?

This is all using the new Latex command. Not the orginal latex() command.

For me, it looks much better. I did some tests, and see no negative effect by always adding \, at the end of \sqrt{}

The reason is this: If there is a symbol after sqrt(.....)<HERE> then the math looks like the symbol is almost inside the integral, when it should be out. By adding \, this makes it more clear and better looking.

It is possible to write macro in Latex to do this in preamble I suppose. But if it can be done in the source, then that will be much better as it will always be there without the need to write complicated macro to change it later in Latex.

Here are 4 expressions to compare

One can see the current problem area and the effect of adding \, automatically. The space was added for each case above in the second column, even for those where it was needed (second and third expressions) to show that adding space has no negative side-effect even when not needed.

Here is the above raw latex used, compiled on Tex Live 2020 on Linux,  and the Maple worksheet below that.

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{longtable}
\usepackage{mleftright}
\mleftright

\begin{document}

\begin{longtable}{|p{3in}|p{3in}|}\hline
Default. No space after & With space added after\\\hline
$\sqrt{\left(3+x \right)^{2}+1} a +\sin \left(x \right)$
&
$\sqrt{\left(3+x \right)^{2}+1}\, a +\sin \left(x \right)$\\\hline
$\frac{\sqrt{\left(3+x \right)^{2}+1}}{5}+b$
&
$\frac{\sqrt{\left(3+x \right)^{2}+1}\,}{5}+b$\\\hline
$\frac{\sqrt{x}}{5}+b$
&
$\frac{\sqrt{x}\,}{5}+b$
\\\hline
$\frac{\sqrt{x^{2}+6} c}{5}+b$
&
$\frac{\sqrt{x^{2}+6}\, c}{5}+b$\\\hline
\end{longtable}

\end{document}

 > interface(version); Physics:-Version();

 > restart;
 > Latex:-Settings(UseImaginaryUnit=i,       UseColor = false,       powersoftrigonometricfunctions= computernotation,       leavespaceafterfunctionname = true,       cacheresults = false );

 > expr1:=sqrt((3+x)^2+1)*a+sin(x); Latex(expr1)

\sqrt{\left(3+x \right)^{2}+1} a +\sin \left(x \right)

 > expr2:=sqrt((3+x)^2+1)/5+b; Latex(expr2)

\frac{\sqrt{\left(3+x \right)^{2}+1}}{5}+b

 > expr3:=sqrt(x)/5+b; Latex(expr3)

\frac{\sqrt{x}}{5}+b

 > expr4:=(sqrt((3+x^2)+3)*c)/5+b; Latex(expr4)

\frac{\sqrt{x^{2}+6} c}{5}+b

 >

(typo, should be sqrt, not int)