Graphics, Figures & Tableslong caption in list of figures and tables

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
gardener_2003
Posts: 2
Joined: Fri Mar 22, 2013 1:02 am

long caption in list of figures and tables

Post by gardener_2003 »

Can anyone help out of this configuring the \listoffigures and \listoftables command

Say if I have a figure with long captions and another figure with short one, they appears as
(1.1 and 1.2 long caption, even longer than text width.
1.3 short caption, correctly displayed.)

[left edge----------------------------------------right edge]
list of figures
1.1 **************************************************************
1.2 **************************************************************
1.3 ******* ..................................................4

What I want is
[left edge----------------------------------------right edge]
1.1 **************************************************************
****************************.....................................1
1.2 **************************************************************
********************************...............................2
1.3 ******* ................................................... 4
Last edited by cgnieder on Fri Mar 22, 2013 12:02 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
Frits
Posts: 169
Joined: Wed Feb 02, 2011 6:02 pm

Re: long caption in list of figures and tables

Post by Frits »

Please provide a minimal working example. I always thought that the line breaking in these lists was done automatically.
howtoTeX.com - Your LaTeX resource site (Tips, Tricks, Templates and more!)
Follow howtoTeX on twitter
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

long caption in list of figures and tables

Post by cgnieder »

Hi gardener_2003,

Welcome to the LaTeX community!
Frits wrote:Please provide a minimal working example. I always thought that the line breaking in these lists was done automatically.
Frits is right: we need to see a Infominimal working example, that is compilable code starting with \documentclass and ending with \end{document} showing the erroneous behavior. The layout of the lists of figures and tables is possibly influenced by the document class you're using, maybe also by packages you've included.

Regards
site moderator & package author
gardener_2003
Posts: 2
Joined: Fri Mar 22, 2013 1:02 am

long caption in list of figures and tables

Post by gardener_2003 »

Code: Select all

\documentclass[11pt,a4paper,twoside]{report}
\usepackage{warwickthesis}  % a thesis package
\usepackage{setspace}       % control line spacing
\usepackage{subfigure}
\usepackage[draft]{graphicx}
\usepackage{textcomp}
\usepackage{amstext}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{gensymb}
\usepackage{wasysym}
\usepackage{comment}
\usepackage{overpic}
\usepackage[colorlinks=true,citecolor=blue]{hyperref}
\usepackage{multirow}
\usepackage{natbib}
\usepackage{url}
\usepackage{aastex_hack}
\usepackage[flushleft]{threeparttable}
\usepackage{pdflscape}
\usepackage[T1]{fontenc}

\bibstyle{aa}
\bibpunct{(}{)}{;}{a}{}{,}

\pagenumbering{roman} %! Begins roman numerals start from page i.
\tableofcontents
\listoffigures
\listoftables
This is what I used to generated the list of figures and tables. The Table of Contents are alright. but the list of tables and figures just go beyond the page limit

In the "warwickthesis.sty" file they are defined alike.

Code: Select all

\renewcommand\listoftables{%
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapter*{\listtablename
      \@mkboth{\uppercase{\listtablename}}{\uppercase{\listtablename}}}%
    \addcontentsline{toc}{chapter}{\listtablename}
    \@starttoc{lot}%
    \if@restonecol\twocolumn\fi
    }
\renewcommand\listoffigures{%
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapter*{\listfigurename
      \@mkboth{\uppercase{\listfigurename}}%
              {\uppercase{\listfigurename}}}%
    \addcontentsline{toc}{chapter}{\listfigurename}
    \@starttoc{lof}%
    \if@restonecol\twocolumn\fi
    }
\renewcommand\tableofcontents{%
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapter*{\contentsname
        \@mkboth{\uppercase{\contentsname}}{\uppercase{\contentsname}}}%
    \@starttoc{toc}%
    \if@restonecol\twocolumn\fi
    }
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

long caption in list of figures and tables

Post by cgnieder »

Unfortunately your example is no Infominimal working example! I quote myself:
cgnieder wrote:[...] compilable code starting with \documentclass and ending with \end{document} showing the erroneous behavior. [...]
If I strip down what you posted and add the necessary commands like \begin{document} I get this:

Code: Select all

\documentclass[11pt,a4paper,twoside]{report}
\usepackage[T1]{fontenc}
\usepackage{warwickthesis}  % a thesis package
% \usepackage{aastex_hack} % does this influence the list? I guess not
% but I can't know since this package is not part of a standard TeX
% distribution

\begin{document}

\listoffigures
\listoftables

\begin{table}
 an example table with a caption
 \caption{the caption of the table}
\end{table}

\begin{figure}
 an example figure with a caption
 \caption{the caption of the figure}
\end{figure}

\end{document}
Can you please extend this to show the behavior? Also, in order to enable us to compile the code you need to either attach warwickthesis.sty to your next post or give us a link where we can download it. I don't know if aastex_hack is important for the example but if it is please also attach aastex_hack.sty.

Regards
site moderator & package author
Post Reply