File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change 11r"""
2- *********************************
3- Typesetting with XeLaTeX/LuaLaTeX
4- *********************************
5-
6- How to typeset text with the ``pgf`` backend in Matplotlib.
2+ *********************************************************
3+ Typesetting with XeLaTeX/LuaLaTeX via the ``pgf`` backend
4+ *********************************************************
75
86Using the ``pgf`` backend, Matplotlib can export figures as pgf drawing
97commands that can be processed with pdflatex, xelatex or lualatex. XeLaTeX and
5351
5452 Generally, these characters must be escaped correctly. For convenience,
5553 some characters (_, ^, %) are automatically escaped outside of math
56- environments.
54+ environments. Other characters are not escaped as they are commonly needed
55+ in actual TeX expressions. However, one can configure TeX to treat them as
56+ "normal" characters (known as "catcode 12" to TeX) via a custom preamble,
57+ such as::
58+
59+ plt.rcParams["pgf.preamble"] = (
60+ r"\AtBeginDocument{\catcode`\&=12\catcode`\#=12}")
5761
5862.. _pgf-rcfonts:
5963
You can’t perform that action at this time.
0 commit comments