1
$\begingroup$

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).

$\endgroup$
  • $\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 '16 at 2:48
2
$\begingroup$

Okay, so I actually figured it out.

MatrixForm[list]//TeXForm works great.

$\endgroup$
0
$\begingroup$
TeXForm[list]

Mathematica graphics

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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