最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin5浏览0评论

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

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

Share Improve this question edited Jan 17 at 18:55 Jan 9,4886 gold badges20 silver badges33 bronze badges asked Jan 17 at 15:39 filups21filups21 1,9271 gold badge23 silver badges29 bronze badges 1
  • There's a discussion of list item spacing here, but adding in this suggested css code chunk doesn't make any difference on the spacing: {css, echo = FALSE} <style> li > p:has(+ul) { margin-bottom: 0; } </style> – filups21 Commented Jan 17 at 15:42
Add a comment  | 

1 Answer 1

Reset to default 4

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

发布评论

评论列表(0)

  1. 暂无评论