Reputation: 777
knitr will execute SQL code using engine='mysql'
but not highlight syntax:
\documentclass{article}
\begin{document}
<<engine='mysql', engine.opts="-h localhost">>=
SHOW DATABASES;
@
\end{document}
On the other hand using engine='highlight'
will highlight the code but not execute it.
\documentclass{article}
\begin{document}
<<engine='highlight', engine.opts='-S sql -O latex'>>=
SHOW DATABASES;
@
\end{document}
Is there a way to have the code executed and the syntax highlighted using one chunk?
Upvotes: 1
Views: 385