考虑这个例子:
\begin{enumerate}
\item Blablabla bla bla bla.
\begin{tabular}{l}
Lorem ipsum dolor sit amet.\\
Consectetur adipiscing elit.\\
Donec eu ante non mi sagittis molestie.\\
\end{tabular}
\item Next question
\end{enumerate}
LaTeX 会将表格垂直居中,这看起来很奇怪。它基本上看起来像这样:
Lorem ipsum dolor sit amet.
1. Blablabla bla bla bla. Consectetur adipiscing elit.
Donec eu ante non mi sagittis molestie.
我怎样才能让连续的线条在第一条线下排列(具有相同的边距)?看起来像这样:
1. Blablabla bla bla bla. Lorem ipsum dolor sit amet.
Consectetur adipiscing elit.
Donec eu ante non mi sagittis molestie.
有任何想法吗?
谢谢!
答案1
环境tabular
有一个可选参数来指定垂直对齐方式。默认为居中,其他选项t
为b
顶部和底部。
\begin{enumerate}
\item Blablabla bla bla bla.
\begin{tabular}[t]{l}
Lorem ipsum dolor sit amet.\\
Consectetur adipiscing elit.\\
Donec eu ante non mi sagittis molestie.\\
\end{tabular}
\item Next question
\end{enumerate}
答案2
根据 Juan A. Navarro 的回答,我们还可以得到这样的结果:
使用以下代码:
\documentclass{article}
\begin{document}
\begin{enumerate}
\item Blablabla bla bla bla.\\
\begin{tabular}[t]{l}
Lorem ipsum dolor sit amet.\\
Consectetur adipiscing elit.\\
Donec eu ante non mi sagittis molestie.\\
\end{tabular}
\item Next question with blabla bla.\\
\begin{tabular}[t]{llr}
I. &Consectetur adipiscing elit.&125.12\\
II. &Consectetur adipiscing elit.&3.25\\
III. &Consectetur elit.&0.35\\
IV. &Consectetur adipiscing.&2783.25\\
\end{tabular}
\item Next question.\\
\begin{tabular}[t]{l}
Lorem ipsum dolor sit amet.\\
Consectetur adipiscing elit.\\
Donec eu ante non mi sagittis molestie.\\
\end{tabular}
\item Next question with bla.\\
\begin{tabular}[t]{l}
Lorem ipsum dolor sit amet.\\
Consectetur adipiscing elit.\\
Donec eu ante non mi sagittis molestie.\\
Consectetur adipiscing elit.\\
\end{tabular}
\end{enumerate}
\end{document}