我是 Beamer 的新手,正在尝试创建一个包含四个图形的幻灯片,并且我想用红色框强调两个图形。
这种设置使得四个数字很好地基于这里接受的答案:
\usepackage{caption}
\captionsetup{labelformat=empty,labelsep=none}
\begin{frame}
\frametitle{Slide Title}
\begin{columns}[t]
\column{.5\textwidth}
\includegraphics[width=\columnwidth,height=3cm]{path/to/my.jpg}
\captionof{figure}{Comment 1}
\includegraphics[width=\columnwidth,height=3cm]{path/to/my.jpg}
\captionof{figure}{Comment 2}
\column{.5\textwidth}
\includegraphics[width=\columnwidth,height=3cm]{path/to/my.jpg}
\captionof{figure}{Comment 3}
\includegraphics[width=\columnwidth,height=3cm]{path/to/my.jpg}
\captionof{figure}{Comment 4}
\end{columns}
\end{frame}
当我尝试添加红色框时(按照这个问题/答案,图形会移到页面外。我怎样才能让它们保持在与上图相同的位置,并且只使用粗红色轮廓来强调前两个(左边两个)图形?
\usepackage{caption}
\captionsetup{labelformat=empty,labelsep=none}
\usepackage{fancybox}
\begin{columns}[t]
\fboxsep=1pt
\fboxrule=2pt
\def\bordercolor{red}
\def\backgroundcolor{white}
\cornersize{0.1}
\column{.5\textwidth}
\fcolorbox{\bordercolor}{\backgroundcolor} {\includegraphics[width=\columnwidth,height=3cm]{path/to/my.jpg}
\captionof{figure}{Comment 1}
\includegraphics[width=\columnwidth,height=3cm]{path/to/my.jpg}
\captionof{figure}{Comment 2}
\column{.5\textwidth}
\includegraphics[width=\columnwidth,height=3cm]{path/to/my.jpg}
\captionof{figure}{Comment 3}
\includegraphics[width=\columnwidth,height=3cm]{path/to/my.jpg}
\captionof{figure}{Comment 4}
\end{columns}
\end{frame}
答案1
使用tabular
带有c
输入列而不是columns
环境来设置所有内容:
\documentclass{beamer}
\usepackage{fancybox}
\begin{document}
\begin{frame}
\setlength{\fboxsep}{1pt}%
\setlength{\fboxrule}{2pt}%
\newcommand\bordercolor{red}%
\newcommand\backgroundcolor{white}
\begin{tabular}{ c c }
\fcolorbox{\bordercolor}{\backgroundcolor}{%
\includegraphics[width=.45\linewidth,height=3cm]{example-image-a}%
} &
\includegraphics[width=.45\linewidth,height=3cm]{example-image-b} \\
Comment 1 &
Comment 2 \\
\fcolorbox{\bordercolor}{\backgroundcolor}{%
\includegraphics[width=.45\linewidth,height=3cm]{example-image-c}%
} &
\includegraphics[width=.45\linewidth,height=3cm]{example-image-a} \\
Comment 3 &
Comment 4
\end{tabular}
\end{frame}
\end{document}