6

Learning Outcomes

By the end of this chapter, the reader will be able to:

  1. Identify latex packages useful for the creation of OER across subject areas.
  2. Describe the inclusion of graphical elements into a latex document
  3. Describe how to create content rich with mathematical and algorithmic elements
  4. Construct a basic presentation using latex package elements

[latexpage]

LaTeX Packages useful for the Creation of OER

In the previous chapter, the LaTeX typesetting platform was discussed along with some editors. As was mentioned in the  chapter, most of these editors simplify the workflow required to create documents.  Our interest in this section is to identify packages across subject areas that are useful for the creation of open resources.

One of the most basic type of packages would be those for creating books or manuals. Along with this are those for creating content in specific areas such as books containing significant amounts of equations and mathematics.

[table id=7 /]

Table 6.1 Table showing some classes useful for creating books/manuals

To use these classes/packages in LaTeX, one must first check to make sure they are installed. The TUG repository is updated on a regular basis and any local installation of MiKTeX/MacTeX/TeXLive needs to be regularly updated as well. For each class and package documentation is provided detailing usage. In some cases, there are examples of usage provided as part of the documentation.

Besides these classes, there are author defined classes and packages useful for specific purposes. This of course requires the author to have an understanding of how to  define a class/package. As open-source users usually do, existing class or package files can be used to customise ones own class or package. The advantage of this is that a user can add personal macros for each application.

Next is a set of packages that can be used to create presentations. Note this list is not exhaustive as there are many users who create custom packages for their own use. Many of these on further refinement are added to the TUG package repository.

[table id=9 /]

Table 6.2 Table showing packages useful for creating presentations in LaTeX

The following table provides a list of packages that can be used to create exercise sheets across different subject areas. These can be combined with any of the previous packages and classes.

[table id=10 /]

Table 6.3  Table showing packages useful for creating exercises/problem sheets

Graphical Elements in LaTeX Documents

One of the most important aspects of LaTeX documents is the ability to include graphical  elements. There are several packages that allow for the inclusion of these graphical elements directly in a LaTeX document. When the LaTeX processor is run, it renders the graphical code element as the required image.  Open-source users love this feature of TeX-based open projects because they can describe a graphical element use source code which is rendered as an image by the processor. This bypasses the need for external drawing programs and image repositories. The following table lists some of those packages.

[table id=11 /]

Table 6.4 Table of packages for creating graphical elements

Typesetting Graphical Elements in LaTeX Documents

Given all the packages available for creating graphics in LaTeX, a logical questions is how these packages are used in a LaTeX document. The best way to describe this is to provide a demonstration of the process in action. In LaTeX documents, there are several ways to include graphical elements:

  1. use a graphical package to create the figures within the document
  2. include the figures from a separate LaTeX file containing the commands to create the graphical elements
  3. run LaTeX files with only graphics commands to create image file formats (.PDF, .JPG, .PNG, etc.) and then include these in the main file

These are the most common ways most LaTeX users work with graphics. They are by no means the only ways to include graphics in files. TeX-based documents can include graphical elements of great complexity as can be seen by looking at examples on the PSTricks and TeXample.net pages.

The following H5P shows images created using LaTeX source code. The two specific graphics packages demonstrated are TikZ and PStricks.

Typesetting Equations, Mathematical and Algorithmic Elements

For many areas in Science Technology Engineering and Mathematics (STEM), there is a need for extensive equations that are mathematical, physical and chemical. For areas such as Computer Science, there is a need to include algorithms within documents. In other areas such as Economics and Finance combinations of these are needed.  LaTeX and TeX-based tools are able to incorporate these into documents very easily through the use of packages.

Mathematical Equations

In this section, a few samples of the type of equations that can be included in documents are shown. Within Pressbooks, to allow the use of LaTeX, one must enable the WP QuickLaTeX plugin. Then, at the start of each file where LaTeX constructs are to be used, one must use the command [latexpage].

\begin{equation}

P(X=x) = \binom{n}{x} \cdot p^x\cdot (1-p)^{n-x}

\end{equation}

And another Statistics equation can be seen below.

\begin{align*}
(x+y)^0 &= 1\\
(x+y)^1 &= x+y\\
(x+y)^2 &= x^2+2xy+y^2\\
(x+y)^3 &= x^3+3x^2y+3xy^2+y^3\\
(x+y)^4 &= x^4+4x^3y+6x^2y^2+4xy^3+y^4\\
(x+y)^5 &= x^5+5x^4y+10x^3y^2+10x^2y^3+5xy^4+y^5\\
(x+y)^6 &= x^6+6x^5y+15x^4y^2+20x^3y^3+15x^2y^4+6xy^5+y^6\\
\end{align*}

This is an expansion of the Binomial Theorem. The following is another equation. For $n$ a positive integer, we have:

