Multiple TeXForm returns just single output

This is just a long comment.

I see the same behaviour in several versions between 9.0–11.0.

Looking at what is actually being sent to the FE with LinkSnooper, we see that the kernel does send all results back, however, the front end only displays the last one. Based on a few experiments, it seems that:

  • When the result is sent as a ReturnExpressionPacket (i.e. it comes as boxes: StandardForm, TraditionalForm, FullForm, etc.) or ReturnTextPacket (OutputForm), then all results are displayed.
  • When the result is sent as ReturnInputFormPacket (InputForm, TeXForm, CForm, etc.), then only the last result is displayed.

I would report this behaviour to Wolfram Support.

As a workaround you can do this (which I think is a better approach anyway):

TeXForm /@ {Sqrt[1 + x^2 + x^4], Sqrt[1 + x^2 + x^5], Sqrt[1 + x^2 + x^6]}

Another workaround is to tack on an "invisible" wrapper such as SequenceForm:

Sqrt[1 + x^2 + x^4] //TeXForm //Defer
Sqrt[1 + x^2 + x^5] //TeXForm //SequenceForm
Sqrt[1 + x^2 + x^6] //TeXForm //HoldForm

$\sqrt{x^4+x^2+1}$

$\sqrt{x^5+x^2+1}$

$\sqrt{x^6+x^2+1}$

Tags:

Latex