How to add a watermark image on rmarkdown?

不想你离开。 提交于 2019-12-10 11:08:57

问题


I'm searching and trying to add a image as watermark to rmarkdown pdf, I'm using the render function to generate the PDFs, and saw the \usepackage{draftwatermark} and this question:

Watermark in rmarkdown

But they don't help me in adding a image as watermark.

--EDIT--

I achieved what I wanted putting this to the header of .Rmd:

header-includes: - \usepackage{eso-pic,graphicx,transparent}

And placing this in the start of file (before the rest of .Rmd):

\AddToShipoutPictureFG{
\put(0,0){%
\parbox[b][\paperheight]{\paperwidth}{%
\centering  
  {\transparent{0.3} \includegraphics[width=\paperwidth,height=\paperheight,%
keepaspectratio]{background.png}}%
    }
  }
}

But the problem is that I can't choose the image that I want. It keeps getting a sample image from C:\Program Files (x86)\MiKTeX 2.9\tex\plain\present.

How I choose the folder before starting processing the file?

来源:https://stackoverflow.com/questions/39746947/how-to-add-a-watermark-image-on-rmarkdown

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!