I have researched and found how to create a watermark in an rmarkdown document.
It works great on basic text, but when you have a plot heavy page, it gets hidden behind the plot.
Obviously, this makes it easy for someone to screencap the figures and use them outside of the PDF.
Below is some code that demonstrates the issue clearly.
---
title: "Testing Watermark"
author: "John"
date: "September 18, 2015"
header-includes:
- usepackage{draftwatermark}
output:
pdf_document
---
This is some basic text.
Note the watermark on this page, and the hidden watermark on the next page.
ewpage
SetWatermarkText{DRAFT}
```{r echo=FALSE, warning=FALSE, message=FALSE, fig.height=7}
library(ggplot2)
ggplot(mtcars) +
geom_point(aes(mtcars$mpg, mtcars$cyl)) +
facet_wrap(~carb, ncol=1) +
theme_bw()
```
If anyone is aware of a fix for this, I'd be grateful.
Either making the ggplot backgrounds transparent (which I've tried), or bringing the watermark to the foreground and making it transparent would be ok as far as I'm concerned.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…