knitr_sethooks {knitLatex} | R Documentation |
sets and fixes knitr hooks
Description
fixes a well-known bug in the knit_hook 'chunk' and provides a hook entitle 'com'
Usage
knitr_sethooks()
Details
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
Examples
knitr_sethooks()
[Package knitLatex version 0.9.0 Index]