@@ -1232,9 +1232,11 @@ def _print_figure_tex(self, outfile, dpi, facecolor, edgecolor, orientation,
12321232 paper will be used to prevent clipping.'% (papertype , temp_papertype ), 'helpful' )
12331233
12341234 texmanager = renderer .get_texmanager ()
1235+ font_preamble = texmanager .get_font_preamble ()
1236+ custom_preamble = texmanager .get_custom_preamble ()
12351237
1236- convert_psfrags (tmpfile , renderer .psfrag ,texmanager . get_font_preamble (),
1237- paperWidth , paperHeight , orientation )
1238+ convert_psfrags (tmpfile , renderer .psfrag , font_preamble ,
1239+ custom_preamble , paperWidth , paperHeight , orientation )
12381240
12391241 if rcParams ['ps.usedistiller' ] == 'ghostscript' :
12401242 gs_distill (tmpfile , ext == '.eps' , ptype = papertype , bbox = bbox )
@@ -1249,8 +1251,8 @@ def _print_figure_tex(self, outfile, dpi, facecolor, edgecolor, orientation,
12491251 print >> outfile , fh .read ()
12501252 else : shutil .move (tmpfile , outfile )
12511253
1252- def convert_psfrags (tmpfile , psfrags , font_preamble , paperWidth , paperHeight ,
1253- orientation ):
1254+ def convert_psfrags (tmpfile , psfrags , font_preamble , custom_preamble ,
1255+ paperWidth , paperHeight , orientation ):
12541256 """
12551257 When we want to use the LaTeX backend with postscript, we write PSFrag tags
12561258 to a temporary postscript file, each one marking a position for LaTeX to
@@ -1272,6 +1274,7 @@ def convert_psfrags(tmpfile, psfrags, font_preamble, paperWidth, paperHeight,
12721274
12731275 print >> latexh , r"""\documentclass{article}
12741276%s
1277+ %s
12751278\usepackage[dvips, papersize={%sin,%sin}, body={%sin,%sin}, margin={0in,0in}]{geometry}
12761279\usepackage{psfrag}
12771280\usepackage[dvips]{graphicx}
@@ -1285,7 +1288,7 @@ def convert_psfrags(tmpfile, psfrags, font_preamble, paperWidth, paperHeight,
12851288\includegraphics*[angle=%s]{%s}
12861289\end{figure}
12871290\end{document}
1288- """ % (font_preamble , paperWidth , paperHeight , paperWidth , paperHeight ,
1291+ """ % (font_preamble , custom_preamble , paperWidth , paperHeight , paperWidth , paperHeight ,
12891292'\n ' .join (psfrags ), angle , os .path .split (epsfile )[- 1 ])
12901293 latexh .close ()
12911294
0 commit comments