diff --git a/lib/matplotlib/mpl-data/stylelib/classic.mplstyle b/lib/matplotlib/mpl-data/stylelib/classic.mplstyle index cd636d65c7c8..56a0461f61f3 100644 --- a/lib/matplotlib/mpl-data/stylelib/classic.mplstyle +++ b/lib/matplotlib/mpl-data/stylelib/classic.mplstyle @@ -111,21 +111,6 @@ text.usetex : False # use latex for all text handling. The following fo # If another font is desired which can loaded using the # 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. - # 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, fix-cm, geometry, graphicx, 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 @@ -452,7 +437,6 @@ pdf.use14corefonts : False # pgf backend params pgf.texsystem : xelatex pgf.rcfonts : True -pgf.preamble : # svg backend params svg.image_inline : True # write raster image data directly into the svg file diff --git a/lib/matplotlib/style/__init__.py b/lib/matplotlib/style/__init__.py index 80c6de00a18d..0f1bcade07bc 100644 --- a/lib/matplotlib/style/__init__.py +++ b/lib/matplotlib/style/__init__.py @@ -37,7 +37,10 @@ 'webagg.port_retries', 'webagg.open_in_browser', 'backend_fallback', 'toolbar', 'timezone', 'figure.max_open_warning', 'figure.raise_window', 'savefig.directory', 'tk.window_focus', - 'docstring.hardcopy', 'date.epoch'} + 'docstring.hardcopy', 'date.epoch', + # Preamble params allow arbitrary LaTeX command injection. + 'text.latex.preamble', 'pgf.preamble', +} @_docstring.Substitution(