Parallel and perpendicular symbol from Mathematica to $\LaTeX$

19

5

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?

Steve Hatcher

Posted 2014-04-21T20:01:06.240

Reputation: 335

Answers

27

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.

Sjoerd C. de Vries

Posted 2014-04-21T20:01:06.240

Reputation: 63 549

Absolutely perfect, thanks. I would have never figured that out. – Steve Hatcher – 2014-04-22T08:45:43.937

I used this today - thanks! Too bad it doesn't look so good in the notebook, but... – Mark McClure – 2014-04-29T18:30:33.647

1This 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} $$ – Michael Hardy – 2018-08-26T21:08:39.137