在 LateX 中將文字換行到表格儲存格中

在 LateX 中將文字換行到表格儲存格中

使用 時,我在將文字換行到表格單元格時遇到問題 tabular。單元格中的短語超出了文字寬度。我嘗試應用multirow命令,但它沒有改變任何事情。為什麼?好吧,每當使用multirow缺少大括號 (})時,我都會收到錯誤。我看了一遍又一遍還是看不出來。也許有人可以測試它並提供免費的錯誤行。

\documentclass[12pt]{article}
\usepackage[english]{babel}

\usepackage{multirow}

\begin{table}[t]
\centering

 \begin{tabular}{lll}
 \hline

  \textbf{Name \& Author(s)} & \textbf{Label}  & \textbf{Definition}                                                                                      \\ \hline

              Poggi 2001     & Nod             & "a down-up movement of the head"                                                                                       \\

              Allwood 2003   & Nod            & "a forward movement of the head going up and down, which can be multiple"\\

這是我得到的輸出:

例子

答案1

這看起來是一個很好的應用程式包tabularx

請不要使用"引號。

\documentclass[12pt]{article}
\usepackage[english]{babel}

\usepackage{tabularx}
\usepackage{booktabs}

\begin{document}

\begin{table}[t]
    \centering
    \begin{tabularx}{\textwidth}{@{}llX@{}}
        \toprule
        \textbf{Name \& Author(s)} & \textbf{Label}  & \textbf{Definition}\\
        \midrule
        Poggi 2001 & Nod & ``a down-up movement of the head''\\
        Allwood 2003 & Nod & ``a forward movement of the head going up and down, which can be multiple''\\
        \bottomrule
    \end{tabularx}
\end{table}

\end{document}

在此輸入影像描述

相關內容