I am the author of one section of a report. I want to but my name right under the caption of this section. And I want this to appear in the table of contents.
This Question gives a very nice answer to this question, if I wanted to but my name under a chapter's caption. However, it is not the chapter that I am writing, but only this one section. For some reason the code provided in the mentioned question doesn't work for sections, and I don't understand LaTeX very well, such that I could change it. Maybe someone can help?
Here is the code that I have copied and tried out:
\documentclass{article}
\usepackage{suffix}
\newcommand{\printsectionauthor}[1]{%
{\parindent0pt\vspace*{-25pt}%
\linespread{1.1}\large\scshape#1%
\par\nobreak\vspace*{35pt}}
\@afterheading%
}
\newcommand{\authortoc}[1]{%
\addtocontents{toc}{\vskip-10pt}%
\addtocontents{toc}{%
\protect\contentsline{section}%
{\hskip1.3em\mdseries\scshape\protect\scriptsize#1}{}{}}
\addtocontents{toc}{\vskip5pt}%
}
\title{Title of the Report}
\author{My Name}
\maketitlepage
\cleardoublepage
\addcontentsline{toc}{chapter}{\listfigurename}
\listoffigures
\begin{document}
\chapter{First Chapter of the Report}
\Section{My Section}\label{mySection}
\printsectionauthor{My Name}
\Subsection{First Subsection}
\end{document}


