0

I highly doubt that this question hasn't been asked before, but I haven't managed to use the right search words to find it.

In case it matters I'm writing in Overleaf and use \documentclass{article}.

My problem is, that when I want to split a block of text into two blocks with a "free" line in between, I usually use \\\\, as it's fast and simple to do. However, using this method annoyingly often causes each block of text to compress or expand so that the last word of each block of text is printed on its own line. I've managed to avoid this a few times by splitting lines within individual blocks with just two \\ (so no "free" space in between). Other times I've managed to fix it by rephrasing sentences (adding or subtracting words). This method is annoying, and usually, only have a chance at working for small blocks of text.

Why does the \\\\-command prioritize a single word on the last line of each block?

Is there another method or command to achieve multiple blocks of text separated by a "free" line without the block constantly rearranging words, so that the last word is printed on it's own line?

In case of my explanation being poorly drafted, look at the two figures below for clarity. The example in the figures is not in English, but I'm pretty sure it doesn't make a difference, so forgive me for being too lazy to create a new example just for this.

enter image description here

Edit: If I just separate paragraphs by an empty line like this:

Text 1

Text 2

Text 3

Then I get the following result:

enter image description here

Still no vertical space, but now there's an annoying horizontal space.

  • 8
    using \\\\ is wrong. separate paragraphs by an empty line and use e.g. \medskip to add some space. – Ulrike Fischer Mar 09 '22 at 12:45
  • Can't tell you why, but empty lines doesn't work for we... Latex just ignores the space. – Luke_Leon Mar 09 '22 at 13:00
  • 1
    I find that hard to believe. In that case, can you post some code, i.e. an example that shows your problem? – Ingmar Mar 09 '22 at 13:06
  • I've updated my post... Am I misunderstanding something? Or doesn't the code work as it's supposed to? – Luke_Leon Mar 09 '22 at 13:26
  • 1
    You're on the right track. The empty line in the source code divides the text up in paragraph. Now you want to add a \bigskip to that empty line, to get roughly one line of vertical space (\medskip is a smaller space). The "horizontal space" at the beginning of a paragraph is the indentation. To suppress it in a single paragraph, add \noindent before the text in that paragraph; to suppress it in the whole document (more elegant) use this approach (write \setlength\parindent{0pt} in the preamble). – marquinho Mar 09 '22 at 13:35
  • This works. Thanks @marquinho – Luke_Leon Mar 09 '22 at 13:54
  • 2
    the horizontal space isn't "annoying", it's the standard way to mark a paragraph. If you want instead to mark it with a vertical skip the parskip package will do that for you. – David Carlisle Mar 09 '22 at 14:09
  • (It was basically just Ulrike's comment, only a bit longer.) – marquinho Mar 09 '22 at 14:09
  • @marquinho I would always avoid adding explicit spaces and \noindent at each paragraph break, the markup should just be a blank line. The choice of styling can then be made at one point, in the document preamble. If the document is full of \noindent moving back to a standard indented layou later is harder. – David Carlisle Mar 09 '22 at 14:12
  • @DavidCarlisle: Thanks, you are absolutely right. Using case-by-case solutions might be OK to fix a snippet of code, but not for a long document. They aren't merely "less elegant" – they come back to bite you. – marquinho Mar 09 '22 at 14:31

1 Answers1

0

Multiple solutions have been found. The two best solutions seem to be...

  1. import \usepackage{parskip} to avoid commands. Just make an empty line as you would in other standard writing softwares like Word and Google Docs.

  2. Make an empty line followed by either \bigskip or \medskip like this:

1st block of text

\bigskip 2nd block of text

\medskip 3rd block of text

  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center. – Community Mar 09 '22 at 14:07
  • 1
    ....you could ask @marquinho to add an answer, or answer yourself with the solution that worked for you. Remember, one of the aims of this site is to be useful to people that could stumble on a similar problem... – Rmano Mar 09 '22 at 18:49