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.

Okay, I am really new at LaTeX so I may be screwing up terribly, but here's my problem. I'm writing a paper with several tables, one of which is in three parts, so I'm using \ContinuedFloat from the caption package to try to get correct captions.

What I want is the first table to be Table 1, then to have Table 2a, 2b, 2c. Instead, I get Table 1 and then Table 1a, Table 1b, Table 1c. Here's what I have (I apologize if it isn't enough, I'm not quite sure what you need!)

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{caption}
\DeclareCaptionLabelFormat{cont}{#1˜#2\alph{ContinuedFloat}}
\captionsetup[ContinuedFloat]{labelformat=cont}
\usepackage[]{subfig}
\begin{document}

\begin{table}[!htbp]
\centering
\includegraphics{plachit.jpg}
\caption{}
\label{plachit}
\end{table}

\begin{table}[!htbp]\ContinuedFloat
\centering
\subfloat[]{\includegraphics{kisel1.jpg}}
\caption{Tier 1}
\label{kisel1}
\end{table}

\begin{table}[!htbp]\ContinuedFloat
\centering
\subfloat[]{\includegraphics{kisel2.jpg}}
\caption{Tier 2}
\label{kisel2}
\end{table}

\begin{table}[!htbp]\ContinuedFloat
\centering
\subfloat[]{\includegraphics{kisel3.jpg}}
\caption{Tier 3}
\label{kisel3}
\end{table}

\end{document}

I wasn't using subfloat at first, but from looking around trying to find an answer, it seemed like other people were. Not exactly sure if it's necessary.

share|improve this question
    
Yes, I was. Thanks! –  Erica Jun 6 '12 at 20:38
    
At the moment you have both (a) and Table 1a, so there seems to be 2 captions- do you want to keep this? If not then there'll probably be an option using the subcaption package, a sibling of the caption package –  cmhughes Jun 6 '12 at 20:54
    
I'm not sure what you mean by having 2 captions-- what causes that? I tried using the subcaption package, by following the directions here link, but now it is throwing this error: [5] [6] (c:/texlive/2011/texmf-dist/tex/latex/base/omlcmr.fd) [7] <plachit.jpg, id=32, 419.31656pt x 156.585pt> <use plachit.jpg> ! Missing number, treated as zero. <to be read again> \let l.159 \includegraphics {kisel1.jpg} ? Also, I'm not sure how to make a post on this to show the new code. –  Erica Jun 6 '12 at 21:10
    
The cause is \subfloat[<caption goes here>]{\includegraphics{kise13.jpg}} and \caption{}. You can click on the edit button to update your question –  cmhughes Jun 6 '12 at 21:21
add comment

1 Answer

up vote 4 down vote accepted

I suspect that using the \ContinuedFloat method of the caption package may constitute a bit of abuse of that method. To my understanding, the ContinuedFloat method is intended to be used in cases where a single "float" (such as a figure or table) doesn't fit on one page and the need arises to link the two (or more) separate parts using some recognizable terminology. In your case, in contrast, I can't discern what is supposed to link Table 1 to Table 2 (which happens to come in three parts). If your Table 2 ends up being too large to fit on a single page, you may want to consider limiting the use of \ContinuedFloat instructions to just that table.

Since you appear to have two main tables ("floats", in LaTeX parlance), one of which has three components (or "tiers", as you call them), you may want to use the subcaption package and its subtable environment. Note that it's possible to assign captions to (and hence cross-reference) the sub-tables individually.

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{subcaption}
\begin{document}

\begin{table}[!htbp]
\caption{A single-tiered table}
\centering
\includegraphics{plachit.jpg}
\label{plachit}
\end{table}

\begin{table}[!htbp]
\caption{A table with three tiers}
\begin{subtable}{1\textwidth}
\centering
\includegraphics[width=1.5in]{kisel1.jpg}
\caption{Tier 1} \label{kisel1}
\end{subtable}

\begin{subtable}{1\textwidth}
\centering
\includegraphics[width=2.5in]{kisel2.jpg}
\caption{Tier 2}
\label{kisel2}
\end{subtable}

\begin{subtable}{1\textwidth}
\centering
\includegraphics[width=3.5in]{kisel3.jpg}
\caption{Tier 3}
\label{kisel3}
\end{subtable}
\end{table}
\end{document}

enter image description here

share|improve this answer
    
Thank you so much! You've saved me hours of frustration. :) –  Erica Jun 6 '12 at 21:28
add comment

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.