我使用添加了水印\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}