Apologies in advance if I've missed something obvious. I'm trying to add LaTeX text to a plot, e.g.
from matplotlib import rc
rc('text', usetex=True)
plot(x^2, legend_label=r'$x^2$')
and each time, I get an error message like this:
/opt/sagemath-9.3/local/lib/python3.7/site-packages/sage/repl/rich_output/display_manager.py:596: RichReprWarning: Exception in _rich_repr_ while displaying object: latex was not able to process the following string:
b'lp'
Here is the full report generated by latex:
This is pdfTeX, Version 3.141592653-2.6-1.40.23 (MiKTeX 21.10)
entering extended mode
! I can't find file `/home/sage/.sage/matplotlib-1.5.1/tex.cache/1acea6f6c115d0
ec7a634ed0529287b9.tex'.
<*> ....cache/1acea6f6c115d0ec7a634ed0529287b9.tex
Please type another input file name
! Emergency stop.
<*> ....cache/1acea6f6c115d0ec7a634ed0529287b9.tex
No pages of output.
Transcript written on texput.log.
RichReprWarning,
The file in question (1acea6f6c115d0ec7a634ed0529287b9.tex) does exist, but the path is
`/home/.sage/matplotlib-1.5.1/tex.cache/1acea6f6c115d0
ec7a634ed0529287b9.tex'
not
`/home/sage/.sage/matplotlib-1.5.1/tex.cache/1acea6f6c115d0
ec7a634ed0529287b9.tex'
For whatever it's worth, my home directory is C:\Users\davis\
and if I copy the relevant file into the folder that LaTeX says it's looking for, and then run the same code, I get the same error message.
I'm on Windows 10 running Sage 9.3 (fresh installation this morning).