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.

When I try to typeset with both the packages subcaption and breqn, I get the following error:

! Package caption Error: The `subcaption' package does not work correctly(caption) in compatibility mode.See the caption package documentation for explanation.Type H for immediate help.... \begin{document}

However, if I deactivate either package, the document can typeset.

My preamble is as follows

\documentclass[a4paper]{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,amssymb}
\usepackage{lmodern}
\usepackage{graphicx}
\usepackage{float}
\graphicspath{{figures/}}
\includeonly{intro}
\usepackage{pstool}
\usepackage{epstopdf}
\usepackage{subcaption}
\usepackage{breqn}

\listfiles

\epstopdfDeclareGraphicsRule{.gif}{png}{.png}{%
 convert #1 \OutputFile
}
\AppendGraphicsExtensions{.gif}


\newcommand{\vect}[1]{\boldsymbol{#1}}
\newcommand{\vectornorm}[1]{\left|\left|#1\right|\right|}
\newcommand{\pic}[5]{
\begin{figure}[H]
\centering
\includegraphics[width=#2\textwidth]{#1} 
\caption[#3]{#4}
\label{#5}
\end{figure}
}

\title{\textbf{report\newline}}
\author{
\begin{tabular}{l c r}
First Middle Surname
\end{tabular}
}
\date{\today}

\setcounter{secnumdepth}{-1}


\begin{document}
\maketitle
\newpage
\begin{dmath}
x=5
\end{dmath}

\end{document}

Let me know if you wanna see file listing

share|improve this question

1 Answer 1

Yes, for a reason I don't understand yet the combination of float and breqn package is incompatible to the (sub)caption package:

\listfiles
\documentclass[a4paper]{article}
\usepackage{breqn}
\usepackage{float}
\usepackage{caption}

\begin{document}
A
\end{document}

will issue the warning

Package caption Warning: \caption will not be redefined since it's already
(caption)                redefined by a document class or package which is
(caption)                unknown to the caption package.

which is obviously rubbish since the caption package should be aware about the redefinition of \caption done by the float package.

As a workaround one can save and restore the definition of \caption when loading the float package:

\let\captionORI\caption
\usepackage{float}
\let\caption\captionORI

As long as the caption package is used this should not make any harm (but outsmart the compatibility test of the caption package) since the caption package will redefine \caption anyway later on.

I will do further examination on week-end and report.

The murder is out (2012-08-25):

The breqn package redefines the LaTeX kernel macro \@ifstar in a way which is incompatible to at least one macro defined by the caption package. Since this macro will be used for the compatibility test this test could fail even if no incompatibility is actually present. I'll fix that in the next release of the caption package.

Update (2013/01/09):

The next release 3.3 of the caption package is out where this bug was fixed. Thanks for your patience.

share|improve this answer
    
Thanks a bunch :) –  Kirbies Aug 28 '12 at 10:17

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.