Line spacing for markdown pdf output

I'm rendering a report completely in rmarkdown, output to PDF. It's my first time through and I've been able to figure out most of the complicated questions, but this seemingly simple one is vexing me.

The first section is Report Summary. There follow some sections, all with tables or charts. The issue is all in the Report Summary section. I want to keep single-spacing throughout the document. My yaml is:

---
title: "Report title"
output:
  pdf_document: 
    latex_engine: lualatex
    fig_width: 6.5
    fig_height: 4
    df_print: kable
header-includes:
   - \usepackage{setspace}
   - \singlespacing
fontsize: 11pt
mainfont: Calibri
sansfont: Calibri
monofont: Calibri
indent: true
self_contained: no
always_allow_html: yes
---

In Report Summary most things end up as single spacing except this example, where the text for an ordered list renders with a line-break between the two lines of the following text:

  • This is a first pass at the data. Follow-up questions include (but are not limited to):
    • Does geography play a role attrition?

Paradoxically where I want lots of blank lines, I don't get them. This text example ends up with no white space even though I added multiple carriage returns and there's plenty of space in the document:

  • Did the increase in UC enrollments at the freshman and transfer levels change enrollment decisions for AAOs especially?
    <imagine 8 carriage returns>
    Notes
    _Note 1
    _Note 2

Is the ordered list an issue? How can I tell the latex render to not add extra line?
And what would be keeping the rendering from adding the returns as line breaks?

Turns out I ended up having to teach myself much more LaTex than I expected, but that'll serve me well going forward.

In the YAML header adding:

  • \usepackage{paralist}
  • \let\itemize\compactitem

...compacted all the list spacing. If I wanted an extra line after an item I added \newline at the end of the sentence.

Adding \vfill and \footnotesize moved the notes text to the bottom of the doc and reduced the text size.

2 Likes

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.