LyX ⇒ longtable | Tables with Counter and Caption
longtable | Tables with Counter and Caption
I normally put all my tables in floats. Now I've seen in this forum that for a longtable this is not possible: When the table is inside a float, then the longtable option in the table settings cannot be activated. So I just said Insert/Table and then I could indeed make it a long table.
However, now the table isn't counted anymore and I don't get a caption. How can I get a longtable with counting and caption?
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
longtable | Tables with Counter and Caption
Anyway, here's how:
Code: Select all
\documentclass{article}
\usepackage{longtable}
\begin{document}
\begin{table}
\caption{something}\label{table}
\end{table}
\begin{longtable}{ll}
\caption{here's the caption and the label\label{longtable}}
\endfirsthead % caption is placed inside the longtable usually as part of the first head
a & b
\end{longtable}
see tables \ref{table} and \ref{longtable}
\end{document}