简体   繁体   中英

Set CMU Sans Serif font on pdf quarto

I've been using Quarto for a few days to produce pdf documents. When specifying the main font used, I can perfectly well choose "Cambria" or "Calibri", but I cannot choose fonts like "Computer Modern Sans Serif".

    format:
     pdf:
     toc: true
     toc-title: "Text mining"
     number-sections: true
     colorlinks: true
     pdf-engine: lualatex
     mainfont: "Computer Modern"
     fontsize: 12pt

What changes should I make to the code to produce pdfs in the font of my choice? The solution proposed here won't work.

You could use fontfamily in your yaml header with pdflatex engine and check The LaTeX Font Catalogue , which shows that Computer Modern Sans Serif is available. Here some reproducible code:

---
format:
  pdf:
    toc: true
    toc-title: "Text mining et Première Guerre mondiale"
    number-sections: true
    colorlinks: true
    pdf-engine: pdflatex
    fontfamily: "Computer Modern Sans Serif"
    fontsize: 12pt
---

This is some example text. 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM