calendar features that are independent of any particular date. To exit
the calendar, type @kbd{q}.
+@iftex
This chapter describes the basic calendar features.
@inforef{Advanced Calendar/Diary Usage,, emacs-xtra}, for information
about more specialized features.
+@end iftex
@menu
* Calendar Motion:: Moving through the calendar; selecting a date.
* Scroll Calendar:: Bringing earlier or later months onto the screen.
* Counting Days:: How many days are there between two dates?
* General Calendar:: Exiting or recomputing the calendar.
-* LaTeX Calendar:: Print a calendar using LaTeX.
+* Writing Calendar Files:: Writing calendars to files of various formats.
* Holidays:: Displaying dates of holidays.
* Sunrise/Sunset:: Displaying local times of sunrise and sunset.
* Lunar Phases:: Displaying phases of the moon.
* Importing Diary:: Converting diary events to/from other formats.
* Daylight Savings:: How to specify when daylight savings time is active.
* Time Intervals:: Keeping track of time intervals.
+@ifnottex
+* Advanced Calendar/Diary Usage:: Advanced Calendar/Diary customization.
+@end ifnottex
@end menu
@node Calendar Motion
(If a frame contains a dedicated calendar window, exiting from the
calendar iconifies that frame.)
-@node LaTeX Calendar
-@section LaTeX Calendar
-@cindex calendar and La@TeX{}
+@node Writing Calendar Files
+@section Writing Calendar Files
+
+ These packages produce files of various formats containing calendar
+and diary entries, for display purposes.
+
+@cindex calendar and HTML
+ The Calendar HTML commands produce files of HTML code that contain
+calendar and diary entries. Each file applies to one month, and has a
+name of the format @file{@var{yyyy}-@var{mm}.html}, where @var{yyyy} and
+@var{mm} are the four-digit year and two-digit month, respectively. The
+variable @code{cal-html-directory} specifies the default output
+directory for the HTML files.
+
+@vindex cal-html-css-default
+ Diary entries enclosed by @code{<} and @code{>} are interpreted as
+HTML tags (for example: this is a diary entry with <font
+color=''red''>some red text</font>). You can change the overall
+appearance of the displayed HTML pages (for example, the color of
+various page elements, header styles) via a stylesheet @file{cal.css} in
+the directory containing the HTML files (see the value of the variable
+@code{cal-html-css-default} for relevant style settings).
+
+@kindex t @r{(Calendar mode)}
+@table @kbd
+@item H m
+Generate a one-month calendar (@code{cal-html-cursor-month}).
+@item H y
+Generate a calendar file for each month of a year, as well as an index
+page (@code{cal-html-cursor-year}). By default, this command writes
+files to a @var{yyyy} subdirectory - if this is altered some hyperlinks
+between years will not work.
+@end table
- The Calendar La@TeX{} commands produce a buffer of La@TeX{} code that
+ If the variable @code{cal-html-print-day-number-flag} is
+non-@code{nil}, then the monthly calendars show the day-of-the-year
+number. The variable @code{cal-html-year-index-cols} specifies the
+number of columns in the yearly index page.
+
+@cindex calendar and La@TeX{}
+ The Calendar La@TeX{} commands produce a buffer of La@TeX{} code that
prints as a calendar. Depending on the command you use, the printed
calendar covers the day, week, month or year that point is in.
@code{nil}), diary entries are included also (in weekly and monthly
calendars only). If the variable @code{cal-tex-rules} is non-@code{nil}
(the default is @code{nil}), the calendar displays ruled pages
-in styles that have sufficient room.
+in styles that have sufficient room. You can use the variable
+@code{cal-tex-preamble-extra} to insert extra La@TeX{} commands in the
+preamble of the generated document if you need to.
@node Holidays
@section Holidays
To view the distribution of holidays for all the dates shown in the
calendar, use the @kbd{x} command. This displays the dates that are
holidays in a different face (or places a @samp{*} after these dates, if
-display with multiple faces is not available). @inforef{Calendar
-Customizing, calendar-holiday-marker, emacs-xtra}. The command applies
-both to the currently visible months and to other months that
-subsequently become visible by scrolling. To turn marking off and erase
-the current marks, type @kbd{u}, which also erases any diary marks
-(@pxref{Diary}). If the variable @code{mark-holidays-in-calendar} is
-non-@code{nil}, creating or updating the calendar marks holidays
-automatically.
+display with multiple faces is not available).
+@iftex
+@inforef{Calendar Customizing, calendar-holiday-marker, emacs-xtra}.
+@end iftex
+@ifnottex
+@xref{Calendar Customizing, calendar-holiday-marker}.
+@end ifnottex
+ The command applies both to the currently visible months and to
+other months that subsequently become visible by scrolling. To turn
+marking off and erase the current marks, type @kbd{u}, which also
+erases any diary marks (@pxref{Diary}). If the variable
+@code{mark-holidays-in-calendar} is non-@code{nil}, creating or
+updating the calendar marks holidays automatically.
@kindex a @r{(Calendar mode)}
@findex list-calendar-holidays
@table @kbd
@item d
Display all diary entries for the selected date
-(@code{view-diary-entries}).
+(@code{diary-view-entries}).
@item Mouse-2 Diary
Display all diary entries for the date you click on.
@item s
-Display the entire diary file (@code{show-all-diary-entries}).
+Display the entire diary file (@code{diary-show-all-entries}).
@item m
Mark all visible dates that have diary entries
(@code{mark-diary-entries}).
@end table
@kindex d @r{(Calendar mode)}
-@findex view-diary-entries
+@findex diary-view-entries
@vindex view-diary-entries-initially
Displaying the diary entries with @kbd{d} shows in a separate window
the diary entries for the selected date in the calendar. The mode line
To get a broader view of which days are mentioned in the diary, use
the @kbd{m} command. This displays the dates that have diary entries in
a different face (or places a @samp{+} after these dates, if display
-with multiple faces is not available). @inforef{Calendar Customizing,
-diary-entry-marker, emacs-xtra}. The command applies both to the
-currently visible months and to other months that subsequently become
-visible by scrolling. To turn marking off and erase the current marks,
-type @kbd{u}, which also turns off holiday marks (@pxref{Holidays}).
-If the variable @code{mark-diary-entries-in-calendar} is
-non-@code{nil}, creating or updating the calendar marks diary dates
-automatically.
+with multiple faces is not available).
+@iftex
+@inforef{Calendar Customizing, diary-entry-marker, emacs-xtra}.
+@end iftex
+@ifnottex
+@xref{Calendar Customizing, diary-entry-marker}.
+@end ifnottex
+ The command applies both to the currently visible months and to
+other months that subsequently become visible by scrolling. To turn
+marking off and erase the current marks, type @kbd{u}, which also
+turns off holiday marks (@pxref{Holidays}). If the variable
+@code{mark-diary-entries-in-calendar} is non-@code{nil}, creating or
+updating the calendar marks diary dates automatically.
@kindex s @r{(Calendar mode)}
-@findex show-all-diary-entries
+@findex diary-show-all-entries
To see the full diary file, rather than just some of the entries, use
the @kbd{s} command.
The command @kbd{M-x diary} displays the diary entries for the current
date, independently of the calendar display, and optionally for the next
few days as well; the variable @code{number-of-diary-entries} specifies
-how many days to include. @inforef{Diary Customizing,, emacs-xtra}.
+how many days to include.
+@iftex
+@inforef{Diary Customizing,, emacs-xtra}.
+@end iftex
+@ifnottex
+@xref{Diary Customizing, number-of-diary-entries}.
+@end ifnottex
If you put @code{(diary)} in your @file{.emacs} file, this
automatically displays a window with the day's diary entries, when you
visible line cannot cause problems, but editing at the end of a line may
not do what you expect. Deleting a line may delete other invisible
entries that follow it. Before editing the diary, it is best to display
-the entire file with @kbd{s} (@code{show-all-diary-entries}).
+the entire file with @kbd{s} (@code{diary-show-all-entries}).
@node Date Formats
@subsection Date Formats
If you prefer the European style of writing dates---in which the day
comes before the month---type @kbd{M-x european-calendar} while in the
calendar, or set the variable @code{european-calendar-style} to @code{t}
-@emph{before} using any calendar or diary command. This mode interprets
-all dates in the diary in the European manner, and also uses European
-style for displaying diary dates. (Note that there is no comma after
-the @var{monthname} in the European style.) To go back to the (default)
-American style of writing dates, type @kbd{M-x american-calendar}.
+with @kbd{M-x customize}, or @emph{before} using any calendar or diary
+command. This mode interprets all dates in the diary in the European
+manner, and also uses European style for displaying diary dates. (Note
+that there is no comma after the @var{monthname} in the European style.)
+To go back to the (default) American style of writing dates, type
+@kbd{M-x american-calendar}.
You can use the name of a day of the week as a generic date which
applies to any date falling on that day of the week. You can abbreviate
specifying the name of a face or a single-character string to use when
marking the entry in the calendar. Most generally, sexp diary entries
can perform arbitrary computations to determine when they apply.
+@iftex
@inforef{Sexp Diary Entries,, emacs-xtra}.
+@end iftex
+@ifnottex
+@inforef{Sexp Diary Entries}.
+@end ifnottex
@node Appointments
@section Appointments
and adds the results to an Emacs diary file. For example:
@example
-(icalendar-import-file "/here/is/calendar.ics" "/there/goes/ical-diary")
+(icalendar-import-file "/here/is/calendar.ics"
+ "/there/goes/ical-diary")
@end example
@noindent
You can use an @code{#include} directive to add the import file contents
-to the main diary file, if these are different files. @inforef{Fancy Diary
-Display,, emacs-xtra}.
+to the main diary file, if these are different files.
+@iftex
+@inforef{Fancy Diary Display,, emacs-xtra}.
+@end iftex
+@ifnottex
+@xref{Fancy Diary Display}.
+@end ifnottex
+
@findex icalendar-export-file, icalendar-export-region
Use @code{icalendar-export-file} to interactively export an entire
should run the command @kbd{M-x timeclock-reread-log} to update the
data in Emacs from the file.
+@ifnottex
+@include cal-xtra.texi
+@end ifnottex
+
@ignore
arch-tag: 4531ef09-9df3-449d-9c52-2b5a4a337f92
@end ignore