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.

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'm writing a document and I wanted to colour some text parts.

In the preamble I call float package and many others and it worked properly. until I called color package. Then LaTeX return errors at some place in the source code:

Missing \endgroup inserted
Missing } inserted
Unbalanced output routine ...

By (un)commenting parts of code I've found that \newfloat{graf}{tbp}{lop}[chapter] command causes it.

Does anyone have idea why it is working only without color package and/or how to define custom floats and be able to use colours?

Thanks for your time and suggestions.





%== Graf environment definition==

\newcommand{\listofgraphs}{\listof{graf}{List of Graf}}


Lorem ipsum dolor sit amet.

share|improve this question
1. Could you please give us a small but complete example showing the problem. 2. Have you already tried replacing the float package by floatrow? – Axel Sommerfeldt May 12 '11 at 5:35
Lots of people use color and float together: there must be something else going on here. – Joseph Wright May 12 '11 at 5:59
Axel: 1. I've added the code, 2. I'haven't known about that package yet. Joseph: When I don't define new float both no error occurs. Well, I use only [H] option so I should better say 'no error'. – Crowley May 12 '11 at 6:13
up vote 2 down vote accepted


Mistake was between chair and screen. As usual.

The problem is not in collision between those packages, problem is caused by the name of my new float - graf - and its collision with color package. When I used


No error was throwed.


I've tried the floatrow package and changed proper commands but same error occurs, so Your advice led me to this conclusion. Thanks.

share|improve this answer

In the course of defining a new floating environment called graf, you will (among other things) define the macros \graf and \endgraf. The latter will cause an error because the \endgraf macro is already defined as \par by LaTeX (and plain TeX).

share|improve this answer
But why it works without problems when color package is not loaded? – Crowley May 13 '11 at 19:44
@Crowley: I guess that the float definition of \endgraf overrides the original definition with \def, which won't cause an error by itself. However, any macro or package that will try to use \endgraf assuming its original definition will cause unexpected effects and very likely errors. – lockstep May 13 '11 at 22:59
Thanks a lot, another thing to avoid as far as possible. :) – Crowley May 15 '11 at 9:29

Your Answer


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.