LaTeX forum ⇒ LyXWhy can't you have empty lines when editing text in Lyx?

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Cosm
Posts: 10
Joined: Thu Nov 07, 2013 12:53 pm

Why can't you have empty lines when editing text in Lyx?

Postby Cosm » Fri Apr 28, 2017 4:52 pm

It's annoying that you can't enter empty lines when editing text in Lyx. I mean it's a text editor so you should be able to do it because composing a complicated text is a piecemeal process, inability to create empty spaces or lines makes you feel trapped. Why isn't there an option to allow empty lines even if they would be ignored in the output (or not ignored, it doesn't really matter to me which one)? I know you can for instance use Ctrl+Space but I just want normal empty spaces in the editor.

I don't see the justification for this, just saying that it's a WYSIWYM editor doesn't justify it, it only defines the problem. I'm almost starting to think I should start learning Latex because this annoys me so much. So what is the justification?

User avatar
Johannes_B
Site Moderator
Posts: 3551
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Fri Apr 28, 2017 5:52 pm

As a LaTeX user, not a LyX user, there is not much i can say.

I would say: Learn LaTeX.

By the way, knowing how LaTeX works is very recommended (indeed needed) to properly use LyX.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

User avatar
Stefan Kottwitz
Site Admin
Posts: 8457
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Wed May 03, 2017 12:45 am

Hi Cosm!

At first, as writing in LyX should represent the output, "ignored" empty input lines don't make much sense. They should be in the output too.

To have it in the input as well as in the output: you could insert ERT (TeX code) such as \vspace{some cm}. Or you could insert skips such as by inset-insert vspace medskip.

To have it in the input but not in the output: you could insert ERT and leave it empty or start with a percent sign % for commenting it out. The ERT inset should be set to be "Open", not collapsed.

Use shortcuts for repeating, or copy & paste. However, I would not put such additional insertions in a document, as it has to be cleaned up later. Feeling trapped is an argument, but also vertical space is precious on screens, that I would not waste. Maybe there's another way to separate things other than large white space, such as comment lines or big headings that can be removed later on.

Stefan
Site admin

scottkosty
Site Moderator
Posts: 496
Joined: Sat Sep 01, 2012 6:38 am

Postby scottkosty » Thu May 04, 2017 2:12 am

Sorry for the frustration. You can get your desired behavior from the customization explained in the following answer: https://tex.stackexchange.com/questions/40447/adding-empty-lines-for-readability/152001#152001

User avatar
Stefan Kottwitz
Site Admin
Posts: 8457
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Thu May 04, 2017 1:00 pm

To quote the solution, scottkosty linked above:

"You can do what you want by adding the following to Document > Settings > Local Layout

  1. Style Standard
  2. Category MainText
  3. Margin Static
  4. LatexType Paragraph
  5. LatexName dummy
  6. ParIndent MM
  7. ParSkip 0.4
  8. Align Block
  9. AlignPossible Block, Left, Right, Center
  10. LabelType No_Label
  11. KeepEmpty true
  12. FreeSpacing true
  13. HTMLStyle
  14. div.standard {
  15. margin-bottom: 2ex;
  16. }
  17. EndHTMLStyle
  18. End


KeepEmpty allows for multiple returns and FreeSpacing allows for multiple spaces. If you decide you want to make this change permanent, either create a layout and put it in your LyX user directory's layout folder or if you want it on a per-document basis, create a module.

All of this information and much more is in Help > Customization."
Site admin

Cosm
Posts: 10
Joined: Thu Nov 07, 2013 12:53 pm

Postby Cosm » Fri Jul 07, 2017 11:12 pm

Thanks scottkosty and Stefan Kottwitz it works, I'm wondering is there a special reason to include all that in the local layout, can't I just include the following which also seems to work:

Style Standard

KeepEmpty true
FreeSpacing true

End

scottkosty
Site Moderator
Posts: 496
Joined: Sat Sep 01, 2012 6:38 am

Postby scottkosty » Sat Jul 08, 2017 11:31 pm

Omitting the other flags I think will not affect PDF output, just the LyX display. For more information, see Help > Customization. If you plan on using LyX for a long time, it is worth the time to read, although it is dry so not the most fun.


Return to “LyX”

Who is online

Users browsing this forum: No registered users and 7 guests