1

I am preparing a group report in LaTeX, assembling many parts written by different authors.

I'd like to write the authors name right aligned into the \subsection{} entry in the TOC, right next to the page numbers. Therefore i've tried to \hfill the line. Unfortunately this is resulting in a "messy" order (picture below), it seems like the author names are center aligned in the remaining space?

The minimal reproducible code snippet i've tried:

\subsection{TITLE \hfill \textit{AUTHOR}} \par

Does anybody know how to handle that? Otherwise i have to use \subsection[]{} to write the authors name right next to the title.

Example

Mig B
  • 113
  • 1
    Would this be a suitable compromise: https://tex.stackexchange.com/questions/110218/add-author-before-chapter-title-in-toc?rq=1 – oliversm May 21 '20 at 13:03
  • Nice idea although i can't use this technique for my document because it needs too much space. – Mig B May 25 '20 at 10:09

1 Answers1

2

Use the tocloft package.

% tocauthorprob.tex SE 545459
\documentclass{article}
\usepackage{tocloft}
\renewcommand{\cftsubsecleader}{} % no leader between subsection title and page number

\begin{document}
\tableofcontents
\section{A section}
\subsection{TITLE \hfill \textit{AUTHOR}}
\end{document}

Read the documentation, texdoc tocloft for details about the package.

Peter Wilson
  • 28,066