Search code examples
quarto

How to remove extra space around sub-bullets in a Quarto list?


How do I remove the extra space added before and after sub-bullets in a quarto PDF document? [Apparently I need more text before stackoverflow will allow me to post this question. But my question is pretty straight-forward. I just want to get rid of the ugly and confusing white space that's added into the middle of my list.]

---
title: "test list"
format: pdf
---

1. First
2. Second
    + sub 1
3. Third

enter image description here


Solution

  • since you render your quarto with LaTeX to PDF, we can add a cutom header to overwrite the enumerate (1.,2.,3.,...) and itemize (bulletpoints) like this:

    ---
    title: "test list"
    format: 
      pdf:
        include-in-header:
          text: |
            \usepackage{enumitem}
            \setlist[itemize]{topsep=0pt,itemsep=0pt,partopsep=0pt,parsep=0pt}
            \setlist[enumerate]{topsep=0pt,itemsep=0pt,partopsep=0pt,parsep=0pt}
    ---
    
    1. First
    2. Second
        + sub 1
    3. Third
    

    enter image description here