Type the following in a Mathematica DisplayFormula cell(other styles may also encounter this problem): Esc+$l$+|+Esc and Esc+$r$+|+Esc, and save as LaTeX.

Note: See the difference of the character between | |.

$z$ and $z_1$, $|z|$, $|z_1|$

 SubscriptBox["z", "1"], "\[RightBracketingBar]"}]], "DisplayFormula"]

with subscript, then...

Mathematica inserts extra \left and \right for absolute values in the LaTeX output:

%% AMS-LaTeX Created by Wolfram Mathematica 9.0 : www.wolfram.com
\usepackage{amsmath, amssymb, graphics, setspace}

\left\left| Z_1+Z_2\right\right| \leq \left\left| Z_1\right\right| +\left\left| Z_2\right\right|

What should I do to get valid output that LaTeX will accept?

  • 2
    $\begingroup$ Please provide the original code that was converted and some info on how this was done to clarify your question and enable reproduction. $\endgroup$
    – Yves Klett
    Jul 28, 2013 at 9:43
  • $\begingroup$ @YvesKlett here, mathematica.stackexchange.com/questions/29314/… $\endgroup$ Jul 28, 2013 at 11:36
  • 1
    $\begingroup$ My preference is to have self-contained questions / MWEs... $\endgroup$
    – Yves Klett
    Jul 28, 2013 at 11:43
  • $\begingroup$ @YvesKlett fine,,,since this question was asked in Tex.SE,...and that was asked in Math.SE...You can type Esc l|Esc and Esc r| Esc in one DisplayFormula cell. $\endgroup$ Jul 28, 2013 at 12:09

1 Answer 1


You may run this

StringReplace[string, {"\\left\\left" -> "\\left", "\\right\\right" -> "\\right"}] 

on your $\LaTeX$ output. I am surprised this bug is still here 3 years after.


Not the answer you're looking for? Browse other questions tagged or ask your own question.