diff --git a/galleries/users_explain/text/pgf.py b/galleries/users_explain/text/pgf.py index 9bcfe34a24b7..8683101032b5 100644 --- a/galleries/users_explain/text/pgf.py +++ b/galleries/users_explain/text/pgf.py @@ -152,10 +152,6 @@ Troubleshooting =============== -* Please note that the TeX packages found in some Linux distributions and - MiKTeX installations are dramatically outdated. Make sure to update your - package catalog and upgrade or install a recent TeX distribution. - * On Windows, the :envvar:`PATH` environment variable may need to be modified to include the directories containing the latex, dvipng and ghostscript executables. See :ref:`environment-variables` and @@ -175,7 +171,7 @@ * Configuring an ``unicode-math`` environment can be a bit tricky. The TeXLive distribution for example provides a set of math fonts which are - usually not installed system-wide. XeTeX, unlike LuaLatex, cannot find + usually not installed system-wide. XeLaTeX, unlike LuaLaTeX, cannot find these fonts by their name, which is why you might have to specify ``\setmathfont{xits-math.otf}`` instead of ``\setmathfont{XITS Math}`` or alternatively make the fonts available to your OS. See this diff --git a/lib/matplotlib/backends/backend_pgf.py b/lib/matplotlib/backends/backend_pgf.py index 9705f5fc6bce..a9763e04a8bd 100644 --- a/lib/matplotlib/backends/backend_pgf.py +++ b/lib/matplotlib/backends/backend_pgf.py @@ -995,14 +995,10 @@ def savefig(self, figure=None, **kwargs): # luatex<0.85; they were renamed to \pagewidth and \pageheight # on luatex>=0.85. self._file.write( - ( - r'\newpage' - r'\ifdefined\pdfpagewidth\pdfpagewidth' - fr'\else\pagewidth\fi={width}in' - r'\ifdefined\pdfpageheight\pdfpageheight' - fr'\else\pageheight\fi={height}in' - '%%\n' - ).encode("ascii") + rb'\newpage' + rb'\ifdefined\pdfpagewidth\pdfpagewidth\else\pagewidth\fi=%fin' + rb'\ifdefined\pdfpageheight\pdfpageheight\else\pageheight\fi=%fin' + b'%%\n' % (width, height) ) figure.savefig(self._file, format="pgf", backend="pgf", **kwargs) self._n_figures += 1