Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Custom date for Quarto YAML header pdf document

The custom date works in RMarkdown-pdf but I noticed Quarto doesn’t.

How can I use custom date in Quarto YAML?

---
title: "Some pdf document"
author: "me"
date: "Spring 2022"  <- I would like to use this
format: pdf
----
---
title: "Some pdf document"
author: "me"
date: "Last update : `r Sys.Date()`"  <- Or, like this
format: pdf
----

Current Quarto-pdf generates %m/%d/%Y format date only.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You can provide last-modified keyword (which refers to the last modified date and time of the file containing the date) to date and use date-format to modify the date.

---
title: "Some pdf document"
author: "me"
date: last-modified
date-format: "[Last Updated on] MMMM, YYYY"
format: pdf
---

screenshot of pdf output


Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading