Graphics, Figures & TablesLongtable numbered caption error

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
dead_mantra
Posts: 10
Joined: Tue Feb 10, 2015 5:32 pm

Longtable numbered caption error

Post by dead_mantra »

Dear all,

I'm trying to insert a numbered caption to a longtable as follows:
1) Create an empty first line in my table
2) Right click on the empty line --> Settings --> Caption on
3) Insert the caption text followed by an ERT with \\

Unfortunately, I get a 'Mispalced\noalign. Emergency stop' error when I try to compile. I've been browsing various forums but couldn't find a solution as of yet.

I have attached the .lyx and .tex minimal versions containing the longtable in case anyone can provide any assistance.

Thanks for any help!
Attachments
longtable_caption_minimal.tex
(9.24 KiB) Downloaded 406 times
longtable_caption_minimal.lyx
(20.12 KiB) Downloaded 350 times

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

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Longtable numbered caption error

Post by Johannes_B »

Take a look at the tex-document. LyX went mental there with the language stuff, switching to english at the beginnning of every cell, printing the content and switching back to british. I don't know what made LyX do it, but that is the cause of error.

Please also note, that the \\ has to be outside the caption.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
dead_mantra
Posts: 10
Joined: Tue Feb 10, 2015 5:32 pm

Re: Longtable numbered caption error

Post by dead_mantra »

Thanks Johannes. Indeed that was the problem.
My suggestion to anyone that reads this post is to set the document language (under the Document--> Settings) to the preferred language. Otherwise the spell checker might go as crazy as in my case.
Finally, at least in this example, the \\ is not needed. Just setting the 'Caption on' in the longtable settings tab worked for me.

Thanks again.
Post Reply