# How can I get my figure list to only show the first sentence/title of my figure caption?

I have figure captions like this:

\documentclass{book}
\usepackage{graphicx}

\begin{document}

\listoffigures

\begin{figure}
\centering
\includegraphics[width=12cm]{example-image-a}
\caption{Vacuum electrostatic surface potential of bovine lactoferrin (1BLF). The circled blue area corresponds to the N1 subdomain and contains the antimicrobial peptide precursors for lactoferricin and lactoferrampin. Vacuum electrostatic surface potential was generated in PyMOL.}
\label{fig:Lf_electrostatic}
\end{figure}

\end{document}


But in my list of figures at the start of my thesis, they render like so:

I would like the list of figures to only show "Vacuum electrostatic surface potential of bovine lactoferrin (1BLF). Should I separate this into a different markup tag? Or how can I go about doing this so it doesn't write out the whole caption?

• Try \caption[Vacuum electrostatic surface potential of bovine lactoferrin (1BLF)]{...} Oct 22 at 2:11
• Cool, that works for the list but it seems to remove the title from the figure itself. Any way to keep it in the figure? Oct 22 at 2:18
• For future questions, please always provide a full MWE starting with \documentclass{...} and loading all necessary packages. Oct 22 at 2:18
• What do you mean with "it removes it from the figure itself". See my example below. The title is still in the figure. Oct 22 at 2:19
• Yes -- Thank you. I didn't realize I had to do [Title]{Title. Caption}. I just did [Title]{Caption}. Cheers Oct 22 at 2:23

Note you need to compile twice.

\documentclass{book}
\usepackage{graphicx}

\begin{document}

\listoffigures

\begin{figure}
\centering
\includegraphics[width=12cm]{example-image-a}
\caption[Vacuum electrostatic surface potential of bovine lactoferrin (1BLF)]{Vacuum electrostatic surface potential of bovine lactoferrin (1BLF). The circled blue area corresponds to the N1 subdomain and contains the antimicrobial peptide precursors for lactoferricin and lactoferrampin. Vacuum electrostatic surface potential was generated in PyMOL.}
\label{fig:Lf_electrostatic}
\end{figure}

\end{document}


• Interesting! Not very DRY-friendly :-) but it should work. Thanks so much Oct 22 at 2:18

You could choose to stick the graph's legend below the graph itself and keep the caption text short and snappy. A beneficial side-effect will be that you won't have to fiddle with the optional argument of \caption.

\documentclass{book}
\usepackage{graphicx}
\hyphenation{anti-microb-ial}
\begin{document}

\listoffigures

\chapter{Uno}

\begin{figure}[ht!]

\includegraphics[width=\textwidth]{example-image-a}

The circled blue area corresponds to the N1 subdomain and contains
the antimicrobial peptide precursors for lactoferricin and lactoferrampin.
Vacuum electrostatic surface potential was generated in PyMOL.

\caption{Vacuum electrostatic surface potential of bovine lactoferrin (1BLF). }
\label{fig:Lf_electrostatic}

\end{figure}

\end{document}


Just for fun:

\documentclass{book}
\usepackage{graphicx}

\newcommand{\savenumberline}{}% reserve global name

\makeatletter
\renewcommand*\l@figure[2]% #1 = title with \numberline, #2 = page number
{\bgroup% use local registers
\setbox0=\vbox{\setlength{\hsize}{\dimexpr \textwidth-\@pnumwidth-3.8em}%
\def\numberline##1{\xdef\savenumberline{##1}}%
#1}%
\ifdim\ht0>\baselineskip
\setbox1=\vsplit0 to \ht\strutbox
\setbox2=\vbox{\unvbox1}% restore original height
\@dottedtocline{1}{1.5em}{2.3em}{\numberline{\savenumberline}\box2}{#2}%
\else
\@dottedtocline{1}{1.5em}{2.3em}{#1}{#2}% default
\fi
\egroup}
\makeatother

\begin{document}

\listoffigures

\begin{figure}
\centering
\includegraphics[width=12cm]{example-image-a}
\caption{Vacuum electrostatic surface potential of bovine lactoferrin (1BLF). The circled blue area corresponds to the N1 subdomain and contains the antimicrobial peptide precursors for lactoferricin and lactoferrampin. Vacuum electrostatic surface potential was generated in PyMOL.}
\label{fig:Lf_electrostatic}
\end{figure}

\end{document}