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.

As said, I have a problem when I create new float type with float.

My preamble contains

\newfloat{protocol}{tHp}{lop}
\floatname{protocol}{Protocole}
\newfloat{fonction}{tHp}{lop}
\floatname{fonction}{Fonctionnalité}

Now, my document contains some protocols, and some "fonctions". But when I use the \listof command, a strange thing happens.

If I use \listof{fonction}{Liste des fonctionnalités}, it will look like this:

enter image description here

Same thing happens if I use \listof{protocol}{Liste des protocoles}.

I have no idea where to look at to correct that :/

\usepackage{latexsym,amssymb,amsmath,amsfonts,amscd,caption,color,amsthm,complexity,mathtools,float,enumitem,color,lettrine,pdfpages,hyperref,mathspec,framed,tocloft}
share|improve this question
3  
Welcome to TeX.SE. While code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. –  Peter Grill Jun 4 '12 at 3:02
    
@PeterGrill My bad, I'll provide a MWE next time. –  Heinz Fiedler Jun 4 '12 at 14:48
add comment

1 Answer

You have specified lop as the file extension for storing the respective listings for both protocol and fonction. \listof is not smart enough to recognize and ignore entries for the wrong type of table, so you need to specify different file extensions in your \newfloat commands.

share|improve this answer
    
It works like a charm now, thanks! –  Heinz Fiedler Jun 4 '12 at 14:49
    
@znieh: If this answer solved your problem, consider accepting it. This is done separate from up-voting. –  Werner Jun 5 '12 at 6:23
    
Actually, "is not smart enough" is a euphemism. If the intent was not to have mixed files, there would have been no point writing different commands for different float types to the file. Obviously the "other" commands should be ignored including their arguments. The way to do that is have \newfloat define the respective listing command to just discard its arguments, and then have \listof enable just the right command locally (currently it is done globally). About 5 changed lines, and stuff would work as expected without needing a separate file for each float type. –  user9588 Jun 5 '12 at 13:04
add comment

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.