# TeXForm of Abs[a^n] is not valid TeX, known error? [duplicate]

In[116]:= Abs[a^n] // TeXForm

Out[116]//TeXForm= \left\left| a^n\right\right|


But the result isn't valid TeX. It won't work here:

$\left\left| a^n\right\right|$

or on texpaste.com, where the error is "Missing or unrecognized delimiter for \left".

Is this a known bug and is there a known workaround?

OK, it turns out the workaround is to just remove the spurious \left and \right, so that \left| a^n\right| works fine:

$\left| a^n\right|$

However, not sure if this workaround works in general, or just in this simple case.

In[49]:= \$Version

Out[49]= 9.0 for Linux x86 (32-bit) (November 20, 2012)

• This looks like a bug to me. You should edit your question to include the Mathematica version and the OS you're using. I can reproduce the bug in MM 10.2.0.0 under Mac OS 10.10.5 Mar 3, 2016 at 20:17
• Please note that TeXForm produces AMS-LaTeX-compatible TeX output. This is documented in the "Details" section of the TeXForm documentation. In LaTeX, \left and \right are used for delimiters when they have to change the size dynamically depending on the content. Mar 3, 2016 at 20:45
• @ArnoudBuzing The issue here is \left\left, not just \left which should be fine. Can \left be followed by another \left in AMS-LaTeX? In other words, \left is being used as a delimiter for another \left which is probably wrong. You need \left(something) not \left\left
– user1722
Mar 3, 2016 at 20:47
• It seemed to be fine when I tried your example here: codecogs.com/latex/eqneditor.php. But you're right that it looks wrong (and probably is wrong in general). Mar 3, 2016 at 20:51
• This is old hat. It has been reported in at least three posts: 54857, 76839 and 29356. The first one also contains a solution. Mar 3, 2016 at 21:20

Barry, please evaluate this code below and then try any TeXForm that uses Abs that you may have:
SystemConvertTeXFormDumpmaketex[
TemplateBox[{SystemConvertCommonDumpn_}, "Abs", ___]
SystemConvertTeXFormDumpMakeTeX[SystemConvertCommonDumpn] <>