Feeds:
Posts

## Latex Editor in Linux – LyX

I have been talking about LaTeX in my previous post.  LaTeX is a tool to create and typeset  mathematically inclined documents and most academic papers are written in it. In this post, I want to talk about editing LaTeX documents.LyX is available for all the major operating systems.

For people who have not used LaTex, this page gives an excellent tutorial. I like this page from Stack Overflow which gives some best practices. If you (for some reason) decided to buy some LaTeX book , you can get some info in this page. I have read superficially the first two books and they are excellent.

Before I talk about LyX, there are other means of writing LaTex code. If you are a fan of Vim , then Vim LaTeX suite is excellent. (Ubuntu Package – vim-latexsuite) . If you are a gedit fan , then you can get the latex plugin for gedit. (Ubuntu package – gedit-latex-plugin) . In case you want to use LaTeX to prepare presentations then use Beamer (Ubuntu package latex-beamer) . Regarding Beamer, I kind of feel its unwieldy, but the other plugins are excellent.

### Lyx

I found Lyx from some LaTeX mailing list and have not looked back. It is very easy to install in Linux (Ubuntu package – lyx) . It comes with a huge list of packages and formats that you can be productive immediately. The best feature of Lyx is that its a WYSIWIG editor for LaTeX. It doesn’t sound like much, but it can be extremely useful and productive. It is always nice to see how your LaTeX expression looks like immediately. It also has a lot of mechanisms by which it avoids you from making errors which was helpful when I was a LaTeX newbie.

More details about using LyX can be found in its wiki page . LyX’s FAQ is here, even though for me its unsorted FAQ was more useful . A very useful set of tips are in the tips page.

Some random tips I find useful are :

1. Learn command sequences for common LyX operations. It will make you really really productive. For eg, to go into math mode, you press Ctrl-m. LyX allows custom command sequences, use them once you are comfortable.

2. To create numbered (ordered list) press Alt-P-E (Mnemonic is Enumerate). For unordered (bullet) it is Alt-P-B. (Mnemonic is , of course, Bullet).

3. I usually make both the Math (auto) and Math Panels (auto) toolbars always visible. (via View->Toolbars) . I also usually enable the Command Buffer toolbar as I use it extensively , partly because I am listening to MIT ‘s Linear Algebra lectures.

4. If you chose to enable Command Buffer, it can be accessed via Alt-x. I primarily use it to enter matrices. To enter a matrix , enter “math-matrix  numcols numrows” in the buffer. Also make sure that you use \left[ and \right] to denote the brackets as they scale with the matrix size. Yes, the notation is counter-intuitive.

5. Another common beginner pitfall happens when you use summation or the product symbol in LaTeX but the limits appear awkwardly. In that case you will have to use the \displaystyle markup.

For example, $latex \sum_{i=1}^{\infty} i^2$ gets you this

$\sum_{i=1}^{\infty} i^2$

But, $latex \displaystyle \sum_{i=1}^{\infty} i^2$ gets you this

$\displaystyle \sum_{i=1}^{\infty} i^2$

6. The default layout automatically displays the date also in the output. In case you want to avoid that add the tag “\date{}” at the end of the title.

There are lot of other useful tips which can be found in Lyx’s tip wiki.

Happy LyXing !!

### One Response

1. […] I felt, overall, the lectures were excellent. They were short (40-50 minutes). So my usual daily schedule was to listen to a lecture, and read the relevant sections in the book , solve the exercises for which the answers are available at the end of book. All these steps took at most 2-3 hours a day. I was also taking notes in LaTeX using Lyx. I have talked about using Lyx previously in this blog post. […]