Open rikudoukarthik opened 2 weeks ago
That's because fig.cap
is needed only after a chunk has finished evaluation. Generating the figure is done after a chunk's evaluation is done. However, for the table case here, it's different: the table caption is needed (by flextable()
) in the middle of the chunk evaluation.
add a single ` to chunk open and close calls
Please read the issue guide when filing issues.
Interesting, I didn't consider that! So the eval.after
option doesn't work for flextable()
?
Also, even if the table caption is evaluated in the middle of chunk evaluation, cap_x
is already assigned in the previous chunk, so how come that doesn't appear either?
Firstly, apologies for the huge delay in responding---this is following on from #2305 which got locked after inactivity.
While @yihui showed how
eval.after = "tab.cap"
can be included in theknitr::opts_knit$set()
call, the issue is still unresolved because thetab.cap
is not functioning as expected. Please see the small reprex below (add a single ` to chunk open and close calls).