ltxprimer-1.0
TUTORIAL VIII
TYPESETTING MATHEMATICS
Donal Knuth created TEX primarily to typeset Mathematics beautifully. L A TEX includes all the capabilities of TEX in Mathematics typesetting, sometimes with easier user interfaces. Then there are packages like amsmath which enhance and refine these interfaces. VIII . 1 . T HE BASICS A mathematical expression occurring in running text (called in-text math) is produced by enclosing it between dollar signs. Thus to produce The equation representing a straight line in the Cartesian plane is of the form ax + by + c = 0 , where a , b , c are constants. we type Some comments are in order. First note that the text within dollars is typeset in italic (actually math italic). Again, even though we did not leave any spaces within ax+by+c=0 , TEX leaves spaces on either side of the addition signs and the equality sign. On the other hand, even if we type $ax + by + c = 0$ , the output would be the same: ax + by + c = 0 . The moral? TEX has its own spacing rules in math mode . To see another instance of this, change the last part of the code above to read ... where $a, b, c$ are constants. Saves some typing, does not it? But look at the output. The equation representing a straight line in the Cartesian plane is of the form $ax+by+c=0$, where $a$, $b$, $c$ are constants. The equation representing a straight line in the Cartesian plane is of the form ax + by + c = 0 , where a , b , c are constants. Do you see the difference? There are no spaces after the commas, though we had such spaces in the output. So TEX swallows spaces in math mode (you can not save dollars that way!). Incidentally, dollar signs are TEX way of distinguishing Mathematical text. L A TEX has other ways also of doing it, using \( ... \) or \begin{math} ... \end{math} . Thus either of the inputs shown below also produces the same output as above. The equation representing a straight line in the Cartesian plane is of the form \(ax+by+c=0\), where \(a\), \(b\), \(c\) are constants. The equation representing a straight line in the Cartesian plane is of the form \begin{math}ax+by+c=0\end{math}, where \begin{math} a \end{math}, \begin{math} b \end{math}, \begin{math} c \end{math} are constants.
77
Made with FlippingBook Publishing Software