TeXForm can be used to convert Mathematica expressions directly to LaTeX. However, this function fails on an expression that has a sub- and a super-script:

expr = Subsuperscript[A, a, b]
expr // TeXForm

enter image description here

My question is:

Is there an alternative Mathematica construct that would translate the above input to A_{a}^{b} under TeXForm operation?

  • 1
    $\begingroup$ I would report this to Wolfram. $\endgroup$
    – Szabolcs
    Oct 2, 2019 at 16:17
  • $\begingroup$ @Szabolcs I sent them an email about it. Any hints for a workaround? $\endgroup$
    – Kagaratsch
    Oct 2, 2019 at 16:32
  • 1
    $\begingroup$ I found this page that uses a python script for a workaround: lieret.net/2018/01/04/mathematica-latex-bugs $\endgroup$
    – Jason B.
    Oct 2, 2019 at 16:33

1 Answer 1


The short answer is to change the default of the following internal variable to False:

BoxForm`$UseTemplateBoxForSubsuperscript = False;


ToString[Subsuperscript[A, a, b], TeXForm]


Another possibility is to teach TeXForm about "Subsuperscript" TemplateBox objects.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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