我使用了主题中的代码:图像类似水印
最小代码:
\documentclass[a4paper,twoside,8pt]{article}
\usepackage{graphicx}
\usepackage{tikz,everypage}
\usepackage{lipsum}
\newcommand*{\Placing}[3]{%
% #1 = x (from south west corner of page
% #2 = y
% #3 = content
\AddThispageHook{%
\begin{tikzpicture}[remember picture,overlay]
\draw (current page.south west) ++(#1,#2) node {#3};%
\end{tikzpicture}
}%
}
\begin{document}
\Placing{4.8cm}{22.0cm}{\includegraphics[height=3cm,angle=45]{example-image-c}}
\lipsum[4]
\centering
\includegraphics[height=5cm]{example-image-a}
\lipsum[4]
\Placing{7.8cm}{17.0cm}{\includegraphics[height=3cm,angle=45]{example-image-b}}
\end{document}
但水印(图像 B、C)位于图像 A 后面。
我怎样才能在图片 A 上添加水印 (B,C)?谢谢
答案1
那么你的水印应该位于背景中的文本后面。因此,如果它们应该位于图像 A 上方,则图像 A 也必须位于背景中(这需要两次编译):
\documentclass[a4paper,twoside,8pt]{article}
\usepackage{graphicx}
\usepackage{tikz,everypage}
\usepackage{lipsum,zref-savepos}
\newcommand*{\Placing}[3]{%
% #1 = x (from south west corner of page
% #2 = y
% #3 = content
\AddThispageHook{%
\begin{tikzpicture}[remember picture,overlay]
\draw (current page.south west) ++(#1,#2) node {#3};%
\end{tikzpicture}
}%
}
\begin{document}
\AddThispageHook{%
\begin{tikzpicture}[remember picture,overlay]
\draw (current page.south west) ++(\zposx{picture}sp,\zposy{picture}sp)
node[inner sep=0pt,anchor=south west] {\includegraphics[height=5cm]{example-image-a}};%
\end{tikzpicture}}
\Placing{4.8cm}{22.0cm}{\includegraphics[height=3cm,angle=45]{example-image-c}}
\Placing{4.8cm}{22.0cm}{\includegraphics[height=3cm,angle=45]{example-image-c}}
\lipsum[4]
\centering
\leavevmode\zsavepos{picture}\phantom{\includegraphics[height=5cm]{example-image-a}}
\lipsum[4]
\Placing{7.8cm}{17.0cm}{\includegraphics[height=3cm,angle=45]{example-image-b}}
\end{document}