On Fri, 3 Sep 1999, Amir Karger wrote:

> Question for the latex gurus in the audience.
> 
> One popular complaint about lyx 1.0 is that you can't get the equivalent of
> \section[short]{long section title}.
> [...]

Hi Amir,

I posted exactly the same trick some months ago to get short caption
entries in the listofwhatever. It is easily generalized to headings. 

>From [EMAIL PROTECTED] Mon Sep  6 17:56:21 1999
Date: Thu, 15 Apr 1999 10:32:01 +0200 (MESZ)
From: Fred Hucht <[EMAIL PROTECTED]>
To: LyX Development Mailing List <[EMAIL PROTECTED]>
Subject: Re: clip figures script... and some more tricks

Hi,

one alternative is to use TeX to turn clipping on. I use
%------------------------------
\makeatletter
\newcommand{\Clip}[1]{%
  \let\zztmp=\includegraphics%
  \def\includegraphics{\Gin@cliptrue\Gin@i}%
  #1%
  \let\includegraphics=\zztmp%
}
\makeatother
%------------------------------
and then put a '\Clip{' before and a '}' after the tobeclipped
graphics. To clip all graphics use
%------------------------------
\makeatletter
\def\includegraphics{\Gin@cliptrue\Gin@i}
\makeatother
%------------------------------
in the preamble.
Other TeX stuff I use include the handy
%------------------------------
\newcommand{\C}[1]{{}} % Comment
%------------------------------
to comment out whole blocks of LyX text.
Also useful is the combo
%------------------------------
\makeatletter
\newcommand{\CapListEntry}[1]{\def\@CapListEntryFlag{1}\def\@CapListEntryText{#1}}
\def\@CapListEntryFlag{0}
\def\caption#1{\refstepcounter\@captype%
  \ifodd\@CapListEntryFlag%
  \@dblarg{\@caption\@captype}[\@CapListEntryText]{#1}%
  \def\@CapListEntryFlag{0}%
  \else%
  \@dblarg{\@caption\@captype}{#1}%
  \fi}
\makeatother
%------------------------------
to use the optional argument or caption, i.e. allow different text in
the list of figures/tables. CapListEntry can be made a LyX environment
by adding
# ------------------------------
# Caption style definition
Style CapListEntry
  Margin                First_Dynamic
  LatexType             Command
  LatexName             CapListEntry
  NeedProtect           1
  LabelSep              x
  ParSkip               0
  TopSep                0
  Align                 Block
  AlignPossible         Block, Left
  LabelType             Static
  LabelString           Entry:
  Font
    Size                Small
  EndFont
End
# ------------------------------
to ~/.lyx/layouts/stdlayouts.inc.
Then, just put the CapListEntry environment before tha caption
environment and...

have fun,

     Fred

Fred Hucht, Institute of Theoretical Physics, University of Duisburg, Germany
Email: [EMAIL PROTECTED]               http://www.thp.Uni-Duisburg.DE/
"Der Koerper der algebraischen Zahlen ist kein algebraischer Zahlkoerper"
(E. Landau, Zahlentheorie (1927), Satz 718)

Reply via email to