2

I am writing a report and since the text is justified, every last sentence of a paragraph has more spaces between words in order to fit into the textwidth. I saw a lot of questions about this subject, I tried the solutions but it never worked for me. In addition to that, the solutions I've found may work for a countable number of words. However, I need to do it for all my report. Does anyone know how to solve this problem?

enter image description here

In the picture above, there are two huge spaces between three words and I'd like to remove this, and to apply the solution for the whole document.

2
  • 3
    Welcome to TeX.SE. Please provide complete small code begging wit \documentclass{...} ending with `\end{document} which will generate text you show. Without this you left us to guessing ...
    – Zarko
    Aug 10 '16 at 12:31
  • 3
    My crystal ball suggests \break. If so, please learn that you mark the end of a paragraph by a blank line.
    – egreg
    Aug 10 '16 at 12:41
1

Here is a comparison of approaches:

  1. using \linebreak at the end of a paragraph leads to the undesired large spacing between words that you discovered. Also the indentation of following paragraphs is missing.
  2. using \\ at the end of paragraphs does not give the large spaces between words, but the indentation of following paragraphs is still missing.
  3. using \\ in combination with a \parskip instead of an indentation will still give the wrong result as the paskip will be missing.
  4. using an empty line inbetween paragraphs will give you the correct result in combination with paragraph indentations and ...
  5. in combination with parskip.

Summary: The only correct way to separate paragraphs f text is an empty line.

enter image description here

\documentclass{article}
\usepackage{geometry}
\begin{document}

\section{wrong result (large space between words) using linebreak command}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,
vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida
mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.
Donec vehicula augue eu neque.\linebreak
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,
vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida
mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.
Donec vehicula augue eu neque.\linebreak
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,
vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida
mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.
Donec vehicula augue eu neque.


\section{wrong result (no paragraph indent on following paragraphs) using double backslash}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,
vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida
mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.
Donec vehicula augue eu neque.\\
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,
vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida
mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.
Donec vehicula augue eu neque.\\
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,
vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida
mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.
Donec vehicula augue eu neque.

\section{wrong result (no parskip between following paragraphs) using double backslash}
{\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,
vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida
mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.
Donec vehicula augue eu neque.\\
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,
vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida
mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.
Donec vehicula augue eu neque.\\
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,
vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida
mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.
Donec vehicula augue eu neque.}

\section{correct result (with paragraph indentation) using empty line}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,
vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida
mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.
Donec vehicula augue eu neque.

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,
vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida
mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.
Donec vehicula augue eu neque.

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,
vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida
mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.
Donec vehicula augue eu neque.

\section{correct result (with parskip) using empty line}
{\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,
vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida
mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.
Donec vehicula augue eu neque.

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,
vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida
mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.
Donec vehicula augue eu neque.

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,
vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida
mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.
Donec vehicula augue eu neque.}
\end{document}
2
  • Nice comparison (+1). I'm afraid the OP is no longer active on site to accept the answer :-(
    – Zarko
    Mar 1 '20 at 10:55
  • Related to the answer: Use \hbox{ No additional space will be introduced between these words. } Credits
    – vineeshvs
    Mar 2 '20 at 11:08
-2

Actually I've found the answer thanks to @egreg. I've used \linebreak in the end of the line. But when I use \\ instead, everything works fine.

5
  • 5
    You shouldn't use \\ either. End a paragraph with an empty line. Aug 10 '16 at 12:55
  • @UlrikeFischer okay thanks, but why shouldn't I use it?
    – iMadz
    Aug 10 '16 at 12:59
  • You don't need it, and you will get lots of underfull box warnings in the log. Aug 10 '16 at 13:00
  • Furthermore, you won't have any parindent (if set to a non-zero value) for the paragraph that follows, since it won't be considered as such.
    – Bernard
    Aug 10 '16 at 13:38
  • 1
    You can also use \par. Aug 10 '16 at 14:07

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.