如何讓下表自動換行?

如何讓下表自動換行?

編輯以便程式碼應該是可編譯的- 我列出了所有包,以檢查是否存在衝突(但我認為不應該有任何衝突),並且我還省略了引用,以便您可以在沒有我的.bib 文件的情況下進行編譯,這不應該影響任何事情。我已經註解掉了 fontspec,因為它就在那裡,但它在指定字體時拋出了一個錯誤,你要么不太可能擁有我的字體,要么它們可能被保存為不同的字體。

我嘗試了多種解決方案,但沒有成功。這是一個非常簡單的表格(儘管我在其他地方有更複雜的表格 - 我之前已經完成了工作,但我似乎已經刪除了該文檔,以執行另一項任務)。

%! TEX program = xelatex
\documentclass[a4paper, titlepage]{book}

\usepackage[utf8]{inputenc}
\usepackage[T1,LGR]{fontenc}
%\usepackage{fontspec}
\usepackage[overlap, CJK]{ruby}
\usepackage{listings}
\usepackage[style=british]{csquotes}
\usepackage{xpatch}
\usepackage{amsmath,amsfonts,amsthm}
\usepackage{ot-tableau}
\usepackage{polyglossia}
\setdefaultlanguage[variant=british]{english}
\usepackage[bibencoding=utf8, backend=biber, style=authoryear-icomp, language=british]{biblatex}
\usepackage{easylist}
\usepackage{hyperref}
\usepackage{memhfixc}
\usepackage[nameinlink,noabbrev,capitalize]{cleveref}
\usepackage[nonumberlist,style=tree,abbreviations,xindy,toc]{glossaries-extra}
\usepackage{blindtext}
\usepackage{cgloss4e}
\usepackage{enumerate}
\usepackage{longtable}
\usepackage{textgreek}
\usepackage{booktabs, siunitx}
\usepackage{tabulary}
\usepackage{multirow}
\usepackage{graphicx}
\graphicspath{ {./images/} }
\usepackage{wrapfig}
\usepackage{chngcntr}
\usepackage{tablefootnote}
\usepackage[tableposition=above]{caption}
\usepackage{imakeidx}
\usepackage{xltxtra}
\usepackage{gb4e} %Ensure this is the last \usepackage

\sloppy

\begin{document}

\begin{table*}
    \centering
    \caption{Some of the events reported during muscular paralysis caused by curare injection.}
    \begin{tabulary}{\textwidth}{ll}
        \toprule
        2:11 PM: & Curare injection administered over 15 minutes.\marginpar{All events are direct quotes or paraphrases of the original report.} \\
        2:20: & Speech no longer possible. Can hear distinctly. Still able to nod head and move hands. \\
        2:22: & Subject reports by movement of head that the experience is not unpleasant. \\
        2:26: & Ability to comprehend and answer questions accurately is indicated by correctness of replies when inquiries are restated in the negative or double negative. \\
        2:45: & Subject now unable to signal response to inquiries due to complete paralysis. \\
        2:48: & Eyelids manually opened. Subject stated upon recovery that he was `clear as a bell' all this period. \\
        4:50: & Subjects is able to sit up on edge of bed. Complete subjective report dictated. \\ \bottomrule
    \end{tabulary}
\end{table*}

\end{document}

謝謝你!

答案1

tabulary需要 LC 或 R 列來執行任何有用的操作,列總是單行,而且表內l不能有列。\marginpar

\documentclass[a4paper, titlepage]{book}

\usepackage{tabulary,booktabs}
\sloppy

\begin{document}

\begin{table}
    \centering
    \caption{Some of the events reported during muscular paralysis caused by curare injection.}

    \begin{tabulary}{\textwidth}{lL}
        \toprule
        2:11 PM: & Curare injection administered over 15 minutes. \\
        2:20: & Speech no longer possible. Can hear distinctly. Still able to nod head and move hands. \\
        2:22: & Subject reports by movement of head that the experience is not unpleasant. \\
        2:26: & Ability to comprehend and answer questions accurately is indicated by correctness of replies when inquiries are restated in the negative or double negative. \\
        2:45: & Subject now unable to signal response to inquiries due to complete paralysis. \\
        2:48: & Eyelids manually opened. Subject stated upon recovery that he was `clear as a bell' all this period. \\
        4:50: & Subjects is able to sit up on edge of bed. Complete subjective report dictated. \\ \bottomrule
    \end{tabulary}

\end{table}

\end{document}

相關內容