GR.jl icon indicating copy to clipboard operation
GR.jl copied to clipboard

latex errors

Open AshtonSBradley opened this issue 5 years ago • 5 comments

On julia 1.3 and 1.4, and windows 10, using LaTeXStrings with the gr backend in Plots

'latex' is not recognized as an internal or external command, operable program or batch file.

latex: failed to create a dvi file

This has appeared on a number of different systems.

The first seems to be solved by build LaTeXStrings.

The second seems to require dvips and it isn't clear to me how to install this on Windows. I assume it should get installed automatically as part of the build?

AshtonSBradley avatar Apr 03 '20 23:04 AshtonSBradley

In the meantime, GR has an inline LaTeX renderer. Did you really use the latest GR version?

ENV["GRDIR"]=""
] up
] build GR

Example:

using GR
using LaTeXStrings
plot(rand(10), ylabel=L"- \frac{{\hbar ^2}}{{2m}}\frac{{\partial ^2 \psi (x,t)}}{{\partial x^2 }} + U(x)\psi (x,t) = i\hbar \frac{{\partial \psi (x,t)}}{{\partial t}}")
latex

jheinen avatar Apr 04 '20 05:04 jheinen

I'm having the same problem on Windows. Using LaTeXStrings as well, here is what happens for me: image In my terminal, when I run cat a | latex, then dvipng texput1.dvi (where a is the LaTeX file with my desired title), this works correctly and I get a PNG: image But it's not getting there when I call plot.

Looks like the error is happening here; is there any way to run this in a more verbose mode or something like that?

a-churchill avatar Apr 11 '20 02:04 a-churchill

You are using Plots.jl, right?

jheinen avatar Apr 11 '20 06:04 jheinen

You are using Plots.jl, right?

@jheinen yes - using Plots.jl with the GR backend.

a-churchill avatar Apr 11 '20 07:04 a-churchill

I added support for vector fonts in Plots#master (link).

Could you please try to use plot(..., fontname="sans-serif")

jheinen avatar Apr 11 '20 09:04 jheinen