我已经使用添加了水印\backgroundsetup
\backgroundsetup{
angle=45,
scale=1,contents={\includegraphics[allpages,
]{water_mark.png}}}
\usepackage[most]{tcolorbox}\tcbset{colback=blue!8!white,colframe=blue!25!white, boxrule=0pt, left=10pt,right=10pt,top=10pt,bottom=10pt, arc=0pt,outer arc=0pt}
\begin{tcolorbox}\begin{verbatim} texts in box\end{verbatim} \end{tcolorbox}
这是我所取得的成就:
我很高兴看到每页都有水印,但问题是有些页面有图片和自定义框,在这些页面中,水印位于图片和框下方。我希望水印位于图片或框上方。
答案1
除了使用background
包之外,您还可以使用xwatermark
。
其带星号(*)的\newwatermark
命令变体将水印放在前景而不是背景中。
\documentclass{article}
\usepackage[printwatermark]{xwatermark}
\usepackage[most]{tcolorbox}
\tcbset{colback=blue!8!white,colframe=blue!25!white, boxrule=0pt, left=10pt,right=10pt,top=10pt,bottom=10pt, arc=0pt,outer arc=0pt}
\usepackage{mwe}% for test purpose only, you don't need to use this in your document
\begin{document}
\newwatermark*[angle=45,scale=1,xpos=0,ypos=40, allpages]{\includegraphics[height=2cm,width=10cm]{example-image}}% put your image here with the correct height and width
\section{An example of section}
\blindtext
\begin{tcolorbox}
\begin{verbatim}
texts in box
\end{verbatim}
\end{tcolorbox}
\blindtext
\newpage
\blindtext
\end{document}