Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 14a5900

Browse filesBrowse files
committed
PGF: Only force loading fontspec if pgf.rcfonts=True
1 parent 46ac87e commit 14a5900
Copy full SHA for 14a5900

File tree

Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed

‎lib/matplotlib/backends/backend_pgf.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_pgf.py
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,18 @@ def _get_preamble():
4444
r"\everymath=\expandafter{\the\everymath\displaystyle}",
4545
# Allow pgf.preamble to override the above definitions.
4646
mpl.rcParams["pgf.preamble"],
47-
r"\ifdefined\pdftexversion\else % non-pdftex case.",
48-
r" \usepackage{fontspec}",
4947
*([
48+
r"\ifdefined\pdftexversion\else % non-pdftex case.",
49+
r" \usepackage{fontspec}",
50+
] + [
5051
r" \%s{%s}[Path=\detokenize{%s/}]"
5152
% (command, path.name, path.parent.as_posix())
5253
for command, path in zip(
5354
["setmainfont", "setsansfont", "setmonofont"],
5455
[pathlib.Path(fm.findfont(family))
5556
for family in ["serif", "sans\\-serif", "monospace"]]
5657
)
57-
] if mpl.rcParams["pgf.rcfonts"] else []),
58-
r"\fi",
58+
] + [r"\fi"] if mpl.rcParams["pgf.rcfonts"] else []),
5959
# Documented as "must come last".
6060
mpl.texmanager._usepackage_if_not_loaded("underscore", option="strings"),
6161
])

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.