Difference between revisions of "LaTeX:LaTeX on AoPS"
(→Basic Expressions) |
(→Basic Expressions) |
||
Line 28: | Line 28: | ||
<b>Fractions</b>: We can make fractions via <code>$\frac{...}{...}$</code>. For instance, <code>$\frac{x+y}{2}$</code> will give us <math>\textstyle\frac{x+y}{2}.</math> | <b>Fractions</b>: We can make fractions via <code>$\frac{...}{...}$</code>. For instance, <code>$\frac{x+y}{2}$</code> will give us <math>\textstyle\frac{x+y}{2}.</math> | ||
</li> | </li> | ||
− | + | ||
<li> | <li> | ||
− | <b><math>n^\text{th}</math> Roots</b>: | + | <b><math>n^\text{th}</math> Roots</b>: Square roots in <math>\LaTeX</math> are pretty simple; we just type <code>$\sqrt{...}$</code>. For instance, <code>$\sqrt{2}$</code> gives us <math>\sqrt 2.</math> Cube roots, fourth roots, and so on are only slightly more difficult; we type <code>$\sqrt[n]{...}$</code. For instance, <code>$\sqrt[4]{x-y}$</code> gives <math>\sqrt[4]{x-y}.</math> |
</li> | </li> | ||
Revision as of 13:11, 1 October 2015
LaTeX |
About - Getting Started - Diagrams - Symbols - Downloads - Basics - Math - Examples - Pictures - Layout - Commands - Packages - Help |
This article explains how to use LaTeX in the AoPSWiki, the AoPS Community, and the AoPS Classroom. See Packages to know which packages are prebuilt into the AoPS site.
Contents
Getting Started with LaTeX
The Very Basics
LaTeX uses a special "math mode" to display mathematics. There are two types of this "math mode":
-
In-line math mode. In in-line math mode, we use
$
signs to enclose the math we want to display, and it displays in-line with our text. For example, typing$\sqrt{x} = 5$
gives us -
Display math mode. In display math mode, we enclose our code in double dollar signs, and it displays the math centered and on its own line. For example,
$$\sqrt{x} = 5$$
gives us Besides displaying in-line vs. displaying centered and on a new line, the two modes render differently in other ways. Note that$\sum_{k=1}^n k^2$
gives us whereas$$\sum_{k=1}^n k^2$$
gives us
Basic Expressions
-
Fractions: We can make fractions via
$\frac{...}{...}$
. For instance,$\frac{x+y}{2}$
will give us -
Roots: Square roots in are pretty simple; we just type
$\sqrt{...}$
. For instance,$\sqrt{2}$
gives us Cube roots, fourth roots, and so on are only slightly more difficult; we type$\sqrt[n]{...}$</code. For instance,
$\sqrt[4]{x-y}$
gives - Superscripts and Subscripts:
-
Grouping Expressions: Our ordinary parentheses
(...)
and brackets[...]
work to group expressions in . For instance,$(x+y)[z+w]$
gives us We can also group expressions using curly braces, but we can't just type{...}
. Rather, we must type\{...\}
. This is because uses plain curly braces for other things, such as fractions and superscripts and subscripts. When we put (vertically) large expressions inside of parentheses (or brackets, or curly braces, etc.), the parentheses don't resize to fit the expression and instead remain relatively small. For instance,$$f(x) = \pi(\frac{\sqrt{x}}{x-1})$$
comes out as To automatically adjust the size of parentheses to fit the expression inside of them, we type\left(...\right)
. If we do this for our equation above, we get
Making Figures Using Asymptote
LaTeX can also be used to draw figure and diagrams on the AoPS site using a language called Asymptote. See Asymptote to learn more.
That's all there is to invoking LaTeX on the AoPS site. Of course, you'll want to do more than square roots! You can read through the Symbols and Commands pages to learn how to render other symbols with LaTeX. You can also click on formulas created by others to see the code they've used.