0

Suppose I have this figure which contains some diagram, and a caption saying: "Frobnication of the bar". But when you read that caption, I also want to tell you "The baz areas indicate quux".

What I do now is:

\begin{figure}
  \centering
  \includegraphics{some_file}
  \caption{Frobnication of the bar (baz areas indicate quux)}
  \label{fig:frobnication-of-bar}
\end{figure}

and this is fine by me as far as typesetting of the figure itself. However, in principle, it's not fine, as that comment is not exactly part of the caption in the same way the first phrase is. And indeed, if I have a list of figures, I see:

1.3 Frobnication of the bar (baz areas indicate quux) ... 9

which doesn't look right. That is, in the list I only want to see the first phrase, since the comment doesn't make sense unless you're looking at the figure.

Also, sometimes the comment is a couple of lines long, which is way to much for the caption as rendered under/above the figure.

My question: What's a better idiom for expressing my "caption-ish comment"?

  • 2
    Would \caption[Frobnication of the bar]{Frobnication of the bar (baz areas indicate quux)} do? – gusbrs Feb 25 '18 at 19:18
  • A figure environment takes anything. Just write your text under the caption. – Johannes_B Feb 26 '18 at 1:31
4

The \caption optional argument allows you to specify the list entry, as distinct from the caption itself.

So \caption[Frobnication of the bar]{Frobnication of the bar (baz areas indicate quux)} should do the job.

A full MWE:

\documentclass{article}

\usepackage{mwe}

\begin{document}
\listoffigures

\begin{figure}
  \centering
  \includegraphics{example-image}
  \caption[Frobnication of the bar]{Frobnication of the bar (baz areas indicate quux)}
  \label{fig:frobnication-of-bar}
\end{figure}
\end{document}

enter image description here

Update, given comment: This is sort of what I use for longer comments on floats, which essentially is to create a dedicated list environment and put it along with the float. I use here enumitem for that, but you can do it otherwise of course. I'm not sure this is what you mean, but perhaps it goes in the right direction.

\documentclass{article}

\usepackage{mwe}
\usepackage{enumitem}

\newlist{floatnotes}{description}{1}
\setlist[floatnotes]{wide,nosep,leftmargin=.05\linewidth,itemindent=\labelsep,rightmargin=\leftmargin,before=\vspace{.5em}\footnotesize}

\begin{document}
\listoffigures

\begin{figure}
  \centering
  \includegraphics{example-image}
  \caption[Frobnication of the bar]{Frobnication of the bar (baz areas indicate quux)}
  \label{fig:frobnication-of-bar}
\begin{floatnotes}
  \item[Sources:] These are my sources.
  \item[Notes:] These are indeed longer notes containing, perhaps, some comments on methods, caveats concerning what is shown in the figure, and so on and so forth.
\end{floatnotes}
\end{figure}
\end{document}

enter image description here

  • Though, if this is really what you are looking for, this is probably to be considered a duplicate. See, e.g. tex.stackexchange.com/q/11579/105447 , tex.stackexchange.com/q/83392/105447 . – gusbrs Feb 25 '18 at 19:51
  • So, this resolves the LoF part of the problem; but not so much the "long comment" part. So +1. – einpoklum Feb 25 '18 at 20:31
  • That's pretty nice. If nobody suggests something else in a couple of days I guess I'll accept. – einpoklum Feb 25 '18 at 21:38
  • That's probably not the only way to do it. But I'd say it's a pretty standard one. I like it. – gusbrs Feb 25 '18 at 21:40
0

Here are two solutions, based on the copyrightbox package, and either the measuredfigure environment, from threeparttable, which has to be inserted in a center environment (so it does not float), or the ffigbox command from floatrow, which is inserted in a figure environment. It can take an optional argument – the caption width, for which I took a multiple of the natural floatbox width (\FBwidth):

\documentclass{article}
\usepackage{threeparttable, floatrow}
\usepackage{copyrightbox}

\makeatletter
\renewcommand{\CRB@setcopyrightfont}{%
\footnotesize
\rmfamily
}
\begin{document}

\listoffigures
\vskip 1cm

\begin{center}
 \begin{measuredfigure}
\copyrightbox[b]{\includegraphics[scale = 0.5]{AliceSteadman}}{Lalala Lalala Lalala Lalala Lalala Lalala Lalala Lalala}
  \caption[Frobnication of the bar]{Frobnication of the bar (baz areas indicate quux)}
  \label{fig:frobnication-of-bar}
\end{measuredfigure}
\end{center}

\begin{figure}[!htb]
 \centering
  \ffigbox[1.2\FBwidth]{\caption[Frobnication of the bars]{Frobnication of the bar (baz areas indicate quux)} \label{fig:frobnication-of-bar1}}
{\copyrightbox[b]{\includegraphics[scale = 0.5]{AliceSteadman}}{Lalala Lalala Lalala Lalala Lalala Lalala Lalala Lalala}}
\end{figure}

\end{document} 

enter image description here enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.