## LaTeX forum ⇒ Graphics, Figures & Tables ⇒ Errors with LOF and LOT in report class Topic is solved

Information and discussion about graphics, figures & tables in LaTeX documents.
didierc
Posts: 5
Joined: Sun Aug 03, 2014 3:21 pm

### Errors with LOF and LOT in report class

Hi,

I'm currently writing a report where I need to add lists of tables and figures.
I'm using the report document class and \listoffigures and \listoftables commands.

But, when I'm compiling the tex sources (I'm using TexLive distribution on Mac OSX with the MacTex package and Texlipse as IDE), I get 3 errors for every figures and tables:

Multiple markers at this line
- Illegal unit of measure (pt inserted). ...xxx}}{5}{figure.caption.5} (followed by: )
- Missing = inserted for \ifnum. ...xxx}}{5}{figure.caption.5} (followed by: )
- Missing number, treated as zero. ...xxx}}{5}{figure.caption.5} (followed by: )

And, in the PDF file, each table entry from the lot (idem for figures and lof) are preceded by ">" character and a lineskip :

>
I.3 XXX . . . . . . . . . . . . . . . . . . . . . . . . . . 20

Could you pls help me solving this problem?

Thanks in advance. Cheers, DC

Stefan Kottwitz
Posts: 9281
Joined: Mon Mar 10, 2008 9:44 pm
Hi DC,

welcome to the forum!

Could you please post some sample code? The best would be a small example which brings that error. Or at least your document preamble with used packages and settings.

It looks like a problem with the hyperref, because hyperref changes the way in which list of figures and tables entries are written. Like if you added or removed hyperref, and from that point on the previously written list of figures and table files (.lof and .lot) won't work anymore. So, another try could be to remove .lot and .lof file and to recompile, which would regenerate the files with current settings.

Stefan

didierc
Posts: 5
Joined: Sun Aug 03, 2014 3:21 pm
Hi,
I indeed use the hyperref package but disabling this package does not have any effect (even after deleting the .lof and .lot files).

As requested, here is my tex main file.


The myenv package is one package I created with my settings for all my documents. It contains :


Do I have some incompatible packages that implies that issue ?

Many thanks in advance.

Cheers, DC

Johannes_B
Site Moderator
Posts: 3952
Joined: Thu Nov 01, 2012 4:08 pm
I couldn't quite reproduce you problem. A more minimal example would have been nice.

Please test the following and check if it works for you.
\documentclass{report}\usepackage{hyperref}%\hypersetup{pageanchor=false}\begin{document}test\pdfbookmark{\contentsname}{toc}\tableofcontents\pagenumbering{arabic}\section{Hi}\begin{figure}	\caption{Hallo hallo}\end{figure}\listoffigures\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

didierc
Posts: 5
Joined: Sun Aug 03, 2014 3:21 pm
Hello,
The example provided by you works perfectly.

Here's a list of all packages used in my document...
May the tocloft have some effects on the list of figures ?

\usepackage[latin1]{inputenc}\usepackage[T1]{fontenc}\usepackage[french]{babel}\usepackage[top=30mm,bottom=25mm,right=25mm,left=25mm,a4paper]{geometry}\usepackage{textcomp}\usepackage{multicol}\usepackage{setspace}\usepackage{chapterbib}\usepackage{pdflscape}\usepackage{envmath}\usepackage{amsmath}\usepackage{amssymb}\usepackage[inline]{enumitem}\usepackage{cases}\usepackage{subcaption}\usepackage{stfloats}\usepackage{diagbox}\usepackage[none]{hyphenat}\usepackage[pdftex,hidelinks,bookmarksdepth=4]{hyperref}\usepackage[subfigure]{tocloft}\usepackage{color, colortbl}\usepackage[dvipsnames,svgnames]{xcolor}\usepackage{eqnarray}\usepackage{tabularx}\usepackage{multirow}\usepackage[nohints]{minitoc}\usepackage{floatrow}\usepackage{fmtcount}\usepackage[round,authoryear]{natbib}\usepackage{nextpage}

Cheers, DC

Johannes_B
Site Moderator
Posts: 3952
Joined: Thu Nov 01, 2012 4:08 pm
Just inserting your code does make the caption in the LOF dissappear. It all boils down to package floatrow. Do you need it?

Still, i didn't see what you describe.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

didierc
Posts: 5
Joined: Sun Aug 03, 2014 3:21 pm
Hello,

Thanks for your suggestion.
I removed the floatrow package as I don't need it anymore. But it didn't have any effect.

I also disabled the tocloft package and all customizations for both sections and chapters and it seems to solve the problem.


I still have just one tiny problem : as I have a huge amount of figures (figures are numbered using the III-10 format where III is the chapter number and 10 the figure number), the number sometimes overlaps the figure caption in the list of figures.

How can I increase the space allowed for the figure number in the LOF ?

Johannes_B
Site Moderator
Posts: 3952
Joined: Thu Nov 01, 2012 4:08 pm
You can achieve that using package tocstyle from the KOMA-bundle. All the other stuff in the minimal example is just to simulate what you described. I did need to patch the report class in order to get the result, because i don't know how you did it. Please note, that this needs multiple LaTeX runs to completely adjust.

You will get a huge warning in your log-file cause package tocstyle is in an alpha state. I didn't hear anything wrong with it by now, so it should be safe to use.

have you ever considered to use a KOMA-class like scrreprt? In case you aren't 95 % finished it might be worth a look.

\documentclass{report}\usepackage[tocindentauto]{tocstyle}%JB <- this is what you need\usepackage{capt-of}\input{multido}\usepackage{etoolbox}\patchcmd{\thefigure}{\thechapter.}{\Roman{chapter}-}{}{}\begin{document}\listoffigures\chapter{test}\chapter{test}\chapter{test}\multido{\i=1+1}{120}{	\captionof{figure}{Caption \i}}\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

didierc
Posts: 5
Joined: Sun Aug 03, 2014 3:21 pm
OK thanks.

After googling my request I did the trick using the following commands in the preamble.


Thank you anyway for your answers which helped me solving my problem.
Best, DC