Re: tocloft: how to add blank line within newlistof after every counter reset



murphyk@xxxxxxxxx wrote:
I am writing a book in which I have exercises at the end of each
chapter.
I want to make a list of these exercises. I would like the list to have
a blank line in it
after each chapter, similar to the standard TOC (currently the list
does not
group things by chapter).
So I want to insert extra space every time the 'within' counter is
reset. How do I do this?

This is my current code.

\listofexercise % see below

\chapter{blah}
\exercise{blah1}
\exercise{blah2}

\chapter{foo}
\exercise{foo}

which produces

"List of exercises
1.1 blah1
1.2 blah2 <--------- want blank line after thiis
2.1 foo
"

I define listofexercise by analogy with listanofanswer on p12 of the
tocloft manual:

\newcommand{\listexercisename}{List of exerices}
\newlistof[chapter]{exercise}{exercisefile}{\listexercisename}
\newcommand{\exercise}[1]{%
\refstepcounter{exercise}
\par\noindent\textbf{Exercise \theexercise. #1}

\addcontentsline{exercisefile}{exercise}{\protect\numberline{\theexercise}#1}\par}

Thanks!
Kevin


you could build it into the \chapter command

\let\oldchapter\chapter

\renewcommand\chapter{%
\addtocontents{exercisefile}{\protect\vskip\baselineskip}
\oldchapter}

untested

/daleif







.