2

In my text, I let make the paragraph indent automatically by latex. That means everywhere I want to have a paragraph indentation in my text, I just press the enter key twice. However, when I look at the PDF version, I see that the line spacing above and below the paragraph input lines are different. Do you know how to fix this? I circled it red in the picture.

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{float}
\usepackage{caption}
\usepackage{booktabs}
\usepackage{graphicx}
\usepackage{threeparttable} 
\usepackage{caption} \captionsetup[table]{skip=4pt}
\usepackage{caption} \captionsetup[figure]{skip=3pt}
\usepackage{threeparttablex}
\usepackage[T1]{fontenc}
\usepackage[a4paper, left=2.5cm, right=3.5cm, top=2.5cm, bottom=2.5cm]{geometry}
\usepackage{setspace}
\usepackage{mwe}
\usepackage[toc,page]{appendix}
\onehalfspacing
\usetikzlibrary{intersections}
\usepackage{hanging}
\usepackage[bottom,hang]{footmisc}
\setlength{\footnotemargin}{10pt}
\usepackage{indentfirst}
\begin{document}

......

\end{document}

enter image description here

[enter image description here]

enter image description here

  • TeX is not Word! Never use multiple Enter to get a vertical space! Which documentclass are you using? – user2478 Dec 12 '17 at 12:57
  • I'm using article – Luke Dec 12 '17 at 12:58
  • 1
    Better post a MWE, i.e., a Minimal Working Example. Without it, answering your questions comes down to guessing. – Denis Dec 12 '17 at 13:00
  • use only an empty line between paragraphs! Without the double backslashes for a new line! – user2478 Dec 12 '17 at 13:01
  • hmm but I'm already using an empty line between... – Luke Dec 12 '17 at 13:11
1

Your example code not valid MWE. If you change the dots by six medium paragraphs (or easier: \lipsum[1-6] with \usepackage{lipsum} in the preamble) you will not see that effect.

Adding a \parskip like 0pt minus 1 ex before of the paragraphs (in the preamble or after that) allow sometimes a negative paragraph skip (note that with only four paragraphs, i.e. \lipsum[1-4], that does not change anything) that look like your problem (see image bellow).

In you real document you probably have something like \setlength\parskip{0pt minus 1 ex} or something else (some other package, for example) changing that glue.

You can test the real values of \parskip at any point (for instance, after
the word "Spain", including \the\parskip. If this renders some like "0.0ptminus5.165pt" you should expect sometimes some lost of space between paragraphs.

In case of default values (0.0pt plus 1.0pt) or any other positive paragraph skip glue, then the problem is hard to guess, except if you provide a real MWE, reducing your real document as far as possible while still showing the problem but without left any irrelevant code (as probably, many of the listed packages). Probably some as simple like:

\documentclass[12pt]{article}
\usepackage[a4paper, left=2.5cm, right=3.5cm, top=2.5cm, bottom=2.5cm]{geometry}
\usepackage{setspace}
\onehalfspacing
\usepackage{hanging}
\usepackage{lipsum}
\setlength\parskip{0pt minus 1 ex}
\begin{document}
\lipsum[1-7]
This document have a park skip of \the\parskip
\end{document}

enter image description here

1

In fact sometimes we should adjust the space between paragraphs. You can try the following codes before \begin{document}:

\setlength{\parskip}{x\baselineskip}%set space between paragraphs

where x can be any value as you wish. Also x\baselineskip can be changed for x em or x pt.

By setting x\baselineskip to be 0.2\baselineskip, you can get a PDF as follows enter image description here

  • I chose \onehalfspacing in the beginning and would like to keep it that way throughout the text. However, whenever there is a paragraph, just above as in the picture, the line spacing decreases. – Luke Dec 12 '17 at 13:47
  • My codes can give a global setting! It's better than your setting since my codes only change parskip! You can have a try. – Mogic Dec 12 '17 at 13:48
  • this does not answer the question at all which is about vaying line space, also the suggested code removes any stretch or shrink component from \parskip which may not be advisable, especially for classes using \flushbottom. – David Carlisle Dec 12 '17 at 14:29
  • @DavidCarlisle Please consider elucidating your comment as an answer. The other comments are probably unhelpful, and the OP might not grasp your own short comment. The reason I don't answer it myself, is because I use a very different layout structure, so what works for me might not work for others. – user139954 Dec 12 '17 at 16:53
  • 1
    @RobtAll unless the OP edits the question I can't see how anyone can even attempt a guess at an answer. There is currently no hint of the markup that produced the output shown. – David Carlisle Dec 12 '17 at 17:20

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.