Generalscrbook+hyperref+oldstylenums: TeX capacity exceeded

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
tristero
Posts: 2
Joined: Tue Jan 20, 2009 1:19 pm

scrbook+hyperref+oldstylenums: TeX capacity exceeded

Post by tristero »

Hi!

I would like to use the mathpazo font for my document. I want oldstylenums in the TOC, in chapter + section headings, in column headings and as page numbers. When entering numbers in "normal" text, I want to have normal numbers by default.

At the moment, I achieve this behaviour by loading the mathpazo-package with the option "osf" (=oldstyle figures) and typesetting each number within the text in math mode (like "...the proportionality factor is $57$ for..."). This doesn't seem elegant to me and I am looking for an improvement.

My plan is to redefine \thepage, \thechapter, \thesection and some other macros separately to make them use oldstylenums, so package mathpazo can be loaded without the option "osf".

Now the problem: I have to use the hyperref package and somehow the combination of documentclass scrbook (KOMA-Script), hyperref and mathpazo does not work. I do not understand the cause. The following example document does not compile on my system:

Code: Select all

\documentclass{scrbook}

\usepackage{hyperref}
\usepackage[sc]{mathpazo}
\renewcommand*{\thepage}{\oldstylenums{\arabic{page}}}

\author{The Author}
\title{The Title}

\begin{document}
\maketitle
\tableofcontents
\chapter{foo}
abc
\chapter{bar}
def
\end{document}
The error is:

Code: Select all

! TeX capacity exceeded, sorry [input stack size=5000].
\par@update ->\let \par@update 
                               \default@par@update \par@updaterelative 
l.12 \tableofcontents
                     
No pages of output.
It seems I succeded in building some endless recursion or an infinite loop.

The error disappears when using "book" instead of "scrbook". This is no option for me.

The error also disappears when inserting "\usepackage{textcomp}" after loading mathpazo but then, I do *not* have oldstylenums as page numbers (and I do not understand the reason) so this is also no option.

The error also disappears when commenting out "\maketitle" (which seems very surprising to me). When twice compiling the document with "\maketitle" commented out, I have the intended result, but of course I need to use \maketitle.

I really like to understand what is going wrong here and I want to have a really clean and reasonable document setup. Any help would be really appreciated. Thanks in advance.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

scrbook+hyperref+oldstylenums: TeX capacity exceeded

Post by phi »

Hi,
on my system no error occurs. Could you please add \listfiles in front of \documentclass and post the resulting file versions? Perhaps the problem can be solved by updating a package.
Generally, it is not a good idea to redefine \thepage, since this command is used at various positions, and some usages could expect that it's expandable. For a first approach, enclose it with \texorpdfstring to make it expandable when things like PDF bookmarks are created:

Code: Select all

\renewcommand*{\thepage}{\texorpdfstring{\oldstylenums{\arabic{page}}}{\arabic{page}}}
tristero
Posts: 2
Joined: Tue Jan 20, 2009 1:19 pm

scrbook+hyperref+oldstylenums: TeX capacity exceeded

Post by tristero »

Thanks. I use texlive 2008.

I already tried to use \texorpdfstring with no change to the error. I tried the line you posted but this did not change anything.

Adding \listfiles in the first line in front of documentclass did not change anything in the console output or the logfile as far as I can see. The versions of the packages loaded are as follows (from the logfile):

Code: Select all

This is pdfTeXk, Version 3.1415926-1.40.9 (Web2C 7.5.7)
(...)
LaTeX2e <2005/12/01>
(...)
Babel <v3.8l>
(...)
Document Class: scrbook 2008/11/03 v3.00 KOMA-Script document class (book)
(...)
Package scrlfile, 2008/07/09 v3.00 KOMA-Script package (loading files)
(...)
Package typearea, 2008/11/03 v3.00 KOMA-Script package (type area)
(...)
Package: hyperref 2008/09/29 v6.78l Hypertext links for LaTeX

(/usr/share/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 not detected.
)
(/usr/share/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/share/texmf-dist/tex/generic/ifxetex/ifxetex.sty
Package: ifxetex 2008/09/18 v0.4 Provides ifxetex conditional
)
(/usr/share/texmf-dist/tex/latex/oberdiek/hycolor.sty
Package: hycolor 2008/09/08 v1.4 Code for color options of hyperref/bookmark (H
O)

(/usr/share/texmf-dist/tex/latex/oberdiek/xcolor-patch.sty
Package: xcolor-patch 2008/09/08 xcolor patch
))
\@linkdim=\dimen103
\Hy@linkcounter=\count89
\Hy@pagecounter=\count90

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

