3

enter image description here

How can I create these two tables with only 1 caption and 2 sub-caption like this figure in Latex?

0

2 Answers 2

2

Use a single \caption instruction, two tabular environments, and \multicolumn instructions to provide headers for each of the two tabular environments.

enter image description here

\documentclass{article}
\usepackage{booktabs}
\usepackage[margin=2.5cm]{geometry}
\usepackage{caption}
\captionsetup{font=bf,labelsep=newline,skip=0.25\baselineskip}
\begin{document}
\begin{table}
\caption{Market Data for the Zero Curve Construction}
{\centering (for December 18, 2007)\par}

\bigskip
\begin{tabular}{@{}cccc@{}}
\multicolumn{4}{@{}l}{\em(a) Libor Spot Rate Information}\\
\toprule
Term & Maturity & Days & Rate (\%)\\
\midrule
\dots \\
\bottomrule
\end{tabular}

\bigskip\bigskip
\begin{tabular}{@{}*{10}{c}@{}}
\multicolumn{10}{@{}l}{\em(b) Eurodollar Futures Information}\\
\toprule
Contract & Price & Start Date & Days & End Date & Days & Days & Futures & Convexity & Forward \\
& & & ($T1$) & & ($T2$) & ($T2{-}T1$) & Rate (\%) & Adjustment & Rate (\%) \\
\midrule
\dots \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
4
  • Can I adjust the margin of the second table without using the \usepackage[margin=2.5cm]{geometry} for the whole document?
    – Duy
    Jun 2, 2017 at 21:01
  • @Duy - Are you actually trying to replicate the table of which you posted a screenshot?
    – Mico
    Jun 2, 2017 at 21:13
  • yes but I dont want to use the \usepackage[margin=2.5cm]{geometry} since it may affect my other tables in the paper. I am now using the \hspace{2.5cm}\begin{table}.......\end{table}\hspace{2.5cm}. It works also
    – Duy
    Jun 4, 2017 at 17:36
  • 1
    @Duy - As I said earlier, I have only rudimentary knowledge of what you're trying to do and what your document parameters are. So far, your descriptions unfortunately do not really clarify these issues. Please provide information about the width of your document's text block, the document font, and the main font size that's in use.
    – Mico
    Jun 4, 2017 at 18:08
2

Here's one version utilizing subcaption (and booktabs). For more information on caption formatting have a look into the caption package's documentation.

subcaption

\documentclass{article}
\usepackage{subcaption}
\usepackage{booktabs}

\begin{document}
\begin{table}
    \caption{General}
    \begin{subtable}{\linewidth}
        \caption{Something}
        \begin{tabular}{ll}
            \toprule Quack? & Quack!\\\midrule
            Quack 1 & Quack 2\\
            Quack 3 & Quack 4\\\bottomrule
        \end{tabular}
    \end{subtable}\par
    \begin{subtable}{\linewidth}
        \caption{Something else}
        \begin{tabular}{ll}
            \toprule Quack? & Quack!\\\midrule
            Quack 1 & Quack 2\\
            Quack 3 & Quack 4\\\bottomrule
        \end{tabular}
    \end{subtable}
\end{table}
\end{document}

You must log in to answer this question.

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