3

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).

lockstep
  • 250,273

1 Answers1

2

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
Gonzalo Medina
  • 505,128