我做了一个 Beamer 演示文稿。在其中一个框架中,我放了几张图片。但是左边距占用了很多空间,而右边距几乎为零。\centering
在图中放置图片也没有帮助,因为图片位置的倾斜与边距有关。
如何在本地更改边距?我可以使用类似于几何包的东西吗?如何在框架内定义它?
\documentclass[xcolor=dvipsnames, table]{beamer}
\usetheme{Frankfurt}
\usepackage{framed}
\usepackage{graphicx,bm, multirow, subfig, tabularx}
\usepackage[]{textpos}
\usepackage{tikz}
\usetikzlibrary{calc,shapes.callouts,shapes.arrows, chains,shapes.multipart}
\usepackage{xcolor}
\usepackage[T1]{fontenc}
\begin{document}
\begin{frame}[plain]{Caption 1}
\begin{figure}
\centering
\begin{tabularx}{\linewidth}{@{}cXX@{}}
\begin{tabular}{cc}
\subfloat[title 1]{\includegraphics[height=5cm, width=5.5cm]{pic1.jpg}}
& \subfloat[title 2]{\includegraphics[height=5cm, width=5.5cm]{pic2.jpeg}}\\
\end{tabular}
\end{tabularx}
\end{figure}
\end{frame}
\end{document}
答案1
使用\useoutertheme{infolines}
,这会减少左边距,然后\tabularx{}
根据指示删除代码。保持内部tabular
对齐{rr}
。
\documentclass[xcolor=dvipsnames, table]{beamer}
\usetheme{Frankfurt}
\useoutertheme{infolines}
\usepackage{framed}
\usepackage{graphicx}
\usepackage{bm, multirow, subfig,tabularx}
\usepackage[]{textpos}
\usepackage{tikz}
\usetikzlibrary{calc,shapes.callouts,shapes.arrows, chains,shapes.multipart}
\usepackage{xcolor}
\usepackage[T1]{fontenc}
\begin{document}
\begin{frame}[plain]{Caption 1}
\begin{figure}
\centering
%\begin{tabularx}{\linewidth}{@{}rXX@{}}
\begin{tabular}{rr}
\subfloat[title1]{\includegraphics[height=5cm, width=5.5cm]{figs/dummy_fig}}
\subfloat[title2]{ \includegraphics[height=5cm, width=5.5cm]{figs/dummy_fig}} \tabularnewline
\end{tabular}
%\end{tabularx}
\end{figure}
\end{frame}
\end{document}
编辑:替代版本
如果\useoutertheme{infolines}
没有选择,则强力方法将会有所帮助,具体取决于图像的大小,但是:
\documentclass[xcolor=dvipsnames, table]{beamer}
\usetheme{Frankfurt}
\usepackage{framed}
\usepackage{graphicx}
\usepackage{bm, multirow, subfig,tabularx}
\usepackage[]{textpos}
\usepackage{tikz}
\usetikzlibrary{calc,shapes.callouts,shapes.arrows, chains,shapes.multipart}
\usepackage{xcolor}
\usepackage[T1]{fontenc}
\begin{document}
\begin{frame}[plain]{Caption 1}
\begin{figure}
\centering
%\begin{tabularx}{\linewidth}{@{}rXX@{}}
\begin{tabular}{rr}
\hspace{-0.5cm}%
\subfloat[title1]{\includegraphics[height=5cm, width=5.5cm]{figs/dummy_fig}}
\subfloat[title2]{ \includegraphics[height=5cm, width=5.5cm]{figs/dummy_fig}} \tabularnewline
\end{tabular}
%\end{tabularx}
\end{figure}
\end{frame}
\end{document}
据我所知,一开始选择的beamer
主题以后就无法更改,除了颜色/字体设置。但是,这并不影响 outerthemeinfolines
等的布局问题。
答案2
不需要表格,只需将两个子浮动彼此相邻放置即可
\documentclass[xcolor=dvipsnames, table]{beamer}
\usetheme{Frankfurt}
\usepackage{framed}
\usepackage{bm, multirow, subfig, tabularx}
\usepackage[]{textpos}
\usepackage{tikz}
\usetikzlibrary{calc,shapes.callouts,shapes.arrows, chains,shapes.multipart}
%\usepackage{xcolor}
\usepackage[T1]{fontenc}
\begin{document}
\begin{frame}[plain]{Caption 1}
\begin{figure}
\subfloat[title 1]{\includegraphics[width=.45\textwidth]{example-image.jpg}}
\hfill
\subfloat[title 2]{\includegraphics[width=.45\textwidth]{example-image}}
\end{figure}
\end{frame}
\end{document}