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 410 times
longtable_caption_minimal.lyx
(20.12 KiB) Downloaded 354 times

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
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