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

Change colon to period in figure caption in Quarto

When referencing a figure in a Quarto document and knitting to HTML, a colon is placed by default between the word Figure and the figure caption. I would like that colon to be a period.

I’ve tried a style.css file with the following but it doesn’t work:

.figcaption::before {
content: "Figure " counter(fig): ". ";
}

Here is my quarto document:

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

---
title: "Periods are better than colons"
author: "Eric"
format:
  html:
    css: style.css
---

I'd like to replace the colon with a period in the caption for @fig-MyRLogo.

![RLogo](Rlogo.jpg){fig-align="left" #fig-MyRLogo}

And the output I get is:

Quarto output

>Solution :

This is controlled via the cross reference options with the title-delim parameter. Your YAML header should look like:

---
title: "Periods are better than colons"
author: "Eric"
format:
  html
crossref:
  title-delim: "."  
---
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