User:Eagle702

Revision as of 19:46, 6 July 2020 by Sparklyflowers (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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 $\frac{x}{y}$.

If you put parentheses around fractions, it will come up like this $(\frac{x}{y})$. 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 $\left(\frac{x}{y}\right)$.

Typing $\sqrt{x}$ makes $\sqrt{x}$.

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

Typing $x \cdot y$ makes $x \cdot y$.

Typing $x \times y$ makes $x \times y$.

Typing $x \div y$ makes $x\div y$.

Typing $\boxed{x}$ makes $\boxed{x}$

Typing $\infty$ makes $\infty$.

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 $1 + \text{Hello world!} = \text{undefined}$.

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

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

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

Typing $x \equiv y$ makes $x \equiv y$.

Typing $x\neq y$ makes $\neq$.

Typing $x^y$ makes $x^y$.

Typing $x_y$ makes $x_y$.

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 $x^{yz}$.

Typing $x_{yz}$ makes $x_{yz}$.

Typing $\mathbb{R}$ makes $\mathbb{R}$.

Typing $\mathbf{x}$ makes $\mathbf{x}$.

Typing $\LaTeX$ makes $\LaTeX$.

Typing $\smiley$ makes $\smiley$.

[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: $\backslash\backslash$.

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 $\backslash\backslash$. 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 $x$ amount of columns, include $x$ 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 $\LaTeX$, you can see the code that was used. Try clicking on any of the above examples and you will see the code!

Good luck! :)

Invalid username
Login to AoPS