Please, Anybody knows how to Write the Author's Name in the TableofContents?
I was trying to do something like that is showed bellow...
\def\@chapter[#1]#2{%
\ifnum \c@secnumdepth >\m@ne
\refstepcounter{chapter}
\typeout{\@chapapp\space\thechapter.} %
\addcontentsline{toc}{chapter}{\protect\numberline{\thechapter}#1}%
%%% \addcontentsline{toc}{chapter}{\@author} (the author's name enter here, would be something like that?)
\else
\fi
\chaptermark{#1}%
\addtocontents{lof}{\protect\addvspace{10pt}}%
\addtocontents{lot}{\protect\addvspace{10pt}}%
\if@twocolumn
\@topnewpage[\@makechapterhead{#2}]%
\else
\@makechapterhead{#2}\@afterheading
\fi
Thanks in advance!
General ⇒ Writing Author's Name in the TableofContents
NEW: TikZ book now 40% off at Amazon.com for a short time.

- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Writing Author's Name in the TableofContents
Hi tacio,
welcome to the LaTeX Community board!
Why not this way or similar. Try this example:
Stefan
welcome to the LaTeX Community board!
Why not this way or similar. Try this example:
Code: Select all
\documentclass[a4paper,10pt]{report}
\title{Test}
\author{Anonymous}
\begin{document}
\makeatletter
\addtocontents{toc}{\protect\contentsline{chapter}{\@author}{}}
\makeatother
\maketitle
\tableofcontents
\chapter{Test}
\section{Section}
\end{document}
Re: Writing Author's Name in the TableofContents
It worked, thanks a lot!