如何给已经填满整个框架的图片添加标题?

如何给已经填满整个框架的图片添加标题?

在我的幻灯片中,我有一张需要标题的图片,但为了看起来更好,我希望它保持原始比例。因此,图像的大小定义为width=\pagewidthheight=\pageheight。如何添加显示在图像本身上的标题,例如在右上角。

带图像的帧的 MMW

\documentclass[aspectratio=169]{beamer}
\usepackage{media9}
\usepackage{graphicx}
\usepackage{graphics}
\usepackage{tikz}
\usetheme{default}
\usetikzlibrary{calc}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% absolute positioning of typeset material    
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\placetextbox}[4][center]{%
    % [#1]: box anchor: center (default) | 
    %                 south west | west | north west | north |
    %                 north east | east | south east | south | 
    %                 mid west | mid | mid east |
    %                 base west | base | base east 
    % #2: horizontal position (fraction of page width)
    % #3: vertical position (fraction of page height)
    % #4: content
    %
    \tikz[remember picture,overlay,x=\paperwidth,y=\paperheight]{%
        \node[anchor=#1,inner sep=0pt]
        at ($(current page.south west)+(#2,#3)$) {#4};
    }%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usecolortheme{wolverine}
\begin{frame}{}
\placetextbox[south]{0.5}{0}{\includegraphics[width=\paperwidth,height=\paperheight]{IMG_7917.jpg}}
\end{frame}
\end{document}

答案1

像这样吗?

\documentclass[aspectratio=169]{beamer}
\usepackage{tikz}
\usetheme{default}
\usetikzlibrary{calc}
\usecolortheme{wolverine}
\begin{document}
\begin{frame}{}
\begin{tikzpicture}[overlay,remember picture]
\node at (current page.center){\includegraphics[width=\paperwidth,height=\paperheight]{example-image-duck}};
\node[anchor=north east] at (current page.north east){Some text about ducks.};
\end{tikzpicture}
\end{frame}
\end{document}

在此处输入图片描述

相关内容