Julia LatexStrings plotting text subscripts

Viewed 526

I am using PyPlot to plot things in Julia. I want my plot label to use LateX fonts so I'm using LatexStrings.

I would like to write a variable with subscript such that the subscript is not written in italics, i.e in Latex: $z_{\text{eff}}$.

The closest I can get with LatexStrings is L"z_{eff}" however the subscript is written in italics in that case.

Is what I am looking for possible with these packages (I don't want to switch to something other than PyPlot)?

1 Answers

You can do

L"z_{\mathrm{eff}}"

if you don't mind using \mathrm instead of \text to make the subscript be upright and non-italic.

L"z_{\text{eff}}" works in LaTeXStrings by itself, but sending that on to PyPlot messes something up. Things like \mathtt and \rm also work, but \textnormal and \textrm don't.

Related