1 回答

TA贡献1780条经验 获得超1个赞
我现在遇到了同样的问题。我通过以下方式解决了它:
从 JupyterLab 中完全卸载扩展
重建和重新加载 JupyterLab
从 pip 安装扩展,如文档所述,使用
pip install jupyterlab_latex
,确保您使用的是来自 conda 的 pip(您可以通过运行which pip
con 终端来检查)。这可能是导致我出现问题的原因。跑步
jupyter labextension install @jupyterlab/latex
最后,打开 JupyterLab,它应该可以工作了。
即使不起作用,您也可以在 JupyterLab 中打开一个终端并.tex
从那里轻松编译.sh
:
#!/bin/bash
# get the folder's name as a variable.
archivo=${PWD##*/}
# runs pdflatex with minimun output (using texfot)
texfot pdflatex $archivo.tex
# if a Rnw exists, then runs it too
count=`ls -1 *.Rnw 2>/dev/null | wc -l`
if [ $count != 0 ]
then
Rscript -e "library(knitr); knit('$archivo.Rnw')"
texfot pdflatex $archivo.tex
fi
# opens evince to view the pdf.
evince $archivo.pdf
它假定.tex您尝试编译的文件与包含文件夹的名称相同。无论如何,这是推荐的。它也适用于使用 knitr 进行 Sweaving 的 Rnoweb 文件。
有了它,您将能够.tex像使用扩展(甚至.Rnw文件)一样轻松地处理来自 JupyterLab 的文件。
添加回答
举报