User's Guide To The L TEX Calendar Bundle: This File Is Version Number 3.1. It Was Last Revised On 1998/01/17 17:11:27
User's Guide To The L TEX Calendar Bundle: This File Is Version Number 3.1. It Was Last Revised On 1998/01/17 17:11:27
Contents
1 System Preparation 1
2 Creating Calendars 1
3 Data Files 3
3.1 Pinpoint Date Syntax . . . . . . . . . . . . . . . . . . . . . . . . 3
3.2 Recursive Date Syntax . . . . . . . . . . . . . . . . . . . . . . . . 4
3.3 Color Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.4 Freezing Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.5 Composite Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.6 Language Support . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.7 Rotating Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.8 Arbitrary Formulæ . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2
Preface
Welcome to the LATEX Calendar bundle. This bundle will produce calendars in a
variety of formats, in any language supported by LATEX 2ε , simply, quickly, and
with enough flexibility to make the little “personal calendars” that ship with
Windows 95 and the like beg for mercy. It just might be the only calendaring
system you need.
This manual explains how to use it.
1 System Preparation
The first thing you must do is be sure that you have all of the necessary tools
to hand. Before using the styles in the LATEX calendar package, you should first
check that your LATEX installation includes all of the utilities in the graphics
subdirectory under packages in the main LATEX 2ε distribution directory on
CTAN, and the longtable and the multicol packages from the tools subdi-
rectory of packages. You will also need everything in the calendar package
itself. With these items in hand, the package should function smoothly in accor-
dance with the documentation given here and in the individual *.dtx files. If
you have problems, please contact me on [email protected].
2 Creating Calendars
There are nine calendar styles in the bundle. The simplest possible document for
each is shown in Figure 1. It is worth spending a little time studying these ex-
amples to see what the essential elements are, and what can vary from one style
to another. Some are packages, invoked through the \usepackage tag. Others
are classes, invoked via the \documentclass tag at the top of the document. In
either case, the calendar itself takes the form of a LATEX environment. The name
of this environment sometimes differs from the name given to \usepackage or
\documentclass, because the operating system on which the largest software
company in the world was built cannot cope with more than eight characters in
a file name.
There are always two extra arguments after the \begin tag that opens the
environment. The first extra argument contains formatting instructions and
other options that modify the behavior of the style. We will refer to these as
calendar options. A few calendar options are common to all calendar styles,
while others are specific to a particular style. In the examples, the first extra
argument is always empty because (get ready for this one) calendar options are
optional. A full explanation of all calendar options for all styles is given in
section 4 below.
The second extra argument gives names of data files containing lists of events
or appointments, together with the names of any colors to be associated with the
entries in each data file. In the examples, this second argument is blank because
a calendar can be created without including any events or appointments. See
section 3 below for a discussion of how to manage data lists and include them
in calendars.
The only other component of a complete calendar is a controlling date or a
controlling range of dates. As you can see from the examples, this is the only
1
\documentclass{article} \documentclass{weekly}
\usepackage{timesht}
\begin{document} \begin{document}
\begin{timesheet} \begin{weekly}
{} {}
{} {}
Jan 1 1997 Jan 1 1997
\end{timesheet} \end{weekly}
\documentclass{monthly} \documentclass{article}
\usepackage{yearly}
\begin{document} \begin{document}
\begin{monthly} \begin{yearly}
{} {}
{} {}
Jan 1 1997 Jan 1 1997
\end{monthly} \end{yearly}
\documentclass{article} \documentclass{timetabl}
\usepackage{evntlist}
\begin{document} \begin{document}
\begin{eventlist} \begin{timetable}
{} {}
{} {}
Jan 1 1997 Jan 1 1997
\end{eventlist} \end{timetable}
\documentclass{article} \documentclass{article}
\usepackage{hmonth} \usepackage{hlist}
\begin{document} \begin{document}
\begin{htmlmonth} \begin{htmllist}
{} {}
{} {}
Jan 1 1997 Jan 1 1997
\end{htmlmonth} \end{htmllist}
\documentclass{article}
\usepackage{hml}
\begin{document}
\begin{htmlmonthlist}
{}
{}
Jan 1 1997
\end{htmlmonthlist}
2
thing written inside the environment, and it is written in a human-readable
form. The bundle is pretty forgiving in the way it reads dates; the elements of
a simple date can be written in any order (that is to say, Aug 1 1997, 1 Aug
1997 and 1997 Aug 1 will all work equally well). Only the first three letters of
the month are read, but any extra characters are quietly ignored (so you can say
August 1 1997 instead of Aug 1 1997). And the first character of the month
can be either upper-case or lower-case (so 1 aug 1997 is okay too).
The finished calendar will be composed so that it includes the controlling
date. This may be expressed as a range rather than, as in the examples, a
pinpoint date. A range is simply two pinpoint dates separated by the word to.
If a range is used (for example, jan 1 1997 to 1 august 1997), the finished
calendar will be composed so that it includes both the starting and the ending
date of the controlling range.
We have now completed an overview of how calendars are written. All that
remains is to examine (a) how data files are written and included in documents
(see section 3 below), and (b) what options are available to modify the behavior
of each of the styles (see section 4 below).
3 Data Files
Most commercial calendars come with pre-printed notes of the major holidays
and other significant events. Calendars created with the LATEX Calendar Bun-
dle can contain pre-printed notes of any events or appontments that you like.
Events or appointments are incorporated into a calendar from separate files that
have the extension .cld. The names of the files, less the extension, should be
listed, separated by commas and without spaces, in the second argument to the
calendar environment, as show in Figure 2. In the next section, we will examine
the content of the data files themselves.
\documentclass{weekly}
\begin{document}
\begin{weekly}{}{firstlist,secondlist}
Jan 1 1997
\end{weekly}
\end{document}
3
Jan 1 1997 {New Year’s Day}
Jan 1 1997 {The Day After New Year’s Day}
% file: class.cld
% The schedule for my Spanish class
range curyear {Current year}
every thurs {Spanish class}
Figure 6: class.cld
% file: curyear.cld
% A range including all dates in the current year
January 1 1997 to December 31 1997 {The year}
Figure 7: curyear.cld
Figures 6 and 7 show the content of two .cld files, which together define a
4
simple recursive date. The file class.cld, shown in Figure 6, will produce a
note saying “Spanish class” for every Thursday within the range given in the
file curyear.cld. It is worth pausing for a few moments to study how these
two files are constructed.
Note that the range declaration takes a filename (less the .cld extension),
followed by a comment in curly braces. The comment will not be printed in
the calendar output, so the braces can be left empty if desired. The file called
by the range declaration should contain one or more ranges, each of which is
composed of a starting and an ending date separated by the word to. Each
range should be ended with a comment (possibly, as in the example, an empty
comment) in matched curly braces.1
The recursive date itself always begins with the word every, followed by a
description of conditions to be repeated throughout the range. Figure 8 gives
examples of all of the conditions that can be specified. The only entry that is
not self-explanatory, I think, is the every third (or first, or second) Tuesday
example. This puts an entry on the nth day of the specified week of the month
throughout the specified range. Note also that times can be specified for all
recursive entries (that is to say, you can specify recursive appointments as well
as recursive events).
There is one common situation with which the simple recursive date illus-
trated in Figures 6 and 7 cannot cope. Suppose I want to define a recursive date
that will put an entry in my diary for classes that I teach on a regular basis. I
might try to do this using an entry like that in Figure 9.
The problem is that the simple ranges recorded in schoolterms.cld will
not account for holidays, and I do not plan to teach classes during holidays. To
cope with this little difficulty, the LATEX Calendar Bundle provides the holiday
declaration. As you can see in Figure 10, the syntax of this declaration is the
same as that of the range declaration. The separate file ukhols.cld should
contain a list of pinpoint dates which are to be excluded when recursive dates
are calculated.
1 The starting date may also be followed by a comment in curly braces. It is often useful
to associate a comment with the starting and ending dates of a range. See Figure 11 and the
discussion at the end of this section.
5
range schoolterms {Terms}
every Tuesday 10:00-12:00 {Jse Lec}
[Japanese Law lecture]
every Tuesday 13:00-14:00 {Prop Tut}
[Property Law tutorial]
The text enclosed in curly braces that follows a range or holiday declaration
(see Figures 6, 9 and 10), and the comments in curly braces inside the .cld files
called by these declarations (see Figure 7) will not appear in the text of printed
calendars. Sometimes it is useful to print a note of the beginning and ending
dates of a range, or the dates of holidays. In this case, the file containing the
relevant range (which should have notes associated with the starting an ending
dates) should be named in the second argument to the calendar environment,
as a normal input file. Figure 11 gives an example of a fully-commented range
file.
% file: ug-current.cld
17 sep 1997 {First SOAS term begins}
to 12 dec 1997 {First SOAS term ends}
5 jan 1998 {Second SOAS term begins}
to 20 mar 1998 {Second SOAS term ends}
20 apr 1998 {Third SOAS term begins}
to 5 jun 1998 {Third SOAS term ends}
6
\documentclass{weekly}
\usepackage[dvips,usenames,dvipsnames]{color}
\begin{document}
the name of the file, followed by the name of the color in which you want its
entries to appear. See the documentation to the graphics package for further
information on what color names are available.
\documentclass{weekly}
\begin{document}
\begin{weekly}{}{firstlist:red,secondlist:blue}
Jan 1 1997
\end{weekly}
\end{document}
7
list ug-cinl-lecture {}
list ug-cinl-lecture {}
list ug-conflicts-lecture {}
list ug-criminal-lecture {}
list ug-csel-lecture {}
list ug-eml-lecture {}
list ug-equity-lecture {}
list ug-essay-lecture {}
list ug-family-lecture {}
list ug-hr-lecture {}
list ug-iel-lecture {}
list ug-islam-lecture {}
list ug-jsel-lecture {}
list ug-ld-lecture {}
list ug-ld-lecture {}
list ug-lsaa-lecture {}
list ug-lssa-lecture {}
list ug-obs1-lecture {}
list ug-obs2-lecture {}
list ug-pil-lecture {}
list ug-property-lecture {}
list ug-public-lecture {}
large or complex data sets, this is a Really Nice Feature. Note, however, that
the freeze declaration will not export any data contained in files referenced
using list. The freeze declaration should therefore be used only in files that
do not contain any list declarations.
If your operating system can cope with long filenames, see the tar archive
file bigdemo.tgz in the calendar subdirectory on CTAN for a complete working
data set that relies on the list declaration to organize things in this way.
\DeclareCalendarLanguage{English}
{{Sunday}{Monday}{Tuesday}{Wednesday}{Thursday}{Friday}{Saturday}}
{{Sun}{Mon}{Tue}{Wed}{Thu}{Fri}{Sat}}
{{January}{February}{March}{April}{May}{June}{July}{August}{September}
{October}{November}{December}}
8
{{Jan}{Feb}{Mar}{Apr}{May}{Jun}{Jul}{Aug}{Sep}{Oct}{Nov}{Dec}}
\DeclareCalendarLanguage{German}
{{Sonntag}{Montag}{Dienstag}{Mittwoch}{Donnerstag}{Freitag}{Samstag}}
{{So}{Mo}{Di}{Mi}{Do}{Fr}{Sa}}
{{Januar}{Februar}{M\"arz}{April}{Mai}{Juni}{Juli}{August}{September}%
{Oktober}{November}{Dezember}}
{{Jan}{Feb}{M\"arz}{Apr}{Mai}{Juni}{Juli}{Aug}{Sep}{Okt}{Nov}{Dez}}
These entries serve two purposes. First, they define the texts that should
be use for long and short names of the days of the week and the months for
each of the language options that they declare. Second, the order of options
determines the order of alternative language entries in your *.cld files. In the
example above, English is the default language, but German can be specified
as an option in your documents, by giving that as a class or package option to
the calendar style you are using. You can declare as many languages in your
dates.cfg file as you like.
Once you have edited the dates.cfg file to your satisfaction, and put the
languages into the correct order for your needs, you are ready to add multi-
lingual *.cld to your files. The first thing to note is that alternative languages
are always optional. If we are using the sample dates.cfg file above, and the
*.cld file contains only default entries in English, the English entries will be
supplied. Nothing will break as a result of specifying an alternative language
that has been declared; they are perfectly safe.
Again following the example configuration file above, a German entry can
be added to a file by using angle braces instead of curly braces for its short
text. Square braces (for a long text) work exactly as they do after the default,
curly-brace text:
jan 1 1998 {New Year}
<Neue Yahr>
jan 1 1998 21:00 {New Year’s Party} [New Year’s Party at Fred’s house.]
<Neue Yahr> []
9
To rotate an entire calendar (such as monthly), use the lscape package, and
enclose the calendar tags in landscape tags:
\documentclass{article}
\usepackage{monthly}
\usepackage{lscape}
\begin{landscape}
\begin{monthly}{}{}
january 1 1998
\end{monthly}
\end{landscape}
4.1 Timesheets
The timesheet style produces a timesheet for every date in the controlling range.
Timesheets have a column of time blocks marked out on the left side of the page,
a list of appointments (if any) to the right of that, and a blank area for recording
actions taken (or doodling pictures) on the far right of the page.
package if you would like more detailed information about how these work.
10
\documentclass{timetabl}
\begin{document}
\begin{timetable}
{notimes,
title={Law Department Timetable},
labels={Monday,Tuesday,Wednesday,Thursday,Friday},
start=9:00,
end=21:00,
blockminutes=60}
{}
Jan 5 1997 to Jan 9 1997
\end{timetable}
\end{document}
title The string fed to this option will form the title of the timesheet. Ro-
bust commands (like \LaTeXe) should be safe here. The default string is
Timesheet.
leftright This option can be used to alter the proportion of space taken up by
the right and left columns. The syntax is a pair of integers separated by
a slash. The default value is 1/1, for evenly spaced columns. The values
express a ratio, so you do not need to make the values add up to anything
in particular.
start This is the starting time of the timesheet. The format is colon-delimited
24-hour time (i.e. 17:00 for five o’clock in the afternoon). The default
starting time is 8:00.
end Like start, but specifies an ending time for the timesheet. The default
ending time is 17:00.
blockminutes If you want the timesheet to be split into time blocks of equal
duration, you can use this option to select the length of the blocks in
minutes. This must divide evenly (without a remainder) into the span of
time specified by the start and end of the timesheet. The default value of
this option is 15, for fifteen-minute blocks.
blockgroup A line will be drawn all the way across the timesheet at the end
of every group of time blocks. The number of blocks in a group can be
set using this option. The default is 4, which puts a line at every hour
boundary with the default value of blockminutes.
width If you don’t want the timesheet to fill the whole width of the page, you
can use this option to specify a smaller size. The feedback given when the
style is run gives you the size in points for that run of LATEX, which may
be useful in making formatting adjustments.
11
leftspace This can be used to specify an explicit left-offset value. The default
is \fill.
rightspace Like leftspace, but for the right side of the timesheet. The default
is \fill, for a centred table.
titletype This sets the default typeface for the overall title of the timesheet.
labeltype This sets the default typeface for the labels (Plan and Action) at
the top of the sheet.
timelabeltype This sets the default typeface for the time markings on the
lefthand side of the page.
timeitemtype This sets the default typeface for the times associated with ap-
pointments.
itemtype This sets the default typeface for the item text itself.
4.2 Weekly
The weekly style prints weekly calendars for use with a Filofax(tm) or other
personal planner. Pages are framed with cut-lines, and punch-marks show where
to cut holes at the edge of the page. For each date, the style initially attempts
to set the event and date text as a single column. If the text overflows the
box for that date, the style will attempt to recover by resetting the text as two
columns.
• The text of the calendar is always rotated, using the lscape package from
the graphics bundle. As a result, calendars generated using this package
can only be printed using dvips or other PostScript(TM) print drivers
supported by the graphics bundle.
• If the graphics bundle has not been configured for your system, you can
specify the driver and other options for its use by giving LATEX options to
the class when it is loaded.
• While the paper size can be specified using options like a4paper, this will
have no effect; the actual paper size is governed by calendar options.
• Documents created with this style should contain nothing other than a
calendar environment.
12
punchcluster Most filofaxes have two or or more clusters or groups of punches
to hold the pages in place. This option sets the number of punches in each
cluster. The default is three.
intraspace This governs the space between punchouts within a group. The
default is 19.25mm.
punchgroups This option sets the number of groups of punches. The default is
two groups.
interspace This option sets the distance between the groups of punches. The
default is 51.25mm.
pageheight This fixes the height of a filofax page (not the physical paper on
which it is printed). The default is 172mm.
pagewidth This fixes the width of an individual page. The physical printed
area will be twice this figure. The default is 95mm, for a 190mm printed
area.
grip This adjusts the distance from the edge of the page to the outer edge of
the punchouts. Default is 5mm.
punchmargin This adjusts the distance from the edge of the text to the inner
edge of the punchouts. Default is 2mm.
punchsize Size, in points, of punchouts. Default is 15.
topspace Gap between top of filofax page and top of text page.
bottomspace Gap between bottom of filofax page and bottom of text page.
jawspread If set to a positive length, this places a set of rules the width of the
punchmarks on either side of each punchhole, centered on its center and
spread the distance specified. This can be useful as a guide with some
one-hole punches that are designed to be used “blind”.
jawline Sets the width of the lines used to make jawmarks. Default value is
0.4pt.
4.3 Monthly
The monthly style produces a simple monthly calendar, similar to the ones you
can buy in shops. The LATEX Calendar version does not include cartoons by
Gary Larson or pictures of the latest fave rave teen band (at least by default),
but you do have access to all of the goodies available in the other packages in
the bundle (color coding, et cetera). Ordinarily you will want to print this using
the lscape package and its landscape environment.
13
4.3.2 Calendar Options
title The string fed to this option will form the title of the calendar. Robust
commands (like “LATEX 2ε ”) should be safe here. The default is the name
of the month, followed by the year.
labels This is an optional comma-delimited, brace-enclosed string giving a list
of seven labels to be used for days of the week. This was once used to
make calendars in languages other than English.
4.4 Yearly
This produces a simple yearly calendar. It was the first of the Calendar style
packages to be written, and in some ways it is the most unsatisfactory; I invite
others to use this style as a model and improve on it. But for workaday needs
— to produce a simple one-year calendar on a single piece of paper — it works
well enough.
title The string fed to this option will form the title of the calendar. Ro-
bust commands (like “LATEX 2ε ”) should be safe here. The default is the
number of the year.
labels This is an optional comma-delimited, brace-enclosed string giving a list
of seven labels to be used for days of the week. This can be used to make
a calendar in a language other than English or German.
14
4.5 Timetable
This package organizes date items in a format suitable for conference schedules,
itineraries, academic teaching timetables and the like. It is a versatile package,
worth playing around with if you want to use this bundle in an institutional
context.
leftspace Amount of space to the left of the table (default is \hfill, but with
table sized to exactly fit the margins).
rightspace Amount of space to the right of the table (default is \hfill, but
with table sized to exactly fit the margins).
width Width of the table. The default is \textwidth.
title The string fed to this option will form the title of the timetable. Robust
commands (like “LATEX 2ε ”) should be safe here. The default is “Confer-
ence Schedule”.
notimes If this option is given, the time of each item is not given in the body
of the timetable. If all entries begin and end exactly on the boundaries
arrived at by applying blockminutes to the range of the table, no infor-
mation is lost, and the table will have a cleaner appearance and be easier
to read.
start Time from which schedule should begin, with hours and minutes sepa-
rated by a colon. The default is 8:00.
end Time at which the schedule should end. The default is 17:00.
blockminutes The number of minutes in each time block. This should divide
evenly into the total number of minutes within the range specified by
start and end. The default is 60.
15
labelface The typeface used for the day labels.
timelabelface The typeface used for the time labels on the left edge of the
table.
timeitemface The typeface used for the time of each entry (suppressed alto-
gether if the notimes option is given).
itemface The typeface used for the entry text.
title The string fed to this option will form the title of the calendar. The
default is the name of the month, followed by the year.
firstday This is the starting day of the calendar, expressed as an integer.
Sunday (the default) is “0”.
outputfile This is the name of a file to which the HTML output should be
written.
16
4.8.1 Class or Package Options
The only options recognized by this package are language options declared via
dates.cfg.
17