On 22.09.2008, at 16:51, Fil wrote:

Hi,

Please could you advise if you can set the caption length in LOF in the TOC?? . I'm using lyx 1.5.4.

I'd prefer to use the float figure caption(box) if possible so really I need to know if there is a command to cut off the text in the figure box so after that point the lof does not list it in the toc (but still under the figure) as I have some long descriptions and references listed.

I know \caption [thing to go in tof]{thing to go under figure \cite{book}} works, however I prefer the figure float presentation. Plus I didn't realise this issue earlier and if I change I'll have to
edited 60 or so captions now.

Hi Fil,

The following might help you if you put it in the preamble.

It redefines \caption so that everything until the first period (.) is taken, without the period, as "short caption".

So:

\caption{Man on moon. This picture shows Neil Armstrong, the first man on the moon.}

effectively becomes:

\caption[Man on moon]{Man on moon.\\ This picture shows Neil Armstrong, the first man on the moon.}

Daniel


%*****************************************************************************
%** float captions ***********************************************************
% We redefine \caption to support long figure texts. The captions
% are typesetted with indented label in \sffamily\footnotesize. The first % sentence (everything up to the first period) is considered as the actual % caption (typesetted in boldface and used in the toc). The remaining part,
% if any, is taken as figure text and typesetted below the "caption".
%
% Note that captions now have to end with a period. However, if nothing follows
% the period (no figure text) it does not appear in the output.
%
  \let\oldcaption\caption
  \def\takeshort#1.#2\next{\gdef\short{#1}\def\two{#2\relax}%
\gdef\everything{\if\two\relax {\bfseries #1}\else{\bfseries #1.}\\#2\fi}}
  \def\caption#1{\takeshort#1\next\oldcaption[\short]{\everything}}

Reply via email to