My tables have the captions above and are set with booktabs's \bottomrule at the end. I would like to separate figure (having their caption below) from the text with a \topfigrule


but not for tables, as they are already separated enough by the \bottomrule.

How can I configure \topfigrule to be active only for figures?

Assume that there is always only one float at the top of the page, either a table or a figure.

MWE: first page with table, second page with figure. The first page should not get a topfigrule.





     1 & 2 & 3 & 4 & 5\\\midrule
     a & b & c & d & e\\




  • Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – Werner Feb 27 '13 at 21:12

LaTeX doesn't normally keep track of float type at that point, but you can make it remember the last type it saw and then make the rule conditional on that:

enter image description here


{\count@\count#1\divide\count@32 \xdef\lasttype{\the\count@}}%
      \vbox{\unvbox\@tempboxa\box #1\vskip\floatsep}}




\begin{table}[t]\caption{ccc} xxx\end{table}




\begin{figure}[t]xxx \caption{kkk}\end{figure}


| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.