# User:Eagle702

Hello everyone!

\LaTeX is something that can be very helpful in writing problems, on the message board, in the classroom, and in many other places on AoPS. Even just knowing the basics can make your calculations look so much better!

Per request of one of my fellow students, here is a list of many \LaTeX commands. Please ask if there are any commands I did not list that you would like to know how to do. You can also ask if your \LaTeX is not working (coming up in red), and we can help you fix it. :)

Also, if you ever want your \LaTeX to come up in the center of the screen, just put two dollar signs on each side of your code rather than one.

Typing $\frac{x}{y}$ makes .

If you put parentheses around fractions, it will come up like this . To make the parentheses fit correctly, you have to write \left( at the beginning and \right) at the end.

Typing $\left(\frac{x}{y}\right)$ makes .

Typing $\sqrt{x}$ makes .

Typing $\sqrt[y]{x}$ makes .

Typing $x \cdot y$ makes .

Typing $x \times y$ makes .

Typing $x \div y$ makes .

Typing $\boxed{x}$ makes

Typing $\infty$ makes .

You can even write words in your \LaTeX. However, be sure to surround the words with \text{write word here}. This makes it work. :)

Typing $ 1 + \text{Hello world!} = \text{undefined}$ makes .

Typing $1 + 2 + 3 + \cdots + 99 + 100$ makes .

Typing $1, 2, 3, \ldots, 99, 100$ makes .

Typing $0.\overline{xy}$ makes .

Typing $x \equiv y$ makes .

Typing $x\neq y$ makes .

Typing $x^y$ makes .

Typing $x_y$ makes .

If you want to write more than one number above or below the base, like in the previous two examples, place curly braces around it. Credit: Chocolatte, post #3.

Typing $x^{yz}$ makes .

Typing $x_{yz}$ makes .

Typing $\mathbb{R}$ makes .

Typing $\mathbf{x}$ makes .

Typing $\LaTeX$ makes .

Typing $\smiley$ makes .

[hide=The Align Function - Aligning your LaTeX] The align function can be used to align lines of equations. Wherever you put the & is where the equations will align to. Also, makes sure you end each line with two backslashes: .

You start the code by writing [verbatim]\begin{align*}[/verbatim] and you end the code by writing [verbatim]\end{align*}[/verbatim]. Important: In the align function you do not use dollar signs. Doing so will result in an error.

Here's an example: [code] \begin{align*} 3x + 5 &= 23 \\ 3x &= 18 \\ x &= 6 \\ \end{align*} [/code] In the above example, the equations align at the equal symbol. Here's what it looks like: \begin{align*} 3x + 5 &= 23 \\ 3x &= 18 \\ x &= 6 \\ \end{align*} [/hide]

[hide=The Tabular Function - Making tables] The tabular function can be used to make tables. Similar to the align function, you use and . You start the code by writing [verbatim]\begin{tabular}{|c|c|}[/verbatim] and you end the code by writing [verbatim]\end{tabular}[/verbatim]. Also, note that you can use dollar signs around your code and it will still work. (Although, you do not have to use dollar signs.)

Changing the part that has |c|c|, will change how many columns the table has. So if you only want one column, you write |c|. If you want three columns, you write |c|c|c|. Basically, if you want amount of columns, include amount of c's in your code.

Right after writing [verbatim]\begin{tabular}{|c|c|}[/verbatim], right before writing [verbatim]\end{tabular}{|c|c|}[/verbatim], and after each row of your table, write \hline to move on to the next row.

Here's an example: [code] \begin{tabular}{|c|c|} \hline \textbf{Students} & \textbf{Teachers} \\ \hline Student 1 & Teacher 1 \\ \hline Student 2 & Teacher 2 \\ \hline Student 3 & Teacher 3 \\ \hline Student 4 & Teacher 4 \\ \hline \end{tabular} [/code] You use the symbol to write something in the next row of the table. Here's what the above example looks like: \begin{tabular}{|c|c|} \hline \textbf{Students} & \textbf{Teachers} \\ \hline Student 1 & Teacher 1 \\ \hline Student 2 & Teacher 2 \\ \hline Student 3 & Teacher 3 \\ \hline Student 4 & Teacher 4 \\ \hline \end{tabular}

[/hide]

The key to learning \LaTeX is practice! So keep practicing and eventually you will know these commands by heart and you will not have to refer to any document to use them. Also, if you click on something that has , you can see the code that was used. Try clicking on any of the above examples and you will see the code!

Good luck! :)