0

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

---
output:
    pdf_document:
        latex_engine: xelatex 
mainfont: Cambria
documentclass: article
classoption: 
  - portrait
  - a4paper
geometry: "left=2cm,right=2cm,top=2cm,bottom=2cm"
header-includes:
  - \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)

\vspace{-1cm}
\rule{\linewidth}{0.4pt}

\nointerlineskip
Lorem ipsum dolor sit amet, consectetur adipiscing elit. 
\nointerlineskip
\rule{\linewidth}{0.4pt}

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.