Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pander.headar inside loop with results = 'markup' chunk #348

Open
iago-pssjd opened this issue Mar 11, 2021 · 1 comment
Open

pander.headar inside loop with results = 'markup' chunk #348

iago-pssjd opened this issue Mar 11, 2021 · 1 comment

Comments

@iago-pssjd
Copy link

pandoc.header does not work inside a loop on an rmarkdown chunk with results='markup', while it works with results='asis'.

I ask the same question as here (https://stackoverflow.com/questions/66580211/how-to-change-chunk-options-results-formatting-inside-a-loop-in-a-chunk), because of the claim:

Also, pander is integrated with knitr by default. pander simply identifies if knitr is running in the background, and if so, it uses capture.output to return the resulting string as an knit_asis object, meaning that you do not need to specify the results='asis' option in your knitr chunk:

I copy the reprex

---
title: "Reprex"
date: "11/03/2021"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(pander)```
# R Markdown

```{r cars}

for(i in 1:10){
  pandoc.header(paste("Section", i), level = 2)
}```

Thank you!

@iago-pssjd
Copy link
Author

In fact, now I found this (yihui/knitr#1137) which seems to be related.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant