8

I'm typesetting my dissertation using Springer's svmono class. The class defines its own formatting of table and figure captions. I have a couple of multipage tables which I typesetted using longtable package, which has its own \caption command which is different than the one imposed by the class (longtable uses default formatting of the article class). I'm trying to make the caption formatting consistent, without success so far.

I had a look at LaTeX Companion, but the only information I found there states that

[with the caption package] it is easy to customize longtable and table captions, keeping the style of captions consistent between those two environments.

I don't find it easy.

Here is a toy example of what I'm looking for.

Link to the class svmonomb

\documentclass{svmonomb}
\usepackage{longtable}

\begin{document}

I would like to have the longtable version \ref{longtable} look like 
the ``normal'' version \ref{table}.

\bigskip

\begin{table}
    \centering
    \begin{tabular}{rrrrrrrrr}
        1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\ 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1
    \end{tabular}
    \caption{Caption of the normal \texttt{table} environment.}
    \label{table}
\end{table}

\begin{longtable}{rrrrrrrrr}
    1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\ 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\
    \caption{Caption of the \texttt{longtable} environment.}
    \label{longtable}
\end{longtable}

\end{document}
5
  • Could you please create a minimal compilable example. Also, it would be good if you link to classes which are not on CTAN. E.g. svmono seems to live here: springer.com/authors/book+authors?SGWID=0-154102-12-417900-0 Feb 22, 2011 at 12:40
  • Since I'm the author of the caption package I am very interested why you don't find it easy. I always try to improve the documentation, but am dependent on input, especially on what is not comprehensible, so I can change it (hopefully) for the better.
    – user2574
    Feb 22, 2011 at 20:02
  • @Martin-Scharrer Sorry, you are perfectly right. Because I tempered with the svmono a little bit here is my modified version (bojan.3e.pl/etc/svmonomb.cls).
    – Michał
    Feb 23, 2011 at 13:22
  • @Axel, caption's documentation is pretty clear how to create custom \caption commands. The problem is that the captions in the longtable package are different animals than the captions defined in, say, article class. I believe they are kind of \multicolumn commands. I'll try to post a small example in a moment.
    – Michał
    Feb 23, 2011 at 13:26
  • Yes, longtable captions are different, and wrapfigure, and many other captions, too. But the caption package patches them all so a single macro is used for the typesetting of the captions, so all should have the same look & feel when using the caption package.
    – user2574
    Feb 26, 2011 at 7:39

1 Answer 1

6

One possibility would be using the caption package:

\documentclass{svmonomb}
\usepackage{longtable}
\usepackage[small,bf,singlelinecheck=off]{caption}

\begin{document}

I would like to have the longtable version \ref{longtable} look like 
the ``normal'' version \ref{table}.

\bigskip

\begin{table}
    \centering
    \begin{tabular}{rrrrrrrrr}
        1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\
        1 & 1 & 1 & 1 & 1 & 1 & 1 & 1
    \end{tabular}
    \caption{Caption of the normal \texttt{table} environment.}
    \label{table}
\end{table}

\begin{longtable}{rrrrrrrrr}
    1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\
    1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\
    \caption{Caption of the \texttt{longtable} environment.}
    \label{longtable}
\end{longtable}

\end{document}

A different option would be redefining \LT@caption similar to the code of \@makecaption (which can be found inside svmonomb.cls).

1
  • @Alex, thanks a million! I did not know that your package works that way (perhaps I should have tried first). Anyway, thanks again.
    – Michał
    Feb 27, 2011 at 12:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .