在 beamer 中的特定位置添加文本

在 beamer 中的特定位置添加文本

我有这张幻灯片,但不想改变构图。我想在特定位置(红色矩形)添加图片的作者,即MC埃舍尔,《相对论》(1953)

\frame{\frametitle{Introduzione}
    \justifying
    \scriptsize 

\vspace{-0.25cm}
Aggarwal, C. C., Hinneburg, A., Keim, D. A. 2001. \emph{On the surprising behavior of distance metrics in high dimensional space}. In International conference on database theory, pp. 420-434. Springer, Berlin, Heidelberg. (\emph{1859 citazioni su Google Scholar nel maggio 2021})
\vspace{-0.25cm}
% \vspace{-0.35cm}
\begin{figure}
    \centering
    \includegraphics[scale =0.155]{Escher.jpg}
\end{figure}
\vspace{-0.35cm}
 

在此处输入图片描述

答案1

\rlap在全宽图形的 后使用\includegraphics可确保图像保持居中。按照目前的配置,图像和注释的基线是相同的。

\documentclass[11pt]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
    
\usetheme{Pittsburgh}   
\usepackage{graphicx}
\usepackage[usestackEOL]{stackengine}
\usepackage{caption} % better control of captions
\captionsetup[figure]{textfont={scriptsize,it}}

\begin{document}

\begin{frame}
    \frametitle{Introduzione}
    {\scriptsize    Aggarwal, C. C., Hinneburg, A., Keim, D. A. 2001. \emph{On the surprising behavior of distance metrics in high dimensional space}. In International conference on database theory, pp. 420-434. Springer, Berlin, Heidelberg. (\emph{1859 citazioni su Google Scholar nel maggio 2021}) }   
    
    \begin{figure}
            \centering
        \includegraphics[width=0.6\textwidth,  height=0.5\textwidth]{example-image}
\rlap{\quad\scriptsize\Longstack[l]{M.C. Escher\\Relativity (1953)}}
    \end{figure}
\end{frame}

\end{document}

在此处输入图片描述

答案2

这也许是最简单的方法之一。 乙

\documentclass[11pt]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
    
\usetheme{Pittsburgh}   
\usepackage{graphicx}

\usepackage{caption} % better control of captions
\captionsetup[figure]{textfont={scriptsize,it}}

\begin{document}

\begin{frame}
    \frametitle{Introduzione}
    {\scriptsize    Aggarwal, C. C., Hinneburg, A., Keim, D. A. 2001. \emph{On the surprising behavior of distance metrics in high dimensional space}. In International conference on database theory, pp. 420-434. Springer, Berlin, Heidelberg. (\emph{1859 citazioni su Google Scholar nel maggio 2021}) }   
    
    \begin{figure}
        \begin{minipage}[b]{0.80\textwidth}
            \centering
        \includegraphics[width=0.7\textwidth,  height=0.6\textwidth]{example-image}
        \end{minipage}\hfill
        \begin{minipage}[b]{0.2\textwidth}      
            \caption*{M.C. Escher, Relativity (1953)} \label{fig:01}
        \end{minipage}
    \end{figure}
\end{frame}

\end{document}

也可以看看https://tex.stackexchange.com/a/29163/161015

答案3

如果您想在幻灯片中的任意位置添加对象,您可以使用带有覆盖选项的 tikz:

\documentclass[11pt]{beamer}
\usepackage{graphicx}
\usepackage{ragged2e}
\usepackage{tikz}

\begin{document}
\begin{frame}{Introduzione}
  \justifying
  \scriptsize 
  \vspace{-0.25cm}
  Aggarwal, C. C., Hinneburg, A., Keim, D. A. 2001. \emph{On the surprising 
  behavior of distance metrics in high dimensional space}. In International 
  conference on database theory, pp. 420-434. Springer, Berlin, Heidelberg. 
  (\emph{1859 citazioni su Google Scholar nel maggio 2021})
  \vspace{-0.25cm}
  \begin{figure}
    \centering
    \includegraphics[width=0.7\textwidth,  height=0.6\textwidth]{example-image.png}
  \end{figure}
  \vspace{-0.35cm}
  %
  \tikz[overlay, remember picture,
    shift=(current page.south west),
    x=(current page.south east), y=(current page.north west),
  ]{
    \node[align=left]at (0.9,0.1) {M.C. Escher,\\Relativity (1953)}; 
    % Optional help grid lines
    %\draw[step=.1, opacity=0.3, thick, red] (0,0) grid (1,1);
  }
\end{frame}
\end{document} 

在此处输入图片描述

该坐标(0.9,0.1)相对于幻灯片左下角是绝对的,并且是标准化的(坐标(1,1)是右上角)

您可以取消注释下面的代码Optional help grid lines,以便绘制网格线来猜测坐标:

在此处输入图片描述

当然,你可以为此定义新的命令:

\newcommand{\posabs}[2][]{
  \tikz[overlay, remember picture,
    shift=(current page.south west),
    x=(current page.south east), y=(current page.north west),
    #1
  ]{#2}
}
\newcommand{\postextabs}[4][align=left]{
  \posabs{\node[#1] at (#2,#3) {#4};}
}

在任意位置添加 tikz 代码:

\posabs[red]{\node[circle, fill=red] at (0.5,0.5) {};}

在任意位置添加一个文本节点:

\postextabs[red]{0.5}{0.5}{\huge !!}

相关内容