0

I am currently writing a scientific paper in LaTeX with a fellow student. We use Overleaf and are still a bit inexperienced with LaTeX. Our professor wants us to create an epilogue that shows who is responsible for which chapter or section.

It would be great if you could write the name of the editor directly behind a \chapter{mychapter} or \section{mysection} and automatically create an epilogue at the end.

Now my question: Is there any library specifically for such a case? And if so, how can I use it?

2
  • Hello and welcome ! This may help tex.stackexchange.com/questions/156862/… – BambOo Apr 10 '20 at 14:09
  • 1
    This is definitely going in the right direction... But I wouldn't like to have a name after every chapter or section in the document... I'd rather have an automatic listing of all chapters or sections for the respective author at the very end of the document – CrazyEight Apr 10 '20 at 15:11
1

After tweaking a bit this answer by user using the tocloft package, here is what comes.

You can create two lists \listchaptersbyA and \listchapterbyB which will hold all the chapters authored by authors A and B. Call \chapterbyA or \chapterbyB after a \chapter to state that this chapter was authored by the specific author. List these chapters by calling \listofchapterbyA or \listofchaptersbyB

\documentclass{book}
\usepackage{lipsum}
\usepackage{tocloft}
\usepackage{hyperref}

\usepackage[english]{babel}
\hypersetup{colorlinks=true}

\newcommand{\listchaptersbyA}{Authored by A}
\newlistof{chaptersbyA}{cbA}{\listchaptersbyA}

\newcommand{\chapterbyA}[0]
{%
    \refstepcounter{chaptersbyA}
    \addcontentsline{cbA}{chaptersbyA}
    {\protect\numberline{\thechaptersbyA}\chaptername~\thechapter}\par
}

\newcommand{\listchaptersbyB}{Authored by B}
\newlistof{chaptersbyB}{cbB}{\listchaptersbyB}

\newcommand{\chapterbyB}[0]
{%
    \refstepcounter{chaptersbyB}
    \addcontentsline{cbB}{chaptersbyB}
    {\protect\numberline{\thechaptersbyB}\chaptername~\thechapter}\par
}

\begin{document}

\chapter{1st chapter}
\chapterbyA{}
\lipsum[1]

\section{A section}
\lipsum[1]

\chapter{2nd chapter}
\chapterbyA{}
\chapterbyB{}
\lipsum[1]

\section{A section}
\lipsum[1]

\chapter{3rd chapter}
\chapterbyA{}
\lipsum[1]

\newpage
\listofchaptersbyA
\listofchaptersbyB
\end{document}

enter image description here

3
  • Exactly what i am looking for... but is there also a way on how to also make this possible for sections? If i add \chapterbyA to a section then also only the chapter is displayed in the toc. And maybe also possible to add the names behind chapter number? – CrazyEight Apr 10 '20 at 16:34
  • @CrazyEight It is really much depending on how much effort you want to put into this, how many chapters and sections or subsections ... If you know since the beginning who will do what, you can also put everything into a table. – BambOo Apr 10 '20 at 19:02
  • @CrazyEight,in addition to my previous comment : what I mean is that depending on the amount of content writtent by one or another author, it makes more sense to add information to the table of contents as in the first linked answer, or to do what I proposed next or something else, this really depends on how you see things. For instance, if most sections were written by a single author, it makes more sense to add information to the table of contents IMHO. And if there is no name, it must be assumed that both contributed. – BambOo Apr 10 '20 at 22:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.