基本上,问题是这样的:
当我使用\begin{tabular}
四列时,单元格对齐不充分,而且我必须将段落的各个部分写在单独的行中,据我所知,这并不是最好的方法。我尝试过列,但这似乎也是一种复杂的方法。这里有一张包含两种方法的图像:
表格:
列(为了简单起见,我仅使用了与上面相同的文本):
以及 MWE:
\documentclass[compress,final]{beamer}
\usetheme{Antibes}
\setbeamertemplate{footline}[frame number]
\setbeamercovered{transparent=25}
\setbeamertemplate{navigation symbols}{}
\usecolortheme{dolphin}
\usepackage{ragged2e} % for justifying
\begin{document}
\section{ITEM}
\subsection{item}
\begin{frame}
\includegraphics[trim = 0mm 0mm 0mm 0mm, clip, width=1.0\textwidth]{1fig.png}
\vspace{.25cm}
\scriptsize
\begin{tabular}{|p{2.75cm}|p{2.35cm}|p{2.35cm}|p{2.35cm}|}
\hline
text starts here but it has & text starts here but it has & text starts here but it has & text starts here but it has \\
\hline
to continue in the next line & to continue in the next line & to continue in the next line & to continue in the next line \\
\hline
because this is a table with & because this is a table with & because this is a table with & because this is a table with \\
\hline
rows, and writing things like & rows, and writing things like & rows, and writing things like & rows, and writing things like \\
\hline
this is pretty crazy!! & this is pretty crazy!! & this is pretty crazy!! & this is pretty crazy!! \\
\hline
\end{tabular}
\end{frame}
\begin{frame}
\includegraphics[trim = 0mm 0mm 0mm 0mm, clip, width=1.0\textwidth]{1fig.png}
\vspace{.25cm}
\scriptsize
\begin{columns}[onlytextwidth]
\begin{column}{.2\textwidth}
\justifying
text starts here but it has to continue in the next line because this is a table with rows, and writing things like this is pretty crazy!!
\end{column}
\begin{column}{.175\textwidth}
\justifying
text starts here but it has to continue in the next line because this is a table with rows, and writing things like this is pretty crazy!!
\end{column}
\begin{column}{.15\textwidth}
\justifying
text starts here but it has to continue in the next line because this is a table with rows, and writing things like this is pretty crazy!!
\end{column}
\begin{column}{.2\textwidth}
\justifying
text starts here but it has to continue in the next line because this is a table with rows, and writing things like this is pretty crazy!!
\end{column}
\end{columns}
\end{frame}
\end{document}
我还在此附上1fig.png
以供测试。
所以,我认为列应该能产生更好的结果,但不确定如何。有没有一种简单的方法可以实现这一点,比如为整个图的每个部分创建单独的段落(只有 1 个图)?
在此先感谢大家对此提出的任何建议,
答案1
这是一种可能性。我坚持使用您的columns
方法。我可以使用多个columns
环境,每个需要的行一个环境(这里,我显示了 2 个这样的行)。在单个“ columns
”内,我使每个环境column
的宽度相同,并通过\hspace
s 和空白在它们之间添加间隙column
。
\documentclass[compress,final]{beamer}
\usetheme{Antibes}
\setbeamertemplate{footline}[frame number]
\setbeamercovered{transparent=25}
\setbeamertemplate{navigation symbols}{}
\usecolortheme{dolphin}
\usepackage{ragged2e} % for justifying
\newcommand\mygap[1][.01]{\hspace{#1\textwidth}}
\begin{document}
\section{ITEM}
\subsection{item}
\begin{frame}
\includegraphics[trim = 0mm 0mm 0mm 0mm, clip, width=1.0\textwidth]{1fig}
\vspace{.25cm}
\scriptsize
\begin{columns}[onlytextwidth]\mygap%
\begin{column}{.2\textwidth}
\justifying
text starts here but it has to continue
\end{column}
\begin{column}{.11\textwidth}
\end{column}
\begin{column}{.2\textwidth}
\justifying
text starts here
\end{column}\mygap%
\begin{column}{.2\textwidth}
\justifying
text starts here but it has to continue in the next
\end{column}\mygap%
\begin{column}{.2\textwidth}
\justifying
text starts here but
\end{column}\mygap%
\end{columns}
\begin{columns}[onlytextwidth]\mygap%
\begin{column}{.2\textwidth}
\justifying
in the next line because this is a table with rows, and writing things like this is pretty crazy!!
\end{column}
\begin{column}{.11\textwidth}
\end{column}
\begin{column}{.2\textwidth}
\justifying
but it has to continue in the next line because this is a table with rows, and writing things like this is pretty crazy!!
\end{column}\mygap%
\begin{column}{.2\textwidth}
\justifying
line because this is a table with rows, and writing things like this is pretty crazy!!
\end{column}\mygap%
\begin{column}{.2\textwidth}
\justifying
it has to continue in the next line because this is a table with rows, and writing things like this is pretty crazy!!
\end{column}\mygap%
\end{columns}
\end{frame}
\end{document}