10

I want to add images as headers and footers (in keeping with my organizations visual identity) to PDF reports. I've managed to do it in Sweave but I'd also like to be able to do it using just Markdown. I can insert the image using ![footer](H:/R/Footer.pdf) however when I try to use the wallpaper package (like I do in Sweave) I get an error.

---
title: "2014 Report"
author: "My Name"
date: "Monday, October 06, 2014"
output:
  pdf_document:
    number_sections: yes
    toc: yes
fontsize: 10pt
header-includes:
    - \usepackage{wallpaper}
abstract: This is my abstract
---
\LRCornerWallPaper{0.99}{![footer](H:/R/Footer.pdf)} 

Is there a way in Markdown, or do I need to stick to Sweave?

GregRousell
  • 997
  • 2
  • 13
  • 23
  • I haven't tried, but I would imagine the contents of `\LRCornerWallPaper{}` need to be in LaTeX format (includegraphics), since (presumably) pandoc wouldn't try to interpret it. – baptiste Oct 07 '14 at 15:01
  • That is the LaTeX format using the wallpaper package. I just include it right after \begin{document}. – GregRousell Oct 07 '14 at 15:06
  • Can you add a minimal pure LaTeX working example? It seems to work alright with `\LRCornerWallPaper{0.99}{path\to\pic}`, but does not with `![footer]` option. And I didn't find this usage in the documentation. – tonytonov Oct 08 '14 at 07:14
  • Ahh, ok. That works - can you add it as an answer? I was combining Markdown language with Latex language. – GregRousell Oct 08 '14 at 12:20

1 Answers1

5

The correct usage of the wallpaper package in this case would be simply

\LRCornerWallPaper{0.99}{path/to/pic}
tonytonov
  • 25,060
  • 16
  • 82
  • 98