What is LyX?

See LyX website.

My answer to the question: it is a very very efficient tool to write latex documents. Here is a screenshot of my recent project written in LyX: Image description

Why not write latex code directly?

If you are using vim/Emacs editing Tex code, then I would simply say “enjoy coding!” and refrain from any comments :-)

If you are using MikTex+WinEdit (many Windows users), or TeXLive+Texmaker (many linux users), I’m sure at some point you would really hate writing latex code.

If you don’t know what MikTex/TeXLive is, then this article is not suitable for you.

How to use LyX efficiently?

writing latex code instead of moving your mouse to click the buttons.

When writing raw latex code, taking this expression for example, you need a lot of keystrokes to input $\nu_\mu \rightarrow \nu_\tau$

Many beginners probably use LyX in this way: click “Insert”>”Math”>”Inline formula”, then click the notation of , click the button for subscript,…., which is very very inefficient.

If you are a bit more advanced, you may use a lot of shortcut keys to do that. But you may realise that you fingers jump too much on the keyboard.

The best way I would recommend (you need to configure LyX properly) to input :

  1. ctrl+M (equivalent to starting the math environment $$ when you write the raw code)
    Image description

  2. type \nu_\mu

  3. press the spacebar twice (you will see how the cursor moves if you only press once)
    Image description

  4. type \ri…,
    Image description
    then press enter (you don’t need to fully type “\rightarrow”. Typing “\ri” is enough for LyX to auto-complete)
    Image description

  5. type \nu_\tau, press spacebar three times to escape the math mode
    Image description

Actually you see step 1 takes same (or less) number of keystrokes as typing $$ (on normal keyboards, you need to press shift to input $), step 2 and 5 cost same, step 4 reduces keystrokes.

Most importantly, you see the expression immediately without running latex/pdflatex to generate pdf.

If you’re really an enthusiast about writing raw code, here is another way

  1. ctrl+L,
  2. type $\nu_\mu \rightarrow \nu_\tau$
    Image description

Using shortcut keys as much as you can

… to be added …

  1. ctrl+shift+M
  2. alt+I, F

Using LyX Note

Select any piece of text, then press Alt+I, N, N, see what happens :-)
I use this very often when I want to drastically modify some text.

LyX configuration

enable auto-completion:

Open LyX, go to Tools > Preferences > Editing > Input Completion, set those items as follows
Image description

inverse search, i.e. jump from pdf to the corresponding place in the code

See LyX & SyncTeX.
more to be added …

set some shortcuts:

Open LyX, go to Tools > Preferences > Editing > Shortcuts

My preferences:

  1. ctrl+shift+i: “label-insert”, which creates “\label{…}” for equations, figures, tables, etc.
  2. ctrl+shift+o: “dialog-show-new-inset ref” (needs to be created), = adding “\ref{…}”
  3. ctrl+shift+p: “citation-insert”, = adding “\cite{…}”

For more information, visit LyX_FrequentlyUsedShortcuts