Numbered Dictionary Terms in LaTeX

Creating a typesetting for an ordered dictionary in LaTeX is rather the harder than one would expect. LaTeX offers a variety of ways to create lists that highlight the opening phrase or provide for numbering but combining requires a variety of techniques. For example, creating something like this:

  1. Bold a heavy typeface
  2. Italics a slanted typeface

requires a fairly sophisticated approach.

The first step in creating a new custom enumeration is to create a new counter with newcounter. Next store the definition of the list using newenvironment.  This will also allow you to name the list type and make your LaTeX code easier to read and write. The basic structure for creating a custom list is thelist macro. This macro requires 2 arguments. The first argument is what code to use if an item has no arguments. The second controls the formatting of the list.

Each entry in the list should have highlighted text so the first argument to list should be empty. Handling the enumeration and highlighting requires overriding the makelabel macro. To make the macros easier to read and reusable, you can define a one parameter macro displaying the typesetting and then use renewcommand{makelabel}{mymacro}. Renewing makelabel and the placement of the list on the page should be the second argument.

Some example macros to create the typesetting above are
newcommand{definitionlabel}[1]{mbox{arabic{definitions} textbf{#1}} stepcounter{definitions}}
newenvironment{definitions}{setcounter{definitions}{1} begin{list}{}{renewcommand{makelabel}{definitionlabel}}}{end{list}}

For more information on lists see The Latex Companion by Mittelbach, Rowley, Carlisle, and Braams

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: