Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1104326

Browse files
authored
Merge pull request #18507 from anntzer/fewertexpacks
Fewer "soft" dependencies on LaTeX packages.
2 parents 641d2fa + 34cb5cd commit 1104326

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

examples/userdemo/pgf_preamble_sgskip.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,16 @@
1313
"text.usetex": True, # use inline math for ticks
1414
"pgf.rcfonts": False, # don't setup fonts from rc parameters
1515
"pgf.preamble": "\n".join([
16-
"\\usepackage{units}", # load additional packages
17-
"\\usepackage{metalogo}",
18-
"\\usepackage{unicode-math}", # unicode math setup
19-
r"\setmathfont{xits-math.otf}",
16+
r"\usepackage{url}", # load additional packages
17+
r"\usepackage{unicode-math}", # unicode math setup
2018
r"\setmainfont{DejaVu Serif}", # serif font via preamble
2119
])
2220
})
2321

2422
plt.figure(figsize=(4.5, 2.5))
2523
plt.plot(range(5))
26-
plt.xlabel("unicode text: я, ψ, €, ü, \\unitfrac[10]{°}{µm}")
27-
plt.ylabel("\\XeLaTeX")
24+
plt.xlabel("unicode text: я, ψ, €, ü")
25+
plt.ylabel(r"\url{https://matplotlib.org}")
2826
plt.legend(["unicode math: $λ=∑_i^∞ μ_i^2$"])
2927
plt.tight_layout(.5)
3028

lib/matplotlib/mpl-data/stylelib/classic.mplstyle

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,16 +112,20 @@ text.usetex : False # use latex for all text handling. The following fo
112112
# LaTeX \usepackage command, please inquire at the
113113
# matplotlib mailing list
114114
text.latex.preamble : # IMPROPER USE OF THIS FEATURE WILL LEAD TO LATEX FAILURES
115-
# AND IS THEREFORE UNSUPPORTED. PLEASE DO NOT ASK FOR HELP
116-
# IF THIS FEATURE DOES NOT DO WHAT YOU EXPECT IT TO.
117-
# preamble is a comma separated list of LaTeX statements
118-
# that are included in the LaTeX document preamble.
119-
# An example:
120-
# text.latex.preamble : \usepackage{bm},\usepackage{euler}
121-
# The following packages are always loaded with usetex, so
122-
# beware of package collisions: color, geometry, graphicx,
123-
# type1cm, textcomp. Adobe Postscript (PSSNFS) font packages
124-
# may also be loaded, depending on your font settings
115+
# AND IS THEREFORE UNSUPPORTED. PLEASE DO NOT ASK FOR HELP
116+
# IF THIS FEATURE DOES NOT DO WHAT YOU EXPECT IT TO.
117+
# text.latex.preamble is a single line of LaTeX code that
118+
# will be passed on to the LaTeX system. It may contain
119+
# any code that is valid for the LaTeX "preamble", i.e.
120+
# between the "\documentclass" and "\begin{document}"
121+
# statements.
122+
# Note that it has to be put on a single line, which may
123+
# become quite long.
124+
# The following packages are always loaded with usetex, so
125+
# beware of package collisions: color, geometry, graphicx,
126+
# type1cm, textcomp.
127+
# Adobe Postscript (PSSNFS) font packages may also be
128+
# loaded, depending on your font settings.
125129

126130
text.hinting : auto # May be one of the following:
127131
# 'none': Perform no hinting

0 commit comments

Comments
 (0)