1

I have created the following table. Basically the caption includes the label, the title (it is in \caption{}) and a caption where I describe the table (which is in \caption*{}). The format is similar to the one used in the Journal of Finance.

Figure 1: With small titles it works.

The problem is that if the title is longer as in the following figure, the table and the title are not centered anymore.

enter image description here

To create the tables above I used the following code. Using the caption package.

\documentclass[11pt, a4paper]{article}
\usepackage{caption}
\usepackage{tabularx}
\captionsetup[table]{labelsep = newline, labelfont = bf}

\begin{document}

\begin{table}[!htbp] \centering 
  \caption{\bf \Large This is the main title.}
  \caption*{This is a second caption describing the table. This is a second caption describing the table. This is a second caption describing the table. This is a second caption describing the table. This is a second caption describing the table. This is a second caption describing the table. This is a second caption describing the table. This is a second caption describing the table. This is a second caption describing the table.} 
  \label{table:rnmSummary} 
\begin{center}
  \begin{tabular}{ l | c || r }
    \hline
    1 & 2 & 3 \\ \hline
    4 & 5 & 6 \\ \hline
    7 & 8 & 9 \\
    \hline
  \end{tabular}
\end{center}
\end{table}

\end{document}

1 Answer 1

1

You could use

\captionsetup{justification=centering,singlelinecheck=off}

inside a group (to keep the effect local). A complete example:

\documentclass[11pt, a4paper]{article}
\usepackage{caption}
\usepackage{tabularx}
\captionsetup[table]{labelsep = newline, labelfont = bf}

\begin{document}

\begin{table}[!htbp] \centering
  {\captionsetup{justification=centering,singlelinecheck=off} 
  \caption{\bfseries\Large This is the main title and some more words so it spans more than one line.}}
  \caption*{This is a second caption describing the table. This is a second caption describing the table. This is a second caption describing the table. This is a second caption describing the table. This is a second caption describing the table. This is a second caption describing the table. This is a second caption describing the table. This is a second caption describing the table. This is a second caption describing the table.} 
  \label{table:rnmSummary} 
\begin{center}
  \begin{tabular}{ l | c || r }
    \hline
    1 & 2 & 3 \\ \hline
    4 & 5 & 6 \\ \hline
    7 & 8 & 9 \\
    \hline
  \end{tabular}
\end{center}
\end{table}

\end{document}

The result:

enter image description here

Of course, if this is going to be used many times, define a command to simplify the code. In the preamble:

\newcommand\MyCaption[2][]{%
\begingroup
\captionsetup{justification=centering,singlelinecheck=off,font=bf,textfont=Large} 
  \caption[#1]{This is the main title and some more words so it spans more than one line.}
\endgroup%
}

and then, in your document,

  \MyCaption{This is the main title and some more words so it spans more than one line.}

You must log in to answer this question.

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