[pdftex] help on hyperref

Shufeng Bai shufengbai at yahoo.com
Tue Apr 24 08:25:33 CEST 2007


Dear all,
 I am writing a class file that and I would like to
use hyperref option with pdflatex. However, the line
with "\addtocententline" can't not pass the second
pdflex compile. Below, I attached a minium example.
can anybody give me some hint?

 thanks a million!

----
% main.tex
\documentclass{myclass}
\usepackage[pdftex,colorlinks]{hyperref}
\begin{document}
\chapter{Problem}
this class file works fine expect that I can't used
``hyperref''
The ``\\addcontentsline'' command in the class file
cause the problem.

\chapter{Solution}
can anybody help? thanks a lot.
\end{document} 
---------------------
% myclass.cls
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{myclass} [2007/04/24 v1.5 ]
\newcommand*{\begincmd}{
\makeabstract
\maketoc
}

\newcommand*{\makeabstract}{
\addcontentsline{toc}{section}{Abstract}
\Huge \textbf{Abstract}
}

\newcommand*{\maketoc}{ 
\addcontentsline{toc}{section}{Contents}
\tableofcontents
}

\DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}}
\ProcessOptions
\LoadClass{report}
\long\def\abstract#1{\gdef\@abstract{#1}}

\AtBeginDocument{\begincmd}
\endinput
===============================

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the pdftex mailing list