Re: hyperref and redefining \@chapter



On Oct 21, 1:30 am, Heiko Oberdiek <oberd...@xxxxxxxxxxxxxxx> wrote:


A complete, but minimal example would be more useful.
Also update hyperref, your version is quite old, current version
is 2008-09-29 6.78l.

This induces the error, even with a new hyperref (from TeX Live '08).
My suspicion is that the \MakeUpperCase is the source of the problem,
after playing around a little bit, but I'm not sure how to fix it.

^L

\documentclass{report}
\usepackage[backref]{hyperref}

\makeatletter
\newcommand{\toc@section}{Chapter}
\def\@chapter[#1]#2{
\ifnum \c@secnumdepth >\m@ne
\refstepcounter{chapter}%
\typeout{\@chapapp\space\thechapter.}%
\addcontentsline{toc}{\toc@section}
{\protect\numberline{\thechapter.}
\MakeUppercase{#1}}%
\else
\addcontentsline{toc}{\toc@section}{\MakeUppercase{#1}}%
\fi
\chaptermark{#1}%
\if@twocolumn
\@topnewpage[\@makechapterhead{#2}]%
\else
\@makechapterhead{#2}%
\@afterheading
\fi
\stepcounter{count@\toc@section}
}
\makeatother

\begin{document}

\begin{abstract}
xyz
\end{abstract}

\chapter{One}
zzz

\chapter{Two}
zzz

\end{document}


This is pdfTeXk, Version 3.1415926-1.40.9 (Web2C 7.5.7)
(format=pdflatex 2008.8.22) 21 OCT 2008 10:10
entering extended mode
%&-line parsing enabled.
**ex.tex
(./ex.tex
LaTeX2e <2005/12/01>
Babel <v3.8l> and hyphenation patterns for english, usenglishmax,
dumylang, noh
yphenation, german-x-2008-06-18, ngerman-x-2008-06-18, ancientgreek,
ibycus, ar
abic, basque, bulgarian, catalan, pinyin, coptic, croatian, czech,
danish, dutc
h, esperanto, estonian, farsi, finnish, french, galician, german,
ngerman, mono
greek, greek, hungarian, icelandic, indonesian, interlingua, irish,
italian, la
tin, mongolian, mongolian2a, bokmal, nynorsk, polish, portuguese,
romanian, rus
sian, sanskrit, serbian, slovak, slovenian, spanish, swedish, turkish,
ukenglis
h, ukrainian, uppersorbian, welsh, loaded.
(/usr/local/texlive/2008/texmf-dist/tex/latex/base/report.cls
Document Class: report 2005/09/16 v1.4f Standard LaTeX document class
(/usr/local/texlive/2008/texmf-dist/tex/latex/base/size10.clo
File: size10.clo 2005/09/16 v1.4f Standard LaTeX file (size option)
)
\c@part=\count79
\c@chapter=\count80
\c@section=\count81
\c@subsection=\count82
\c@subsubsection=\count83
\c@paragraph=\count84
\c@subparagraph=\count85
\c@figure=\count86
\c@table=\count87
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
(/usr/local/texlive/2008/texmf-dist/tex/latex/hyperref/hyperref.sty
Package: hyperref 2008/08/14 v6.78f Hypertext links for LaTeX

(/usr/local/texlive/2008/texmf-dist/tex/latex/graphics/keyval.sty
Package: keyval 1999/03/16 v1.13 key=value parser (DPC)
\KV@toks@=\toks14
)
(/usr/local/texlive/2008/texmf-dist/tex/generic/oberdiek/ifpdf.sty
Package: ifpdf 2007/12/12 v1.6 Provides the ifpdf switch (HO)
Package ifpdf Info: pdfTeX in pdf mode detected.
)
(/usr/local/texlive/2008/texmf-dist/tex/generic/oberdiek/ifvtex.sty
Package: ifvtex 2007/09/09 v1.3 Switches for detecting VTeX and its
modes (HO)
Package ifvtex Info: VTeX not detected.
)
(/usr/local/texlive/2008/texmf-dist/tex/generic/ifxetex/ifxetex.sty
Package: ifxetex 2006/08/21 v0.3 Provides ifxetex conditional
)
(/usr/local/texlive/2008/texmf-dist/tex/latex/oberdiek/hycolor.sty
Package: hycolor 2008/08/01 v1.3 Code for color options of hyperref/
bookmark (H
O)

(/usr/local/texlive/2008/texmf-dist/tex/latex/oberdiek/xcolor-
patch.sty
Package: xcolor-patch 2008/08/01 xcolor patch
))
\@linkdim=\dimen103
\Hy@linkcounter=\count88
\Hy@pagecounter=\count89

(/usr/local/texlive/2008/texmf-dist/tex/latex/hyperref/pd1enc.def
File: pd1enc.def 2008/08/14 v6.78f Hyperref: PDFDocEncoding definition
(HO)
)
(/usr/local/texlive/2008/texmf-dist/tex/generic/oberdiek/etexcmds.sty
Package: etexcmds 2007/12/12 v1.2 Prefix for e-TeX command names (HO)

(/usr/local/texlive/2008/texmf-dist/tex/generic/oberdiek/infwarerr.sty
Package: infwarerr 2007/09/09 v1.2 Providing info/warning/message (HO)
)
Package etexcmds Info: Could not find \expanded.
(etexcmds) That can mean that you are not using pdfTeX
1.50 or
(etexcmds) that some package has redefined \expanded.
(etexcmds) In the latter case, load this package earlier.
)
(/usr/local/texlive/2008/texmf/tex/latex/config/hyperref.cfg
File: hyperref.cfg 2002/06/06 v1.2 hyperref configuration of TeXLive
)
(/usr/local/texlive/2008/texmf-dist/tex/latex/oberdiek/kvoptions.sty
Package: kvoptions 2007/10/18 v3.0 Keyval support for LaTeX options
(HO)
)
Package hyperref Info: Hyper figures OFF on input line 2876.
Package hyperref Info: Link nesting OFF on input line 2881.
Package hyperref Info: Hyper index ON on input line 2884.
Package hyperref Info: Plain pages OFF on input line 2891.
Package hyperref Info: Backreferencing ON on input line 2894.

Implicit mode ON; LaTeX internals redefined
Package hyperref Info: Bookmarks ON on input line 3086.
(/usr/local/texlive/2008/texmf-dist/tex/latex/hyperref/backref.sty
Package: backref 2006/09/05 v1.28 Bibliographical back referencing
)
(/usr/local/texlive/2008/texmf-dist/tex/latex/ltxmisc/url.sty
\Urlmuskip=\muskip10
Package: url 2006/04/12 ver 3.3 Verb mode for urls, etc.
)
LaTeX Info: Redefining \url on input line 3272.

(/usr/local/texlive/2008/texmf-dist/tex/generic/oberdiek/bitset.sty
Package: bitset 2007/09/28 v1.0 Data type bit set (HO)

(/usr/local/texlive/2008/texmf-dist/tex/generic/oberdiek/intcalc.sty
Package: intcalc 2007/09/27 v1.1 Expandable integer calculations (HO)
)
(/usr/local/texlive/2008/texmf-dist/tex/generic/oberdiek/
bigintcalc.sty
Package: bigintcalc 2007/11/11 v1.1 Expandable big integer
calculations (HO)

(/usr/local/texlive/2008/texmf-dist/tex/generic/oberdiek/
pdftexcmds.sty
Package: pdftexcmds 2007/12/12 v0.3 LuaTeX support for pdfTeX utility
functions
(HO)
Package pdftexcmds Info: LuaTeX not detected on input line 139.
)))
(/usr/local/texlive/2008/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty
Package: kvsetkeys 2007/09/29 v1.3 Key value parser with default
handler suppor
t (HO)
)
\Fld@menulength=\count90
\Field@Width=\dimen104
\Fld@charsize=\dimen105
\Field@toks=\toks15
Package hyperref Info: Hyper figures OFF on input line 4189.
Package hyperref Info: Link nesting OFF on input line 4194.
Package hyperref Info: Hyper index ON on input line 4197.
Package hyperref Info: backreferencing ON on input line 4202.
Package hyperref Info: Link coloring OFF on input line 4209.
Package hyperref Info: Link coloring with OCG OFF on input line 4214.
Package hyperref Info: PDF/A mode OFF on input line 4219.

(/usr/local/texlive/2008/texmf-dist/tex/generic/oberdiek/atbegshi.sty
Package: atbegshi 2008/07/31 v1.9 At begin shipout hook (HO)
)
\Hy@abspage=\count91
\c@Item=\count92
\c@Hfootnote=\count93
)
*hyperref using default driver hpdftex*
(/usr/local/texlive/2008/texmf-dist/tex/latex/hyperref/hpdftex.def
File: hpdftex.def 2008/08/14 v6.78f Hyperref driver for pdfTeX
\Fld@listcount=\count94
) (./ex.aux)
\openout1 = `ex.aux'.

LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line
26.
LaTeX Font Info: ... okay on input line 26.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 26.
LaTeX Font Info: ... okay on input line 26.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line
26.
LaTeX Font Info: ... okay on input line 26.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line
26.
LaTeX Font Info: ... okay on input line 26.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line
26.
LaTeX Font Info: ... okay on input line 26.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 26.
LaTeX Font Info: ... okay on input line 26.
LaTeX Font Info: Checking defaults for PD1/pdf/m/n on input line
26.
LaTeX Font Info: ... okay on input line 26.
Package hyperref Info: Link coloring OFF on input line 26.

(/usr/local/texlive/2008/texmf-dist/tex/latex/hyperref/nameref.sty
Package: nameref 2007/05/29 v2.31 Cross-referencing by name of section

(/usr/local/texlive/2008/texmf-dist/tex/latex/oberdiek/refcount.sty
Package: refcount 2008/08/11 v3.1 Data extraction from references (HO)
)
\c@section@level=\count95
)
LaTeX Info: Redefining \ref on input line 26.
LaTeX Info: Redefining \pageref on input line 26.
(./ex.out) (./ex.out)
\@outlinefile=\write3
\openout3 = `ex.out'.

\AtBeginShipoutBox=\box26
[1

{/usr/local/texlive/2008/texmf-var/fonts/map/pdftex/updmap/
pdftex.map}]
Chapter 1.

Package hyperref Warning: bookmark level for unknown Chapter defaults
to 0.

! Use of \@chapter doesn't match its definition.
\@uclclist ->\oe
\OE \o \O \ae \AE \dh \DH \dj \DJ \l \L \ng \NG \ss
\SS \th...
l.32 \chapter{One}

? x

Here is how much of TeX's memory you used:
3427 strings out of 493886
51337 string characters out of 1151099
109797 words of memory out of 3000000
6706 multiletter control sequences out of 10000+50000
3948 words of font info for 15 fonts, out of 3000000 for 5000
714 hyphenation exceptions out of 8191
36i,4n,21p,210b,288s stack positions out of 5000i,500n,10000p,200000b,
50000s
</usr/local/texlive/2008/texmf-dist/fonts/type1/bluesky/cm/
cmbx10.pfb></usr/loc
al/texlive/2008/texmf-dist/fonts/type1/bluesky/cm/cmr10.pfb>
Output written on ex.pdf (1 page, 8439 bytes).
PDF statistics:
23 PDF objects out of 1000 (max. 8388607)
2 named destinations out of 1000 (max. 131072)
17 words of extra memory for PDF output out of 10000 (max. 10000000)

.



Relevant Pages

  • Re: Restating theorems?
    ... Redefining \overline on input line 307. ... LaTeX Font Info: Redeclaring font encoding OML on input line 567. ... Package hyperref Info: Hyper figures OFF on input line 1880. ... okay on input line 105. ...
    (comp.text.tex)
  • Re: MikTeX 2.5: algorithmic + hyperref = no PDFLaTeX?
    ... Babel and hyphenation patterns for english, dumylang, ... LaTeX Font Info: Redeclaring font encoding T1 on input line 43. ... Package hyperref Info: Hyper figures OFF on input line 2118. ... okay on input line 15. ...
    (comp.text.tex)
  • Re: Installing texlive under Fedora 17.
    ... See the hypdestopt package documentation for explanation. ... Package hyperref Info: Option `setpagesize' set `false' on input line 2238. ... Package xcolor Info: Package option `override' ignored on input line 216. ... LaTeX Font Info: ... ...
    (Fedora)
  • attachfile-package - problem when extracting empty file from pdf
    ... Redefining \addtolength on input line 60. ... Package hyperref Info: Hyper figures OFF on input line 1880. ... LaTeX Font Info: Try loading font information for U+pzd on input line 63. ... okay on input line 4. ...
    (comp.text.tex)
  • Re: amsmath + hyperref problem when using subequations
    ... Redefining \overline on input line 307. ... LaTeX Font Info: Redeclaring font encoding OML on input line 567. ... umsa.fd 2002/01/19 v2.2g AMS font definitions ... Package hyperref Info: Hyper figures OFF on input line 2907. ...
    (comp.text.tex)