我为 Beamer 演示文稿中的所有帧添加了水印,但是遇到了这个问题: 我希望水印与调色板重叠时位于下方,这样它就不会出现。我该怎么做才能得到如图所示的结果?
这是我编写的代码:
\documentclass[aspectratio=169]{beamer}
\usetheme{CambridgeUS}
% === Change default option ===
\usepackage{xcolor}
\definecolor{green}{HTML}{00753B}
\definecolor{mybackground}{HTML}{82CAFA}
\definecolor{myforeground}{HTML}{0000A0}
\setbeamercolor{palette primary}{fg=green, bg=green}
\setbeamercolor{palette tertiary}{fg=white, bg=green}
\setbeamercolor{palette secondary}{fg=white, bg=gray!50!white}
\setbeamercolor{frametitle}{fg=black, bg=white}
\setbeamercolor{title}{fg=black, bg=white}
\setbeamertemplate{headline}
{
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.65ex,dp=1.5ex,center]{section in head/foot}%
\usebeamerfont{section in head/foot}\insertsectionhead\hspace*{2ex}
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.65ex,dp=1.5ex,center]{subsection in head/foot}%
\usebeamerfont{subsection in head/foot}\hspace*{2ex}\insertsubsectionhead
\end{beamercolorbox}}%
\vskip0pt%
}
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{title page}[default][colsep=-4bp,rounded=true]
\setbeamertemplate{enumerate items}[default]
\setbeamercolor*{enumerate item}{fg=green}
\setbeamercolor*{enumerate subitem}{fg=green}
\setbeamercolor*{enumerate subsubitem}{fg=green}
\setbeamercolor{section number projected}{bg=green,fg=white}
\setbeamercolor{subsection number projected}{bg=green,fg=white}
\setbeamertemplate{itemize item}{\color{green}$\bullet$}
\setbeamertemplate{itemize subitem}{\color{orange}$\blacktriangleright$}
% ==============================
\usepackage[utf8]{inputenc}
\usepackage[italian]{babel}
\usepackage{amsmath, physics, booktabs, tikz, graphicx}
\usepackage[printwatermark]{xwatermark}
\setbeamertemplate{caption}[numbered]
\title{\bfseries{High Performance network for HPC}}
\author[Riccardo Nigrelli]{Riccardo Nigrelli}
\newsavebox\mybox
\savebox\mybox{\tikz[color=gray,opacity=0.2]\node{\includegraphics[scale=0.1]{images/logo.pdf}};}
\newwatermark*[
allpages,
angle=30,
scale=3,
xpos=45,
ypos=30
]{\usebox\mybox}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\end{document}
答案1
无需使用外部包,您可以简单地将水印添加到background canvas
模板中:
\documentclass[aspectratio=169]{beamer}
\usetheme{CambridgeUS}
% === Change default option ===
\definecolor{green}{HTML}{00753B}
\definecolor{mybackground}{HTML}{82CAFA}
\definecolor{myforeground}{HTML}{0000A0}
\setbeamercolor{palette primary}{fg=green, bg=green}
\setbeamercolor{palette tertiary}{fg=white, bg=green}
\setbeamercolor{palette secondary}{fg=white, bg=gray!50!white}
\setbeamercolor{frametitle}{fg=black, bg=white}
\setbeamercolor{title}{fg=black, bg=white}
\setbeamertemplate{headline}
{
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.65ex,dp=1.5ex,center]{section in head/foot}%
\usebeamerfont{section in head/foot}\insertsectionhead\hspace*{2ex}
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.65ex,dp=1.5ex,center]{subsection in head/foot}%
\usebeamerfont{subsection in head/foot}\hspace*{2ex}\insertsubsectionhead
\end{beamercolorbox}
}%
\vskip0pt%
}
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{title page}[default][colsep=-4bp,rounded=true]
\setbeamertemplate{enumerate items}[default]
\setbeamercolor*{enumerate item}{fg=green}
\setbeamercolor*{enumerate subitem}{fg=green}
\setbeamercolor*{enumerate subsubitem}{fg=green}
\setbeamercolor{section number projected}{bg=green,fg=white}
\setbeamercolor{subsection number projected}{bg=green,fg=white}
\setbeamertemplate{itemize item}{\color{green}$\bullet$}
\setbeamertemplate{itemize subitem}{\color{orange}$\blacktriangleright$}
% ==============================
\usepackage[utf8]{inputenc}
\usepackage[italian]{babel}
\usepackage{amsmath, physics, booktabs, tikz, graphicx}
\setbeamertemplate{caption}[numbered]
\title{\bfseries{High Performance network for HPC}}
\author[Riccardo Nigrelli]{Riccardo Nigrelli}
\setbeamertemplate{background canvas}{\tikz[color=gray,opacity=0.2]\node{\includegraphics{example-image-duck}};
}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\end{document}