PreTeXt

Examples

Examples

We have a variety of PreTeXt projects designed to be examples of what is possible with PreTeXt. These are not necessarily best practices, especially since they are also used for testing new features and new code. They can be an adjunct to the documentation, and are always built with the very latest version of PreText. Be sure to look for annotated HTML versions of the Sample Article and the Sample Book, which contain easy access to the source code right next to the output. These source for these examples are part of the PreTeXt repository, so you can explore them further there.

To see examples of actual books (and other projects), see the Gallery at the main page of this site.

Sample Book

The Sample Book is an example of how a book-length document can be authored and organized. It may have a run of chapters, or be structured into parts. The parts can be structural, where numbering of chapters restarts in each part, or decorative, where chapters are numbered consecutively throughout the book without regard for the parts.

The first version below has only chapters, and no parts. There is also an annotated version of this variant.

The final chapter contains interactive exercises and programming environments. There are powered by Javascript we get from Runestone Services. A slightly modified build will make an even more interactive version when hosted at Runestone Academy on a dedicated (no-cost) server there.

Chapters Only:

Structural Parts:

Decorative Parts:

Chapters Only, Hosted at Runestone Academy:

Annotated with Source Examples, with Parts:

Source:

Sample Article

The Sample Article is both a developer’s sandbox and the kitchen sink with every possible PreTeXt feature. It is a sandbox because we frequently test new features here and sometimes also debug problems. So sometimes it contains some preliminary, or immature, examples. It is the kitchen sink because we try to add one of everything. This is both for testing, and so that you can look at output and then examine the source to see how to do something you like or need. There is even a special version of the online output that has copious "View Source" knowls that will show you the PreTeXt source for each division and many blocks

But it is cutting-edge and contains new features before they make it into the Author’s Guide. As a testing platform, we bring the least powerful version of LaTeX to bear for creating the PDF, so this is always built using the pdflatex engine (in contrast to the font example below).

WeBWorK Sample Chapter

The WeBWorK Sample Chapter contains examples of various ways to incorporate WeBWorK automated homework problems into your text. This work was initiated with a grant from OpenOregon with a matching grant from University of Puget Sound.

Styling Online Versions

HTML output can employ a variety of styles (independent of content). We use the Sample Article as a vehicle for demonstrating these styles. Color schemes may also be changed, but we do not demonstrate any of that here, as each example has its default colors.

EPUB Sampler

The EPUB Sampler is designed to test and stress the conversion to EPUB. We build a PDF and an HTML version, as a demonstration, even though EPUB is something of a blend of the two output formats.