0

When editing my documents in Texstudio I like to visually have some parts separated. Usually I would leave some blank lines in the .tex file. But Latex translates this into a linebreak/new line. Is there a possibility to stop it from doing that and only have linebreaks when putting a \\ ?

  • 2
    I'm afraid you can't, and you should use \\ exceptionally (it is used for multiline equations environments, tabulars, &c.). To order visually your source-code, why don't you insert lines containing only the comment sign %? – Bernard Sep 25 '15 at 10:14
  • Oh that's an amazing idea! I never thought about that! If you post the comment as an answer I can mark it as 'approved'. Why shouldn't I use \\ so much? I use it for example after finishing a paragraph. Isn't it the same as two blank lines? – ElDoe Sep 25 '15 at 10:26
  • 4
    never use \\ at the end of a paragraph! It generates a warning about underfull hbox badness 10000 (infinitely bad) and produces a spurious white line that is not vertical space but an empty line of text that is not discarded at a page break. – David Carlisle Sep 25 '15 at 10:30
  • Yeah you are right, I never thought much about that error. So instead I should just use two blank lines? – ElDoe Sep 25 '15 at 10:32
  • 1
    one blank line (two returns) is an end of paragraph, \\ is for the rare case you want to have a line break (leaving a short line) within a paragraph. – David Carlisle Sep 25 '15 at 11:05
8

You can't: blank lines are used by TeX-the-program to indicate a new paragraph (the basic unit for text formatting), and you should use \\ exceptionally (it is used for multiline equations environments, tabulars, &c.).

To order visually your source-code, why don't you insert lines containing only the comment sign %?

0

A simple workaround is to use empty comments instead of blank linkes:

Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
%
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
nisi ut aliquip ex ea commodo consequat.
%
Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur.
%
Excepteur sint occaecat cupidatat non proident, sunt in culpa
qui officia deserunt mollit anim id est laborum.

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.