Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Commit7fc9917
committed
Support {lua,xe}tex as alternative usetex engine.
Currently, this PR is mostly a proof of concept; only the svg backendis supported (under rcParams["svg.fonttype"] = "none", the default).However, there is a companion branch on the mplcairo repository, alsonamed "luadvi", which implements support for all output formats.Example (requiring both this PR, and mplcairo installed from its luadvibranch):```import matplotlib as mpl; mpl.use("module://mplcairo.qt")from matplotlib import pyplot as pltplt.rcParams["text.latex.engine"] = "lualatex" # or "xelatex"plt.rcParams["text.latex.preamble"] = ( # {lua,xe}tex can use any font installed on the system, spec'd using its # "normal" name. Try e.g. DejaVu Sans instead. r"\usepackage{fontspec}\setmainfont{TeX Gyre Pagella}")plt.figtext(.5, .5, r"\textrm{gff\textwon}", usetex=True)plt.show()```Font effects are supported by mplcairo, e.g.`\fontspec{DejaVu Sans}[FakeSlant=0.2] abc`.TODO:- Fix many likely remaining bugs.- Rework font selection in texmanager, which is currently very ad-hoc due to the limited number of fonts supported by latex.- Implement rendering support in the (other) builtin backends. In particular, the Agg (and, if we care, cairo) backend will require significant reworking because dvipng, currently used to rasterize dvi to png, doesn't support luatex-generated dvi; instead we will need to proceed as with the other backends, reading the glyphs one at a time from the dvi file and rasterizing them one at a time to the output buffer. Working on the other backends is not very high on my priority list (as I already have mplcairo as playground...) so it would be nice if others showed some interest for it :-)1 parent6a177bd commit7fc9917
File tree
4 files changed
+35
-9
lines changed- lib/matplotlib
- mpl-data
4 files changed
+35
-9
lines changedLines changed: 6 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
109 | 109 |
| |
110 | 110 |
| |
111 | 111 |
| |
112 |
| - | |
113 |
| - | |
114 |
| - | |
115 |
| - | |
116 |
| - | |
117 |
| - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
118 | 118 |
| |
119 | 119 |
| |
120 | 120 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
327 | 327 |
| |
328 | 328 |
| |
329 | 329 |
| |
| 330 | + | |
330 | 331 |
| |
331 | 332 |
| |
332 | 333 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1051 | 1051 |
| |
1052 | 1052 |
| |
1053 | 1053 |
| |
| 1054 | + | |
1054 | 1055 |
| |
1055 | 1056 |
| |
1056 | 1057 |
| |
|
Lines changed: 27 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
200 | 200 |
| |
201 | 201 |
| |
202 | 202 |
| |
| 203 | + | |
203 | 204 |
| |
204 | 205 |
| |
205 | 206 |
| |
206 | 207 |
| |
207 | 208 |
| |
208 |
| - | |
| 209 | + | |
| 210 | + | |
209 | 211 |
| |
210 | 212 |
| |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
211 | 228 |
| |
212 | 229 |
| |
213 | 230 |
| |
| |||
277 | 294 |
| |
278 | 295 |
| |
279 | 296 |
| |
280 |
| - | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
281 | 300 |
| |
282 | 301 |
| |
283 | 302 |
| |
| |||
292 | 311 |
| |
293 | 312 |
| |
294 | 313 |
| |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
295 | 319 |
| |
296 |
| - | |
| 320 | + | |
297 | 321 |
| |
298 | 322 |
| |
299 | 323 |
| |
|
0 commit comments
Comments
(0)