Python 使用 knitR 在 Rstudio 中的 LaTeX 中突出显示语法
Python syntax highlighting in LaTeX in Rstudio with knitR
如何突出显示 Rnw
文件(LaTeX 文件)中的 python 代码?我正在使用 RStudio 的 "Compile PDF" 函数来 运行 pdflatex
.
Markdown 文件有两个相关问题 (Q1, ),但此问题特定于 Rnw
个文件。
示例:
\documentclass{article}
\begin{document}
<<>>=
print("This is R")
@
<<engine='python'>>=
print "This is python"
@
\end{document}
我用的是IPython笔记本,你可以convert it to latex很简单。
$ ipython nbconvert notebook.ipynb
您将拥有一个 .tex 文件。
安装亮点:andre-simon.de。参见问题评论中@Yihui 的post
如何突出显示 Rnw
文件(LaTeX 文件)中的 python 代码?我正在使用 RStudio 的 "Compile PDF" 函数来 运行 pdflatex
.
Markdown 文件有两个相关问题 (Q1, Rnw
个文件。
示例:
\documentclass{article}
\begin{document}
<<>>=
print("This is R")
@
<<engine='python'>>=
print "This is python"
@
\end{document}
我用的是IPython笔记本,你可以convert it to latex很简单。
$ ipython nbconvert notebook.ipynb
您将拥有一个 .tex 文件。
安装亮点:andre-simon.de。参见问题评论中@Yihui 的post