Watermark in rmarkdown

后端 未结 1 1919
后悔当初
后悔当初 2020-12-14 11:08

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 beh

相关标签:
1条回答
  • 2020-12-14 12:11

    Try using

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

    and then on the first page of your document (within the LaTeX part), add

    \AddToShipoutPictureFG{
      \AtPageCenter{% or \AtTextCenter
        \makebox[0pt]{\rotatebox[origin=c]{45}{%
          \scalebox{5}{\texttransparent{0.3}{DRAFT}}%
        }}
      }
    }
    

    This should add a rotated DRAFT message (semi-transparent) in the ForeGround (over top) of the page.

    0 讨论(0)
提交回复
热议问题