Tx · LaTeX & TikZ

How to Add a Short Figure Caption to LyX’s List of Figures

Published By the 9to5Science editorial team

At a glance

  1. 1. Open caption settings

    In LyX, right-click the figure’s caption inset and open its settings.

  2. 2. Enter a short title

    Fill in the Short Title or Short Caption field with the text for the List of Figures.

  3. 3. Keep the full caption

    Leave the complete explanatory caption in the document body.

  4. 4. Recompile and check

    Recompile the document and check the List of Figures; rerun if it has not updated.

A figure caption can be too long to work well as an entry in the List of Figures. In LyX, give the caption a short title: it appears in the list, while the full caption remains under the figure.

LaTeX provides this feature through an optional argument to \caption. LyX’s caption settings let you enter that shorter text without having to type the LaTeX command yourself.

Set the short caption in LyX

  1. Make sure the image is inside a Figure float. In LyX, floats are commonly inserted from the Insert menu under Float.
  2. Insert a caption if the figure does not already have one. The caption is a distinct inset, usually marked by a caption label in the LyX editing window.
  3. Right-click the caption inset and open Settings. Look for a field named Short Title, Short Caption, or similar; the exact wording can differ between LyX versions.
  4. Enter the concise wording you want in the List of Figures. Keep the complete description in the caption itself, and apply the settings.
  5. Recompile the document and inspect the List of Figures. If the entry still shows the old text, compile again so LaTeX can refresh its auxiliary list file.

For example, the caption beneath a figure might read “A comparison of measured and predicted temperatures over the full 24-hour experiment.” The short title could be “Measured and predicted temperatures.” The short version is for the list; the full version stays with the figure.

What LaTeX does underneath

A short caption is written in LaTeX as an optional argument before the full caption:

\caption[Short list entry]{Full caption printed below the figure}

LyX generates the equivalent LaTeX when you set the short title in the caption settings. This is preferable to editing generated LaTeX directly, because direct edits can be overwritten the next time LyX exports or compiles the document.

Here is a minimal compilable LaTeX example showing the same behavior. It uses a framed placeholder instead of an external image file:

\documentclass{article}

\begin{document}

\listoffigures

\begin{figure}[ht]
  \centering
  \fbox{\rule{0pt}{25mm}\rule{45mm}{0pt}}
  \caption[Measured and predicted temperatures]
    {A comparison of measured and predicted temperatures over the full 24-hour experiment.}
  \label{fig:temperatures}
\end{figure}

\end{document}

The optional text in square brackets supplies the List of Figures entry. The text in braces is the full caption printed below the figure. The \label comes after \caption so references to the figure receive its number. The placeholder box is only there to make the example self-contained; replace it with your image when adapting the code.

If you cannot find the short-title field

LyX’s interface can vary by release and document setup. First confirm that you opened the settings for the caption inset, not the settings for the image or the enclosing figure float. Also check the caption inset’s context menu for a short-title option.

If your version does not offer a field, inspect the LaTeX generated by LyX to confirm the caption is being produced as expected. Avoid inserting \caption as raw LaTeX inside a caption that LyX already generates: that can produce duplicate captions or errors. As a last resort, a LaTeX inset can be used to write the entire caption command, but then LyX may not treat it as a normal caption when editing or managing the document.

Common mistakes

  • Changing the full caption instead of setting a short title. That changes the text under the figure as well as the list entry. Use the separate short-title field when you want both versions.
  • Putting the caption outside a figure float. Standard figure captions belong inside a figure float. If you need a caption for an image outside a float, the solution depends on the document class and packages in use.
  • Expecting the list to update immediately. LaTeX writes list entries to an auxiliary file. Recompile, and compile again if necessary, before judging whether the change worked.
  • Making the short entry too long. A short title is most useful when it identifies the figure at a glance; leave detailed methods, conditions, and explanations in the full caption.

References

  1. The LaTeX2e unofficial reference manual: \caption
  2. LyX User Guide

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.