matvil
August 16, 2023, 8:50pm
1
I want my Quarto document to do different things depending on if I render to html or pdf:
For html output I want to display an iframe (containing an interactive observable widget)
For pdf output I want instead to display an image that is clickable and leads to a website.
I want to be able to render to both formats automatically from the same quarto file, so I must add this programmatically in the quarto file.
Is this possible?
Thanks!
cderv
August 22, 2023, 4:12pm
2
Are you using Knitr engine or Jupyter output ?
With knitr you can do conditional based on format using R:
This book showcases short, practical examples of lesser-known tips and tricks to helps users get the most out of these tools. After reading this book, you will understand how R Markdown documents are transformed from plain text and how you may...
With Quarto you can conditionally include content using blocks: Quarto – Conditional Content
based on that, you can insert what you expect for each format you target. I don't know how you do a clickable image in PDF though using LaTeX. You would need to find that.
1 Like
matvil
August 22, 2023, 4:40pm
3
Thanks, the conditional Quarto options is what I was looking for.
1 Like
system
Closed
August 29, 2023, 4:41pm
4
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed. If you have a query related to it or one of the replies, start a new topic and refer back with a link.