Legendary LaTeX Tutorial! made by thomaster XD
In this turorial, I will highlight begin and end tags in \(\sf\color{red}{red}\), commands in \(\sf\color{green}{green}\) and parameters in \(\sf\color{blue}{blue}\). Normal text is black. You can't copy these colored examples and use them because they won't work (they contain different symbols to make it possible to display them here without it being recognized as latex) So you'll have to type over everything.
\(\hspace{50pt}\Huge\sf \color{#730000}{Basic\ \LaTeX\ Layout}\) Always begin with \(\color{red}{\backslash(}\) and end with \(\color{red}{\backslash)}\) When you write your text between these two, it will be recognized as LaTeX \(\color{red}{\backslash(}\sf Hello~there!!!\color{red}{\backslash)}\) will look like: \(Hello there!!!\) The commands (or tags) in latex begin with a backslash and most of them also want parameters, which are enclosed in curly braces after the command. For example, write: \(\sf\color{red}{\backslash(}\color{green}{\backslash underline}\color{blue}{\{my\ first\ underlined\ text!\}} \color{red}{\backslash)}\) It will look like this: \(\underline{my first underlined text!}\) In LaTeX, you need to define spaces. You can use a single backslash followed by a space to induce spaces. So just type a single backslash\ after\ every\ word\ and you'll have text with spaces. You can also use a tilde (\(\sf\sim\)) to induce spaces. Now we write: \(\sf\color{red}{\backslash(}\color{green}{\backslash underline}\color{blue}{\{my\backslash~first\backslash~underlined\backslash~text!\}} \color{red}{\backslash)}\) It will look like this: \(\underline{my\ first\ underlined\ text!}\) When you use the tide, it will be \(\sf\color{red}{\backslash(}\color{green}{\backslash underline}\color{blue}{\{my\sim first\sim underlined\sim text!\}} \color{red}{\backslash)}\) Other ways to create spaces are: \(\backslash;\) = thick space \(\hspace{60 pt}~\to\sf M\;M\) \(\backslash\hspace{-2pt}:\) = medium space\(\hspace{51 pt}~\to\sf M\:M\) \(\backslash,\) = thin space\(\hspace{68 pt}~\to\sf M\,M\) \(\backslash!\) = negative space\(\hspace{51 pt}~\to\sf M\!M\) \(\backslash\sf quad\) = 1 em space\(\hspace{43 pt}~\to\sf M\quad M\) \(\backslash\sf qquad\) = 2 em space (2x \quad)\(~\to\sf M\qquad M\) For long white spaces, use: \(\sf\color{green}{\backslash hspace\color{blue}{\{x~pt\}}}\), where x is the length. Example: \(\color{red}{\backslash(}\sf Hello\color{green}{\backslash hspace}\color{blue}{\{100~pt\}}there!\color{red}{\backslash)}\) will be: \(Hello~\hspace{100 pt}there!\)
\(\hspace{80pt}\Huge\sf \color{#730000}{More\ fonts}\) Now this italic text is nice, but we can use way cooler fonts! The syntax for this is: \(\color{red}{\backslash(}\sf\color{green}{\backslash font}\color{blue}{~text }\color{red}{\backslash)}\) \(\sf\color{red}{\backslash(}\color{green}{\backslash bf}\color{blue}{~Hello\sim there!}\color{red}{\backslash)}\) Will become: \( \bf Hello\ there! \) \(\LARGE\sf Fonts\ you\ can\ use:\) \(\huge\sf\color{green}{\backslash sf} \hspace{19pt} \to ABCDEFabcdef123456\) \(\huge\sf\color{green}{\backslash tt} \hspace{19pt} \to \tt ABCDEFabcdef123456\) \(\huge\sf\color{green}{\backslash it} \hspace{21pt} \to \it ABCDEFabcdef123456\) \(\huge\sf\color{green}{\backslash bf} \hspace{15pt} \to \bf ABCDEFabcdef123456\) \(\huge\sf\color{green}{\backslash rm} \hspace{10pt} \to \rm ABCDEFabcdef123456\) \(\huge\sf\color{green}{\backslash cal} \hspace{10pt} \to \cal ABCDEFabcdef123456\) \(\huge\sf\color{green}{\backslash scr} \hspace{10pt} \to \scr ABCDEFabcdef123456\) \(\huge\sf\color{green}{\backslash frak} \to \frak ABCDEFabcdef123456\) \(\LARGE\sf There\ are\ 2\ exceptions:\) You need to add braces to these fonts in order to use them, so \(\bf\color{red}{\backslash(}\color{green}{\backslash mathbb\{}\color{blue}{text}\color{green}{\} }\color{red}{\backslash)}\) \(\LARGE\sf\color{green}{\backslash mathbb} \to \mathbb{ ABCDEFabcdef123456}\) \(\LARGE\sf\color{green}{\backslash boldsymbol} \to \boldsymbol{ ABCDEFabcdef123456}\) \(\Large\sf How\ to\ use\ 2\ fonts\ in\ 1\ line:\) When you type \sf, everything after that will become Sans-serif until you introduce another font command. So when you type: \(\color{red}{\backslash(}\sf\color{green}{\backslash sf}\color{blue}{~hello\sim everyone\sim i'm}\color{green}{\backslash cal}\color{blue}{~Thomaster!!}\color{red}{\backslash)}\) It will become: \(\sf hello\ everyone\ i'm\ \cal Thomaster!!\)
\(\hspace{80pt}\Huge\sf \color{#730000}{Change\ Sizes}\) In \(\LaTeX\) on OpenStudy, we can use a few different text sizes. The syntax for this is \(\bf\color{red}{\backslash(}\color{green}{\backslash size~}\color{blue}{text}\color{red}{\backslash)}\) (don't forget the space after the size tag) For \(\sf\color{green}{\backslash size}\) we can use the following 9 sizes: \(\begin{array}{ll} \large\sf\color{green}{\backslash tiny}&\Large\to\sf\tiny ABCDEFabcdef123456\\ \large\sf\color{green}{\backslash scriptsize}&\Large\to\sf\scriptsize ABCDEFabcdef123456\\ \large\sf\color{green}{\backslash small}&\Large\to\sf\small ABCDEFabcdef123456\\ \large\sf\color{green}{\backslash normalsize}&\Large\to\sf\normalsize ABCDEFabcdef123456\\ \large\sf\color{green}{\backslash large}&\Large\to\sf\large ABCDEFabcdef123456\\ \large\sf\color{green}{\backslash Large}&\Large\to\sf\Large ABCDEFabcdef123456\\ \large\sf\color{green}{\backslash LARGE}&\Large\to\sf\LARGE ABCDEFabcdef123456\\ \large\sf\color{green}{\backslash huge}&\Large\to\sf\huge ABCDEFabcdef123456\\ \large\sf\color{green}{\backslash Huge}&\Large\to\sf\Huge ABCDEFabcdef123456\\ \end{array}\) You can use more sizes in 1 line. Everytime you introduce a new size text, everything after that will be in that size untill you introduce a new one. So \(\bf\color{red}{\backslash(}\color{green}{\backslash Huge~}\color{blue}{hello}\color{green}{\backslash small~}\color{blue}{every}\color{green}{\backslash LARGE~}\color{blue}{one}\color{red}{\backslash)}\) will output: \(\Huge hello\small every\LARGE one\)
\(\hspace{110pt}\Huge\sf \color{#730000}{Symbols}\) Syntax for symbols: \(\sf\color{red}{\backslash(}\color{green}{\backslash symbolcode} \color{red}{\backslash)}\) \(\begin{array}{|c|l|c|l|} \hline \large\sf symbol&\sf\large code&\sf\large symbol&\sf\large code\\\hline \large\leftarrow&\sf\backslash leftarrow&\large\rightarrow&\sf\backslash righttarrow\\\hline \large\Leftarrow&\sf\backslash Leftarrow&\large\Rightarrow&\sf\backslash Righttarrow\\\hline \large\longleftarrow&\sf\backslash longleftarrow&\large\large\longrightarrow&\sf\backslash longrighttarrow\\\hline \large\Longleftarrow&\sf\backslash Longleftarrow&\large\Longrightarrow&\sf\backslash Longrighttarrow\\\hline \large\leftrightarrow&\sf\backslash leftrightarrow&\large\Leftrightarrow&\sf\backslash Leftrightarrow\\\hline \large\longleftrightarrow&\sf\backslash longleftrightarrow&\Longleftrightarrow&\sf\backslash Longleftrightarrow\\\hline \large\uparrow&\sf\backslash uparrow&\large\downarrow&\sf\backslash downarrow\\\hline \large\leq&\sf\backslash leq&\large\geq&\sf\backslash geq\\\hline \large\ll&\sf\backslash ll&\large\gg&\sf\backslash gg\\\hline \large\approx&\sf\backslash approx&\large\neq&\sf\backslash neq\\\hline \large\pm&\sf\backslash pm&\large\div&\sf\backslash div\\\hline \large\sum&\sf\backslash sum&\large\infty&\sf\backslash infty\\\hline \large\diamondsuit&\sf\backslash diamondsuit&\large\heartsuit&\sf\backslash heartsuit\\\hline \large\triangle&\sf\backslash triangle&\large\Box&\sf\backslash Box\\\hline \large\LaTeX&\sf\backslash LaTeX&\large\bigstar&\sf\backslash bigstar\\\hline \end{array}\) Example of combination with size and color: \(\bf\color{red}{\backslash(}\color{green}{\backslash Huge}\color{green}{\backslash color\{\color{#8C00FF }{red}\}\{\color{blue}{\backslash sum}\}}\color{red}{\backslash)}~~\Large\longrightarrow~\Huge\color{red}{\sum}\) For more symbols, visit http://detexify.kirelabs.org/symbols.html All latex symbols are on that list but you can only use the mathmode symbols on OpenStudy.
\(\hspace{110pt}\Huge\sf \color{#730000}{Math}\) Some useful latex math stuff: \[\begin{array}{l|l|l} \hline \large\sf function&\sf\large preview&\sf\large code\\\hline\\ \sf fraction& \dfrac{1+2}{3+4} &\sf\backslash dfrac\{1+2\}\{3+4\} \\~\\ \sf square\ root&\large\sqrt{x+3}&\sf\backslash sqrt\{x+3\}\\~\\ \sf multiple\ root&\large\sqrt[3]{x+3}&\sf\backslash sqrt[3]\{x+3\}\\~\\ \sf limit & \large\lim_{x \to \infty}&\sf\backslash lim\_\{x ~\backslash to \backslash infty\} \\~\\ \sf power& \large5x^2 &\sf 5x\wedge 2 \\~\\ \sf indices&\large F_{(x)} &\sf F\_\{(x)\} \\~\\ \sf integral& \large\int_7^2 x &\sf\backslash int\_7\wedge2~ x \\~\\ \sf sum& \large\sum_{x=4}^{19} t_x &\sf\backslash sum\_\{x=4\}\wedge\{19\} ~t\_x \\~\\ \end{array}\]
\(\hspace{90pt}\Huge\sf \color{#730000}{Chemistry}\) For a chemical equation, you need mainly subscripts. Use the _ symbol to do this. When only 1 number is used as subscript, you can just write it as _3 (in case the number is 3) When more characters are used, you need to put them in curly braces, so _{12} Let's write a chemical equation: \(\sf\color{red}{\backslash(}\color{blue}{6CO\_2+6H\_2O\backslash to~C\_6H\_\{12\}O\_6+6O\_2}\color{red}{\backslash)}\) Will become: \(\sf\large 6CO_2+6H_2O ~\to~C_6H_{12}O_6+6O_2\) For nuclear equations, you can use subscripts and superscripts. When you write _5^2 x, it will look like \(\large^2_5 x\) Don't forget to add braces for 2 or more characters. \(\sf\color{red}{\backslash(}\color{blue}{\_6\wedge{13}C + \_2\wedge4He \backslash to \large\_8\wedge{16}O+\_0\wedge1n}\color{red}{\backslash)}\) Will become: \(\sf\large_6^{13}C + _2^4He \to _8^{16}O+_0^1n\)
@KjSaif thomaster latex thing is now on qc XD
nice!
Join our real-time social learning platform and learn together with your friends!