yihui/knitr — Issue #109: Hooks are lost forever when a child document is called
Author: dmenne
Created: 2012-01-25 08:11:05+00:00
State: open

\documentclass{article}
\begin{document}

<>=
knit_hooks$set(inline = function(x) paste("!!!",x))
@
The value is \Sexpr{3}, and shouts \Sexpr{"Hello"}.

% The child file has only one sentence in it
% The value in the child file is \Sexpr{3}, and shouts \Sexpr{"Hello"}.
<>=
@

The value is \Sexpr{3}, and shouts \Sexpr{"Hello"}.

Note that the hook is lost both in the child file and after coming back.
\end{document}