r - Python syntax highlighting in LaTeX in Rstudio with knitR -
how highlight python code in rnw
files (latex files)? i'm using rstudio's "compile pdf" function run pdflatex
.
there 2 related questions (q1, q2) markdown files, questions specific rnw
files.
example:
\documentclass{article} \begin{document} <<>>= print("this r") @ <<engine='python'>>= print "this python" @ \end{document}
i used ipython notebook , can convert latex pretty easy.
$ ipython nbconvert notebook.ipynb
and you'll have .tex file.
Comments
Post a Comment