# Difference between revisions of "User:Eagle702"

(creating page on request) |
|||

Line 1: | Line 1: | ||

Hello everyone! | 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 <math>\frac{x}{y}</math>. | |

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

− | + | Typing \$\sqrt{x}\$ makes <math>\sqrt{x}</math>. | |

− | [ | + | Typing \$\sqrt[y]{x}\$ makes <math>\sqrt[y]{x}</math>. |

− | + | Typing \$x \cdot y\$ makes <math>x \cdot y</math>. | |

− | + | Typing \$x \times y\$ makes <math>x \times y</math>. | |

− | + | Typing \$x \div y\$ makes <math>x\div y</math>. | |

− | + | Typing \$\boxed{x}\$ makes <math>\boxed{x}</math> | |

− | + | Typing \$\infty\$ makes <math>\infty</math>. | |

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

− | + | Typing \$1 + 2 + 3 + \cdots + 99 + 100\$ makes <math>1 + 2 + 3 + \cdots + 99 +100</math>. | |

− | + | Typing \$1, 2, 3, \ldots, 99, 100\$ makes <math>1, 2, 3, \ldots, 99, 100</math>. | |

− | + | Typing \$0.\overline{xy}\$ makes <math>0.\overline{xy}</math>. | |

− | + | Typing \$x \equiv y\$ makes <math>x \equiv y</math>. | |

− | + | Typing \$x\neq y\$ makes <math>\neq</math>. | |

− | [verbatim] | + | Typing \$x^y\$ makes <math>x^y</math>. |

+ | |||

+ | Typing \$x_y\$ makes <math>x_y</math>. | ||

+ | |||

+ | 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 <math>x^{yz}</math>. | ||

+ | |||

+ | Typing \$x_{yz}\$ makes <math>x_{yz}</math>. | ||

+ | |||

+ | Typing \$\mathbb{R}\$ makes <math>\mathbb{R}</math>. | ||

+ | |||

+ | Typing \$\mathbf{x}\$ makes <math>\mathbf{x}</math>. | ||

+ | |||

+ | Typing \$\LaTeX\$ makes <math>\LaTeX</math>. | ||

+ | |||

+ | Typing \$\smiley\$ makes <math>\smiley</math>. | ||

+ | |||

+ | [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: <math>\backslash\backslash</math>. | ||

+ | |||

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

+ | |||

+ | Good luck! :) |

## Latest revision as of 19:46, 6 July 2020

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! :)