2

In my LaTeX document, I'd like to have two paragraphs which are separated by some smaller vertical spacing.

When I use the following code, this works just as intended, automatically:

\documentclass[a4paper]{article}

\usepackage[english]{babel}
\usepackage[utf8]{inputenc}

\setlength{\parindent}{0cm}

\begin{document}

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.\\

At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

\end{document}

enter image description here

But when I wrap these two paragraphs in \begin{flushleft} ... \end{flushleft} (which is what I'm trying to do), the result changes to the following, unforunately:

...

\begin{flushleft}

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.\\

At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

\end{flushleft}

...

enter image description here

Is there any way I can get the original style of paragraphs and spacing -- just with a ragged right side (instead of full justification)?

I have already seen that wrapping each paragraph in the environment separately helps. But is this really the only way to solve the problem? Having lots of paragraphs, I would prefer to set the justification once only, apparently.

2
  • 2
    No never end a paragraph with \\ that is always wrong. the code does not "work as intended" it produces Underfull \hbox (badness 10000) in paragraph at lines 11--12 Badness 10000 means that the paragraph is infinitely bad according to TeX's notion of quality of linebreaking Jan 12, 2015 at 1:39
  • 1
    See this question and answer more generally.
    – jon
    Jan 12, 2015 at 3:40

1 Answer 1

2

Don't use \\ for line spacings (they have application in places like tabular, but are not intended as a mechanism for line skip). If you want an inter-paragraph spacing, use \parskip and end the paragraph with a blank line or a \par.

\documentclass[a4paper]{article}

\usepackage[english]{babel}
\usepackage[utf8]{inputenc}

\setlength{\parindent}{0cm}
\setlength{\parskip}{\baselineskip}
\begin{document}

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.

At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

\noindent\hrulefill

\begin{flushleft}
\setlength{\parskip}{\baselineskip}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.

At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
\end{flushleft}

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .