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 have created a new float type with the following in my preamble:

\floatstyle{plain}
\newfloat{myfloat}{thpb}{myfloat}[chapter]
\floatname{myfloat}{\bf My Float}

Then I use the following to create a list at the beginning of my document of all of these new floats:

\listof{myfloat}{My Floats}

I'd like to change the spacing between the elements in the list of myfloat's such that it matches the spacing in my listoffigures and listoftables.

I'm using a class based on the book class (more specifically: http://www.eg.bucknell.edu/physics/thesis/buthesis.cls).

share|improve this question
1  
Do not use \bf ... but \textbf{My Float}. See Does it matter if I use \textit or \it or l2tabu for an explanation. –  Martin Scharrer Apr 3 '11 at 21:45
add comment

1 Answer

up vote 2 down vote accepted

To achieve the same format for the new list of floats, it's necessary to redefine two commands: \listof from float.sty (I assumed that you are using this package to build your new float type) and \@chapter from book.cls (the standard class on top of which buthesis.cls is build). The first redefinition only changes \parskip from 0pt (default value used for the new lists created with float) to 0.2in (which is the value used for buthesis.cls). The second redefinition simply adds a vertical space of 10pt at the beginning of each chapter in the new list.

The relevant code that has to be added to the preamble (after the float package has been loaded) is the following:

\makeatletter
\renewcommand*{\listof}[2]{%
  \@ifundefined{ext@#1}{\float@error{#1}}{%
    \@namedef{l@#1}{\@dottedtocline{1}{1.5em}{2.3em}}%
    \float@listhead{#2}%
  \begingroup\setlength{\parskip}{0.2in}% default: 0pt
    \@starttoc{\@nameuse{ext@#1}}%
  \endgroup}}
\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
                       \if@mainmatter
                         \refstepcounter{chapter}%
                         \typeout{\@chapapp\space\thechapter.}%
                         \addcontentsline{toc}{chapter}%
                                   {\protect\numberline{\thechapter}#1}%
                       \else
                         \addcontentsline{toc}{chapter}{#1}%
                       \fi
                    \else
                      \addcontentsline{toc}{chapter}{#1}%
                    \fi
                    \chaptermark{#1}%
                    \addtocontents{lof}{\protect\addvspace{10\p@}}%
                    \addtocontents{lot}{\protect\addvspace{10\p@}}%
                    \addtocontents{myfloat}{\protect\addvspace{10\p@}}%adds space to the new list
                    \if@twocolumn
                      \@topnewpage[\@makechapterhead{#2}]%
                    \else
                      \@makechapterhead{#2}%
                      \@afterheading
                    \fi}
\makeatother
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.