Make a short form of the caption via \caption[short form]{long form}
. The short form will be printed in the LoF, and shall not contain the \gls
.
To keep the glossaries machinery (links) for the glossary entry intact, use the short form as follows:
\caption[Short form: \protect\glsunset{wysiwyg}\gls{wysiwyg}\protect\glsreset{wysiwyg}]%
{Long form: \gls{wysiwyg}}
The \glsunset
prevents that wysiwyg
becomes a first use glossary entry at this point, the \glsreset
sets the usage counter back, so that any following use of wysiwyg
will be a first use, as far as glossaries
is concerned. This way, the LoF entry will have a hyperlink to the glossary (in addition to being a hyperlink to the figure), the LoF is in the location list of the glossary entry, and you get the formatting of the glossary entry in the LoF as desired.
Somewhat simpler is
\caption[Short form: \glshyperlink{wysiwyg}]{Long form: \gls{wysiwyg}}
This will print the name of the glossary entry in the LoF, hyperlinked to the glossary. You lose the formatting that \gls
applies, and the LoF won't be in the location list of the glossary entry.
Still simpler is
\caption[Short form: \glsentryname{wysiwyg}]{Long form: \gls{wysiwyg}}
This is like the above version, but the LoF line will now link only to the figure, not to the glossary anymore. This form probably suffices for most use cases. It's just that I like that I can link from a glossary term in the LoF to the glossary, and also applying styles to the appearance of glossary entries via \glsdisplay(first)
, which is why I prefer the first form.
This might do the trick
\setlength{\cftfignumwidth}{\dimexpr\mylenf+2em}
\setlength{\cfttabnumwidth}{\dimexpr\mylenf+2em}
\renewcommand\cftfigaftersnum{\enspace--\enspace}
\renewcommand\cfttabaftersnum{\enspace--\enspace}
Since Table
is shorter than Figure
is does not quite line up. The main problem here is that the material (the number and the title) is handed over to the typesetting macro as a single construction. Similar to
\numberline{number}Title
Where the \numberline
is giving the box of a certain width.
Best Answer
The
\caption
has two arguments - one optional and the other mandatory. The contents of optional argument (which is enclosed within[]
) is used for the list of figures (if given). If you want to put custom (short) description in the list of figures, use it in the optional argument like:A sample code: