@yihui 安装新版 tinytex 似乎又出现在前面已安装的 LaTeX 工具(比如 dvipng/dvipng.x86_64-linux),在后面使用的时候找不到的现象,这次是 dvipng 我怀疑也是被误删了,这类工具不知道有没有和普通 LaTeX 宏包区别对待?
错误消息详见 https://github.com/XiangyunHuang/masr/runs/792711252?check_suite_focus=true
- Install TinyTeX 这段任务明确安装了 dvipng
- Build Book 这段任务在运行 Python 代码绘图的时候报错,提示找不到 dvipng
之前运行都没有报错
Error in py_call_impl(callable, dots$args, dots$keywords) :
RuntimeError: Evaluation error: RuntimeError: Failed to process string with tex because dvipng could not be found
Detailed traceback:
File "/opt/.virtualenvs/r-tensorflow/lib/python3.6/site-packages/matplotlib/pyplot.py", line 724, in savefig
fig.canvas.draw_idle() # need this if 'transparent=True' to reset colors
File "/opt/.virtualenvs/r-tensorflow/lib/python3.6/site-packages/matplotlib/backend_bases.py", line 1947, in draw_idle
self.draw(*args, **kwargs)
File "/opt/.virtualenvs/r-tensorflow/lib/python3.6/site-packages/matplotlib/backends/backend_agg.py", line 393, in draw
self.figure.draw(self.renderer)
File "/opt/.virtualenvs/r-tensorflow/lib/python3.6/site-packages/matplotlib/artist.py", line 38, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File "/opt/.virtualenvs/r-tensorflow/lib/python3.6/site-packages/matplotlib/figure.py", line 1736, in draw
renderer, self, artists, self.suppressComposite)
File "/opt/.virtualenvs/
Calls: local ... py_capture_output -> force -> <Anonymous> -> py_call_impl
对应的代码块如下
```{python matplotlib, fig.cap = "matplotlib 示例", echo = FALSE, dev = ifelse(knitr::is_html_output(), 'svg', ifelse(knitr::is_latex_output(), 'pdf', 'png')), out.width='.8\\textwidth'}
import matplotlib.pyplot as plt
from matplotlib import rcParams
rcParams.update({'font.size': 18, 'text.usetex': True}) # 其它可配置选项见 rcParams.keys()
plt.switch_backend('agg')
plt.plot([0, 2, 1, 4])
plt.xlabel(r'$x$')
plt.ylabel(r'$y$')
plt.show()
```