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've increased \parskip with \baselineskip to use the "skipped" paragrahs style instead of the default "indented" style. However, this causes all listings to automatically include a baselineskip afterwards (see below).

enter image description here

How do I remove it? A minimal example is included below.

\documentclass{article}

\usepackage{listings}

\addtolength{\parskip}{\baselineskip}

\lstset{%
  frame=single,
}

\begin{document}
bla bala bla
\begin{lstlisting}
test test test
\end{lstlisting}
bla bal bal
\end{document}
share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

You should use the parskip package to deal with this. The basic problem is that parskip gets used all over the place. The parskip package tries to have the change of paragraph skip length only have an effect where you actually intend it to. Simply add \usepackage{parskip} to your preamble above the command that changes the length.

share|improve this answer
    
Although I did "solve" the problem by reverting to using the indented style of paragraphs, I'll set this answer as accepted. –  gablin Oct 19 '11 at 17:01
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.