next up previous contents
Next: Navigating an Equation Up: Using Math Previous: Using Math   Contents

Math Mode

Somewhere in your LYX document, type:

I like what Einstein said, E=mc^2, because it's so simple. 
Now, that equation doesn't look very good, even in the dvi file; there's no space between the letters and the equals sign, and you'd like to write an actual superscript for the ``2''. That bad typesetting happened because we didn't tell LYX that we were writing a mathematical expression, so it typeset the equation like regular old text.

Instead, we create a formula that will get typeset properly. In order to create a formula, just click the toolbar button with $ {\frac{{a+b}}{{c}}}$ written on it in blue. LYX will insert a little blue square, which is an empty math formula. LYX has placed the cursor in the blue square, so just type E=mc^2 again. The expression is typed in blue, and the blue square disappears as soon as the formula is not empty. Now type Esc to leave the equation The purple markers disappear, leaving the cursor to the right of the expression, and now if you type something, it will be regular text.

Run LATEX and look at the dvi file. Notice that the expression was typeset nicely, with spaces between the letters and the equals sign, and a superscript ``2''. Letters in math mode are assumed to be variables, and come out in italics. Numbers are just numbers.

This math editor is another example of the WYSIWYM philosophy. In LATEX, you write a mathematical expression using text and commands like \sqrt; this can be frustrating, because you can't see what an expression looks like until you LATEX the file, and may have to spend time to find missing brackets or other ``bugs''. On the other hand, LYX doesn't attempt to get the expression to look perfect (WYSIWYG), but it gives you an extremely good idea of what the expression will look like. LATEX then takes care of the professional typesetting. 99% of the time, you won't have to make any changes to the font sizes or spacing that LATEX outputs. This way (sorry to be so repetitive) you can focus on the content of your mathematical expressions, not their format.


next up previous contents
Next: Navigating an Equation Up: Using Math Previous: Using Math   Contents
Jay Bolton 2004-04-15