我一直试图在文档背景的右下角放置一个图像(标题页除外),并且我成功地使用以下代码放置了一个居中的水印:
\documentclass[titlepage,a4paper,twocolumn]{article}
\usepackage{geometry}
\usepackage{graphicx}
\usepackage{tikz}
\usepackage{background}
\backgroundsetup{
scale=0.5,
firstpage=false,
angle=0,
opacity=0.15,
contents= {\begin{tikzpicture}[remember picture, overlay]
\node at (currentpage.southeast){\includegraphics{img/image.png}};
\end{tikzpicture}}
}
\begin{document}
Some stuff for the title page. % where the image also shows up
\section{intro} % now the twocolumn starts
With a lot of text.
And then the rest of the five-page doc.
我忽略了什么?
答案1
以下代码基于eso-pic
并在右下角添加水印。一切都由 管理tikz
,eso-pic
只在每一页上添加水印。如果您想从某一页开始停止水印,您也可以使用\ClearShipoutPictureBG
\documentclass[12pt]{report}
\usepackage{tikz}
\usepackage{graphicx}
\usepackage{eso-pic}
\usepackage{kantlipsum}
%% Define watermarks
\newsavebox\WM
\savebox\WM{%
\begin{tikzpicture}[overlay] % remember picture
\node (WD) [anchor=south east, xshift=-5mm, yshift=5mm, opacity=0.25]
at (current page.south east)
{\includegraphics[width=0.3\paperwidth]{example-image}};
\end{tikzpicture}}
%% Title
\title{The Title}
\author{Firstname Surname}
\date{}
\begin{document}
\maketitle
\AddToShipoutPictureBG{\usebox\WM} % Start watermarks from here onward
\kant
\end{document}
答案2
与 Celdor 解决方案类似,但不使用TikZ
\documentclass[12pt]{report}
\usepackage{graphicx}
\usepackage{eso-pic}
\usepackage{kantlipsum}
%% Title
\title{The Title}
\author{Firstname Surname}
\date{}
\AddToShipoutPictureBG{%
\AtPageLowerLeft{%
\put(\LenToUnit{\paperwidth-25mm}),\LenToUnit{5mm}){\includegraphics[width=2cm]{example-image-a}}%
}}%
\begin{document}
\maketitle
\kant
\end{document}