From f12f34156bc5723135f7e28915013e6ac598ed7c Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Wed, 17 Apr 2024 16:01:53 +0200 Subject: [PATCH] Minor maintenance on pgf docs/backends. - Remove vague mention of outdated tex packages (first because it was written more than 10 years ago so packages too old for backend_pgf compatibility are unlikely to be seen nowadays, and second because if we don't actually provide compatibility bounds such a statement is not particularly useful). - Fix consistency between xetex/xelatex, and also for capitalization. - Remove an unnecessary encoding step in PdfPages by directly formatting bytes. --- galleries/users_explain/text/pgf.py | 6 +----- lib/matplotlib/backends/backend_pgf.py | 12 ++++-------- 2 files changed, 5 insertions(+), 13 deletions(-) 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 pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy