Re: ! Use of \@index doesn’t match its definition.

#83956
Up
0
Down
::

egreg9″ post=83178

Sto provando a usare arara. Questa la sequenza dopo le righe magiche:
`% arara: pdflatex
% arara: bibtex
% arara: makeindex
% arara: pdflatex
% arara: pdflatex`

Queste le impostazioni di imakeidx:
`\usepackage{imakeidx}
\makeindex[options=-s classic.ist,intoc,columns=2]`

dove [tt]classic.ist[/tt] è
`headings_flag 1
heading_prefix “\\goodbreak\\textsf{\\scshape\\bfseries\\MakeUppercase{”
heading_suffix “}}\\par\\nobreak\\vskip\\smallskipamount\\nobreak”
symhead_positive “Comandi particolari”
symhead_negative “comandi particolari”
numhead_positive “Numeri”
numhead_negative “numeri”`

Ora, tutto fila liscio fino a che non scrivo una cosa come
`\comando{latex}`

dove [tt]\comando[/tt] è
`\DeclareRobustCommand*{\comando}[1]{\mbox{\lstinline!\\#1!}\index{#1@\texttt{\makebox[0pt][r]{\textbackslash}#1}}}`

Sapete dirmi che succede? Con comandi del tipo:
`\DeclareRobustCommand*{\pacchetto}[1]{{\normalfont\sffamily#1}\index{Pacchetto!#1@\textsf{#1}}}
\DeclareRobustCommand*{\classe}[1]{{\normalfont\sffamily#1}\index{Classe!#1@\textsf{#1}}}`

tutto procede correttamente.

Vi metto un pezzo del .log interessante:
`LaTeX Warning: Hyper reference `tab:risposteerrori' on page 19 undefined on inp
ut line 126.

LaTeX Warning: Reference `tab:risposteerrori' on page 19 undefined on input lin
e 126.

! Use of \@index doesn't match its definition.
\@ifnextchar … \reserved@d =#1\def \reserved@a {
#2}\def \reserved@b {#3}\f…
l.126 …comando (quello giusto è \comando{LaTeX}
e non \lstinline!\latex!:…

? x
pdfTeX warning (dest): name{cite.0@gregorio:ubuntu} has been referenced but doe
s not exist, replaced by a fixed one`

Ciao
Tommaso

Perché mai chiedi ad arara di far andare MakeIndex se usi imakeidx?

E perché non alleghi un esempio minimo?

Ciao
Enrico

Questo è il codice minimo:

`% !TEX encoding = UTF-8 Unicode
% !TEX TS-program = arara
% !TEX spellcheck = it-IT

% arara: pdflatex
%! arara: bibtex
%! arara: pdflatex
%! arara: pdflatex

\documentclass[10pt,a4paper,twoside,openright,titlepage,%
headinclude,footinclude,BCOR5mm,%
numbers=noenddot,cleardoublepage=empty,%
tablecaptionabove,abstracton]{scrreprt}
\usepackage[eulerchapternumbers,subfig,beramono,%
eulermath,pdfspacing,listings,parts]{classicthesis}
\usepackage{arsclassica}
\usepackage{subfig}

\usepackage[OT2,LGRx,T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[latin,greek,german,english,italian]{babel}

\usepackage{imakeidx}
\makeindex[options=-s classic.ist,intoc,columns=2]

%\DeclareRobustCommand*{\comando}[1]{\mbox{\lstinline!\\#1!}\index{Comando!#1@\texttt{\makebox[0pt][r]{\textbackslash}#1}}}
\DeclareRobustCommand*{\comando}[1]{\mbox{\lstinline!\\#1!}\index{Comando!#1@\texttt{\textbackslash #1}}}
\DeclareRobustCommand*{\pacchetto}[1]{{\normalfont\sffamily#1}\index{Pacchetto!#1@\textsf{#1}}}
\DeclareRobustCommand*{\classe}[1]{{\normalfont\sffamily#1}\index{Classe!#1@\textsf{#1}}}
\DeclareRobustCommand*{\ambiente}[1]{{\normalfont\ttfamily#1}\index{Ambiente!#1@\texttt{#1}}}

\begin{document}

\chapter{Primo}

Questa è la classe \classe{book}.

Questo è il pacchetto \pacchetto{imakeidx}.

Questo è l'ambiente \ambiente{quotation}.

Questo è il comando \comando{textsf}.

\phantomsection
\addcontentsline{toc}{chapter}{\tocEntry{\indexname}}
\printindex

\end{document}`

In realtà ho risolto semplicemente usando la definizione di \comando non commentata (quella commentata è l’originale che mi dà errore). Non so se ho fatto bene.

Ciao
Tommaso

Go to top