|
4 | 4 | import logging |
5 | 5 | import math |
6 | 6 | import os |
7 | | -from pathlib import Path |
| 7 | +import pathlib |
8 | 8 | import re |
9 | 9 | import shutil |
10 | 10 | import subprocess |
@@ -69,7 +69,7 @@ def get_fontspec(): |
69 | 69 | for family, command in zip(families, commands): |
70 | 70 | # 1) Forward slashes also work on Windows, so don't mess with |
71 | 71 | # backslashes. 2) The dirname needs to include a separator. |
72 | | - path = Path(fm.findfont(family)) |
| 72 | + path = pathlib.Path(fm.findfont(family)) |
73 | 73 | latex_fontspec.append(r"\%s{%s}[Path=%s]" % ( |
74 | 74 | command, path.name, path.parent.as_posix() + "/")) |
75 | 75 |
|
@@ -1118,9 +1118,9 @@ def close(self): |
1118 | 1118 | open(self._outputfile, 'wb').close() |
1119 | 1119 |
|
1120 | 1120 | def _run_latex(self): |
1121 | | - texcommand = get_texcommand() |
| 1121 | + texcommand = rcParams["pgf.texsystem"] |
1122 | 1122 | cmdargs = [ |
1123 | | - str(texcommand), |
| 1123 | + texcommand, |
1124 | 1124 | "-interaction=nonstopmode", |
1125 | 1125 | "-halt-on-error", |
1126 | 1126 | os.path.basename(self._fname_tex), |
@@ -1182,12 +1182,11 @@ def _build_newpage_command(self, width, height): |
1182 | 1182 | so we need to check the lualatex version and use `\pagewidth` if |
1183 | 1183 | the version is 0.85 or newer |
1184 | 1184 | ''' |
1185 | | - texcommand = get_texcommand() |
| 1185 | + texcommand = rcParams["pgf.texsystem"] |
1186 | 1186 | if texcommand == 'lualatex' and _get_lualatex_version() >= (0, 85, 0): |
1187 | 1187 | cmd = r'\page' |
1188 | 1188 | else: |
1189 | 1189 | cmd = r'\pdfpage' |
1190 | | - |
1191 | 1190 | newpage = r'\newpage{cmd}width={w}in,{cmd}height={h}in%' + '\n' |
1192 | 1191 | return newpage.format(cmd=cmd, w=width, h=height).encode('utf-8') |
1193 | 1192 |
|
|
0 commit comments