1

I encountered this error message while trying to use the minted package along the floatrow package:

(/usr/share/texlive/texmf-dist/tex/latex/floatrow/floatrow.sty
Package: floatrow 2008/08/02 v0.3b floatrow: float package extension
! Package floatrow Error: Do not use float package with floatrow.
(floatrow) The latter will be skipped.
See the floatrow package documentation for explanation.
Type H <return> for immediate help.
...
l.33 \@namedef{opt@floatrow.sty}{}\endinput}
This error message was generated by an \errmessage
command, so I can't give any explicit help.
Pretend that you're Hercule Poirot: Examine all clues,
and deduce the truth by order and method.

And I'm not Hercule Poirot at all.
I have to discard floatrow to make minted works.

mwe:

\documentclass{report}
\usepackage{minted}
\usepackage{floatrow}
\begin{document}
Hi
\end{document}
  • 2
    Neither are we: as far as I know, Hercule Poirot doesn't subscribe to the site. So a minimal example is needed. – egreg Jul 6 '17 at 22:18
  • 1
    Although the error does tell you what you've done wrong, so should be fairly intelligible even if you're not Hercule Poirot. It also tells you where to look for more information about the error. – cfr Jul 6 '17 at 22:20
  • @egreg Actually there might be a Mr. Poirot on this site: tex.stackexchange.com/users/36554/poirot – user36296 Jul 6 '17 at 23:29
  • @samcarter Might not be Hercule, though. Could be Fred Poirot. – cfr Jul 7 '17 at 0:28
  • 1
    Try changing the loading order, i.e, move \usepackage{floatrow} before \usepackage{minted} – cmhughes Jul 7 '17 at 6:57
3

The packages float and floatrow are incompatible with each other.

However, minted has \RequirePackage{float} at the beginning, so that's the source of the message. Loading the two packages in the reverse order appears to solve the issue, but it can lead to problems later.

Actually, the float package seems to be used just in order to provide minted floats with the [H] option, which is bad anyway. The other features of float relevant for minted can be obtained with newfloat, that's not incompatible with floatrow.

You should make a feature request to the maintainer of minted, so as to provide a way to disable the loading of float.

In the meantime, you can disable it yourself.

\documentclass{report}

% pretend to already have loaded float
\makeatletter 
\@namedef{ver@float.sty}{3000/12/31}
\makeatother

\usepackage[newfloat]{minted}
\usepackage{floatrow}

\begin{document}

Hi

\begin{figure}
\fcapside
  {\caption{...}\label{...}}
  {...}
\end{figure}

\end{document}
  • Clear explanation. And it works. By the way, can you enlight me a little more by explaning why [H] is not a good idea for figure positioning e.g. ? – s.k Jul 7 '17 at 10:43
  • @s.k There are several posts on the site about this. If you don't want something to float, then it's not a float (and should not have a caption). – egreg Jul 7 '17 at 10:44
  • Starting with minted v2.5 (just released), float is no longer loaded if the newfloat option is specified, and the default listing placement is the same as that for figure and table. So pretending to load float shouldn't be necessary in the future. – G. Poore Jul 19 '17 at 19:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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