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

Make asis_output works for Quarto the same as results: asis #2332

Open
cderv opened this issue Mar 25, 2024 · 0 comments
Open

Make asis_output works for Quarto the same as results: asis #2332

cderv opened this issue Mar 25, 2024 · 0 comments
Assignees
Labels
quarto Related to quarto specific usage

Comments

@cderv
Copy link
Collaborator

cderv commented Mar 25, 2024

Related to

Example

---
title: "Test"
format: 
  typst:
    keep-typ: true
    keep-md: true
---

```{r}
#| results: asis
knitr::asis_output("`#set page(flipped: true)`{=typst}")
```

Using asis_output() will not apply raw output here, because options$results = 'asis' us onlyfor LaTeX output

knitr/R/output.R

Lines 514 to 518 in 031e08c

x = wrap_asis(x, options)
if (!out_format('latex') || inline) return(x)
# latex output need the \end{kframe} trick
options$results = 'asis'
knit_hooks$get('output')(x, options)

I think we need it for Quarto as the wrapping used will check for this value
https://github.com/quarto-dev/quarto-cli/blob/f43107222f70ca3579a520d496597b75b5bd0097/src/resources/rmd/patch.R#L116-L117

@cderv cderv added the quarto Related to quarto specific usage label Mar 25, 2024
@cderv cderv self-assigned this Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
quarto Related to quarto specific usage
Projects
None yet
Development

No branches or pull requests

2 participants