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.

Follow-up question of Why are \listof{}{} and \listoffigures styled differently?...

With the issue mentioned above I finally managed to design my \listof{}{} and \listoffigures as desired but one issue remains unsolved: How to avoid global settings for my document like \setlength{\parskip}{3mm} being applied to list of figures, list of tables, etc.?

MWE: Uncommenting \setlength{\parskip}{3mm} affects the \listoffigures but not the \listof{algo}{List of Algorithms}.

\documentclass[12pt,a4paper,twoside,openright]{report}
 \usepackage[english]{babel}
 \usepackage{float}
  \newfloat{algo}{tbp}{loa}[chapter]
%  \setlength{\parskip}{3mm}
%  \setlength{\parindent}{3mm}
  \frenchspacing
  \sloppy
 \usepackage{etoolbox}
 \makeatletter
  \patchcmd{\@chapter}%
  {\addtocontents{lof}}%
  {\addtocontents{loa}{\protect\addvspace{10pt}}%
   \addtocontents{lof}}%
  {\typeout{*** SUCCESS ***}}{\typeout{*** FAIL ***}}
 \makeatother


 \begin{document}
  \listoffigures
  \listof{algo}{List of Algorithms}

  \chapter{foo}
   \begin{figure}
    \centering
    \rule{1cm}{1cm}
    \caption{A figure}
   \end{figure}
   \begin{algo}
    (algo)
    \caption{An algorithm}
   \end{algo}
   \begin{figure}
    \centering
    \rule{1cm}{1cm}
    \caption{Another figure}
   \end{figure}
   \begin{algo}
    (algo)
    \caption{Another algorithm}
   \end{algo}

  \chapter{bar}
   \begin{figure}
    \centering
    \rule{1cm}{1cm}
    \caption{Yet another figure}
   \end{figure}
   \begin{algo}
    (algo)
    \caption{Yet another algorithm}
   \end{algo}

 \end{document}
share|improve this question

1 Answer 1

up vote 7 down vote accepted

You shouldn't be setting \parskip to a rigid value, to begin with and probably using the parskip package is better. Just enclose the lists in a group where you set the parskip to zero.

\documentclass[12pt,a4paper,twoside,openright]{report}
\usepackage[english]{babel}
\usepackage{float}
\newfloat{algo}{tbp}{loa}[chapter]

\usepackage{parskip}

\frenchspacing

\usepackage{etoolbox}
\makeatletter
\patchcmd{\@chapter}
  {\addtocontents{lof}}
  {\addtocontents{loa}{\protect\addvspace{10pt}}\addtocontents{lof}}
  {}{}
\makeatother


\begin{document}
\begingroup\setlength{\parskip}{0pt plus .1pt}
\listoffigures
\listof{algo}{List of Algorithms}
\endgroup

\chapter{foo}
...

I would never use a nonzero parskip and a nonzero indentation (to be honest I'd never use a nonzero parskip). Also declaring \sloppy for the whole document is asking for poor typography even when TeX could do better.

share|improve this answer
    
thanks, that's exactly what i was looking for. –  vertoe Jun 5 '12 at 10:21

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.