0

使用 Matplotlib 的 PGF 后端,使用 LuaLaTeX 作为 texsystem 时出现权限被拒绝错误。

最小的例子如下:

import matplotlib as mpl

mpl.use('pgf')
mplparams = {
    "font.family": "serif",
    "text.usetex": True,
    "pgf.texsystem": "lualatex",
    "pgf.rcfonts": False,
    "pgf.preamble": [r"\usepackage{fourier}"]
}
mpl.rcParams.update(mplparams)

import matplotlib.pyplot as plt
plt.title("Example Plot")
plt.plot([1, 2, 3, 4, 5])

plt.savefig('output.pdf')

给我以下错误:

This is LuaTeX, Version beta-0.76.0-2013062820 (rev 4627)
(c:/users/lholden/appdata/local/temp/mpl_pgf_5oh3zg/figure.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ara

<snip>

*geometry* driver: auto-detecting
*geometry* detected driver: pdftex
(C:/Users/LHolden/AppData/Roaming/MiKTeX/2.9/tex/context/base/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) ABD: EveryShipout initializing macroslualatex: Permission denied: c:/users/lho
lden/appdata/local/temp/mpl_pgf_5oh3zg/figure.pgf
lualatex: Data: c:/users/lholden/appdata/local/temp/mpl_pgf_5oh3zg/figure.pgf

我正在使用来自 Anaconda 2.1.0 的 64 位 Python 2.7.8,运行 Windows 8。luatex --version结果为This is LuaTeX, Version beta-0.76.0-2013062820 (MiKTeX 2.9) (rev 4627). 我在 matplotlib 的 1.4.2 版上。

在管理员命令提示符下执行相同的示例给出了相同的结果。"pgf.texsystem": "lualatex"注释掉的相同示例成功完成,除了只有数字采用序言中指定的字体 - 文本仍采用默认字体。

4

0 回答 0