Graphics, Figures & TablesLongtable And Illegal Unit Of Measure Error

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
rosspenny83
Posts: 3
Joined: Tue Jul 30, 2019 6:34 pm

Longtable And Illegal Unit Of Measure Error

Post by rosspenny83 »

Hi all,

Appreciate most times a MWE is required for these questions, but I'm not even sure what code to include from a fairly large thesis file set. My question surrounds the use of caption in the longtable package.

Code: Select all

\usepackage{longtable}
\usepackage{caption} %both have been called in the preamble
I don't see anywhere in the preamble where

Code: Select all

\captionsetup
has been called.

I want to build a single column, multi-page longtable with a caption. I can build the table I want using the normal table functions, but without the multi-page layout so I know the formatting of that is ok. However the caption is throwing up an error that I just can't work out.

At a basic level:

Code: Select all

\begin{longtable}{c}
	\caption{Here is my first table...}\\
\end{longtable}
Gives me the error ! illegal unit of measure (pt inserted).<to be read again>{\caption[Here is my first table...}....

I've tried some different guesses at inserting the

Code: Select all

\captionsetup
in the preamble and within the longtable environment with no success. Really I'm looking for guidance on where I can find the resource to solve this quicly rather than an answer - unless it is straightforward.

Any help is much appreciated.

Thanks

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

Longtable And Illegal Unit Of Measure Error

Post by Ijon Tichy »

I cannot reproduce the error using the code snippets and information from your question:

Code: Select all

\usepackage{longtable}
\usepackage{caption}

\begin{document}
\begin{longtable}{c}
  \caption{Here is my first table...}\\
\end{longtable}
\end{document}
With up-to-date TeX Live 2019 this compiles without any error or warning message. So, please show us a Infominimal working example, that can be used to reproduce the problem.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
Post Reply