![第 1 页上的透明背景](https://linux22.com/image/245441/%E7%AC%AC%201%20%E9%A1%B5%E4%B8%8A%E7%9A%84%E9%80%8F%E6%98%8E%E8%83%8C%E6%99%AF.png)
我尝试在某些文档中添加“水印”。为了实现这一点,我使用了eso-pic
和tikz
。问题是,单页文档无法获得透明度。只要文档有多页,一切就都正常了。
我的 MWE 证明了这一点。取消注释%\newpage
,背景是透明的(即使在第 1 页)。
我的代码有什么问题?我需要做哪些更改才能在单页文档上实现透明背景?
\documentclass{article}
\usepackage{eso-pic}
\usepackage{tikz}
\ClearShipoutPicture
\AddToShipoutPicture{
\begin{tikzpicture}[remember picture, overlay, opacity=0.08]%
\node [rotate=60,scale=10,text opacity=0.2] at (current page.center) {Example};
\end{tikzpicture}
}
\begin{document}
\null
%\newpage
\end{document}
答案1
您可以使用该background
包(基于TikZ
)。请注意,您必须编译两次才能使其正常工作。
\documentclass[parskip]{scrartcl}
\usepackage[margin=15mm]{geometry}
\usepackage{background}
\usepackage{lipsum}
\SetBgContents{water free water mark}
\SetBgScale{7}
\SetBgColor{black!40!white}
\begin{document}
\lipsum[1-7]
\end{document}