答案1
eso-pic
欢迎!您可以使用和来执行此操作tikz
。此水印与文本之间的距离在 中指定([xshift=-1ex]current page text area.west)
。
\documentclass{article}
\usepackage{tikzpagenodes}
\usepackage{eso-pic}
\usepackage{lipsum}%<- only to add some text
\AddToShipoutPicture{\begin{tikzpicture}[overlay,remember picture]
\node[anchor=south,rotate=90,pink,font=\sffamily\Huge]
(AE) at ([xshift=-1ex]current page text area.west){Albert Einstein};
\draw[very thick,pink] (AE.east) -- ++ (0,4)
(AE.west) -- ++ (0,-4);
\end{tikzpicture}}
\begin{document}
\section{Blub}
\lipsum[1-10]
\end{document}
对于偶数页和奇数页上的不同“水印”,您可以使用
\documentclass{article}
\usepackage{tikzpagenodes}
\usepackage{eso-pic}
\usepackage{lipsum}%<- only to add some text
\AddToShipoutPicture{\begin{tikzpicture}[overlay,remember picture]
\ifodd\value{page}
\node[anchor=south,rotate=90,pink,font=\sffamily\Huge]
(AE) at ([xshift=-1em]current page text area.west){Albert Einstein};
\draw[very thick,pink] (AE.east) -- ++ (0,4)
(AE.west) -- ++ (0,-4);
\else
\node[anchor=south,rotate=-90,pink,font=\sffamily\Huge]
(CFG) at ([xshift=1em]current page text area.east){Carl Friedrich Gauss};
\draw[very thick,pink] (CFG.west) -- ++ (0,4)
(CFG.east) -- ++ (0,-4);
\fi
\end{tikzpicture}}
\begin{document}
\section{Blub}
\lipsum[1-20]
\end{document}