Lesson 1


This lesson shows assorted examples of other popular LaTeX packages that were not covered in the main lessons.

This course has given an overview of the core features of LaTeX. LaTeX has vast array of extension packages and is used in many subject areas. We give here some examples, with no explanation here but links to the package documentation at texdoc.org. The examples are taken from the package documentation unless otherwise noted.

Note that inclusion here is not intended as an endorsement of the package over other similar packages, we just aim for a small sample showing a range of areas not otherwise covered in this course.


Package: mhchem

\ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-}


Package: forest

  [DP\\John ]
    [V\\sent ]
    [DP\\Mary ]


Package: xskak

\mainline{1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6}

Position after 2.\,\xskakget{lan}


Class: memoir

\settowidth{\versewidth}{Nay, nay, I leave thee not,
                                       thou goest too}
\ldots \\*
His judgement rendered, he dissolved the Thing. \\*
\flagverse{Ingeborg} And your decision? \\*
\flagverse{Fridthjof} \vinphantom{And your decision?}

                                   Have I ought to choose? \\*
Is not mine honour bound by his decree? \\*
And that I will redeem through Angantyr \\*
His paltry gold doth hide in Nastrand’s flood. \\*
Today will I depart. \\*
\flagverse{Ingeborg} \vinphantom{Today will I depart.}

                                 And Ingeborg leave? \\*
\flagverse{Fridthjof} Nay, nay, I leave thee not,

                                   thou goest too. \\*
\flagverse{Ingeborg} Impossible! \\*
\flagverse{Fridthjof} \vinphantom{Impossible!}

                                   O! hear me, ere thou answerest.


Package: tikz



\fill[gray!80!white] (tpp cs:x=0,y=0,z=#3)
-- (tpp cs:x=0,y=#2,z=#3)
-- (tpp cs:x=#1,y=#2,z=#3)
-- (tpp cs:x=#1,y=0,z=#3) -- cycle;
\fill[gray] (tpp cs:x=0,y=0,z=0)
-- (tpp cs:x=0,y=0,z=#3)
-- (tpp cs:x=0,y=#2,z=#3)
-- (tpp cs:x=0,y=#2,z=0) -- cycle;
\fill[gray!50!white] (tpp cs:x=0,y=0,z=0)
-- (tpp cs:x=0,y=0,z=#3)
-- (tpp cs:x=#1,y=0,z=#3)
-- (tpp cs:x=#1,y=0,z=0) -- cycle;}
\draw[->] (-0.5,0,0) -- (#1,0,0) node[pos=1.1]{$x$};
\draw[->] (0,-0.5,0) -- (0,#2,0) node[pos=1.1]{$y$};
\draw[->] (0,0,-0.5) -- (0,0,#3) node[pos=1.1]{$z$};}
\begin{tikzpicture}[3d view]

Function plotting

Package: pgfplots



      % density of Normal distribution:
      \addplot [
            {exp(-x^2 / (2e-3^2)) / (1e-3 * sqrt(2*pi))};



Package: musixtex



% 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
\Notes\ibu0f0\qb0{dgf}|\qlp i\en
\Notes\ibu0f0\qb0{cge}\tbu0\qb0g|\hl j\en
% terminate excerpt