I cannot find information on whether it is possible to specify options for inline chunks in knitr. I\'ve just tried specifying them, as in the regular chunk, but this gives
Thanks to Yihui you can do,
\documentclass{article}
<>=
knit_hooks$set(inline = function(x) {
if (is.numeric(x)) return(knitr:::format_sci(x, 'latex'))
highr::hi_latex(x)
})
@
\begin{document}
the value of $\pi$ is \Sexpr{pi}, and the function to read a table is
\Sexpr{'read.table()'}.
<>=
rnorm(10)
@
\end{document}