File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -50,13 +50,17 @@ jss_article <- function(
5050 }
5151
5252 hooks <- knitr :: hooks_sweave(c(' CodeInput' , ' CodeOutput' , ' CodeChunk' ))
53- hook_chunk <- hooks [[' chunk' ]]
54- hooks [[' chunk' ]] <- function (x , options ) {
55- x2 <- hook_chunk(x , options )
56- if (identical(x , x2 )) x else paste0(' ```{=latex}\n ' , x2 , ' \n ```' )
57- }
58-
53+ hooks [[' chunk' ]] <- latex_block(x , options , hooks [[' chunk' ]])
5954 base $ knitr $ knit_hooks <- merge_list(base $ knitr $ knit_hooks , hooks )
6055
6156 base
6257}
58+
59+ # wrap the content in a raw latex block
60+ latex_block <- function (x , options , hook ) {
61+ force(hook )
62+ function (x , options ) {
63+ x2 <- hook(x , options )
64+ if (identical(x , x2 )) x else paste0(' ```{=latex}\n ' , x2 , ' \n ```' )
65+ }
66+ }
You can’t perform that action at this time.
0 commit comments