# Add a \cmidrule and I get an illegal parameter number in definition

When I add a \cmidrule into a table and then try to recompile in XeLatex, it breaks.

It stops at the \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.


I fix it by deleting the .aux file, and it works again as long as I do not add in a \cmidrule.

I am a noob to LaTeX, so any help is appreciated.

This is where it stops:

   ...
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.


This is my preamble:

    \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}


Example of table:

\begin{longtable}[]{@{}llll@{}}
\toprule
centeral & personal & &\tabularnewline
\cmidrule(r){3-8}
& 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}

• Hi, welcome. Can you show the actual code of the table as well? – Torbjørn T. Apr 20 '17 at 15:10
• I added it to the main question, but it happens with every table I try. thanks – esponapule Apr 20 '17 at 15:15

Your table has four columns, but you've asked the \cmidrule to span columns 3 to 8. That doesn't work. I don't know exactly which columns you intended it to span, but \cmidrule(r){3-4} for example works.

You might want just \midrule though:

\documentclass{book}
\usepackage[letterpaper,inner=0.75in,outer=1in]{geometry}
\usepackage{longtable,booktabs}
\begin{document}
\begin{longtable}[]{@{}llll@{}}
\toprule
centeral & personal & &\tabularnewline
\midrule
& 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}

• Ahh, so If I do not have the right columns indicated it will break the table? It does work now. Thanks. – esponapule Apr 20 '17 at 15:25
• @esponapule Well, yes (apparently). – Torbjørn T. Apr 20 '17 at 15:28
• well, I meant it would not even compile instead of producing a wrong result within the table. It would not even create the PDF where as other errors would create a PDF but the table would be a mess. – esponapule Apr 20 '17 at 15:31
• @esponapule I don't actually get the same error as you, but I could skip through them and get a PDF. But I cannot shed any more light on that bit. – Torbjørn T. Apr 20 '17 at 15:36