Skip to content

Commit

Permalink
Use the new pgf.documentclass rcParam
Browse files Browse the repository at this point in the history
  • Loading branch information
voidstarstar committed May 4, 2024
1 parent faf747c commit db62b70
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/matplotlib/backends/backend_pgf.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ class LatexManager:
@staticmethod
def _build_latex_header():
latex_header = [
r"\documentclass{article}",
mpl.rcParams["pgf.documentclass"],
# Include TeX program name as a comment for cache invalidation.
# TeX does not allow this to be the first line.
rf"% !TeX program = {mpl.rcParams['pgf.texsystem']}",
Expand Down Expand Up @@ -815,7 +815,7 @@ def print_pdf(self, fname_or_fh, *, metadata=None, **kwargs):
self.print_pgf(tmppath / "figure.pgf", **kwargs)
(tmppath / "figure.tex").write_text(
"\n".join([
r"\documentclass[12pt]{article}",
mpl.rcParams["pgf.documentclass"],
r"\PassOptionsToPackage{pdfinfo={%s}}{hyperref}" % pdfinfo,
r"\usepackage{hyperref}",
r"\PassOptionsToPackage{%s}{geometry}" % geometry_options,
Expand Down Expand Up @@ -927,7 +927,7 @@ def _write_header(self, width_inches, height_inches):
pdfinfo = ','.join(
_metadata_to_str(k, v) for k, v in self._info_dict.items())
latex_header = "\n".join([
r"\documentclass[12pt]{article}",
mpl.rcParams["pgf.documentclass"],
r"\usepackage[pdfinfo={%s}]{hyperref}" % pdfinfo,
r"\usepackage[papersize={%fin,%fin}, margin=0in]{geometry}"
% (width_inches, height_inches),
Expand Down

0 comments on commit db62b70

Please sign in to comment.