0
$\begingroup$

I want to label my y-axis as $\frac{P}{e^{3N}}$. I just know how to put symbols by using the command; [Phi] as an example. I need a precise command to get the latex math.

$\endgroup$
6
  • 2
    $\begingroup$ Look at the MaTeX package from Szabolcs. $\endgroup$
    – MarcoB
    Oct 1, 2021 at 13:47
  • $\begingroup$ I have 9.1 version of Mathematica. $\endgroup$
    – Jpmg
    Oct 1, 2021 at 13:54
  • $\begingroup$ @MarcoB MaTeX requires Mathematica 10.0.2 or later. Actually, there is no 9.1 version, only 9.0.1. $\endgroup$
    – Szabolcs
    Oct 1, 2021 at 14:30
  • $\begingroup$ @Jpmg Please clarify what you mean by "Latex mathematics". LaTeX is not necessary to typeset formulae in Mathematica. See reference.wolfram.com/language/tutorial/… $\endgroup$
    – Szabolcs
    Oct 1, 2021 at 14:31
  • $\begingroup$ @MarcoB I made use of associations for caching results, and they were added only in 10.0 (back in 2014 or so...) $\endgroup$
    – Szabolcs
    Oct 1, 2021 at 14:32

1 Answer 1

2
$\begingroup$

As mentioned in comments, you can already typeset your labels within Mathematica. For instance:

Plot[
 Sin[x], {x, 0, 10},
 Frame -> {{True, False}, {True, False}}, 
 Axes -> False, 
 FrameLabel -> 
  {"", 
   Rotate[
    Style[
     "\!\(\*FractionBox[\(P\), SuperscriptBox[\(e\), \(3  N\)]]\)", 
     Black, 18, FontFamily -> "Times"
    ],
    -90*Degree
   ]
  }
]

simple plot with label

The rather inscrutable portion of the above code ("\!\(\*FractionBox[\(P\), SuperscriptBox[\(e\), \(3 N\)]]\)") was not generated by hand, but instead it was typed in with formatting:

picture of the code that generated the plot above, showing the formatted label as it appears in the notebook

See also this Tutorial on input methods for two-dimensional expressions.

$\endgroup$
1
  • $\begingroup$ Thanks a lot @MarcoB, that really helps. $\endgroup$
    – Jpmg
    Oct 2, 2021 at 19:51

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