Search code examples
rpdflatexquarto

Figure short caption in LOF in Quarto


What is the Quarto way to write an alternative caption for the LOF?

Tex code would be like:

\begin{figure}[hbtp]
  \centering
  \includegraphics{img/some_image.png}
  \caption[Short caption for LOF.]{A long and descriptive caption to be shown below figure. Source: somebody}
  \label{fig:figure-1}
\end{figure}

EDIT: STEPS TO REPRODUCE

  1. new Quarto file
  2. a picture in /img/some_image.png

CONTENTS OF QUARTO FILE

---
title: "Untitled"
format: pdf
lof: true
---

\begin{figure}[hbtp]
  \centering
  \includegraphics{img/some_image.png}
  \caption[Short caption for LOF.]{A long and descriptive caption to be shown below figure. Source: somebody}
  \label{fig:figure-1}
\end{figure}

RESULTS

LOF

Image with caption

WHAT DO I WANT INSTEAD

A "Quarto way", like:

![A long and descriptive caption to be shown below figure. Source: somebody.][Short caption for LOF.](img/some_image.png)

Solution

  • Use fig-scap option to get a short caption in the "List of Figures". From the Quarto docs,

    fig-scap => A short caption (only used in LaTeX output). A short caption is inserted in \caption[], and usually displayed in the “List of Figures” of a PDF document.

    ---
    title: Demo Short Figure Caption
    format: pdf
    lof: true
    ---
    
    ## Quarto
    
    ![A long and descriptive caption.](test-scap.png){#fig-short-cap fig-scap="Short caption for LOF." width=30%}
    

    short caption for figures in quarto