knitr_sethooks: sets and fixes knitr hooks

Description Usage Details Examples


fixes a well-known bug in the knit_hook 'chunk' and provides a hook entitle 'com'




There is a well_known bug in the knit_hook 'chunk' which prevents using results = 'asis' in conjunction with user-defined hooks (including com, to be discussed next). Calling this function allows user-defined hooks to be called with results = 'asis' and get the expected result. This function also provides a knitr hook called 'com', by setting 'com = TRUE' in a knitr chunk, the resulting code is converted to a latex command. For example: '<<mytable, com=TRUE>>=' results in a latex command entitled '\mytable', which will produce the exact output that would have appeared in the spot of the chunk



Search within the knitLatex 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.