General ⇒ Writing Author's Name in the TableofContents
Writing 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!
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
Writing Author's Name in the TableofContents
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}