M.Qasim
M.Qasim

Reputation: 1878

Left-align YAML title for Rmarkdown PDF

R gurus,

I wonder if it is possible at all to left align PDF output title in YAML in Rmarkdown documents.

And also is it possible to add a logo above title (in header)?

---
output: 
  pdf_document:
    fig_caption: false

#title: "Multi pricing report"
latex_engine: xelatex
fontfamily: mathpazo
fontsize: 11pt
# spacing: double
endnote: no
---

You time and effort to answer is much appreciated.

Upvotes: 5

Views: 4995

Answers (1)

Martin Schmelzer
Martin Schmelzer

Reputation: 23919

You can use the titling package and add \begin{flushleft} before the title and \end{flushleft} afterwards:

---
output: 
  pdf_document:
    fig_caption: false
    keep_tex: yes
title: "Multi pricing report"
fontfamily: mathpazo
fontsize: 11pt
header-includes:
  - \usepackage{titling}
  - \pretitle{\begin{flushleft}}
  - \posttitle{\end{flushleft}}
---

Upvotes: 9

Related Questions