|
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 |
|
@@ -1119,9 +1119,9 @@ def close(self):
|
1119 | 1119 | open(self._outputfile, 'wb').close()
|
1120 | 1120 |
|
1121 | 1121 | def _run_latex(self):
|
1122 |
| - texcommand = get_texcommand() |
| 1122 | + texcommand = rcParams["pgf.texsystem"] |
1123 | 1123 | cmdargs = [
|
1124 |
| - str(texcommand), |
| 1124 | + texcommand, |
1125 | 1125 | "-interaction=nonstopmode",
|
1126 | 1126 | "-halt-on-error",
|
1127 | 1127 | os.path.basename(self._fname_tex),
|
@@ -1183,12 +1183,11 @@ def _build_newpage_command(self, width, height):
|
1183 | 1183 | so we need to check the lualatex version and use `\pagewidth` if
|
1184 | 1184 | the version is 0.85 or newer
|
1185 | 1185 | '''
|
1186 |
| - texcommand = get_texcommand() |
| 1186 | + texcommand = rcParams["pgf.texsystem"] |
1187 | 1187 | if texcommand == 'lualatex' and _get_lualatex_version() >= (0, 85, 0):
|
1188 | 1188 | cmd = r'\page'
|
1189 | 1189 | else:
|
1190 | 1190 | cmd = r'\pdfpage'
|
1191 |
| - |
1192 | 1191 | newpage = r'\newpage{cmd}width={w}in,{cmd}height={h}in%' + '\n'
|
1193 | 1192 | return newpage.format(cmd=cmd, w=width, h=height).encode('utf-8')
|
1194 | 1193 |
|
|
0 commit comments