- Questo topic ha 5 risposte, 2 partecipanti ed è stato aggiornato l'ultima volta 17 anni, 7 mesi fa da .
-
Topic
-
Ho un curioso errore con hyperref. Ho ridefinito il comando \section della classe article in modo che funzioni come il \part della classe book. Ho fatto un copia-incolla da book.cls, ed apportato alcune correzioni. L’obbiettivo è ottenere il titolo di sezione al centro di una pagina, con apertura a destra, la scritta ‘Capitolo n’, ecc….`\makeatletter
\renewcommand\tableofcontents{%
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse
\fi
\@starttoc{toc}%
\if@restonecol\twocolumn\fi
}
\renewcommand\section{%
\if@openright
\cleardoublepage
\else
\clearpage
\fi
\thispagestyle{fancy}%
\if@twocolumn
\onecolumn
\@tempswatrue
\else
\@tempswafalse
\fi
\null\vfil\vspace{30mm}
\secdef\@Intermedia\@spart}\def\@Intermedia[#1]#2{%
\ifnum \c@secnumdepth >-2\relax
\refstepcounter{section}%
\addcontentsline{toc}{section}{\thesection\hspace{1em}#1}%
\else
\addcontentsline{toc}{section}{#1}%
\fi
\markboth{}{}%
{\raggedleft
\interlinepenalty \@M
\normalfont
\ifnum \c@secnumdepth >-2\relax
\Huge \bfseries \nobreakspace\thesection
\par
\vskip 20\p@
\fi
\LARGE \bfseries #2\par}%
\@endpart}
\def\@spart#1{%
{\centering
\interlinepenalty \@M
\normalfont
\Huge \bfseries #1\par}%
\@endpart}
\def\@endpart{\vfil\newpage
\if@tempswa
\twocolumn
\fi}
\makeatother`
Il problema è che adesso non funziona hyperref con le accentate, tipo \section{Generalità} mi produce un errore che non ferma la compilazione ma produce un bookmark di istruzioni TeX.Dove sbaglio (a parte che non si dovrebbe fare copia-incolla, se non si ha ben chiaro quello che si fa)?
L’errore è questo:Token not allowed in a PDF string (Unicode),(hyperref) removing `\begingroup’ on input line 261. Token not allowed in a PDF string (Unicode),(hyperref) removing `\begingroup’
Token not allowed in a PDF string (Unicode),(hyperref) removing `\-command’ on input line 261. Token not allowed in a PDF string (Unicode),(hyperref) removing `\-command’
Token not allowed in a PDF string (Unicode),(hyperref) removing `\utf@viii@undeferr’ on input line 261. Token not allowed in a PDF string (Unicode),(hyperref) removing `\utf@viii@undeferr’
Token not allowed in a PDF string (Unicode),(hyperref) removing `\endgroup’ on input line 261. Token not allowed in a PDF string (Unicode),(hyperref) removing `\endgroup’La riga 261 è ‘\section{Generalità}’
- Devi essere connesso per rispondere a questo topic.