{ "cells": [ { "cell_type": "markdown", "metadata": { "collapsed": false }, "source": [ "# A Brief Introduction to Typesetting Mathematics with LaTeX" ] }, { "cell_type": "markdown", "metadata": { "collapsed": false }, "source": [ "Typesetting simple mathematical expressions in LaTeX is straightforward. This very brief introduction should be enough to get you started, but it is not intended to be complete. The typesetting commands usually need to be placed between dollar signs or pairs of them." ] }, { "cell_type": "markdown", "metadata": { "collapsed": false }, "source": [ "The lower case and upper case Greek letters have fairly obvious names (for example,\n", "“`\\delta`” is $\\delta$ and “`\\Delta`” is $\\Delta$). You can look up other common symbols (such as\n", "“`\\infty`” is $\\infty$ and \"`\\pm`\" is $\\pm$) at the website given at the end of this tutorial. Subscripts and superscripts\n", "are made with “`_`” (underscore) and “`^`” as shown below.\n", "
    \\alpha_i = \\beta^2
" ] }, { "cell_type": "markdown", "metadata": { "collapsed": false }, "source": [ "$$\\alpha_i = \\beta^2$$" ] }, { "cell_type": "markdown", "metadata": { "collapsed": false }, "source": [ "If you want multiple characters to appear in a subscript or superscript (like \"ij\"), they can be\n", "grouped in curly brackets. Notice that a symbol can have both a subscript and a\n", "superscript. The subscript of *B* is plain text because it is preceded by “`\\rm`”, which\n", "changes the font to Roman (unitalicized).\n", "
    A_{ij}^3 < B_{\\rm max}
" ] }, { "cell_type": "markdown", "metadata": { "collapsed": false }, "source": [ "$$A_{ij}^3 < B_{\\rm max}$$" ] }, { "cell_type": "markdown", "metadata": { "collapsed": false }, "source": [ "Common functions such as “sin” have shortcuts (“`\\sin`” in this case) that typeset them\n", "in a Roman font. The result of the second command below is better than that of the first, because the function is in a different font than the variable and the spacing is better.\n", "
    sin\\theta
" ] }, { "cell_type": "markdown", "metadata": { "collapsed": false }, "source": [ "$$sin\\theta$$" ] }, { "cell_type": "markdown", "metadata": { "collapsed": false }, "source": [ "
    \\sin\\theta
" ] }, { "cell_type": "markdown", "metadata": { "collapsed": false }, "source": [ "$$\\sin\\theta$$" ] }, { "cell_type": "markdown", "metadata": { "collapsed": false }, "source": [ "The following example shows how to make a fraction.\n", "
    C=\\frac{3}{4}
" ] }, { "cell_type": "markdown", "metadata": { "collapsed": false }, "source": [ "$$C = \\frac{3}{4}$$" ] }, { "cell_type": "markdown", "metadata": { "collapsed": false }, "source": [ "Preceding brackets with “`\\left`” and “`\\right`” automatically makes them the right\n", "size for what’s inside. The result of the second command below is better than that of the first.\n", "
    (\\frac{5}{3})
" ] }, { "cell_type": "markdown", "metadata": { "collapsed": false }, "source": [ "$$(\\frac{5}{3})$$" ] }, { "cell_type": "markdown", "metadata": { "collapsed": false }, "source": [ "
    \\left( \\frac{5}{3} \\right)
" ] }, { "cell_type": "markdown", "metadata": { "collapsed": false }, "source": [ "$$\\left(\\frac{5}{3}\\right)$$" ] }, { "cell_type": "markdown", "metadata": { "collapsed": false }, "source": [ "Another frequently used command is “`\\sqrt`” for a square root symbol.\n", "
    \\sqrt{xy} = 3
" ] }, { "cell_type": "markdown", "metadata": { "collapsed": false }, "source": [ "$$\\sqrt{xy} = 3$$" ] }, { "cell_type": "markdown", "metadata": { "collapsed": false }, "source": [ "You can find more information about typesetting mathematics in LaTeX at \n", "http://en.wikibooks.org/wiki/LaTeX/Mathematics.\n", "For example, that page shows how to make integrals and matrices." ] } ], "metadata": { "kernelspec": { "display_name": "Python 2 (SageMath)", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.14" } }, "nbformat": 4, "nbformat_minor": 0 }