Balaji wrote:
Hi,

I have a LaTeX class called toptesi that has a special latex command \indici
that produces the table of contents, list of figures and list of tables
etc., in a specific format. I want to use this using the Inset features of
LyX. Now I know that you can insert LaTeX commands in LyX, but this is more
for my mother than for me, and so she cannot understand this. I want to
create a layout file that will modify the CommandInset for the TOC to
generate a different code.

This cannot be done without modifying the code. It was a natural idea to try it with InsetLayout, but that only works with collapsable insets, like ERT, footnotes, etc.

The present CommandInset for TOC generates the following:
\begin_inset CommandInset toc
LatexCommand tableofcontents

\end_inset

Instead of producing this, I want LyX to generate the following code:

\begin_inset CommandInset toc
LatexCommand indici

\end_inset

No, this isn't what you want to do. What you want is to change the LaTeX export, not the LyX code. So where LyX generates:
   \tableofcontents{}
you want what? Answer that and your solution will be to put this in the preamble (which you can do in a layout file):
   \let\oldtoc=\tableofcontents
   \def\tableofcontents{NEW CODE}
This trick is used in the beamer layouts.

Richard

Reply via email to