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} 

enter image description here

i used ipython notebook , can convert latex pretty easy.

$ ipython nbconvert notebook.ipynb  

and you'll have .tex file.


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

jquery - ReferenceError: CKEDITOR is not defined -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -