加上 \cmidrule ,我在定義中得到非法參數號

加上 \cmidrule ,我在定義中得到非法參數號

當我將 \cmidrule 添加到表中然後嘗試在 XeLatex 中重新編譯時,它會崩潰。

它停在 \begin{document} 處:

File ended while scanning definition of \LT@xxxix. \begin{document}
Illegal parameter number in definition of \LT@xxxix. \begin{document}
Illegal parameter number in definition of \LT@xxxix. \begin{document}
File ended while scanning definition of \LT@xxxix.

我透過刪除 .aux 檔案來修復它,只要我不添加 \cmidrule,它就會再次工作。

我是 LaTeX 的菜鳥,所以感謝您的幫助。

這是它停止的地方:

   ...
    Chapter 7.
    ! Extra alignment tab has been changed to \cr.
    <template> \endtemplate

    l.1204 ^^I\cmidrule(r){3-8}

    ?

    Underfull \vbox (badness 10000) has occurred while \output is active [29]
    [30]
    Appendix A.

這是我的序言:

    \documentclass{book}
    \usepackage[letterpaper,inner=0.75in,outer=1in]{geometry}
    \usepackage{color}
    \usepackage[english]{babel}
    \usepackage[T1]{fontenc}
    \usepackage{longtable,booktabs}
    \usepackage{multirow}
    \usepackage{parskip} %removes firstline indent
    \usepackage{makeidx}
    \usepackage{titling}
    \usepackage{fontspec}
    \setmainfont{Linux Libertine O}

表格範例:

\begin{longtable}[]{@{}llll@{}}
    \toprule
    centeral & personal & &\tabularnewline
    \cmidrule(r){3-8}
    \endhead
    & reflexive & &\tabularnewline
    & possessive & &\tabularnewline
    reciprocal & each other, one another & &\tabularnewline
    relative & & &\tabularnewline
    interrogative & & &\tabularnewline
    demonstrative & this, that, these, those & &\tabularnewline
    Indefinite & positive & universal & All, both\tabularnewline
    & & & Each, every\tabularnewline
    & & assertive & some\tabularnewline
    & & & Multal, paucal\tabularnewline
    & & & One\tabularnewline
    & & & Half, several, enough\tabularnewline
    & & & Other, another\tabularnewline
    & & nonassertive & Any, either\tabularnewline
    & negative & & No, neither\tabularnewline
    \bottomrule
\end{longtable}

答案1

您的表格有四列,但您要求\cmidrule跨越第 3 列到第 8 列。我不確切知道您希望它跨越哪些列,但\cmidrule(r){3-4}例如可以工作。

你可能想要\midrule

在此輸入影像描述

\documentclass{book}
\usepackage[letterpaper,inner=0.75in,outer=1in]{geometry}
\usepackage{longtable,booktabs}
\begin{document}
\begin{longtable}[]{@{}llll@{}}
\toprule
centeral & personal & &\tabularnewline
\midrule
\endhead
& reflexive & &\tabularnewline
& possessive & &\tabularnewline
reciprocal & each other, one another & &\tabularnewline
relative & & &\tabularnewline
interrogative & & &\tabularnewline
demonstrative & this, that, these, those & &\tabularnewline
Indefinite & positive & universal & All, both\tabularnewline
& & & Each, every\tabularnewline
& & assertive & some\tabularnewline
& & & Multal, paucal\tabularnewline
& & & One\tabularnewline
& & & Half, several, enough\tabularnewline
& & & Other, another\tabularnewline
& & nonassertive & Any, either\tabularnewline
& negative & & No, neither\tabularnewline
\bottomrule
\end{longtable}
\end{document}

相關內容