A version with automatic label generation and a helpchapter
associated counter. The \label
is injected after \refstepcounter{chapter}
and is prefixed with helpchapter:
The macro \DisplayEnumTocLine{Foo}
uses enumi
as counter and retracts the name and page reference as \nameref{helpchapter:\number\value{enumi}}
etc. The content of the mandatory argument is displayed as description text.
The starred version of \DisplayEnumTocLine
does not generate hyperlinks for the name and page references, the example shows usages of both versions.
(Note: The xassoccnt
package is not really necessary here, but it simplifies the automatic stepping of helpchapter
here).
\documentclass{book}
\usepackage{enumitem}
\usepackage{xassoccnt}
\newcounter{helpchapter}
\DeclareAssociatedCounters{chapter}{helpchapter}
\usepackage{xpatch}
\makeatletter
\xpatchcmd{\@chapter}{%
\refstepcounter{chapter}%
}{%
\refstepcounter{chapter}%
\label{helpchapter:\number\value{helpchapter}}%
}{}{}
\NewDocumentCommand{\DisplayEnumTocLine}{sO{helpchapter:}+m}{%
\IfBooleanTF{#1}{%
\nameref*{#2\number\value{enumi}} \hfill \pageref*{#2\number\value{enumi}}%
}{%
\nameref{#2\number\value{enumi}} \hfill \pageref{#2\number\value{enumi}}%
}%
#3%
}
\makeatother
\usepackage{hyperref}
\usepackage{blindtext}
\begin{document}
\begin{enumerate}
\item \DisplayEnumTocLine{A foo chapter}
\item \DisplayEnumTocLine*{\blindtext}
\end{enumerate}
\chapter{Foo chapter}
\chapter{Other chapter}
\end{document}

\chapter
cmd in your doc. For example, the memoir class has build in features to do this. If you're using another class, the memoir code can easily be copied. – daleif Jun 1 '17 at 14:38\chaptertocprecis
in the manual. It something presis. Memoir should be a drop in replacement for book, already contains the code from a lot of packages – daleif Jun 1 '17 at 18:14