I would like time to cut the pieces and write down how long it took to make them using the comments in the LaTeX output.
I tried the following hook:
now = Sys.time() knit_hooks$set(timeit = function(before) { if (before) { now <<- Sys.time() } else { paste("%", sprintf("Chunk rendering time: %s seconds.\n", round(Sys.time() - now, digits = 3))) } })
And it gives the correct comment with synchronization, but the problem is that it is completed in kframe, which leads to ugly gaps in LaTeX output:
\begin{kframe} % Chunk rendering time: 12.786 seconds. \end{kframe}
Is there a way to create detailed comments?
source share