I'm a new Lyx user, and yes I've read the tutorial.

Lyx won't let you add two spaces or two blank lines when you want to. If you switch to Verbatim font, then you type as you please but ctrl-m is disabled so you have to use Insert->Inline Eqn which is slow and irritating. Is there any way defeat these irritating features, so that I can type what I want to type but also us ctrl-m?

EDIT: Either enabling spaces in Standard or storing ctrl-M in Verbatim would work. Or if there is some other setting that let's both work at the same time.

  • 1
    Welcome to TSE. That question is off-topic here. Oct 17 at 18:04
  • 6
    @JoséCarlosSantos No, it is not. Oct 17 at 18:04
  • 1
    Jerry: Yes, there is, but may I ask why you need to do that? You can add multiple spaces with Ctrl + space, and multiple line breaks with Ctrl + enter, but particularly the last thing is usually the wrong thing to do. Depending on what you want to achieve, there will be other methods that are better. Oct 17 at 18:06
  • 1
    Ctrl+enter at the start of an empty paragraph (when you hit enter you start a new paragraph) won't work, but if you do it at the end of a paragraph with text in it, it does work. That is the wrong thing to do though. It doesn't end the paragraph. If you want more space between paragraphs in general, go to Document -> Settings -> Text layoyut, and set the "Vertical space" to what suits you. To add more space in specific cases, Insert -> Formatting -> Vertical space. Oct 17 at 18:21
  • 1
    @JerryGuern Do not expect to use LyX like Word. LyX will not allow you to add very easily wrong formats, as several spaces between words , or several blank lines between lines, but is not very difficult do that: Ctrl+Alt+(space space space space space) or Ctrl+(Enter Enter Enter) you will do what you want (and most times that will be the wrong way to format the document correctly).
    – Fran
    Oct 17 at 18:29

As you're not exporting to any other format, it's probably more OK to ignore the LaTeX side of things. In the case that PDF is a desired output, the LaTeX side should not be ignored, and see the old answer below.

Go to Document --> Settings --> Local Layout, and add the following:

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
    FreeSpacing           1
    KeepEmpty       1

This modifies the Standard style to allow multiple spaces (FreeSpacing 1) and empty paragraphs (KeepEmpty 1). This will allow you to add spaces and newlines as you will, while not disabling math mode.

I guess the Save as document defaults button will make this default for new documents as well.

Old answer

Well you can, but in general you probably shouldn't. There will probably be better ways of achieving what you're actually trying to do. That said:

  • Adding multiple spaces can be done with Ctrl + Space (the LaTeX equivalent is inserting a ~).
  • Adding multiple line breaks can be done with Ctrl + enter, with the caveat that it doesn't work in an empty paragraph (the LaTeX equivalent is adding a \\)
  • Thank you! For those who are wondering, I have premature arthritis, and my handwriting is deteriorating. I use Lyx to jot math notes and work through problems the way I used to use scratch paper. I don't even Export to other formats. So I want to just space things out how I want to see them, while still being able to use inline equations. It was terribly annoying to discover that Lyx needlessly disables ctrl-m in Verbatim, forcing me to use the mouse and dropdown menu every time. I wish engineers thought about such things a little more. Oct 17 at 19:09
  • 1
    @JerryGuern From a LaTeX perspective, it makes sense to disable Ctrl+M in verbatim, because it's not possible to insert math mode in verbatim mode. The point of verbatim is to print the content exactly as is, so \begin{verbatim}$\int\,dx$\end{verbatim} will show you a dollar sign, a backslash, etc. while outside of verbatim you will see an integral sign followed by dx. When you've selected verbatim from the dropdown, you're in such a verbatim environment, and there can be no inline math inside that. (ctd.) Oct 17 at 19:38
  • @JerryGuern If you end that verbatim mode, the next piece of content will be in a new paragraph, and hence on a new line. In other words, there is a reason for why it is the way it is. You can define a keyboard shortcut to jump from verbatim to math, but that math will be placed on a separate line. I don't know if it's possible to customize LyX to behave differently. Oct 17 at 19:42
  • 1
    @JerryGuern Although the answer of Torbjørn is excellent (+1), be careful what you wish for. If you want to print or share your notes you will need to export to PDF and this way the blank lines will be ignored and the spaces will be protected (~) avoiding a good paragraph format. The export to HTML will be also bad. IMHO the right solution is (1) understanding that LyX is not a WYSIWYG editor (i.e., what you see is NOT what will get) and (2) just maintain pressed the Ctrl if you cannot avoid the temptation to force yourself extra spaces or lines.
    – Fran
    Oct 18 at 3:31
  • 1
    @JerryGuern May be sometimes you'll want to print your notes to read on A4 paper, and then you'll be glad to allow to LaTeX takes care of these things. By the way, DocumentsSettings...Text LayoutParagraph separation → Check Vertical space and set it so some noticeable length (to BigSkip, for instance) and you will notice that very rarely you will need Ctrl+Enter to see your text better also in the screen.
    – Fran
    Oct 18 at 19:06

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.