需要一个简单的表格。问题是第二列中有很多文本,它应该尊重文本边距。
例子:
\documentclass[11pt]{article}
\usepackage{booktabs}
\begin{document}
\begin{tabular}{@{}llr@{}} \toprule
Animal & Description \\ \midrule
During & the period while Major Henry Lee and his famous Light Dragoons were serving in New Jersey, intelligence came of the marauding operations of a band of Tory robbers \\
Located & in the extensive pine woods toward Barnegat, in Monmouth county, whose head-quarters were at a secret cave in that region. Lee dispatched a select party of fearless men \\
who & approached the dangerous region in a farmer’s wagon, concealed under a covering of straw \\
Fagans & the robber leader, with some followers, stopped the wagon to plunder it, when the concealed dragoons immediately put a ball through Fagans’s head \\\bottomrule
\end{tabular}\\
Source: Modified Text fragments Forman (2014) Down the Ohio and Mississippi \texttt{http://www.gutenberg.org/files/44823/44823-h/44823-h.htm}
\end{document}
答案1
包tabularx
可用于使用X
允许换行并跨越可用空间的列:
\documentclass[11pt]{article}
\usepackage{booktabs}
\usepackage{tabularx}
\begin{document}
\noindent
\begin{tabularx}{\linewidth}{@{}lX@{}}
\toprule
Animal & Description \\
\midrule
During & the period while Major Henry Lee and his famous Light Dragoons were
serving in New Jersey, intelligence came of the marauding operations of a
band of Tory robbers \\
Located & in the extensive pine woods toward Barnegat, in Monmouth county,
whose head-quarters were at a secret cave in that region. Lee dispatched a
select party of fearless men \\
who & approached the dangerous region in a farmer’s wagon, concealed under a
covering of straw \\
Fagans & the robber leader, with some followers, stopped the wagon to
plunder it, when the concealed dragoons immediately put a ball through
Fagans’s head \\\bottomrule
\end{tabularx}\\
Source: Modified Text fragments Forman (2014) Down the Ohio and Mississippi
\texttt{http://www.gutenberg.org/files/44823/44823-h/44823-h.htm}
\end{document}
有很多方法可以将来源放在表格标题中,例如:
\documentclass[11pt]{article}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{caption}
\usepackage{url}
\urldef\urlOhio\url{http://www.gutenberg.org/files/44823/44823-h/44823-h.htm}
\begin{document}
\begin{table}
\captionsetup{format=hang, justification=RaggedRight}
\centering
\begin{tabularx}{\linewidth}{@{}lX@{}}
\toprule
Animal & Description \\
\midrule
During & the period while Major Henry Lee and his famous Light Dragoons were
serving in New Jersey, intelligence came of the marauding operations of a
band of Tory robbers \\
Located & in the extensive pine woods toward Barnegat, in Monmouth county,
whose head-quarters were at a secret cave in that region. Lee dispatched a
select party of fearless men \\
who & approached the dangerous region in a farmer’s wagon, concealed under a
covering of straw \\
Fagans & the robber leader, with some followers, stopped the wagon to
plunder it, when the concealed dragoons immediately put a ball through
Fagans’s head \\\bottomrule
\end{tabularx}
\caption{Source: Modified Text fragments Forman (2014)
Down the Ohio and Mississippi \urlOhio}
\end{table}
\end{document}