# Making Calendars with Emacs

A brief HOWTO document for creating monthly paper calendars with the Emacs editor.

## Requirements

• Emacs with standard packages installed.
• A LaTeX software stack. On UNIX-alikes this would typically be the teTeX distribution. On Windows, MikTeX or the Cygwin port of teTeX should work fine.

On most modern releases of Emacs, the menu features are sufficiently rich that you can now access most of the important features with the GUI. For those who are running older or non-GUI versions by choice or necessity, we will include the keystrokes afterward.

## Getting into Calendar Mode

Type Meta-x calendar in order to open up a Calendar buffer in the lower portion of the screen. This should give you a 3 month view centered around the current month.

Point at a date in the calendar section, middle-click (hold down) and select the Prepare LaTeX buffer. Releasing the button will then reveal a set of choices for types of calendar covering several date ranges and with a few variant types.

Choose the calendar type that you want. Another buffer will open up containing the LaTeX code necessary to generate a PostScript version of the calendar which can then be printed.

Because the calendar package has not been updated recently to reflect changes in LaTeX, you can save your self a bit of grief, by editing the generated LaTeX code before saving the file and processing it.

The head of the article will look like:

% This buffer was produced by cal-tex.el.% To print a calendar, type% M-x tex-buffer RET% M-x tex-print RET\documentstyle[11pt]{article}\hbadness 20000\hfuzz=1000pt\vbadness 20000

Use the editor to change

\documentstyle[11pt]{article}

to

\documentclass[11pt]{article}

The use of documentstyle has been deprecated since about 1995 and use of it amplifies greatly the chance of something going strangely wrong.

Once you have the LaTeX code saved into a file, you can then run through the usual sequence of:

user@host$latex calendar-file.texuser@host$ dvips -o calendar-file.ps calendar-file.texuser@host\$ lp -d ps1 calendar-file.tex

In a Windows environment, you may be able to click a single button to run through the sequence, but that lies outside the purview of this document.

## Key Sequences for Non-GUI Use

For the full set of options, you can do a web search for "Emacs LaTeX Calendar", but the most frequently used key sequences should be:

Key Sequence Calendar Function
t m Monthly Calendar (Portrait)
t M Monthly Calendar (Landscape)
t w 1 Weekly Calendar (Variant 1)
t w 2 Weekly Calendar (Variant 2)
t w 3 Weekly Calendar (Variant 3: ISO-style)
t w 4 Weekly Calendar (Variant 4: Monday-start)
t y Year Calendar (Portrait)
t Y Year Calendar (Landscape)

Apps and Devices