9

The problem I have is that the spacing between the paragraphs are too large. I have tried the \setlength{\parskip}{0.1mm} command but it does not give the correct spacing that I want.

I have also tried \raggedbottom but neither does that work.

Here is some example code:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\usepackage{titling}
\usepackage{blindtext}
\usepackage[a4paper, top=1cm]{geometry}
%\usepackage{parskip}

\setlength{\parskip}{0.1mm}
\raggedbottom

\title{Open Source och Licenser}
\author{Martin}

\begin{document}

\maketitle

\paragraph{}
\blindtext
\paragraph{}
\blindtext

\end{document}

I read in another thread that the parskip package would be good to use for this kind of problem, but I did not get it to work. As you can see I have commented the \usepackage{parskip} because all it does in my document is reducing the spacing between the title and the author lines.

Here is an image of how the document looks:

enter image description here

What I want to do is to reduce the spacing between the paragraphs so it is almost non existent. Is there any easy way to do that?

martin36
  • 319

1 Answers1

7

\paragraph{} doesn't have to be issued to start a paragraph. It is actually a sectional unit (level 4, in fact) used to set a heading for a paragraph (usually run-in). Here's an example:

enter image description here

\documentclass{article}

\usepackage{blindtext}

\begin{document}
\paragraph{First paragraph}
\blindtext
\paragraph{Second paragraph}
\blindtext

\end{document}

Since \paragraph sets a heading it also adds some space before it to separate it from the regular paragraph text. Without it, leave a blank line or insert an explicit \par to separate a paragraph:

enter image description here

\documentclass{article}

\usepackage{blindtext}

\begin{document}

\blindtext

\blindtext

\end{document}
Werner
  • 603,163
  • Thank you! The result \par gave me was more what I was looking for. But do you know if there is a way to reduce the spacing between paragraphs using \paragraph? – martin36 Jan 17 '17 at 19:17
  • @martin36: Since \paragraph is a sectional heading setting, by default is uses \@startsection (search for \paragraph in article.cls). And \@startsection has one of its argument dedicated to the space before setting the heading. See beforeskip in Where can I find help files or documentation for commands like \@startsection for LaTeX? So, you can redefine \paragraph to use a different beforeskip or use a package (like titlesec, say). – Werner Jan 17 '17 at 19:25
  • Thank you very much! I will check that out, but it seems pretty difficult to do for my skill level. – martin36 Jan 17 '17 at 19:34
  • @martin36 you should not need to check it out at any skill level as using \paragraph{} is incorrect markup it is a heading with no heading so there should not be a need to customize it. Also using \par is unnecessary it is just the same as leaving a blank line. – David Carlisle Jan 17 '17 at 19:44
  • 2
    @martin36: Using the default \@startsection is not necessary, if you're using a package. However, you could try adding \makeatletter \renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}% {3.25ex \@plus1ex \@minus.2ex}% {-1em}% {\normalfont\normalsize\bfseries}} \makeatother to your preamble and change the value of 3.25ex \@plus 1ex \@minus.2ex to (say) 1mm. Then see what that does to your output. However, for just plain paragraphs, don't use \paragraph. – Werner Jan 17 '17 at 19:51
  • 1
    @Werner I tried what you wrote and changed 3.25ex to 1mm and it gives a perfect space between the paragraphs. But I will remember not to use the \paragraph{} for separation plain paragraphs in the future. – martin36 Jan 17 '17 at 20:23