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 9446a9d

Browse filesBrowse files
author
pwuertz
committed
pgf: documentation enhancements
1 parent ecb4802 commit 9446a9d
Copy full SHA for 9446a9d

File tree

Expand file treeCollapse file tree

2 files changed

+19
-10
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+19
-10
lines changed

‎doc/users/pgf.rst

Copy file name to clipboardExpand all lines: doc/users/pgf.rst
+14-5Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Rc parameters that control the behavior of the pgf backend:
4040
================= =====================================================
4141
pgf.preamble Lines to be included in the LaTeX preamble
4242
pgf.rcfonts Setup fonts from rc params using the fontspec package
43-
pgf.texsystem Either "xelatex", "lualatex" or "pdflatex"
43+
pgf.texsystem Either "xelatex" (default), "lualatex" or "pdflatex"
4444
================= =====================================================
4545

4646
.. note::
@@ -82,10 +82,10 @@ Custom preamble
8282
===============
8383

8484
Full customization is possible by adding your own commands to the preamble.
85-
Use the ``pgf.preamble`` parameter if you want to configure the math fonts or
86-
for loading additional packages. Also, if you want to do the font configuration
87-
yourself instead of using the fonts specified in the rc parameters, make sure
88-
to disable ``pgf.rcfonts``.
85+
Use the ``pgf.preamble`` parameter if you want to configure the math fonts,
86+
using ``unicode-math`` for example, or for loading additional packages. Also,
87+
if you want to do the font configuration yourself instead of using the fonts
88+
specified in the rc parameters, make sure to disable ``pgf.rcfonts``.
8989

9090
.. htmlonly::
9191

@@ -147,6 +147,15 @@ Troubleshooting
147147
ways to cause problems. When experiencing problems, try to minimalize or
148148
disable the custom preamble.
149149

150+
* Configuring an ``unicode-math`` environment can be a bit tricky. The
151+
TeXLive distribution for example provides a set of math fonts which are
152+
usually not installed system-wide. XeTeX, unlike LuaLatex, cannot find
153+
these fonts by their name, which is why you might have to specify
154+
``\setmathfont{xits-math.otf}`` instead of ``\setmathfont{XITS Math}`` or
155+
alternatively make the fonts available to your OS. See this
156+
`tex.stackexchange.com question <http://tex.stackexchange.com/questions/43642>`_
157+
for more details.
158+
150159
* If the font configuration used by matplotlib differs from the font setting
151160
in yout LaTeX document, the alignment of text elements in imported figures
152161
may be off. Check the header of your ``.pgf`` file if you are unsure about

‎doc/users/plotting/examples/pgf_preamble.py

Copy file name to clipboardExpand all lines: doc/users/plotting/examples/pgf_preamble.py
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
"text.usetex": True, # use inline math for ticks
88
"pgf.rcfonts": False, # don't setup fonts from rc parameters
99
"pgf.preamble": [
10-
r"\usepackage{units}", # load additional packages
11-
r"\usepackage{metalogo}", # load additional packages
12-
r"\usepackage{unicode-math}", # unicode math setup
13-
r"\setmathfont{XITS Math}",
14-
r"\setmainfont{DejaVu Serif}", # font setup via preamble
10+
r"\usepackage{units}", # load additional packages
11+
r"\usepackage{metalogo}",
12+
r"\usepackage{unicode-math}", # unicode math setup
13+
r"\setmathfont{xits-math.otf}",
14+
r"\setmainfont{DejaVu Serif}", # serif font via preamble
1515
]
1616
}
1717
mpl.rcParams.update(pgf_with_custom_preamble)

0 commit comments

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