在以下MWE中调用python块:
\documentclass{article}
\begin{document}
\SweaveOpts{concordance=TRUE}
Syntax highlighting also works for other languages in the \LaTeX{} or HTML output, if Highlight has been installed (and is in PATH).
<<hi-python, engine='python'>>=
x = 'hello, python world!'
print x
print x.split(' ')
@
\end{document}
文档编译但python代码无法呈现
查看以下行:
语法高亮也适用于\ LaTeX {}或其他语言 HTML输出,如果已安装Highlight(并且在PATH中)。
我已安装了突出显示sudo apt-get install highlight
(并且还安装了r包install.packages("highlight")
以涵盖两个基础。我怀疑突出显示可能不在我的路径中。我该怎么做?
我安装了python:
$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
那么可能是什么问题?