1

I am trying to add a watermark image to the background of my Table of Contents page only. I have tried a combination of the following questions:

How to Obtain A Watermark Image

Add an Image In The Title Page

Below is the contents of my example.Rmd file. I use the Knit button in RStudio to turn it into a .pdf.

---
title: <center> <h1>Example Report</h1> </center>
header-includes:
- \usepackage{booktabs} 
- \usepackage{sectsty} \sectionfont{\centering}
- \renewcommand{\contentsname}{}\vspace{-2cm} 
mainfont: Arial
output:
  pdf_document:
    latex_engine: xelatex
sansfont: Arial
fig_crop: false
toc: true
classoption: landscape
fontsize: {10}
geometry: margin=0.20in

---

I have tried, using the code below, adding the image as a post title but there is a big space left after the title and before the TOC:

    ---
    title: <center> <h1>Example Report</h1> </center>
    header-includes:
    - \usepackage{titling}
    - \pretitle{\begin{center}}
    - \posttitle{\end{center}\LARGE\includegraphics[width=12cm]{my_graphic.png}\\[\bigskipamount]}
    - \usepackage{booktabs} 
    - \usepackage{sectsty} \sectionfont{\centering}
    - \renewcommand{\contentsname}{}\vspace{-2cm} 
    mainfont: Arial
    output:
      pdf_document:
        latex_engine: xelatex
    sansfont: Arial
    fig_crop: false
    toc: true
    classoption: landscape
    fontsize: {10}
    geometry: margin=0.20in

    ---

How do I please center, create a watermark and place the image behind the TOC rather than in-front?

Any help would be greatly appreciated.

user2716568
  • 1,866
  • 3
  • 23
  • 38

0 Answers0