20
$\begingroup$

I want to get the following expression from Mathematica to $\LaTeX$:

\begin{bmatrix} E_{\parallel} \\ E_{\perp} \end{bmatrix}

I have tried to use inbuilt 'symbol' character from the special characters window but get an error:

error

So I thought maybe I can just type in \parallel and \perp so when I convert it to $\TeX$ it will be there and work, but I get different errors:

more errors

Any way to achieve what I want?

$\endgroup$

1 Answer 1

28
$\begingroup$

The following Mathematica construction translates to $\TeX$ just fine:

Mathematica graphics

\left(
\begin{array}{c}
 e_{\bot } \\
 e_{\parallel } \\
\end{array}
\right)

Which looks like this in StackExchange's MathJax:

$\left( \begin{array}{c} e_{\bot } \\ e_{\parallel } \\ \end{array} \right)$

The key issue is to enter the initial Mathematica construction correctly. That is done as follows.

The $\bot$ character is Mathematica's symbol \[UpTee] which is interpreted as the UpTee function which takes two arguments. This is part of the cause of the error messages you got. You haven't provided those.

You can type Esc+null+Esc for the first argument (which is nothing thanks to the null), followed by Esc+uT+Esc and Esc+null+Esc again for the second argument.

The same goes for the $\parallel$ character, Mathematica's DoubleVerticalBar symbol and (undefined) function which can be entered as Esc+Space+||+Esc.

Alternatively, you can just use

TeXForm@{{Subscript[E,\[Null]\[UpTee]\[Null]]},{Subscript[E,\[Null]\[DoubleVerticalBar]\[Null]]}}

to generate your TeX code. If you want square brackets you may want to change the \left( to \left[ and \right( to \right[. Additionally, since Mathematica interprets E as Euler's number it ends up as a lower case e in the TeX code. You may want to change that back to an uppercase E manually afterwards, or use a \[CapitalEpsilon] in Mathematica. This gets translated as E in the TeX code.

$\endgroup$
4
  • $\begingroup$ Absolutely perfect, thanks. I would have never figured that out. $\endgroup$ Apr 22, 2014 at 8:45
  • $\begingroup$ I used this today - thanks! Too bad it doesn't look so good in the notebook, but... $\endgroup$ Apr 29, 2014 at 18:30
  • 2
    $\begingroup$ This answer fails to warn people that \bot and \perp sometimes have different results, and there's a good reason why they were intended to work that way: $$ \begin{align} & P\bot Q \\ \text{versus} \\ & P\perp Q \end{align} $$ $\endgroup$ Aug 26, 2018 at 21:08
  • $\begingroup$ Instead of \[UpTee] you can just use \[Perpendicular] or esc+perp+esc. $\endgroup$ Apr 13, 2021 at 20:47

Your Answer

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

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