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.
Post Reply
Cosm
Posts: 13
Joined: Thu Nov 07, 2013 12:53 pm

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

Post by Cosm »

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?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

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

Post by Johannes_B »

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: 10335
Joined: Mon Mar 10, 2008 9:44 pm

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

Post by Stefan Kottwitz »

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
LaTeX.org admin
scottkosty
Site Moderator
Posts: 542
Joined: Sat Sep 01, 2012 6:38 am

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

Post by scottkosty »

Sorry for the frustration. You can get your desired behavior from the customization explained in the following answer: https://tex.stackexchange.com/questions ... 001#152001
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

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

Post by Stefan Kottwitz »

To quote the solution, scottkosty linked above:

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

Code: Select all

Style Standard
    Category              MainText
    Margin                Static
    LatexType             Paragraph
    LatexName             dummy
    ParIndent             MM
    ParSkip               0.4
    Align                 Block
    AlignPossible         Block, Left, Right, Center
    LabelType             No_Label
    KeepEmpty             true
    FreeSpacing           true
    HTMLStyle
        div.standard {
            margin-bottom: 2ex;
        }
    EndHTMLStyle
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."
LaTeX.org admin
Cosm
Posts: 13
Joined: Thu Nov 07, 2013 12:53 pm

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

Post by Cosm »

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: 542
Joined: Sat Sep 01, 2012 6:38 am

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

Post by scottkosty »

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.
Post Reply