Generallongtable vs. nice captions

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
k.m.
Posts: 3
Joined: Fri Mar 28, 2008 11:10 am

longtable vs. nice captions

Post by k.m. »

Hi,
I've a problem with the caption in longtable environment...

The caption in longtable are embedded in a different way than in other table environments. Now, the problem is that in longtables the caption is above the table with ~one line spacing between the caption and the actual table which does not appear in the "normal" table environments where the caption is directly above the table...

Here is the starting code for my longtable...
\begin{longtable}{ll.}
\caption{bla jkag} \\
\toprule
1 & 2 & 3 \\\midrule
\endfirsthead

\caption{(...continued)}\\\toprule
1 & 2 & 3 \\\midrule
\endhead

\multicolumn{3}{r}{{...}continues on next page} \\
\endfoot

\endlastfoot

4 & 5 & 6\\*

.......................................and so on...............


I tried for two days now to trick Latex into another format but so far Latex won and kept on showing the space...

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

sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Re: longtable vs. nice captions

Post by sommerfee »

The space between longtable caption and contents is hard coded into the longtable package. So you need to utilize a package which patches this (like the caption package for example), or you need to patch the \LT@makecaption command (the command inside the longtable which is responsible for typesetting the caption) on your own.
k.m.
Posts: 3
Joined: Fri Mar 28, 2008 11:10 am

Re: longtable vs. nice captions

Post by k.m. »

Thanks again :) I just figured that you're the same guy I'm discussing with in the other forum in german :) so no need to expand it ...

So I will just go back to the other one in german as it is more convinient anyway
Post Reply