Open christophergandrud opened 8 years ago
The code by Cristopher works perfectly for me. However, I get the following warning:
Warning in install.packages : package ‘setspace’ is not available (for R version 3.2.3)
Thus, I cannot create the respective citation because R Studio does not find the package. Did anyone encounter the same problem?
Hi @philipp-stdr setspace
isn't an R package, it's a LaTeX package, so you can't use R to create a citation from it.
I know it's kind of inconsistent, but it isn't common place to cite LaTeX packages, so no need to worry about this.
Okay, thank you for your help!
Is there any way to exclude the first page from getting the double spacing?
Not an easy way that I know of. You could of course create your own LaTeX style file.
Is there any way to exclude the first page from getting the double spacing?
Is there any update to this question? Also, it would be extremely useful to to have a different spacing param for a part of a document, e.g. the reference list
@ikashnitsky it would probably be better to raise this question with rmarkdown directly. Much higher chance of getting an answer.
The solution works perfectly fine for me without any warning. I'm using RStudio 1.1.456.
@sixtyfive @ikashnitsky
Is there any way to exclude the first page from getting the double spacing?
RMarkdown accepts LaTeX commands after the header, so I suggest using additional setspace commands throughout your document to control when doublespace is turned on and off. So do your header like
---
header-includes:
- \usepackage{setspace}
---
...and then when you want to switch to double spacing, toss in a \doublespacing
This might solve your problem if you know where your first page break is. Add a quick \doublespacing at the page break and your document will come out as described. Having LaTeX switch spacing at the page break automatically would require more LaTeX magic than I'm able to conjure up at the moment.
If you would like double spacing in your R Markdown PDF document include
\usepackage{setspace}\doublespacing
in the header underheader-includes
.For example: