Skip to content

Minor maintenance on pgf docs/backends. #28093

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions galleries/users_explain/text/pgf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
12 changes: 4 additions & 8 deletions lib/matplotlib/backends/backend_pgf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down