@@ -185,7 +185,7 @@ class LatexManager:
185
185
@staticmethod
186
186
def _build_latex_header ():
187
187
latex_header = [
188
- r"\ documentclass{article}" ,
188
+ mpl . rcParams [ "pgf. documentclass" ] ,
189
189
# Include TeX program name as a comment for cache invalidation.
190
190
# TeX does not allow this to be the first line.
191
191
rf"% !TeX program = { mpl .rcParams ['pgf.texsystem' ]} " ,
@@ -815,7 +815,7 @@ def print_pdf(self, fname_or_fh, *, metadata=None, **kwargs):
815
815
self .print_pgf (tmppath / "figure.pgf" , ** kwargs )
816
816
(tmppath / "figure.tex" ).write_text (
817
817
"\n " .join ([
818
- r"\ documentclass[12pt]{article}" ,
818
+ mpl . rcParams [ "pgf. documentclass" ] ,
819
819
r"\PassOptionsToPackage{pdfinfo={%s}}{hyperref}" % pdfinfo ,
820
820
r"\usepackage{hyperref}" ,
821
821
r"\PassOptionsToPackage{%s}{geometry}" % geometry_options ,
@@ -927,7 +927,7 @@ def _write_header(self, width_inches, height_inches):
927
927
pdfinfo = ',' .join (
928
928
_metadata_to_str (k , v ) for k , v in self ._info_dict .items ())
929
929
latex_header = "\n " .join ([
930
- r"\ documentclass[12pt]{article}" ,
930
+ mpl . rcParams [ "pgf. documentclass" ] ,
931
931
r"\usepackage[pdfinfo={%s}]{hyperref}" % pdfinfo ,
932
932
r"\usepackage[papersize={%fin,%fin}, margin=0in]{geometry}"
933
933
% (width_inches , height_inches ),
0 commit comments