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've created a new float environment and new list-of as described in the memoir manual. My issue is that the spacing between the title of the list and its items isn't the same as for list of figures. Here's an example that shows what I mean:

test.tex

\documentclass[a4paper]{memoir}

\usepackage{xltxtra}
\usepackage{polyglossia}

% New list of source code listings
\newcommand{\sourcename}{Source Code Listing}
\newcommand{\listsourcename}{List of Source Code}

\newfloat[chapter]{source}{los}{\sourcename}
\newlistof{listofsources}{los}{\listsourcename}
\newlistentry{source}{los}{0}

\chapterstyle{pedersen}

\begin{document}

\frontmatter

\listoffigures
\clearpage
\listofsources

\mainmatter

\chapter{One}   

\begin{figure} \caption{Some  fig} \end{figure}
\begin{figure} \caption{Other fig} \end{figure}

\begin{source} \caption{Some  src} \end{source}
\begin{source} \caption{Other src} \end{source}

\end{document}

Compile with:

xelatex test.tex && xelatex test.tex

Below are images of what the titles look like.

Is there any easy way to style the new list the same as list of figures?

share|improve this question

1 Answer 1

up vote 8 down vote accepted

\insertchapterspace must be redefined so that it also adds some vertical space to the los whenever a new chapter starts. EDIT: memoir provides the \addtodef macro which can be used to amend the definition of \insertchapterspace.

\documentclass[a4paper]{memoir}

\newcommand{\sourcename}{Source Code Listing}
\newcommand{\listsourcename}{List of Source Code}

\newfloat[chapter]{source}{los}{\sourcename}
\newlistof{listofsources}{los}{\listsourcename}
\newlistentry{source}{los}{0}

\addtodef{\insertchapterspace}{}%
    {\addtocontents{los}{\protect\addvspace{10pt}}}

\usepackage{graphicx}

\chapterstyle{pedersen}

\begin{document}

\frontmatter

\listoffigures
\clearpage
\listofsources

\mainmatter

\chapter{One}   

\begin{figure} \caption{Some  fig} \end{figure}
\begin{figure} \caption{Other fig} \end{figure}

\begin{source} \caption{Some  src} \end{source}
\begin{source} \caption{Other src} \end{source}

\end{document}
share|improve this answer
    
I see, that solves it thank you very much. –  Thor Sep 2 '12 at 19:51
    
Now that I knew what to look for, it's been under my nose the whole time, it's in section 9.3 bottom of page 173. –  Thor Sep 2 '12 at 21:11
1  
@Thor Thanks for the tip -- example now uses \addtodef. –  lockstep Sep 2 '12 at 21:17

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.