6

After a period in a .tex file, within a paragraph, should I use a space or a new line?

I.e. like this:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec rhoncus vestibulum metus ut suscipit. Sed suscipit sem ligula, iaculis dignissim turpis ultricies vitae. Curabitur interdum lorem fermentum tellus blandit venenatis et et nisi. Ut elementum interdum nulla, at dapibus urna consequat ut. Nulla sodales in nulla et semper. Proin et consequat lacus. Nam faucibus, dui sit amet sodales cursus, nunc neque mattis eros, a pharetra purus elit quis tortor.

Or like this:

Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Donec rhoncus vestibulum metus ut suscipit.
Sed suscipit sem ligula, iaculis dignissim turpis ultricies vitae.
Curabitur interdum lorem fermentum tellus blandit venenatis et et nisi.
Ut elementum interdum nulla, at dapibus urna consequat ut.
Nulla sodales in nulla et semper.
Proin et consequat lacus.
Nam faucibus, dui sit amet sodales cursus, nunc neque mattis eros, a pharetra purus elit quis tortor.
  • 3
    It makes no difference, as long as you don't use a blank line (ie two newlines) any number of spaces or a single blank line are treated the same way. – David Carlisle Sep 18 '13 at 8:44
  • Ok:-) But if you are asking about editor preferences rather than TeX behaviour, you could perhaps make that clearer in your question, As that is not at all clear as it is currently worded. – David Carlisle Sep 18 '13 at 8:54
  • I recommend you read the answers at tex.stackexchange.com/q/62446/86 – Loop Space Sep 18 '13 at 9:07
  • xkcd.com/1285 Obviously (^; – jmc Apr 12 '18 at 9:15
7

It’s up to you, both a space or a new line work fine and result in the same output. I recommend using a new line:

  • If your pdf viewer and your editor support SyncTeX, you can click a word in the pdf and you will be taken to the corresponding line in your source.
  • It’ll be easier to find LaTeX errors if your lines are shorter. (Usually error messages tell you in which line the error occurred.)
  • You’ll notice if one single sentence gets too long just by looking at the lines. (I recommend setting up your editor to soft-wrap your lines after a certain number of characters, e.g. 80.)

The setup I’m mentioning here works great with TeXstudio and SumatraPDF.

6

There is no global recommendation. It really depends on your preferences, the tool you use, and your editing context.

For instance, if several persons edit a tex file using SVN, you should use new lines to form a paragraph. In this case SVN will make a diff line by line instead paragraph by paragraph avoiding many conflicts.

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.