TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to use subfloats in a custom caption/float environment. But I get compilation errors.




\DeclareCaptionType[fileext=loc,placement=b,within=chapter]{chart}[Chart][List of Charts] %list of charts is generated by \listofcharts


\subfloat[Test 1]{\includegraphics[width=0.4\textwidth]{Test1.pdf}\label{chrt:Tests:1}}%


If I change \begin{chart} to \begin{table} and \end{chart} to \end{table} this suddenly works...

share|improve this question

closed as too localized by Paulo Cereda, lockstep, egreg, Thorsten, Marco Daniel Mar 4 '12 at 15:36

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

RTFM, Section "2.1.2 The \newsubfloat Command" – Axel Sommerfeldt Feb 21 '12 at 20:29
Ok, I added \newsubfloat{chart} and now it sortof works. However cleveref doesn't seem to inherit the "chart" label from chart. Any idea how I can fix that? – Matthias Feb 22 '12 at 13:16
RTFM (cleveref), Section 7.1.2 "Customising Individual Cross-Reference Types" ;-) – Axel Sommerfeldt Feb 24 '12 at 17:34