3

I can use:

\setlength{\parskip}{\baselineskip}
\setlength{\parindent}{0pt}

But this messes up the rest of the document as it also increases the spacing after chapters, sections, sub-sections, and sub-sub-sections. As well as this it increases the white space between text and equations, equations and other equations, figures, tables, and lists etc.

I only want it to add white space between two text paragraphs, so the spacing between text and equations etc stays at the default size.

The way I have been doing this so far is to manually add:

\\

After each paragraph. This does exactly what I want, but since the project I'm working on is a large collaborative project this is undesirable as someone is likely to forget.

I'd also ideally like to do this without having to put all text inside a custom \begin{myParagraph} environment for the same reasons.

Is there something I can put in my header.tex file to sort all of this out automatically?

  • Idea: Unlike \parskip, the \parindent setting only effects text paragraphs, and doesn't effect section titles, lists, equations and figures, so can I redefine this command so it inserts a vertical space instead of a horizontal space? – Blue7 May 15 '15 at 15:50
  • surely adding \\ after the paragraph makes latex complain about an underful hbox of badness 10000 in every case doesn't it? – David Carlisle May 15 '15 at 15:52
  • Yep it does. That's another reason I don't want to use ` \\ ` . But its still the best solution I have so far. – Blue7 May 15 '15 at 15:53
  • 1
    \parindent is a tex primitive like \parskip and affects exactly the same things, it may be that it is set to 0 locally, or suppressed with \noindent in some places. – David Carlisle May 15 '15 at 15:54
  • No, it is not a solution at all, it does not make a vertical space it makes an additional horizontal box at the end of the paragraph with no content, such boxes are not discarded at the top of the page, and have multiple other bad effects. – David Carlisle May 15 '15 at 15:55
4

The parskip package aims to allow setting for a non zero \parskip with the standard classes while reducing the number of places unwanted space appears. Alternatively more extensive classes such as the koma classes have design options incorporating non zero parskip.

\documentclass[parskip=half]...

for example.

Using \\ at the end of a paragraph does not add vertical space, it forces a spurious extra line of the paragraph that is an empty box the width of the page (which is why you get an underfull box warning). Such boxes to not act well at page breaks (or anywhere else).

  • The {parskip} package is almost perfect! Thankyou! The only probelm is it adds a space between text and an equation. Is there a way I can fix this? – Blue7 May 15 '15 at 16:08
  • Never mind. It was just because I had a space between the text and the \begin{equation} in the source code. – Blue7 May 15 '15 at 16:09
  • Sorry, I've changed my mind again. Is there an option to automatically remove the space between a paragraph and equations? Manually going through my source code and removing all of the empty lines is taking a while and making my source code look cramped and unreadable. – Blue7 May 15 '15 at 16:16
  • 2
    @Blue7 empty lines before display math are a syntax error irrespective of the setting of \parskip. They absolutely should always be removed (or commented out) multiple examples of this on the site, eg see Herberts answer here tex.stackexchange.com/questions/7831/… – David Carlisle May 15 '15 at 16:19
  • Commenting it out has worked nicely. It removes the white space between the text and equation in the compiled document without making the source look cramped. Thanks! – Blue7 May 15 '15 at 16:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.