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.

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.

Edit:

Code:

\documentclass[a4paper%,draft%
    ,12pt]{report}
\usepackage[cp1250]{inputenc}
\usepackage[english,czech]{babel}
\usepackage{float}
\usepackage[usenames,dvipsnames]{color}

\newcommand{\dd}{\ensuremath{\mathrm{d}}}

%== Graf environment definition==

\newfloat{graf}{tbp}{lop}[chapter]
\floatname{graf}{Graf}
\newcommand{\listofgraphs}{\listof{graf}{List of Graf}}

\begin{document}

Lorem ipsum dolor sit amet.

\end{document}
share|improve this question
2  
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

2 Answers 2

up vote 2 down vote accepted

Ok...

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

\newfloat{foo}{tbp}{lop}[chapter]

No error was throwed.

Axel:

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
1  
@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

 
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.