4

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?

  • That's easy, just drop the use of \paragraph{}... – Werner Jan 17 '17 at 19:08
  • What should I use instead? – martin36 Jan 17 '17 at 19:08
  • @martin36: Obviously you are confusing \paragraph with paragraph -- the paragraph ;-) – user31729 Jan 17 '17 at 19:09
  • @Werner If I comment the \paragraph{} then the text just becomes one large paragraph. I still want the spacing in between but just a smaller one. – martin36 Jan 17 '17 at 19:13
  • @martin36: Leave a blank line, or use an explicit \par. The former is more readily used than explicitly typing \par. – Werner Jan 17 '17 at 19:14
5

\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}
  • 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
  • 1
    @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

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.