how can i use latex in julia v1.0

i want to write in latex a title in a plot

so

title("(Omega_d )^2 " i try to use \Omega and press tab to choose the greek letter … but the subscript _d i can not

julia v1.0 do not accept L"\Omega_d"
any ideas ?

Have you installed LaTeXStrings? The L" " string is from this package.

It seems that the package authors are still fixing some compatibility issues with V1.0. But it should work fine at least on Julia V0.7.

Even without LaTexStrings you should be able to use LaTeX (depending on what package you’re using for plotting). In Plots.jl this should work:
plot(...., title = "\$(\\Omega_d)^2\$")

or, as mentioned, with LaTeXStrings.jl:

using LaTeXStrings
plot(...., title = L"$(\Omega_d)^2$")
2 Likes

how can i write a sentence and use latex ? for example:

title = general collision “$(\Omega_d)^2$”)

i the output appears $ symbol and the Omega_d do not appear

you have not put the L before the string

not work this:

using Plots,LaTeXStrings
plot(rand(10),xlabel=“General Collision”"$(\Omega_d)^2$")

Have you read my post above?
The solution is there.

using Plots,LaTeXStrings
plot(rand(10),xlabel= L"blablabla(\Omega_d)^2")

i want the word blablabla has not the same font that the latex equation … blablabla have to be out of the latex

and so?

plot(rand(10),xlabel= "blablabla"*L"(\Omega_d)^2"))

Or L"blablabla $ (\Omega_d)^2 $" with math markers $ as in LaTeX.

1 Like

Yes, I forgot to include the $.
As far as I know, however, mixing normal text and math doesn’t currently work with the default gr() backend in Plots.jl. It should work with pyplot().

1 Like