Skip to content

Commit

Permalink
Merge pull request matplotlib#18507 from anntzer/fewertexpacks
Browse files Browse the repository at this point in the history
Fewer "soft" dependencies on LaTeX packages.
  • Loading branch information
story645 authored Sep 17, 2020
2 parents 641d2fa + 34cb5cd commit 1104326
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
10 changes: 4 additions & 6 deletions examples/userdemo/pgf_preamble_sgskip.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,16 @@
"text.usetex": True, # use inline math for ticks
"pgf.rcfonts": False, # don't setup fonts from rc parameters
"pgf.preamble": "\n".join([
"\\usepackage{units}", # load additional packages
"\\usepackage{metalogo}",
"\\usepackage{unicode-math}", # unicode math setup
r"\setmathfont{xits-math.otf}",
r"\usepackage{url}", # load additional packages
r"\usepackage{unicode-math}", # unicode math setup
r"\setmainfont{DejaVu Serif}", # serif font via preamble
])
})

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

Expand Down
24 changes: 14 additions & 10 deletions lib/matplotlib/mpl-data/stylelib/classic.mplstyle
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,20 @@ text.usetex : False # use latex for all text handling. The following fo
# LaTeX \usepackage command, please inquire at the
# matplotlib mailing list
text.latex.preamble : # IMPROPER USE OF THIS FEATURE WILL LEAD TO LATEX FAILURES
# AND IS THEREFORE UNSUPPORTED. PLEASE DO NOT ASK FOR HELP
# IF THIS FEATURE DOES NOT DO WHAT YOU EXPECT IT TO.
# preamble is a comma separated list of LaTeX statements
# that are included in the LaTeX document preamble.
# An example:
# text.latex.preamble : \usepackage{bm},\usepackage{euler}
# The following packages are always loaded with usetex, so
# beware of package collisions: color, geometry, graphicx,
# type1cm, textcomp. Adobe Postscript (PSSNFS) font packages
# may also be loaded, depending on your font settings
# AND IS THEREFORE UNSUPPORTED. PLEASE DO NOT ASK FOR HELP
# IF THIS FEATURE DOES NOT DO WHAT YOU EXPECT IT TO.
# text.latex.preamble is a single line of LaTeX code that
# will be passed on to the LaTeX system. It may contain
# any code that is valid for the LaTeX "preamble", i.e.
# between the "\documentclass" and "\begin{document}"
# statements.
# Note that it has to be put on a single line, which may
# become quite long.
# The following packages are always loaded with usetex, so
# beware of package collisions: color, geometry, graphicx,
# type1cm, textcomp.
# Adobe Postscript (PSSNFS) font packages may also be
# loaded, depending on your font settings.

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

0 comments on commit 1104326

Please sign in to comment.