PyPlot.title(L"Plot of the 1st eigenfunction, corresponding to $\lambda=$ $(eigenvalue_approx[1])")

and as you can probably guess, I want lambda to be rendered as the appropriate lower case Greek letter and the first element of eigenvalue_approx to be displayed after the equal sign. But currently I just get:

You can also use the lower-level constructor latexstring(args...) , which works much like string(args...) except that it produces a LaTeXString result and automatically puts $ at the beginning and end of the string if an unescaped $ is not already present. Note that with latexstring(...) you do have to escape $ and \ : for example, latexstring("an equation: \$1 + \\alpha^2\$") . One reason you might want to use latexstring instead of L"..." is that only the former supports string interpolation (inserting the values of other variables into your string).

You can also supply a mixture of String and LaTeXString args to latexstring to avoid the need for multiple escape characters:

julia> latexstring("Plot of the ", L"1^\mathrm{st}", " eigenfunction, corresponding to ", L"\lambda = ", rand(1:.1:10))
L"Plot of the $1^\mathrm{st}$ eigenfunction, corresponding to $\lambda = $4.5"

Is there a way to do what I asked originally AND specify the number of digits in eigenvalue_approx[1] that are shown? eigenvalue_approx[1] is only accurate to at most 10 digits, so showing 16 isn’t particularly helpful.

julia> using Printf
julia> latexstring("Plot of the ", L"1^\mathrm{st}", " eigenfunction, corresponding to ", L"\lambda = ",
@sprintf("%.10f", eigenvalue_approx[1]))

…or you could round the value: round(eigenvalue_approx[1], sigdigits=10)

And how do I incorporate that in my plot title? I ask because I tried the obvious, that is:

PyPlot.title(latexstring("Plot of the ", L"1^\mathrm{st}", " eigenfunction, corresponding to ", L"\lambda = ",
@printf("%.10f", eigenvalue_approx[1])))