简体   繁体   中英

Creating a space between figure number and label in latex table of figures

Hi I have a problem with the table of figures in latex. As the figure below shows, the figure number is quite long and bleeding over the figure label. Any ideas on how I can address this?

在此处输入图片说明

You can use tocloft to define the spacing between the figure number and figure caption within the LoF. The length that controls this distance is \\cftfignumwidth . Here's a quick example:

在此处输入图片说明

\documentclass{article}

\usepackage{tocloft}

\setlength{\cftfignumwidth}{3em}

\begin{document}

\listoffigures

\begin{figure}
  \caption[short caption text]{Long caption text}
\end{figure}

\end{document}

The above suggestion provides a consistent adjustment that can be changed as needed.

Reference:

A workaround: Use horizontal space in the short caption argument of your figure environment

\caption[\hspace{0.5cm} short caption text]{Long caption text}

This is of course not a too nice solution, though. If you want to avoid it, you would have to fudge the code in your document class, I believe.

If you get an error like:

! LaTeX Error: Command \c@lofdepth already defined.
               Or name \end... illegal, see p.192 of the manual.

Try using tocloft from the subfigure package:

\usepackage{subfigure}
\usepackage[subfigure]{tocloft}

\setlength{\cftfignumwidth}{4em}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM