Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am having trouble adding a newlistof to a memoir file. My example follows the memoir answer example very closely, but I get an ugly "List of Comments" -- spacing across the page and returns are wrong.

Minimal TeX example below. As an uncredentialed user, I don't seem to be able to attach an image of the PDF. The appearance I get is a space after the comment number, the comment title, then no space and the comment page number; followed by no CR/LF between the first and second entry.

I want the List of Comments to look much like the List of Figures. Running TexShop.

\documentclass[11pt,letterpaper,openany]{memoir} % for a short document

 % Comment command
\newcommand{\listcommentname}{List of Comments}
\newlistof{listofcomments}{loc}{\listcommentname}
\newcounter{Comment}[chapter]
\renewcommand{\theComment}{\arabic{Comment}}
\newcommand{\Comment}[1] {
    \refstepcounter{Comment}    
    \par\noindent\textbf{Comment \theComment.  #1.}
    \addcontentsline{loc}{Comment}{\protect\numberline{\theComment}#1}\par} 

\begin{document}
%
\frontmatter

\tableofcontents*\clearpage
\listoffigures\clearpage
\listofcomments\clearpage

\chapter*{Foreword}
\addcontentsline{toc}{chapter}{Foreword}

\mainmatter
\chapter{Introduction \& so on}
\Comment{Silly comment}
Here is a test comment.

\section{Example section}
And here is some text

\begin{figure}
\centering\mbox{Just text to generate a lof entry.}
\caption{Test figure}
\end{figure}

\clearpage

\Comment{Another silly comment}
Here is a second test comment, on a different page.

\end{document}
share|improve this question
add comment

1 Answer

You have to create a ToC-(LoC-)formatting command \l@Comment that resembles \l@figure. Add the following to your preamble:

\makeatletter
\let\l@Comment\l@figure
\makeatother

Consider also to add the chapter number to the "appearence" of the "Comments" counter:

\renewcommand{\theComment}{\thechapter.\arabic{Comment}}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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