Open
Description
The documentation mentions this behavior, but only as a passing note in the middle of the tutorial.
matplotlib/galleries/users_explain/text/usetex.py
Lines 87 to 94 in f94fce6
When passing slightly complex latex code to matplotlib, a user might be tempted to use multi-line strings, and the error that matplotlib produces is quite cryptic. For example,
ax.annotate(text=r"""\begin{tabular}{cc}
a & b \\
c & d
\end{tabular}""", xy=(0.5,0.5), xycoords="figure fraction", xytext=(0,0))
produces
RuntimeError: latex was not able to process the following string: b'\\\\begin{tabular}{cc} '
I think it would be better to fix this behavior, but if not, it would be nice to give more visibility to it or include it in the troubleshooting at the end of the same page, at least.