(/usr/share/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/share/texmf/tex/latex/config/hyperref.cfg
File: hyperref.cfg 2002/06/06 v1.2 hyperref configuration of TeXLive
)
(/usr/share/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 2907.
Package hyperref Info: Link nesting OFF on input line 2912.
Package hyperref Info: Hyper index ON on input line 2915.
Package hyperref Info: Plain pages OFF on input line 2922.
Package hyperref Info: Backreferencing OFF on input line 2927.

Implicit mode ON; LaTeX internals redefined
Package hyperref Info: Bookmarks ON on input line 3117.
(/usr/share/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 3351.

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

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

(/usr/share/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/share/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=\count91
\Field@Width=\dimen104
\Fld@charsize=\dimen105
\Field@toks=\toks15
Package hyperref Info: Hyper figures OFF on input line 4268.
Package hyperref Info: Link nesting OFF on input line 4273.
Package hyperref Info: Hyper index ON on input line 4276.
Package hyperref Info: backreferencing OFF on input line 4283.
Package hyperref Info: Link coloring OFF on input line 4288.
Package hyperref Info: Link coloring with OCG OFF on input line 4293.
Package hyperref Info: PDF/A mode OFF on input line 4298.

(/usr/share/texmf-dist/tex/generic/oberdiek/atbegshi.sty
Package: atbegshi 2008/07/31 v1.9 At begin shipout hook (HO)
)
\Hy@abspage=\count92
\c@Item=\count93
\c@Hfootnote=\count94
)
*hyperref using default driver hdvips*
(/usr/share/texmf-dist/tex/latex/hyperref/hdvips.def
File: hdvips.def 2008/09/29 v6.78l Hyperref driver for dvips

(/usr/share/texmf-dist/tex/latex/hyperref/pdfmark.def
File: pdfmark.def 2008/09/29 v6.78l Hyperref definitions for pdfmark specials
\pdf@docset=\toks16
\pdf@box=\box27
\pdf@toks=\toks17
\pdf@defaulttoks=\toks18
\Fld@listcount=\count95
))
(/usr/share/texmf-dist/tex/latex/psnfss/mathpazo.sty
Package: mathpazo 2005/04/12 PSNFSS-v9.2a Palatino w/ Pazo Math (D.Puga, WaS) 
\symupright=\mathgroup4
) (./foo.aux)
\openout1 = `foo.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 13.
LaTeX Font Info:    ... okay on input line 13.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 13.
LaTeX Font Info:    ... okay on input line 13.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 13.
LaTeX Font Info:    ... okay on input line 13.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 13.
LaTeX Font Info:    ... okay on input line 13.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 13.
LaTeX Font Info:    ... okay on input line 13.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 13.
LaTeX Font Info:    ... okay on input line 13.
LaTeX Font Info:    Checking defaults for PD1/pdf/m/n on input line 13.
LaTeX Font Info:    ... okay on input line 13.
LaTeX Font Info:    Try loading font information for OT1+pplx on input line 13.


(/usr/share/texmf-dist/tex/latex/psnfss/ot1pplx.fd
File: ot1pplx.fd 2004/09/06 font definitions for OT1/pplx.
)
Package hyperref Info: Link coloring OFF on input line 13.

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

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

\AtBeginShipoutBox=\box28


Package hyperref Warning: Rerun to get /PageLabels entry.

\big@size=\dimen106
LaTeX Font Info:    Try loading font information for OML+zplm on input line 15.

(/usr/share/texmf-dist/tex/latex/psnfss/omlzplm.fd
File: omlzplm.fd 2002/09/08 Fontinst v1.914 font definitions for OML/zplm.
)
LaTeX Font Info:    Try loading font information for OMS+zplm on input line 15.


(/usr/share/texmf-dist/tex/latex/psnfss/omszplm.fd
File: omszplm.fd 2002/09/08 Fontinst v1.914 font definitions for OMS/zplm.
)
LaTeX Font Info:    Try loading font information for OMX+zplm on input line 15.


(/usr/share/texmf-dist/tex/latex/psnfss/omxzplm.fd
File: omxzplm.fd 2002/09/08 Fontinst v1.914 font definitions for OMX/zplm.
)
LaTeX Font Info:    Try loading font information for OT1+zplm on input line 15.


(/usr/share/texmf-dist/tex/latex/psnfss/ot1zplm.fd
File: ot1zplm.fd 2002/09/08 Fontinst v1.914 font definitions for OT1/zplm.
)
! TeX capacity exceeded, sorry [input stack size=5000].
\par@update ->\let \par@update 
                               \default@par@update \par@updaterelative 
l.15 \tableofcontents
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

scrbook+hyperref+oldstylenums: TeX capacity exceeded

Post by localghost »

tristero wrote:[…] Adding \listfiles in the first line in front of documentclass did not change anything in the console output or the logfile as far as I can see. […]
The \listfiles command generates a list of the used files. Search the log file for the section between *File List* and ***********. There you will find a list that is much clearer.

Looking at your sample code, I see that hyperref is not loaded as the last package. There are only a few exceptional packages that are allowed to be loaded after hyperref. But this is not the problem. The line with the redefinition of the page number is the cause.


Best regards and welcome to the board
Thorsten¹
Post Reply