Re: Frontmatter con più capitoli

#62499
Up
0
Down
::


Il problema è che hyperref usa `\thesection` per i suoi riferimenti interni e quindi trova riferimenti uguali. Scrivi questo codice dopo aver caricato hyperref:
`\newcounter{introchapter}
\renewcommand{\theintrochapter}{\alph{introchapter}}

\appto\frontmatter{\let\ORIGINALtheHsection\theHsection
\let\ORIGINALchapter\chapter
\renewcommand{\chapter}{\stepcounter{introchapter}\ORIGINALchapter}
\renewcommand{\theHsection}{\theintrochapter.\arabic{section}}%
\renewcommand{\thesection}{\arabic{section}}%
}
\appto\mainmatter{\let\theHsection\ORIGINALtheHsection
\let\chapter\ORIGINALchapter
\renewcommand{\thesection}{\thechapter.\arabic{section}}%
}`
e carica (prima) il pacchetto etoolbox.

Ora
`\frontmatter
\tableofcontents
\chapter{Primo non numerato}
\section{Abc}

\chapter{Secondo non numerato}
\section{Def}

\mainmatter
\chapter{Primo}
\section{Ghi}`
non ti darà più problemi.

Ciao
Enrico

Go to top