2 Motivating Examples

Laura Greenstreet

Latex is best known for typesetting math equations. However, many packages have been developed to create other difficult to typeset elements including plots, chemical equations, multi-lingual documents, and music. Below are examples of some of the applications of Latex.

Mathematics

Suppose we want to solve the general quadratic equation [latex]ax^2 + bx + c = 0[/latex]. If you isolate for x, you derive the well-known quadratic formula:
[latex]$$ x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}.$$[/latex]

The default distribution of Latex offers over 10,000 symbols. So, you can easily typeset most equations:
[latex]\begin{tabular}{r c l} $\displaystyle |L_\beta(f) - L_\beta(g)|$ &=& $\int_a^b f(x) - g(x) d \beta$\\ &=& $\displaystyle \sup_{P,T} \{ \sum_{i=1}^n f(t_i) - g(t_i) \Delta \beta \}$\\ &=& $\displaystyle \sup_{P,T} \{ \sum_{i =1}^n \frac{\epsilon}{2 (\beta(b) - \beta(a))} \Delta \beta \}$\\ &=& $\displaystyle \frac{\epsilon}{2(\beta(b) - \beta(a))} (\beta(b) - \beta(a))$\\ &=& $\displaystyle \frac{\epsilon}{2}$\\ \end{tabular}[/latex]

Chemical Equations:

[latex]\begin{tabular}{l} \ce{Na2SO4 ->[H2O] Na+ + SO4^2-}\\ \ce{(2Na+,SO4^2- ) + (Ba^2+, 2Cl- ) -> BaSO4 v + 2NaCl} \end{tabular}[/latex]

Credit: Stack Exchange

Phonetic Transcription:

[latex]\begin{tabular}{c | c| c| c | c} {\bf Gloss} & `innate' & `intolerant' & `impolite' & `inconsistent'\\ \hline {\bf UR} & \ipaUR{IneIt} & \ipaUR{IntAl\s{r}\s{n}t} & \ipaUR{ InpAUlAIt} & \ipaUR{Ink@nsIst\s{n}t}\\ \hline {\bf Assimilation} & NA & NA & \ipa{ I{\bf m}pAUlAIt} & \ipa{I{\bf \ipa{N}}k@nsIst\s{n}t}\\ \hline {\bf SR} & [\ipa{IneIt}] & [\ipa{intAl\s{r}\s{n}t}]& [\ipa{ImpAUlAIt}] & [\ipa{iNk@nsIst\s{n}t}]\\ \end{tabular}[/latex]

Music:

[latex]\begin{music} \parindent10mm \instrumentnumber{1} \setname1{Piano} \setstaffs1{2} \generalmeter{\meterfrac44} \startextract ˇˇˇˇˇˇˇ % a single instrument % whose name is Piano % with two staffs % 4/4 meter chosen ˇ ˇˇˇˇ % starting real score \Notes\ibu0f0\qb0{cge}\tbu0\qb0g|\hl j\en \Notes\ibu0f0\qb0{cge}\tbu0\qb0g|\ql l\sk\ql n\en \bar \Notes\ibu0f0\qb0{dgf}|\qlp i\en \notes\tbu0\qb0g|\ibbl1j3\qb1j\tbl1\qb1k\en \Notes\ibu0f0\qb0{cge}\tbu0\qb0g|\hl j\en \zendextract % terminate excerpt \end{music}[/latex]
Credit: Musixtex Documentation

Plots:

[latex]\resizebox{1}{ \tikzpicture \begin{axis}[xlabel=$x$, ylabel=$y$] \addplot3[surf,domain=-180:180,samples=40] {((x-y)/180)*sin(0.5*x)*cos(1.5*y)}; \end{axis} \endtikzpicture}[/latex]

License

Icon for the Creative Commons Attribution-ShareAlike 4.0 International License

Motivating Examples Copyright © by Laura Greenstreet is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License, except where otherwise noted.

Share This Book