I'm having some difficulty TexForming a list. The output is not what I want.

The following is a minimum working example. I've tried every combination of Flatten, ArrayReshape, and Partition to no avail. I have the following variable list, that I'm trying to put into the following LaTeX form.

$$ \textrm{list} = \{ \{ a \to b \} , \{ c \to d \} \} $$

Hopeful LaTeX form output:

$$ \begin{pmatrix} a \to b \\ c \to d \end{pmatrix} $$

What I've been able to get: $$ \begin{pmatrix} \{ a \to b \} \\ \{ c \to d \} \end{pmatrix} $$

(Can't remember how I got that).

  • $\begingroup$ Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$
    – Michael E2
    May 5, 2016 at 2:48

2 Answers 2


Okay, so I actually figured it out.

MatrixForm[list]//TeXForm works great.


Mathematica graphics

$$\left( \begin{array}{c} a\rightarrow b \\ c\rightarrow d \\ \end{array} \right)$$

  • $\begingroup$ I wish that was the output I would get! TeXForm[{{ a -> b }, { c -> d }}] returns \{ \{ a \to b \}, \{c to d \} \}. $\endgroup$ May 5, 2016 at 0:56
  • $\begingroup$ @fuzzybear3965, probably it is version or os issue. I am using Version 9 on Windows 10. $\endgroup$
    – kglr
    May 5, 2016 at 0:58
  • $\begingroup$ Version 10 on Mac OS X. :( $\endgroup$ May 5, 2016 at 1:00

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.