Re: makeindex e lettere accentate

#59271
franen
Partecipante
    Up
    0
    Down
    ::


    Buongiorno! Sono un po’ arrugginito in fatto di programmazione LaTeX e non riesco a capire come mai ora il codice di Enrico non funziona più. Un emc senza usare il pacchetto songs:
    `\documentclass[10pt]{book}
    \usepackage[T1]{fontenc}
    \usepackage[utf8]{inputenc}
    \usepackage{imakeidx}
    \makeindex

    \makeatletter
    \def\accents@list{\do\IeC\do\`\do\'}
    \def\letters@list{\do\i{i}}
    \newcommand{\noaccentindex}[1]{%
    \begingroup
    \protected@edef\next{#1}%
    \ifnum\pdfstrcmp{\detokenize\expandafter{\next}}{\detokenize{#1}}=\z@
    \endgroup\index{#1}%
    \else
    \def\do##1{\def##1####1{####1}}\accents@list
    \def\do##1##2{\def##1{##2}}\letters@list
    \edef\next{\endgroup\def\noexpand\next{\next}}\next
    \expandafter\index\expandafter{\next @\detokenize{#1}}%
    \fi}
    \makeatother

    \begin{document}
    ciao\noaccentindex{arto}

    rete\noaccentindex{èna}

    remo\noaccentindex{era}
    \printindex
    \end{document}`

    nel file .idx trovo`\indexentry{arto}{1}
    \indexentry{èna}{1}
    \indexentry{era}{1}`

    anziché `\indexentry{arto}{1}
    \indexentry{ena@èna}{1}
    \indexentry{era}{1}`


    @Enrico
    , sai aiutarmi? in questi 10 anni è stato sviluppato qualche altro modo per ovviare al problema delle lettere accentate in makeindex?

    Go to top