Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I used the array-environment to construct a table of data:

\documentclass[12pt,landscape]{article}

\usepackage{amsmath,amssymb}
\usepackage{array}
\usepackage{booktabs}% for top-,mid- & bottomrule

\begin{document}

    $
    \begin{array}{lcc}
        \toprule
            &\text{1\textsuperscript{st} growth period} & \text{2\textsuperscript{nd} growth period} \\
        \midrule
             \text{Estonia} & 1.28 & 1.72 \\
             \text{Slovenia} & 1.26 & 0.21 \\
             \text{Czech Republic} & 1.16 & 0.46 \\
             \text{...} & \text{...} & \text{...} \\
             \text{...} & \text{...} & \text{...} \\
        \hline
             \text{Mean} & 0.69 & 0.53 \\
             \text{Lower-Quantile} & 0.37 & 0.21 \\
             \text{Upper-Quantile} & 0.99 & 0.80\\
        \bottomrule
    \end{array}
    $

Now I would like to add a caption to my table. Has anyone an idea?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

I'm not entirely sure why you're not using a tabular for this, but if you want to add a caption, you can use \captionof from the caption package. Note that \captionof stands for 'caption outside float'

enter image description here

\documentclass[12pt,landscape]{article}

\usepackage{amsmath,amssymb}
\usepackage{array}
\usepackage{booktabs}% for top-,mid- & bottomrule
\usepackage{caption}

\begin{document}

\begin{center}
    $
    \begin{array}{lcc}
        \toprule
            &\text{1\textsuperscript{st} growth period} & \text{2\textsuperscript{nd} growth period} \\
        \midrule
             \text{Estonia} & 1.28 & 1.72 \\
             \text{Slovenia} & 1.26 & 0.21 \\
             \text{Czech Republic} & 1.16 & 0.46 \\
             \text{...} & \text{...} & \text{...} \\
             \text{...} & \text{...} & \text{...} \\
        \hline
             \text{Mean} & 0.69 & 0.53 \\
             \text{Lower-Quantile} & 0.37 & 0.21 \\
             \text{Upper-Quantile} & 0.99 & 0.80\\
        \bottomrule
    \end{array}
    $
    \captionof{table}{My caption}
\end{center}

\end{document}
share|improve this answer
    
Sorry for the late answer: I work with Mathematica, which exports tables only in the array-environment. That's why I did not use tabular. Thank you for your answer! I think it will do it. –  John Mar 6 '12 at 14:51

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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