Difference between revisions of "LaTeX:LaTeX on AoPS"

(LaTeX on the AoPSWiki and the AoPS Community)
Line 7: Line 7:
 
== LaTeX on the AoPSWiki and the AoPS Community ==
 
== LaTeX on the AoPSWiki and the AoPS Community ==
  
LaTeX uses a special math mode to display mathematics. To place something written in LaTeX in '''math mode''', use <nowiki>$</nowiki> signs to enclose the math you want to display. For example, suppose you type the following in a Community post or in the AoPSWiki:
+
LaTeX uses a special "math mode" to display mathematics. There are two types of this "math mode":
  
<pre><nowiki>
+
* <b>In-line math mode</b>. In in-line math mode, we use <nowiki>$</nowiki> signs to enclose the math we want to display, and it displays in-line with our text. For example, typing <nowiki>$ \sqrt{x} = 5 $</nowiki> gives us <math>\sqrt{x} = 5.</math>
The solution to $\sqrt{x} = 5$ is $x=25$.
 
</nowiki></pre>
 
  
The resulting post will read:
+
* <b>Display math mode</b>. 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, <nowiki>$$ \sqrt{x} = 5 $$</nowiki> gives us <cmath>\sqrt{x} = 5.</cmath>
  
The solution to <math>\sqrt{x} =  5</math> is <math>x=25</math>.
+
Besides from display in-line vs. displaying centered and on a new line, the two modes render differently in other ways. Note that <nowiki>$ \sum_{k=1}^n k^2 $</nowiki> gives us <math> \textstyle\sum_{k=1}^n k^2,</math> whereas <nowiki>$$ \sum_{k=1}^n k^2 $$</nowiki> gives us <cmath> \sum_{k=1}^n k^2. </cmath> If, for some reason, you want the display style in in-line mode, just place <nowiki></nowiki> at the start of your code. For example, <nowiki>$ \sum_{k=1}^n k^2 $ </nowiki> gives <math>\textstyle \sum_{k=1}^n k^2,</math> whereas <nowiki>$\sum_{k=1}^n k^2 $</nowiki> gives <math>\sum_{k=1}^n k^2.</math>
 
 
As we saw above, when using <nowiki>$</nowiki>math stuff here<nowiki>$</nowiki> to typeset math, the resulting math expression appears right in the text at the location of the <nowiki>$</nowiki>...<nowiki>$</nowiki>. Sometimes we want to break some of the math out of the text and give it its own special line. To do so, we use <nowiki>\[</nowiki>math stuff here<nowiki>\]</nowiki> or <nowiki>$$math stuff here$$</nowiki> to put the math text in display math mode:
 
<pre><nowiki>
 
The solution to \[\sqrt{x} = 5\] is \[x=25.\]
 
</nowiki></pre>
 
The output of this is:
 
 
 
The solution to <cmath>\sqrt{x} = 5</cmath> is <cmath>x=25.</cmath>
 
  
 
LaTeX can also be used to draw figure and diagrams on the AoPS site using a language called [http://artofproblemsolving.com/wiki/index.php/Asymptote_(Vector_Graphics_Language) Asymptote]. See [http://artofproblemsolving.com/wiki/index.php/Asymptote_(Vector_Graphics_Language) Asymptote] to learn more.
 
LaTeX can also be used to draw figure and diagrams on the AoPS site using a language called [http://artofproblemsolving.com/wiki/index.php/Asymptote_(Vector_Graphics_Language) Asymptote]. See [http://artofproblemsolving.com/wiki/index.php/Asymptote_(Vector_Graphics_Language) 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 [[LaTeX:Symbols|Symbols]] and [[LaTeX:Commands|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.
 
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 [[LaTeX:Symbols|Symbols]] and [[LaTeX:Commands|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.

Revision as of 20:45, 30 September 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.



LaTeX on the AoPSWiki and the AoPS Community

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 $\sqrt{x} = 5.$
  • 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 \[\sqrt{x} = 5.\]

Besides from display 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 $\textstyle\sum_{k=1}^n k^2,$ whereas $$ \sum_{k=1}^n k^2 $$ gives us \[\sum_{k=1}^n k^2.\] If, for some reason, you want the display style in in-line mode, just place at the start of your code. For example, $ \sum_{k=1}^n k^2 $ gives $\textstyle \sum_{k=1}^n k^2,$ whereas $\sum_{k=1}^n k^2 $ gives $\sum_{k=1}^n k^2.$

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.