Question: adding space after sqrt to improve the Latex?

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();

`Standard Worksheet Interface, Maple 2020.2, Windows 10, November 11 2020 Build ID 1502365`

`The "Physics Updates" version in the MapleCloud is 882. The version installed in this computer is 881 created 2020, November 21, 11:11 hours Pacific Time, found in the directory C:\Users\me\maple\toolbox\2020\Physics Updates\lib\`

restart;

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

`* Partial match of  '`*UseImaginaryUnit*`' against keyword '`*useimaginaryunit*`' `

`* Partial match of  '`*UseColor*`' against keyword '`*usecolor*`' `

[powersoftrigonometricfunctions = computernotation, leavespaceafterfunctionname = true, cacheresults = false, useimaginaryunit = i, usecolor = false]

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

((3+x)^2+1)^(1/2)*a+sin(x)

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

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

(1/5)*((3+x)^2+1)^(1/2)+b

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

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

(1/5)*x^(1/2)+b

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

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

(1/5)*(x^2+6)^(1/2)*c+b

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

 


(typo, should be sqrt, not int)

Download space_after_int.mw

Please Wait...