Quarto生成PDF时标题页后首页底部边距过大问题
Quarto标题页后正文首页底部边距异常问题
问题描述
我在RStudio中使用Quarto生成PDF文档,通过quarto_titlepages扩展制作标题页。标题页之后的正文首页出现了异常大的底部边距(顶部边距正常),推测是标题页的配置残留导致的。
我尝试在pdf格式配置中设置margin-left、margin-right、margin-bottom、margin-top参数,也试过用geometry参数调整,但都没有效果。
初始配置代码
--- title: "Here we have a title, not too long" author: "First Author and Second Author" date: last-modified date-format: "d-MMMM-YYYY" lang: "es" format: titlepage-pdf: documentclass: scrreport titlepage: plain titlepage-geometry: - top=90mm - bottom=60mm - right=30mm - left=30mm titlepage-logo: "images/anyimages.png" titlepage-bg-image: "images/anyimage2.png" titlepage-theme: elements: ["\\titleblock", "\\logoblock", "\\authorblock", "(some additional information)"] page-fontfamily: "Helvetica Neue" page-align: center title-fontsize: 30 title-align: center title-fontstyle: [] title-space-after: 3cm author-fontsize: 16 author-style: plain logo-align: center logo-size: 4cm logo-space-after: 4cm bg-image-location: "ULCorner" bg-image-size: 21cm pdf: # Fonts mainfont: Helvetica Neue fontsize: 12pt papersize: A4 margin-top: 25mm margin-bottom: 25mm margin-left: 25mm margin-right: 25mm toc: true toc-depth: 2 toc-title: Táboa de contidos editor: visual ---
初始效果
标题页后的正文首页底部空白明显过大,边距异常。
更新尝试
按照建议添加\\restoregeometry后,边距问题有所缓解,但pdf配置下的其他格式设置失效。于是我删除了独立的pdf层级,将所有PDF相关配置移到titlepage-pdf下,然而首页底部边距过大的问题再次出现,即使保留了\\restoregeometry命令。
更新后的配置代码
--- title: "Here we have a title" author: "Author 1 with surname & Author 2 with surname" date: last-modified date-format: "d-MMMM-YYYY" lang: "es" format: titlepage-pdf: documentclass: scrreport titlepage: plain titlepage-geometry: - top=90mm - bottom=60mm - right=30mm - left=30mm titlepage-logo: "images/circularNegro.png" titlepage-bg-image: "images/OsTres.png" titlepage-theme: elements: ["\\titleblock", "\\logoblock", "\\authorblock", "(some additional text)"] page-fontfamily: "Helvetica Neue" page-align: center title-fontsize: 30 title-align: center title-fontstyle: [] title-space-after: 3cm author-fontsize: 16 author-style: plain logo-align: center logo-size: 4cm logo-space-after: 4cm bg-image-location: "ULCorner" bg-image-size: 21cm # Fonts mainfont: Helvetica Neue fontsize: 12pt papersize: A4 margin-top: 25mm margin-bottom: 25mm margin-left: 25mm margin-right: 25mm toc: true toc-depth: 2 toc-title: Táboa de contidos editor: visual --- \\restoregeometry
更新后的效果
正文首页底部边距仍然过大,问题没有得到解决。
内容的提问来源于stack exchange,提问作者Asier
相关产品推荐
相关产品推荐

