I'm starting to explore Latex right now, working with Rstudio and using an r markdown file to produce a report in pdf format. I would like to find a way to adjust the spaces between lines of the title, author and date to single spacing. Thanks

        latex_engine: xelatex 
mainfont: Cambria
documentclass: article
  - portrait
  - a4paper
geometry: "left=2cm,right=2cm,top=2cm,bottom=2cm"
  - \usepackage{titling}
  - \pretitle{\begin{flushleft}\large\bfseries}
  - \posttitle{\end{flushleft}}  
  - \preauthor{\begin{flushleft}\large}
  - \postauthor{\end{flushleft}}  
  - \predate{\begin{flushleft}\large}
  - \postdate{\end{flushleft}}
  - \usepackage{setspace}\singlespacing
title: "This is my title"
subtitle: "Lorem ipsum"
author: "dolor sit amet"
date: "`r format(Sys.time(), '%d/%m/%Y - %X')`"
fontsize: 10pt
{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)


Lorem ipsum dolor sit amet, consectetur adipiscing elit. 

The desired output would be like this:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.