lazy.insert.code: Insert Code to a TeX or HTML document

Description Usage Arguments Details Author(s)


Places TeX code from a file into a TeX document. Text is placed within a verbatim environment. For HTML documents, a verbatim-like environment is created


lazy.insert.code(file, prompt.symbol = options()$prompt, lines)



Filename containing the code to be inserted


Character to be placed at the left most side of the page. Defaults to the system's current prompt symbol


A vector giving the lines in file to be inserted into the document


Text is inserted in a verbatim environment to preserve whitespace. This function is performed better by Sweave and knitr. Those packages will also display any result printed by the code. This function will not display results.

With HTML, the font family is set to monospace, and the font is set to courier. All of the spaces are replaced with a non-breaking space to preserve the white space in the code.


Benjamin Nutter

Search within the lazyWeave package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.