- Questo topic ha 2 risposte, 2 partecipanti ed è stato aggiornato l'ultima volta 21 anni fa da .
-
Topic
-
Salve a tutti.
Sto cercando di ottenere una table of contents personalizzata, sulla falsariga dell’esempio riportato a pag. 36 del `LaTeX Companion’
Per vedere come funziona, ho utilizzato esattamente l’esempio del testo e cioè:\newcommand{listofexamples}{\@starttoc{xmp}}
\newcommand{\ecaption}[1]{\addcontentsline{xmp}{example}{#1}}
\newcommand{\l@example}[2]{\par\noindent#1 {\itshape #2}}Il problema è che durante la compilazione il mio LaTeX (versione 2001/06/01 in SuSE Linux 8.2) sembra non gradire affatto la presenza del carattere `@’ all’interno dei comandi, come si può vedere dall’estratto del log che ho riportato sotto. Se ho ben capito (ma ne dubito..) , per il comando \@starttoc{xmp} il programma è convinto che io abbia voluto passare al modo matematico e che poi mi sia dimenticato di chiuderlo, mentre per \l@example legge il comando solo prima del `@’, dicendomi infatti che il comando \l è già stato definito.
Vi sto chiedendo una banalità allucinante (nel qual caso chiedo umilmente scusa) oppure c’è effettivamente qualcosa che non va?
Vi ringrazio anticipatamente.
Questa è la parte di log che riguarda \l@example
! LaTeX Error: Command \l already defined.
Or name \end… illegal, see p.192 of the manual.See the LaTeX manual or LaTeX Companion for explanation.
Type Hfor immediate help.
…l.24 …example}[2]{\par\noindent#1 {\itshape #2}}
Your command was ignored.
Type Ito replace it with another command,
orto continue without it. ! Missing number, treated as zero.
e
l.24 …example}[2]{\par\noindent#1 {\itshape #2}}A number should have been here; I inserted `0′.
(If you can’t figure out why I needed to see a number,
look up `weird error’ in the index to The TeXbook.)! You already have nine parameters.
\reserved@a …def \expandafter \l \reserved@b #10
e{
l.24 …example}[2]{\par\noindent#1 {\itshape #2}}I’m going to ignore the # sign you just used.
! You can’t use `macro parameter character #’ in horizontal mode.
## l.24 …example}[2]{\par\noindent#1 {\itshape #2}}
Sorry, but I’m not programmed to handle this case;
I’ll just pretend that you didn’t ask for it.
If you’re in the wrong mode, you might be able to
return to the right one by typing `I}’ or `I$’ or `I\par’.! You can’t use `macro parameter character #’ in horizontal mode.
\par \noindent ##1 {\itshape ##
2}
l.24 …example}[2]{\par\noindent#1 {\itshape #2}}Sorry, but I’m not programmed to handle this case;
I’ll just pretend that you didn’t ask for it.
If you’re in the wrong mode, you might be able to
return to the right one by typing `I}’ or `I$’ or `I\par’.Questa è la parte di log che riguarda \@strttoc{xmp}
! You can’t use `\spacefactor’ in vertical mode.
\@->\spacefactor
\@m
l.396 \listofexamplesSorry, but I’m not programmed to handle this case;
I’ll just pretend that you didn’t ask for it.
If you’re in the wrong mode, you might be able to
return to the right one by typing `I}’ or `I$’ or `I\par’.! Missing $ inserted.
$
l.396 \listofexamplesI’ve inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.! Missing $ inserted.
$
l.397 \listoffiguresI’ve inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.
- Devi essere connesso per rispondere a questo topic.