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.

When using a 0 length \parindent and an expandable length of \parskip it is my feeling that the space after section headlines becomes too big (see example). Is there another command I should use for decreasing the vertical space after section headings or should I perhaps use a completely different approach to accomplish what I am after?

\documentclass[a4paper, twoside, 11pt, onecolumn]{article}
\usepackage{sectsty}

\begin{document}

    \allsectionsfont{\sffamily}

    \section{Lorem ipsum}
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse mollis
    ultricies porttitor. Mauris iaculis dignissim magna, sit amet viverra enim
    feugiat consectetur. Ut at mauris in felis congue mattis. Nam molestie mattis
    erat sit amet eleifend. Nulla volutpat ornare quam. 

    Pellentesque at varius libero. Nunc quis nunc eget elit congue pulvinar non
    sagittis turpis. Fusce mauris lorem, euismod accumsan sollicitudin dictum,
    adipiscing dignissim tortor. Aliquam commodo cursus sapien placerat
    volutpat. Mauris dignissim sem vitae magna fringilla hendrerit.

    \setlength{\parindent}{0 em}
    \setlength{\parskip}
              {1 \baselineskip plus 0.2 \baselineskip minus 0.2 \baselineskip}

    \section{Dolor sit}
    Phasellus non odio nec arcu aliquam cursus. Integer at sem id magna
    lobortis ultrices. Morbi sed lacus neque, vitae aliquet massa. Aliquam vel
    ligula orci.  Nam at velit libero. Vivamus ac commodo velit. Mauris cursus
    ultricies sapien et egestas. Donec non augue ut nisi luctus pretium.
    Vivamus laoreet varius lacus at feugiat. Phasellus condimentum tincidunt
    egestas. Aenean eu aliquam sem. 

    Cras libero nunc, mattis quis aliquet vel, faucibus fringilla nibh. Etiam
    commodo sem et arcu eleifend tincidunt. Maecenas pulvinar odio id turpis
    feugiat ac sollicitudin nulla sollicitudin. Pellentesque habitant morbi
    tristique senectus et netus et malesuada fames ac turpis egestas. Quisque
    non felis ligula, in interdum justo.

\end{document}
share|improve this question

2 Answers 2

up vote 3 down vote accepted

This is a rather general problem, since \parskip is always used, when there is a \par somewhere. This often has very strange side effects, also after environments and math formulas.

The memoir class has a special length called \abnormalparskip that can be used to introduce space between paragraphs and not after every other object. It is not perfect, but much better.

share|improve this answer
    
Is it just me, or does pulling in the big (I just found a 500 pages pdf) memoir thing seem like an overly complicated way of solving something that (at least at first glance) looks very simple? –  jonalv Jan 4 '11 at 13:07
    
Yes. It is a very complex document class that has many more features features than you might need. The problem is, that you need to introduce a length that gets inserted after paragraphs but not everywhere where TeX ends a paragraph (by issuing \par) The memoir class might be overkill. Maybe someone else has a solution that works with every class. –  Carsten Thiel Jan 4 '11 at 13:12

There are also some packages which supports a user interface for setting the lengths. However, you can also overwrite the existing definitions, e.g. for section (can be found in article.cls):

\documentclass[a4paper, twoside, 11pt, onecolumn]{article}
\usepackage{sectsty}
       \setlength{\parindent}{0 em}
    \setlength{\parskip}
              {1 \baselineskip plus 0.2 \baselineskip minus 0.2 \baselineskip}

\makeatletter
\renewcommand\section{\@startsection {section}{1}{\z@}%
      {-3.5ex \@plus -1ex \@minus -.2ex}%
      {0.2ex \@plus.1ex}% <=== space after
      {\normalfont\Large\bfseries}}
\makeatother

\begin{document}

    \allsectionsfont{\sffamily}

    \section{Lorem ipsum}
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse mollis
    ultricies porttitor. Mauris iaculis dignissim magna, sit amet viverra enim
    feugiat consectetur. Ut at mauris in felis congue mattis. Nam molestie mattis
    erat sit amet eleifend. Nulla volutpat ornare quam. 
\end{document}
share|improve this answer
    
Ah, then I have to this for all used section levels. It is probably not worth it... –  jonalv Jan 4 '11 at 13:41
    
@jonalv: maybe ... on the other hand it is simply a copy and paste ... –  Herbert Jan 4 '11 at 13:44

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.