You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a normal Rmd document, the following code works:
asis_output("## hello\n")
but this does not work:
for (iin1:3) {
asis_output("## hello\n\n")
}
When I try to create a group of knit_printable objects in a for-loop, it can be very unnatural to print every object. Is it possible to make it easier to do so?
The text was updated successfully, but these errors were encountered:
Unfortunately no, it is not possible. asis_output() only works in top-level R expressions. To create as-is output from a loop, you have to either use the chunk option results = 'asis' (but this option applies to all output in this code chunk, i.e. you cannot have both as-is output and verbatim output in the same chunk), or collect the character results in a loop, and write them out using asis_output()after the loop.
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.
In a normal Rmd document, the following code works:
asis_output("## hello\n")
but this does not work:
When I try to create a group of
knit_print
able objects in a for-loop, it can be very unnatural to print every object. Is it possible to make it easier to do so?The text was updated successfully, but these errors were encountered: