I would like to write a book in which I put the solutions to some problems. I want to write the texts of the problem in some chapters at the beginning of the book and their solutions in other chapters at the end. Suppose I use the same title for the chapter with the texts and the chapter with the solutions: I would like to have, in the TOC, the following structure

                                  Texts         Solutions 
1 Chapter_Title...................Pag.x.............Pag.y

2 Chapter_Title...................Pag.z.............Pag.t

How can I get it?

  • 2
    The easy solution is to not use \tableofcontents. Instead create your own (tabular) table of contents. Put a \label after the \chapter and \section and use \pageref to get the page numbers. The chapter numbers and titles are also stored in the aux file, but it will take a bit of effort to extract them. – John Kormylo Feb 12 '19 at 16:27

The following builds on John Kormylo's comment about manually setting the ToC

enter image description here




\setchaptocgap{3pt plus 1pt minus 1pt}









\chapter{First chapter}\label{ch:first}

\chapter{Second chapter}\label{ch:second}

% ========= SOLUTIONS =========

\chapter*{First chapter solutions}\label{ch:first:sol}

\chapter*{Second chapter solutions}\label{ch:second:sol}


I've added some customisation, but there's plenty you can add yourself.

|improve this answer|||||

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.