[Tex/LaTex] Adding empty lines for readability


I'm a new user of LyX, and reading the tutorial I found that I can't add freely spaces and empty lines to the LaTeX code, since it's about formatting the text, and it's done by the compiler.

I can really understand the philosophy, and that's why I decided to use that tool; what I find hard to understand, is why I can't use spaces and empty lines to improve the readability of the code itself, and maybe let the compiler ignore them.
Or maybe there is a "dummy" marker, that allows to insert a space in the code ignored by the compiler?

Follow up: I eventually switched to LaTeX right after that document and sticked to it.

Best Answer

Since LyX is attempting to show something that represents the output and not the raw LaTeX input, there isn't a way (that I'm aware of) to put extra spaces in the editor since that would imply having them in the output.

One thing you can do as a "dummy marker" is to insert an "ERT" box (Ctrl+L or Alt+I+X) on the line you want to preserve as empty. The ERT box is copied verbatim into the LaTeX source, so if you leave it empty, it will have no effect on the final document.

Alternatively, you could set the document to use vertical space to separate paragraphs rather than indents (Document > Settings > Text layout). Note that this will change your output as well as the LyX representation, but it's easy to change back when you're ready to export your finished document.

Related Question