# How to export LaTeX expressions with subscripts and greek letters? [closed]

I am constantly using the mathematica software and using TeXForm command to go back and forth between the calculations and the latex document I'm typesetting. However, mathematica won't allow me to define variables with underscore, which I constantly need in my latex document. Does anybody know how to create variables with "smarter" names in mathematica? In a broader sense, what is the best way to integrate the use of mathematica and latex? Thanks.

## closed as off-topic by user9660, MarcoB, RunnyKine, m_goldberg, WReachMay 2 '16 at 3:38

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Community, MarcoB, RunnyKine, m_goldberg, WReach
If this question can be reworded to fit the rules in the help center, please edit the question.

• Did you try TeXForm[Subscript[a, b]] ? – Alexey Bobrick Nov 2 '14 at 18:29
• what is the best way to integrate the use of mathematica and latex? There are 2 ways: Export as tex using the menu, or use TeXForm for an expression. – Nasser Nov 2 '14 at 18:32
• Alexey, it seems to work! Can I name variables using a backslash aswell? Thats for the greek letter in latex. – user191919 Nov 2 '14 at 18:48
• Can I name variables using a backslash aswell? There is no need. Mathematica will add the backslash for you automatically when you export to Latex. Try TeXForm[Sin[x]] You'll see the result is \sin (x). I do not think a variable name can start with "\" in Mathematica. I just tried \x=5 in Mathematica, and it gave me syntax error. Version 10.01 on windows. – Nasser Nov 2 '14 at 19:05
• @user191919: Yep! Do in analogy with this: 1) In the notebook press esc, 2) type "mu", 3) press esc again. You get a character which looks like greek mu. Use TeXForm to get latex code. Also, instead of mu you can use any latex symbol name (without slash). – Alexey Bobrick Nov 2 '14 at 19:07