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.

There is a compatibility problem between the CIFA document class and the subcaption package. When I compile the following example (with PDFLaTex):

    \documentclass{cifa}

    \usepackage{subcaption}

    \begin{document}
    \begin{figure}
    \parbox{4cm}{\subcaption{This is a          subcaption}\label{sub}}

    \caption{nothing}
    \label{nothing}
    \end{figure}

    See figure \ref{nothing}: there is \ref{sub} inside...

    \end{document}

this warnings are dislayed:

Package caption Warning: Unsupported document class (or package) detected,

Package caption Warning: \caption will not be redefined since it's already

In addition the words "figure" and "subfigure" are displayed AFTER the captions.

How to fix this issue?

share|improve this question
    
Depending on the particulars of the cifa class, you may be able to restore the caption style by passing options to the caption package, see this answer. –  johntex Jun 22 at 1:52

1 Answer 1

up vote 28 down vote accepted

The very recent version of the subcaption package will even issue an error:

! Package caption Error: The `subcaption' package does not work correctly
(caption)                in compatibility mode.

The only way to get around this is to specify the option compatibility=false to the caption package:

\documentclass{cifa}

\usepackage{subcaption}
\captionsetup{compatibility=false}

\begin{document}
\begin{figure}
\parbox{4cm}{\subcaption{This is a subcaption}\label{sub}}
\caption{nothing}
\label{nothing}
\end{figure}

See figure \ref{nothing}: there is \ref{sub} inside...

\end{document}

PLEASE NOTE: This way the customization of the captions done by the cifa document class will be overwritten by the caption package in a brute-force manner. In best case the output of the captions will look different (and some caption-related stuff offered by the cifa document class will not work anymore), in worst case you'll get error messages and wired output. So please also take a look at the caption package documentation, section "6 Package Support". Since this is a perfect method to shoot oneself in the foot, an extra warning is always issued when using the compatibility=false option:

Package caption Warning: Forced redefinition of \caption since the
(caption)                unsupported(!) package option `compatibility=false'
(caption)                was given.
See the caption package documentation for explanation.

If you do not want this (or it does not work anyway) then the only solution left is not-using the subcaption package. Use the subfig package with option caption=false (which prevents loading of the caption package) instead:

\documentclass{cifa}

\usepackage[caption=false]{subfig}

\begin{document}
\begin{figure}
\subfloat[This is a subcaption\label{sub}]{............}
\caption{nothing}
\label{nothing}
\end{figure}

See figure \ref{nothing}: there is \ref{sub} inside...

\end{document}
share|improve this answer

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.