objpath <- file.path(getwd(),"slickr_files/figure-html")
if(!dir.exists(objpath))
dir.create(objpath,recursive = TRUE)
tex_opts$set(
fileDir = objpath, # path to save output
returnType = 'html', # return images ready for html
imgFormat = 'png' # return png images
)
The first two chunks create outputs to place in the carousel in the last chunk.
tab='
\\begin{tabular}{llr}
\\hline
\\multicolumn{2}{c}{Item} \\\\
\\cline{1-2}
Animal & Description & Price (\\$) \\\\
\\hline
Gnat & per gram & 13.65 \\\\
& each & 0.01 \\\\
Gnu & stuffed & 92.50 \\\\
Emu & stuffed & 33.33 \\\\
Armadillo & frozen & 8.99 \\\\
\\hline
\\end{tabular}'
tab%>%
texPreview::tex_preview(stem = 'tex-1')
The images created above are placed in a slickR carousel.