SweaveListingUtils and line numbers
I'm currently trying to use SweaveListingUtils. Because of the vignette, the first steps are quite easy.
Only the line numbers (including references) are not working as intended/expected (the relevant Sweave/R/LaTeX code is posted below):
<<exam001>>=
x <- rnorm(3) # comment (*\label{comment1}*)
print(round(x, 2))
a <- 2 # comment (*\label{comment2}*)
@
Note that line \ref{comment1} and \ref{comment2} contain comments.
The output should contain the executed code and the printing including line numbers from 1 to 3. But the numeration restarts after the print command!
Also the references are affected:
Note that line 1 and 1 contain comment.
Does anyone know how to get correct line n开发者_如何学Pythonumbering using Sweave and SweaveListingUtils? (I assume that the solution works with printing, plotting etc. from/in the R code!)
精彩评论