Text Formattingvertical spacing for list of floats

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
miker2
Posts: 1
Joined: Fri Jan 15, 2010 5:13 am

vertical spacing for list of floats

Post by miker2 »

I have a question about the vertical spacing in a list of floats. I am using the algorithms package (which actually consists of 'algorithm.sty' and 'algorithmic.sty'. The package provides a command that can be used to produce a "List of Algorithms" similar to the other lists in the document using \listofalgorithms

The list appears in the final document and is populated correctly, but the vertical spacing between the list items is different than the other lists in the document. I've searched the documentation and the web, but have not found a solution.

I have included an example of the code I'm using to produce the list of algorithms, including the other packages being used (I don't know if they are interfering with the \listofalgorithms or not).

Code: Select all

\documentclass[12pt]{report}
\usepackage[english]{babel}
\usepackage{float}
\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage[chapter]{algorithm}
\usepackage{algorithmic}
\usepackage[colorlinks=true]{hyperref}
\usepackage[all]{hypcap}

\setlength{\textwidth}{6.5in}
\setlength{\textheight}{8.5in}
\setlength{\evensidemargin}{0in}
\setlength{\oddsidemargin}{0in}
\setlength{\topmargin}{0in}

\setlength{\parindent}{0pt}	%Sets indentation to begin a paragraph
\setlength{\parskip}{0.1in} %Sets spacing between paragraphs
\setlength{\headheight}{14.5pt}


\begin{document}

%title page, abstract, etc. here

\tableofcontents
\pagebreak

\listoffigures
\pagebreak

\listoftables
\pagebreak

\listofalgorithms
\pagebreak

\pagenumbering{arabic}
\pagestyle{fancy}
Here is a sample algorithm included in the document
\chapter{Path Planning}
Here is one algorithm:
\begin{algorithm}
	\caption[Forward Search]{Forward Searching Algorithm}
	\label{alg:forwardsearch}
	\begin{algorithmic}[1]
	\STATE $Q.Insert(n_I)$ and mark $n_I$ as visited
	\WHILE{$Q$ not empty}
		\STATE Do stuff here
	\ENDWHILE
	\RETURN FAILURE
	\end{algorithmic}
\end{algorithm}

Here is another algorithm:
\begin{algorithm}
	\caption{Reconstruct Path}
	\label{alg:reconpath}
	\begin{algorithmic}[1]
		\REQUIRE $n_G$
		\medskip
		\STATE $i=1$
		\STATE $OptimalPath(i) \leftarrow n_G$
		\STATE $n \leftarrow n_G$
		\WHILE{$n \neq n_I$}
			\STATE do stuff here
		\ENDWHILE	
		\RETURN $OptimalPath$
	\end{algorithmic}
\end{algorithm}

\begin{table}
	\caption{This is the first table}
	\centering
		\begin{tabular}{|r|l|}
			\hline
			Max Payload & 28 kg \\ \hline
			Endurance & 60 min \\ \hline
		\end{tabular}
		\label{tab:tab1}
\end{table}

\begin{table}
	\caption{This is the second table}
	\centering
		\begin{tabular}{|r|l|}
			\hline
			This & is \\ \hline
			a & sample \\ \hline
		\end{tabular}
		\label{tab:tab2}
\end{table}

\end{document}

I've included two algorithms and two tables in the example so that once compiled, one can see the difference in spacing of the two lists. I had to whittle this down from a 150 pg. document, so hopefully it is all there.

The setlength commands in the preample are all part of the formatting required for the paper.

I don't know if it matters, but here's the system configuration:
Windows XP
MikTeX 2.8
TeXnicCenter

I'm still pretty new to Latex, so I would love any help I can get on this, and thanks in advance.
Last edited by miker2 on Sat Jan 16, 2010 9:35 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

vertical spacing for list of floats

Post by localghost »

Your example doesn't show the problem. There are no algorithms. Please post a minimal working example (MWE) that is reduced to only the necessary packages and clearly reproduced the described behaviour.


Best regards and welcome to the board
Thorsten
Post Reply