我一直为这个问题而绞尽脑汁(其他的答案都不适合我),但是我无法摆脱这个未满的 \hbox(糟糕程度 4886 或 2111,取决于我是否使用实际的文本内容)用 tabularx 得到一个跨页面的完整文本宽度表格...我只想要一个很好的解决方案来显示一个 3 列表格,其中只有文本段落(最右边两列)和左边列中的名称。如下所示(我正在使用 sharelatex):
\begin{table}[ht]
\centering
\begin{tabularx}{\linewidth}{lXX}
\toprule
Name & Their Description & Functions \\ \midrule
Tommytommy & "I describe myself as fantastic obviously. Like, really fantastic." & This person is correct, they are fantastic and, like, really smart. We could go on a whole bunch but we will stop. \\
Jerome & "I describe myself as fantastic obviously." & This person is correct, they are fantastic and, like, really smart. \\
Lindsay & "I describe myself as fantastic obviously." & This person is correct, they are fantastic and, like, really smart (really really smart, actually). \\
Helen & "I like to talk a lot so will avoid this question until I absolutely have to admit that I am fantastic just like all the rest, obviously." & This person is correct, and they even gave it lots of consideration -- they are fantastic and, like, really smart. \\ \bottomrule
\end{tabularx}
\caption{My caption}
\label{rage-table}
\end{table}
答案1
这是第一行第二个单元格的问题:由于这些单元格的宽度较短,LaTeX 有时难以在行尾处用连字符连接单词。Tommytom
例如,如果您将第一个单元格的内容缩短为,则问题会消失。我建议在单元格开头加载ragged2e
和使用。>[{\RaggedRight}
X
比较是否有此指令:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
%\usepackage{geometry}
\usepackage{ragged2e}
\usepackage{tabularx, booktabs}
\begin{document}
\begin{table}[!ht]
\centering
\begin{tabularx}{\linewidth}{lXX}
\toprule
Name & Their Description & Functions \\ \midrule
Tommytommy
& "I describe myself as fantastic obviously. Like, really fantastic." & This person is correct, they are fantastic and, like, really smart. We could go on a whole bunch but we will stop.
\\
Jerome & "I describe myself as fantastic obviously." & This person is correct, they are fantastic and, like, really smart. \\
Lindsay & "I describe myself as fantastic obviously." & This person is correct, they are fantastic and, like, really smart (really really smart, actually). \\
Helen & "I like to talk a lot so will avoid this question until I absolutely have to admit that I am fantastic just like all the rest, obviously." & This person is correct, and they even gave it lots of consideration -- they are fantastic and, like, really smart. \\
\bottomrule
\end{tabularx}
\caption{My caption}
\label{rage-table}
\end{table}
\begin{table}[!ht]
\centering
\begin{tabularx}{\linewidth}{l>{\RaggedRight}X>{\RaggedRight\arraybackslash}X}
\toprule
Name & Their Description & Functions \\
\midrule
Tommytommy
& "I describe myself as fantastic obviously. Like, really fantastic." & This person is correct, they are fantastic and, like, really smart. We could go on a whole bunch but we will stop.
\\
Jerome & "I describe myself as fantastic obviously." & This person is correct, they are fantastic and, like, really smart. \\
Lindsay & "I describe myself as fantastic obviously." & This person is correct, they are fantastic and, like, really smart (really really smart, actually). \\
Helen & "I like to talk a lot so will avoid this question until I absolutely have to admit that I am fantastic just like all the rest, obviously." & This person is correct, and they even gave it lots of consideration -- they are fantastic and, like, really smart. \\
\bottomrule
\end{tabularx}
\caption{My caption}
\label{rage-table}
\end{table}
\end{document}