From 64364d31849e5732c0098a62d503f20ac8777704 Mon Sep 17 00:00:00 2001 From: Jody Klymak Date: Sat, 11 May 2019 17:13:34 -0700 Subject: [PATCH] Backport PR #14167: Fix backend_pgf header. --- lib/matplotlib/backends/backend_pgf.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/backends/backend_pgf.py b/lib/matplotlib/backends/backend_pgf.py index 9b7f0906eb4a..2bc9ae49a702 100644 --- a/lib/matplotlib/backends/backend_pgf.py +++ b/lib/matplotlib/backends/backend_pgf.py @@ -212,9 +212,10 @@ def _build_latex_header(): # fonts later when we don't expect the additional output on stdout. # TODO: is this sufficient? latex_header = [ + r"\documentclass{minimal}", # Include TeX program name as a comment for cache invalidation. + # TeX does not allow this to be the first line. r"% !TeX program = {}".format(rcParams["pgf.texsystem"]), - r"\documentclass{minimal}", latex_preamble, latex_fontspec, r"\begin{document}",