Text Formattinghyperref | Error with ToC in custom Document Class

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
emptyhb
Posts: 1
Joined: Mon Sep 24, 2012 11:44 pm

hyperref | Error with ToC in custom Document Class

Post by emptyhb »

Hi,
I'm a graduate student finishing my PhD thesis. I'm using a class file circulating around in the University of Chicago community. I found it to have a problem with hyperref. Specifically, compiling fails with the\tableofcontents command. I attached an archive containing a minimal example. The problem occurs as I add \usepackage{hyperref} to the end of the preamble.

The error is:

Code: Select all

(./thesis_template.toc
! Undefined control sequence.
\find@pdflink ...ode \protected@edef\Hy@testname
                           {#2}\ifx \Hy@testname \@em...
l.1 ...{chapter}{List of Figures}{vi}{chapter*.4}
Attachments
zuwiki-ucetd-latex-231f038.zip
(63.38 KiB) Downloaded 210 times
Last edited by cgnieder on Tue Sep 25, 2012 12:31 am, edited 1 time in total.

Recommended reading 2024:

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

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

texbob
Posts: 2
Joined: Fri Mar 01, 2013 8:19 am

Re: hyperref | Error with ToC in custom Document Class

Post by texbob »

Hi, I too am having the same problem with the UChicago template while writing my thesis. Anyone found a solution yet??
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: hyperref | Error with ToC in custom Document Class

Post by Johannes_B »

Hi and welcome, very simple solution: Ask the guy in charge of the class file, i.e. the maintainer. He can do the appropriate changes and provide a centralised new version available for all students and staff members.

Hacking this type of files leads to multiple copipes around the campus/world of the same document.


EDIT: I just ran the example posted by the OP a few years back. I didn't get any error.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
texbob
Posts: 2
Joined: Fri Mar 01, 2013 8:19 am

hyperref | Error with ToC in custom Document Class

Post by texbob »

Thanks for your reply.. I have an email out to the current maintainer, I've just been waiting a while for a response, so thought I'd try here.

Also, I tried the OP's file thesis_template.tex as well but still get the same errors. Are you sure you added

Code: Select all

\usepackage{hyperref}
in the preamble? The originally posted code does not have that line inserted yet, and that is the command causing problems with this UChicago thesis template.

In any case, I'll keep waiting for a reply from the maintainer (I agree with you that having one well maintained master copy available is better than several hacked versions), but if anyone has a suggestion they can post here, I'll pass it on to the maintainer.

Thanks
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

hyperref | Error with ToC in custom Document Class

Post by Johannes_B »

You are right, i didn't load hyperref :-)

A quick workaround should be \renewcommand{\etdChapterHeadFormat}[1]{\uppercase{#1}}

What is going on here? The above command is used to make all titles uppercased, which is rather crude by a typographical point of view. The university should reconsider their guidelines.

Little hint to the maintainer. Use package tocbasic of the KOMA bundle to style your lists.
You can patch commands using package etoolbox. You can use package unnumberedtotoc to get unnumbered chapters to the table of contents (including setting the headers).
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply