Latest news 2021-09-06: new blog post "Legacy Documents and TeX Live Docker Images".

Gallery

A selection of images or sample documents related to my books or packages or to code I have helped develop. For some great examples of images created using LaTeX, have a look at the TikZ and PGF gallery on texample.net, or for some examples of what can be done with TeX have a look at The TeX showcase.

The purpose of LaTeX-related sections of the gallery is to illustrate various styles that can be created with the particular package. If you want to know how to do something not illustrated here or you want to know how to adapt one of these examples, please post your query to an appropriate site such as TeX on StackExchange or The LaTeX Community Forum.

Click on the images below for details.

If you have a small screen, you may prefer to switch on the small image setting.

Search for:
Search Tips

File List

View alphabetical list of all .tex and .bib files used in the examples that are available for download.

glossaries

These are some sample documents that use the glossaries package. Most of these examples use dummy lorum ipsum text, one of them uses the sample image files provided by the mwe package, which is available on both MiKTeX and TeX Live, and one of them uses the sample bibliography file xampl.bib, which should be readily available in your TeX distribution. Make sure you have an up-to-date version of the glossaries package if you want to try any of these examples. For help with building the glossary see Incorporating makeglossaries or makeglossaries-lite or bib2gls into the document build.

All Predefined Styles

A list of all the styles provided by the glossaries package and the glossaries-extra extension package.

Brief Descriptions

An example glossary with brief descriptions (just one or two words long). A compact style works best for this type of list.

image of glossary with one or two word descriptions

Long Descriptions

An example glossary with multi-sentence descriptions (but no paragraph breaks).

image of glossary with running descriptions that span multiple lines

Multi-Paragraph Descriptions

An example glossary with multi-paragraph descriptions.

image of glossary with a line break between the name and the start of the multi-paragraph description

Symbols Glossary

An example glossary where the entries have a symbol in addition to the name and description.

image of a four-column glossary with name, description, symbol and page number

Images in Glossary

An example glossary where the entries have an image in addition to the name and description.

image of glossary with multiple paragraph descriptions containing an image inset on the right

Hierarchical Entries

An example glossary with hierarchical entries (sub-entries that have a different name to their parent). This approach could be used for lists of topics or categories with sub-topics or sub-categories.

image of hierarchical glossary with each level indented slightly more than the previous

Homograph Entries

An example glossary with homograph entries (where the sub-items have the same name as their parent entry). This approach could be used for a dictionary-style glossary where a term may have multiple meanings.

image of glossary where child entries don\'t have a name and are numbered

Citations in Glossary

An example glossary where the entries have a citation in addition to the name and description.

image of glossary where a citation follows the description in parentheses

Cross-References

An example glossary where some entries cross-reference other entries.

image of glossary where some entries have a “see also” list after the description

URLs in Glossary

An example glossary where the entries have a URL in addition to the name and description.

image of glossary with a URL on the line following the description and page number

Acronyms (No Descriptions)

An example list of abbreviations with no description. (The long form is assumed to be a description of the short form.)

image of a two-column list of abbreviations (short form in the first column and long form in the second)

Acronyms (With Descriptions)

An example list of abbreviations with a description. (The name field is formed from a combination of the short and long forms.)

image of list of abbreviations with full form followed by the description after a line break

Acronyms (With Translations)

An example list of abbreviations accompanied by translations. See also the glossaries-extra version of this example.

image of document containing a sample section and acronym list including translations in parentheses

Mixed Glossary

An example document with a single glossary that contains a mixture of regular terms and abbreviations.

image of a document with sample references and a single ordered list of terms and acronyms

Mixed Glossary with Emphasis

An example document with a single glossary that contains a mixture of regular terms and abbreviations, where the entries are emphasized on first use (but not the short form).

image of a document with sample references and a single ordered list of terms and acronyms where entries are emphasized

Units (glossaries.sty)

This example is a modification of the Units (glossaries-extra.sty) example. The symbolic representation is in the name field and the symbol name is now in the symbol field. The first field is used to alter the first use representation.

image of sample document with section referencing entries and a 4-column glossary showing the symbol, description, name and page

glossaries-extra

The glossaries-extra package is an extension to the glossaries package. It provides better abbreviation handling and extra features, as demonstrated by these examples. For help with building the glossary see Incorporating makeglossaries or makeglossaries-lite or bib2gls into the document build.

Initialisms

The dots in the abbreviations in this example are automatically inserted through the use of category attributes. The sentence terminator following commands like \gls can be automatically discarded for those entries.

image showing sample document with initialisms

Abbreviations With Translations

An alternative to the base glossaries example this example uses the more convenient glossaries-extra settings.

image of document containing a sample section and abbreviation list including translations in parentheses

Mixed Glossary with Emphasis (glossaries-extra.sty)

This is an alternative to the similar example with just the base package.

image of sample document with first use emphasized (except for the short forms)

Mixing Styles

This rather colourful example isn’t encouraging garish documents, but is illustrating how you can apply different styles to entries according to their category and category attributes. With just the basic glossaries.sty package, different styles may only be applied per glossary type, whereas in this example all entries are in the same glossary.

image of 3-column glossary with name (in various colours) optionally followed by symbol in first column

Adjusting Parenthetical Style

This example adjusts the user parenthetical style so that only the long form is displayed on first use and the short form on subsequent use. Both the long and short form are emphasized. With the introduction of the long-only-short-only style, that may now be used as an alternative.

image of sample document with bacteria referenced in text and listed in a glossary.

Abbreviations with Footnotes Sample

This example compares the footnote and postfootnote styles (using the small-caps variant).

image of sample document showing abbreviations in text with footnote markers and a glossary

Adjusting the alttree Style

The alttree style is redefined by the glossaries-extra-stylemods package to make it more flexible. This example uses the commands provided by this package to adjust the style. The location list and associated image are placed in the right margin and the entry name is on the left.

image of glossary with names in coloured boxes in left margin and page number in coloured box in right margin with image below

Abbreviation Styles

This example demonstrates some of the predefined abbreviation styles.

image of sample abbreviations each in a different style

Aliases

This example demonstrates the use of the alias key.

image of sample glossary listing real and fiction people and their aliases

Units (glossaries-extra.sty)

This example demonstrates the use of the category key in combination with the post-link hook to append the entry’s symbol in the text on first use. This is an alternative to using the abbreviation mechanism.

image of sample document referencing units followed by a glossary

Standalone Entries

Instead of displaying a sorted list, this example uses standalone entries. Since no sorting or indexing is required, the build process is quite simple.

image of sample document with entry name in section header followed by description in italic with an image in the right margin

Mini-Glossary

This example provides an environment that displays a mini list of terms at the end of it. This is in addition to the main glossary at the end of the document. There’s a similar example for bib2gls.

image of sample document with an equation followed by a short list of symbols and a full glossary at the end

bib2gls

With the base glossaries package you can sort and collate using makeindex or xindy or using TeX. (See the glossaries performance page for a comparison.)

The glossaries-extra package additionally provides a way of simply listing all defined entries in the order of definition without the need for an external tool, but it also provides another sorting and collation method and that’s with bib2gls. Some of the examples below can be found in bib2gls’s examples directory and are described in more detail in the “Examples” chapter of the bib2gls user manual. For help with building the glossary see Incorporating makeglossaries or makeglossaries-lite or bib2gls into the document build.

Sorting

The default behaviour of bib2gls is to sort according to the value of the sort field. However, typically, this field should not be explicitly set. Instead, bib2gls has a set of fallback fields that vary according to the entry type. This example demonstrates the difference between using the sort fallback and using a field that’s been set in the .bib file.

image of glossary containing a mixture of symbols, abbreviations, entries with a description, and terms without a description

Logical Glossary Divisions (type vs group vs parent)

There’s a new section added to the bib2gls manual (version 1.9) regarding this topic. This example is an abridged version of that section. If you have a document with many terms that need listing, it’s likely that you may want to divide the terms into separate blocks for easier reading, but should you use type, group or parent? This example provides a guide to help you decide the answer.

image of document shown in PDF viewer with bookmarks showing the entry hierarchy

Constants

In this example, all defined entries are selected (without being referenced in the document) and listed in numerical order, where the numeric value is the approximate value of the given constant.

image of glossary with the constant's symbol followed by the description (and value or other representation)

Icons

In this example, all defined entries are selected (without being referenced in the document) and sorted according to the description field since the name is a symbol with no intuitive order.

image of glossary showing list of symbols ordered by their descriptions (symbols colour-coded according to category))

Mini-Glossary (bib2gls)

This example is an alternative to the mini-glossary example with \makeglossaries. It provides an environment that displays a mini list of terms at the end of it. This is in addition to the main glossary at the end of the document.

image of sample document with an equation followed by a short list of symbols and a full glossary at the end

Summary of Frequently Used Terms

One of the major differences between bib2gls and makeindex/xindy is that instead of creating a file containing the commands to typeset the glossary bib2gls creates a file containing the entry definitions structured in a way that allows \printunsrtglossary to display the glossary by simply iterating over the list of entries defined for the given glossary. This iterative approach makes it easier to filter the list so that only a subset of entries are displayed.

Image of summary of most frequently used terms

Inner or Nested Glossaries

As from glossaries-extra v1.44, it’s possible to have inner or nested glossaries with bib2gls. This is another way of creating logical divisions that uses the type field but can produce similar effects to using the group or parent fields. This means that you can create the illusion of a hierarchical glossary with different sort methods for different levels.

Image of hierarchical effect glossary with the top level entries in reverse alphabetical order.

Performance

datatool

Documents that use the datatool package can take a long time to run, but there are ways to speed things up, especially if you use the datatooltk helper application.

image of datatooltk application

glossaries

Documents that use the glossaries package can take a long time to run, but different options can improve the build time, depending on your requirements.

image of test document containing alphabetically ordered list of random words

arara

Paulo Cereda’s cool automation tool arara has been upgraded to version 4.0 and with it comes some new localisation! Here are some screenshots. (That’s Broad Norfolk, in case you’re confused.)

That Ent Gorn Right, Ole Partner

In this example, the test file has an error in it, which arara complains about.

screenshot of terminal showing arara messages

Help

The command line argument -help makes arara list all the available options with brief explanations about their function.

screenshot of terminal showing arara messages

Book Launch Photos

Photos from book launches.

Quack, Quack, Quack. Give My Hat Back! Cake in Box

The cake from the launch of the illustrated children’s book Quack, Quack, Quack. Give My Hat Back! (still in its box).

image of cake in box

Quack, Quack, Quack. Give My Hat Back! Cake on Display

The cake from the launch of the illustrated children’s book Quack, Quack, Quack. Give My Hat Back! on display.

image of cake

Quack, Quack, Quack. Give My Hat Back! Cake Cutting

The cake from the launch of the illustrated children’s book Quack, Quack, Quack. Give My Hat Back! being cut by the author and illustrator.

photo of the cake being cut

The Private Enemy Book Launch

The launch of the crime/speculative fiction novel The Private Enemy.

Photo of books arranged on and around an old printing press