\begin{align*}
(x+y)^n &=\sum^n_{k=0}\binom{n}{k}x^{n-k}y^k\\
&=x^n+\binom{n}{1}x^{n-1}y+\binom{n}{2}x^{n-2}y^2+\binom{n}{3}x^{n-3}y^3+\ldots\\
&{}+\binom{n}{n-1}xy^{n-1}+y^n
\end{align*}
where the general term is $\binom{n}{r}x^{n-r}y^r$ and
$$
\binom{n}{r}=\dfrac{n!}{(n-r)!r!}=\dfrac{n(n-1)(n-2)\ldots(n-r+1)}{r!}.
$$

One of the challenges of using LaTeX in Pressbooks is that not all elements of TeX are supported. Not all packages are supported and elements such as macros cannot be included. However, when using the workflow mentioned in the previous chapters (i.e., a LaTeX installation with an editor) all the features are available.

 Creating Presentations Using LaTeX Tools

For the purpose of this guide, the focus will be on the use of one particular presentation package for the sake of brevity.  There are several packages that can be used to create presentations in LaTeX. The table below lists some of the packages available for creating presentations.

Package name Description Location
Beamer The beamer LaTeX class can be used for producing slides. The class works in both PostScript and direct PDF output modes, using the pgf graphics system for visual effects. https://ctan.org/pkg/beamer
powerdot Powerdot is a presentation class for LaTeX that allows for the quick and easy development of professional presentations. It comes with many tools that enhance presentations and aid the presenter. Examples are automatic overlays, personal notes and a handout mode. To view a presentation, DVI, PS or PDF output can be used. A powerful template system is available to easily develop new styles. A LyX layout file is provided. https://ctan.org/pkg/powerdot
HA-prosper HA-prosper is a patch for prosper that adds new functionality to prosper based presentations. Among the new features you will find automatic generation of a table of contents on each slide, support for notes and portrait slides. The available styles demonstrate how to expand the functionality of prosper even further. https://ctan.org/pkg/ha-prosper
Powerdot-fuberlin The bundle provides a powerdot-derived class and a package for use with powerdot to provide the corporate design of the Free University in Berlin. https://ctan.org/pkg/powerdot-fuberlin
Sslides The class provides a variant of the LaTeX standard slides class, in which the user may add headers and footers to the slide. https://ctan.org/pkg/sslides
uwmslide A slide format which produces slides with a simple Power Point like appearance. Several useful features include: use of standard titlepage to produce title slide; several slide environments including plain (page with a title), double slide (two column page with slide title), item slide (item list with title), left item slide, and right item slide. Logos are placed in the upper left corner of each slide if the logo file logo.eps is present. Preconfigured in landscape mode by default and uses Times Roman by default (originally, it was claimed, for simple conversion to PDF format). https://ctan.org/pkg/uwmslide
pdfslide This is a package for use with pdfTeX, to make nice presentation slides. Its aims are: to devise a method for easier technical presentation; to help the mix of mathematical formulae with text and graphics which other present day document processing tools fail to accomplish; to exploit the platform independence of TeX so that presentation documents become portable; and to offer the freedom and possibilities of using various backgrounds and other embellishments that a user can imagine to have in as presentation. https://ctan.org/pkg/pdfslide
ffslides The ffslides (“freeform slides”) class is intended to make it easier to place various types of content freely on the page, and therefore easier to design documents with a strong visual component: presentations, posters, research or lecture notes, and so on. https://ctan.org/pkg/ffslides
Texpower ePower is a bundle of packages intended to provide an all-inclusive environment for designing pdf screen presentations to be viewed in full-screen mode, especially for projecting `online’ with a video beamer. For some of its core functions, it uses code derived from ppower4 packages. https://ctan.org/pkg/texpower
gridslides This package allows creating free form slides with blocks placed on a grid. The blocks can be filled with text, equations, figures etc. The resulting slides are similar to the ones produced with LaTeX beamer, but more flexible. https://ctan.org/pkg/gridslides
fancyslides This class is prepared for short presentations with a modern look & feel. It offers the following features:

  • custom background for each slide,
  • predefined types of slides,
  • simplified commands (e.g. for starting and ending slide).

The class is built upon LaTeX beamer, so all beamer commands should work.

https://ctan.org/pkg/fancyslides
soton The bundle contains two packages: soton-palette which defines colour-ways, and soton-beamer, which uses the colours to produce compliant presentations. https://ctan.org/pkg/soton

Table 6.5 LaTeX packages for creating Presentations

The Beamer Presentation Package

The Beamer presentation package is installed as one of the default packages in LaTeX. Table 5.1 shows the location of the package including its documentation. To use any package in LaTeX, one must be willing to reference the appropriate documentation. From the documentation, one can find the list of options, features and examples of how to use the package to create specific document elements.

Video length: 4:30 minutes

Frequently Asked Questions about TeX/LaTeX[1]

For further information, Appendix B contains a list of a few open resources created using TeX-based tools. In addition, Appendix C contains a list of LaTeX references the interested reader can consult.

 


License

Icon for the Creative Commons Attribution 4.0 International License

Tools for Creating OER Copyright © 2022 by Isaac Mulolani is licensed under a Creative Commons Attribution 4.0 International License, except where otherwise noted.

Share This Book