annotate lisp/calendar/cal-tex.el @ 18688:eb0638b0b1eb

(RE_TRANSLATE): Copy definition from config.in.
author Richard M. Stallman <rms@gnu.org>
date Wed, 09 Jul 1997 01:25:06 +0000
parents 68cce262538d
children a1c69eba1dd6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1 ;;; cal-tex.el --- calendar functions for printing calendars with LaTeX.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
2
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
3 ;; Copyright (C) 1995 Free Software Foundation, Inc.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
4
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
5 ;; Author: Steve Fisk <fisk@bowdoin.edu>
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
6 ;; Edward M. Reingold <reingold@cs.uiuc.edu>
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
7 ;; Keywords: calendar
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
8 ;; Human-Keywords: Calendar, LaTeX
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
9
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
10 ;; This file is part of GNU Emacs.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
11
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
12 ;; GNU Emacs is free software; you can redistribute it and/or modify
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
13 ;; it under the terms of the GNU General Public License as published by
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
14 ;; the Free Software Foundation; either version 2, or (at your option)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
15 ;; any later version.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
16
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
17 ;; GNU Emacs is distributed in the hope that it will be useful,
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
20 ;; GNU General Public License for more details.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
21
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
22 ;; You should have received a copy of the GNU General Public License
14169
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13649
diff changeset
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13649
diff changeset
24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13649
diff changeset
25 ;; Boston, MA 02111-1307, USA.
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
26
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
27 ;;; Commentary:
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
28
13206
2d1da471963a Minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13195
diff changeset
29 ;; This collection of functions implements the creation of LaTeX calendars
2d1da471963a Minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13195
diff changeset
30 ;; based on the user's holiday choices and diary file.
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
31
14169
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13649
diff changeset
32 ;; TO DO
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13649
diff changeset
33 ;;
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13649
diff changeset
34 ;; (*) Add holidays and diary entries to daily calendar.
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13649
diff changeset
35 ;;
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13649
diff changeset
36 ;; (*) Add diary entries to weekly calendar functions.
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13649
diff changeset
37 ;;
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13649
diff changeset
38 ;; (*) Make calendar styles for A4 paper.
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13649
diff changeset
39 ;;
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13649
diff changeset
40 ;; (*) Make daily and monthly styles Filofax paper.
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
41
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
42 ;;; Code:
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
43
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
44 (require 'calendar)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
45
13649
fb670bed6222 Use new file name diary-lib.
Richard M. Stallman <rms@gnu.org>
parents: 13595
diff changeset
46 (autoload 'list-diary-entries "diary-lib" nil t)
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
47 (autoload 'calendar-holiday-list "holidays" nil t)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
48 (autoload 'calendar-iso-from-absolute "cal-iso" nil t)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
49
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
50 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
51 ;;; Customizable variables
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
52 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
53
17626
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
54 (defcustom cal-tex-which-days '(0 1 2 3 4 5 6)
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
55 "*The days of the week that are displayed on the portrait monthly calendar.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
56 Sunday is 0, Monday is 1, and so on. The default is to print from Sunday to
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
57 Saturday. For example, use
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
58
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
59 (setq cal-tex-which-days '(1 3 5))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
60
17626
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
61 to only print Monday, Wednesday, Friday."
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
62 :type '(repeat integer)
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
63 :group 'calendar-tex)
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
64
17626
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
65 (defcustom cal-tex-holidays t
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
66 "*If t (default), then the holidays are also printed.
17626
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
67 If finding the holidays is too slow, set this to nil."
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
68 :type 'boolean
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
69 :group 'calendar-tex)
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
70
17626
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
71 (defcustom cal-tex-diary nil
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
72 "*If t, the diary entries are printed in the calendar."
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
73 :type 'boolean
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
74 :group 'calendar-tex)
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
75
17626
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
76 (defcustom cal-tex-daily-string
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
77 '(let* ((year (extract-calendar-year date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
78 (day (calendar-day-number date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
79 (days-remaining (- (calendar-day-number (list 12 31 year)) day)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
80 (format "%d/%d" day days-remaining))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
81 "*An expression in the variable `date' whose value is placed on date.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
82 The string resulting from evaluating this expression is placed at the bottom
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
83 center of `date' on the monthly calendar, next to the date in the weekly
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
84 calendars, and in the top center of daily calendars.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
85
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
86 Default is ordinal day number of the year and the number of days remaining.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
87 As an example of what you do, setting this to
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
88
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
89 '(progn
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
90 (require 'cal-hebrew)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
91 (calendar-hebrew-date-string date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
92
17626
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
93 will put the Hebrew date at the bottom of each day."
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
94 :type 'sexp
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
95 :group 'calendar-tex)
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
96
17626
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
97 (defcustom cal-tex-buffer "calendar.tex"
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
98 "*The name for the tex-ed calendar."
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
99 :type 'string
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
100 :group 'calendar-tex)
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
101
17626
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
102 (defcustom cal-tex-24 nil
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
103 "*If t, use a 24 hour clock in the daily calendar."
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
104 :type 'boolean
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
105 :group 'calendar-tex)
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
106
17626
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
107 (defcustom cal-tex-daily-start 8
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
108 "*The first hour of the daily calendar page."
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
109 :type 'integer
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
110 :group 'calendar-tex)
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
111
17626
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
112 (defcustom cal-tex-daily-end 20
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
113 "*The last hour of the daily calendar page."
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
114 :type 'integer
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
115 :group 'calendar-tex)
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
116
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
117 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
118 ;;; Definitions for LaTeX code
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
119 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
120
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
121 (defvar cal-tex-day-prefix "\\caldate{%s}{%s}"
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
122 "The initial LaTeX code for a day.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
123 The holidays, diary entries, bottom string, and the text follow.")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
124
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
125 (defvar cal-tex-day-name-format "\\myday{%s}%%"
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
126 "The format for LaTeX code for a day name. The names are taken from
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
127 calendar-day-name-array.")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
128
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
129 (defvar cal-tex-cal-one-month
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
130 "\\def\\calmonth#1#2%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
131 {\\begin{center}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
132 \\Huge\\bf\\uppercase{#1} #2 \\\\[1cm]%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
133 \\end{center}}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
134 \\vspace*{-1.5cm}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
135 %
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
136 "
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
137 "LaTeX code for the month header")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
138
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
139 (defvar cal-tex-cal-multi-month
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
140 "\\def\\calmonth#1#2#3#4%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
141 {\\begin{center}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
142 \\Huge\\bf #1 #2---#3 #4\\\\[1cm]%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
143 \\end{center}}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
144 \\vspace*{-1.5cm}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
145 %
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
146 "
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
147 "LaTeX code for the month header")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
148
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
149 (defvar cal-tex-myday
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
150 "\\renewcommand{\\myday}[1]%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
151 {\\makebox[\\cellwidth]{\\hfill\\large\\bf#1\\hfill}}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
152 %
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
153 "
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
154 "LaTeX code for a day heading")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
155
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
156 (defvar cal-tex-caldate
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
157 "\\fboxsep=0pt
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
158 \\long\\def\\caldate#1#2#3#4#5#6{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
159 \\fbox{\\hbox to\\cellwidth{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
160 \\vbox to\\cellheight{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
161 \\hbox to\\cellwidth{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
162 {\\hspace*{1mm}\\Large \\bf \\strut #2}\\hspace{.05\\cellwidth}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
163 \\raisebox{\\holidaymult\\cellheight}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
164 {\\parbox[t]{.75\\cellwidth}{\\tiny \\raggedright #4}}}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
165 \\hbox to\\cellwidth{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
166 \\hspace*{1mm}\\parbox{.95\\cellwidth}{\\tiny \\raggedright #3}}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
167 \\hspace*{1mm}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
168 \\hbox to\\cellwidth{#6}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
169 \\vfill%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
170 \\hbox to\\cellwidth{\\hfill \\tiny #5 \\hfill}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
171 \\vskip 1.4pt}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
172 \\hskip -0.4pt}}}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
173 "
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
174 "LaTeX code to insert one box with date info in calendar.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
175 This definition is the heart of the calendar!")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
176
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
177 (defun cal-tex-list-holidays (d1 d2)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
178 "Generate a list of all holidays from absolute date D1 to D2."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
179 (let* ((result nil)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
180 (start (calendar-gregorian-from-absolute d1))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
181 (start-month (extract-calendar-month start))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
182 (start-year (extract-calendar-year start)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
183 (increment-calendar-month start-month start-year 1)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
184 (let* ((end (calendar-gregorian-from-absolute d2))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
185 (end-month (extract-calendar-month end))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
186 (end-year (extract-calendar-year end)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
187 (if (= (extract-calendar-day end) 1)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
188 (increment-calendar-month end-month end-year -1))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
189 (let* ((s (calendar-absolute-from-gregorian
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
190 (list start-month 1 start-year)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
191 (e (calendar-absolute-from-gregorian
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
192 (list end-month 1 end-year)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
193 (d s)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
194 (never t)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
195 (displayed-month start-month)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
196 (displayed-year start-year))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
197 (while (or never (<= d e))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
198 (setq result (append result (calendar-holiday-list)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
199 (setq never nil)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
200 (increment-calendar-month displayed-month displayed-year 3)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
201 (setq d (calendar-absolute-from-gregorian
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
202 (list displayed-month 1 displayed-year))))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
203 (let ((in-range)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
204 (p result))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
205 (while p
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
206 (and (car (car p))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
207 (let ((a (calendar-absolute-from-gregorian (car (car p)))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
208 (and (<= d1 a) (<= a d2)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
209 (setq in-range (append (list (car p)) in-range)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
210 (setq p (cdr p)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
211 in-range)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
212
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
213 (defun cal-tex-list-diary-entries (d1 d2)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
214 "Generate a list of all diary-entries from absolute date D1 to D2."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
215 (let ((diary-display-hook nil))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
216 (list-diary-entries
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
217 (calendar-gregorian-from-absolute d1)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
218 (1+ (- d2 d1)))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
219
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
220 (defun cal-tex-preamble (&optional args)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
221 "Insert the LaTeX preamble.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
222 Preamble Includes initial definitions for various LaTeX commands.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
223 Optional ARGS are included."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
224 (set-buffer (get-buffer-create cal-tex-buffer))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
225 (erase-buffer)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
226 (insert "\\documentstyle")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
227 (if args
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
228 (insert "[" args "]"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
229 (insert "{article}\n"
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
230 "\\hbadness 20000
14268
28face32932e Add \hfuzz=1000pt to get rid of overfull box messages.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 14169
diff changeset
231 \\hfuzz=1000pt
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
232 \\vbadness 20000
17196
1b2490698826 (cal-tex-preamble): Set \lineskip to 0pt.
Karl Heuer <kwzh@gnu.org>
parents: 15433
diff changeset
233 \\lineskip 0pt
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
234 \\marginparwidth 0pt
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
235 \\oddsidemargin -2cm
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
236 \\evensidemargin -2cm
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
237 \\marginparsep 0pt
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
238 \\topmargin 0pt
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
239 \\textwidth 7.5in
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
240 \\textheight 9.5in
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
241 \\newlength{\\cellwidth}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
242 \\newlength{\\cellheight}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
243 \\newlength{\\boxwidth}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
244 \\newlength{\\boxheight}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
245 \\newlength{\\cellsize}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
246 \\newcommand{\\myday}[1]{}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
247 \\newcommand{\\caldate}[6]{}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
248 \\newcommand{\\nocaldate}[6]{}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
249 \\newcommand{\\calsmall}[6]{}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
250 %
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
251 "))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
252
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
253 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
254 ;;; Yearly calendars
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
255 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
256
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
257 (defun cal-tex-cursor-year (&optional arg)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
258 "Make a buffer with LaTeX commands for the year cursor is on.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
259 Optional prefix argument specifies number of years."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
260 (interactive "P")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
261 (cal-tex-year (extract-calendar-year (calendar-cursor-to-date t))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
262 (if arg arg 1)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
263
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
264 (defun cal-tex-cursor-year-landscape (&optional arg)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
265 "Make a buffer with LaTeX commands for the year cursor is on.
13595
2af9ec0bc9cc (cal-tex-version): Deleted.
Richard M. Stallman <rms@gnu.org>
parents: 13206
diff changeset
266 Optional prefix argument specifies number of years."
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
267 (interactive "P")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
268 (cal-tex-year (extract-calendar-year (calendar-cursor-to-date t))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
269 (if arg arg 1)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
270 t))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
271
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
272 (defun cal-tex-year (year n &optional landscape)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
273 "Make a one page yearly calendar of YEAR; do this for N years.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
274 There are four rows of three months each, unless optional LANDSCAPE is t,
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
275 in which case the calendar isprinted in landscape mode with three rows of
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
276 four months each."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
277 (cal-tex-insert-preamble 1 landscape "12pt")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
278 (if landscape
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
279 (cal-tex-vspace "-.6cm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
280 (cal-tex-vspace "-3.1cm"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
281 (calendar-for-loop j from 1 to n do
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
282 (insert "\\vfill%\n")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
283 (cal-tex-b-center)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
284 (cal-tex-Huge (number-to-string year))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
285 (cal-tex-e-center)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
286 (cal-tex-vspace "1cm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
287 (cal-tex-b-center)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
288 (cal-tex-b-parbox "l" (if landscape "5.9in" "4.3in"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
289 (insert "\n")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
290 (cal-tex-noindent)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
291 (cal-tex-nl)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
292 (calendar-for-loop i from 1 to 12 do
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
293 (insert (cal-tex-mini-calendar i year "month" "1.1in" "1in"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
294 (insert "\\month")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
295 (cal-tex-hspace "0.5in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
296 (if (zerop (mod i (if landscape 4 3)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
297 (cal-tex-nl "0.5in")))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
298 (cal-tex-e-parbox)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
299 (cal-tex-e-center)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
300 (insert "\\vfill%\n")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
301 (setq year (1+ year))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
302 (if (/= j n)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
303 (cal-tex-newpage)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
304 (cal-tex-end-document))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
305 (run-hooks 'cal-tex-year-hook))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
306 (run-hooks 'cal-tex-hook))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
307
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
308 (defun cal-tex-cursor-filofax-year (&optional arg)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
309 "Make a Filofax one page yearly calendar of year indicated by cursor.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
310 Optional parameter specifies number of years."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
311 (interactive "P")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
312 (let* ((n (if arg arg 1))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
313 (year (extract-calendar-year (calendar-cursor-to-date t))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
314 (cal-tex-preamble "twoside")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
315 (cal-tex-cmd "\\textwidth 3.25in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
316 (cal-tex-cmd "\\textheight 6.5in")
15433
172725d0d2d5 A bit more fiddling with layout of Filofax year page.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 15432
diff changeset
317 (cal-tex-cmd "\\oddsidemargin 1.675in")
172725d0d2d5 A bit more fiddling with layout of Filofax year page.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 15432
diff changeset
318 (cal-tex-cmd "\\evensidemargin 1.675in")
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
319 (cal-tex-cmd "\\topmargin 0pt")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
320 (cal-tex-cmd "\\headheight -0.875in")
15432
c76e8e8fdb0a Fix Filofax year output so that it's the correct size.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 14268
diff changeset
321 (cal-tex-cmd "\\fboxsep 0.5mm")
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
322 (cal-tex-cmd "\\pagestyle{empty}")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
323 (cal-tex-b-document)
15432
c76e8e8fdb0a Fix Filofax year output so that it's the correct size.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 14268
diff changeset
324 (cal-tex-cmd "\\vspace*{0.25in}")
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
325 (calendar-for-loop j from 1 to n do
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
326 (insert (format "\\hfil {\\Large \\bf %s} \\hfil\\\\\n" year))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
327 (cal-tex-b-center)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
328 (cal-tex-b-parbox "l" "\\textwidth")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
329 (insert "\n")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
330 (cal-tex-noindent)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
331 (cal-tex-nl)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
332 (calendar-for-loop i from 1 to 12 do
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
333 (insert (cal-tex-mini-calendar i year
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
334 (calendar-month-name i)
15432
c76e8e8fdb0a Fix Filofax year output so that it's the correct size.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 14268
diff changeset
335 "1in" ".9in" "tiny" "0.6mm")))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
336 (insert
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
337 "\\noindent\\fbox{\\January}\\fbox{\\February}\\fbox{\\March}\\\\
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
338 \\noindent\\fbox{\\April}\\fbox{\\May}\\fbox{\\June}\\\\
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
339 \\noindent\\fbox{\\July}\\fbox{\\August}\\fbox{\\September}\\\\
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
340 \\noindent\\fbox{\\October}\\fbox{\\November}\\fbox{\\December}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
341 ")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
342 (cal-tex-e-parbox)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
343 (cal-tex-e-center)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
344 (setq year (1+ year))
15433
172725d0d2d5 A bit more fiddling with layout of Filofax year page.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 15432
diff changeset
345 (if (= j n)
172725d0d2d5 A bit more fiddling with layout of Filofax year page.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 15432
diff changeset
346 (cal-tex-end-document)
172725d0d2d5 A bit more fiddling with layout of Filofax year page.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 15432
diff changeset
347 (cal-tex-newpage)
172725d0d2d5 A bit more fiddling with layout of Filofax year page.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 15432
diff changeset
348 (cal-tex-cmd "\\vspace*{0.25in}"))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
349 (run-hooks 'cal-tex-year-hook))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
350 (run-hooks 'cal-tex-hook)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
351
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
352 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
353 ;;; Monthly calendars
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
354 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
355
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
356 (defun cal-tex-cursor-month-landscape (&optional arg)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
357 "Make a buffer with LaTeX commands for the month cursor is on.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
358 Optional prefix argument specifies number of months to be produced.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
359 The output is in landscape format, one month to a page."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
360 (interactive "P")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
361 (let* ((n (if arg arg 1))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
362 (date (calendar-cursor-to-date t))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
363 (month (extract-calendar-month date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
364 (year (extract-calendar-year date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
365 (end-month month)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
366 (end-year year)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
367 (cal-tex-which-days '(0 1 2 3 4 5 6)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
368 (increment-calendar-month end-month end-year (1- n))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
369 (let ((diary-list (if cal-tex-diary
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
370 (cal-tex-list-diary-entries
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
371 (calendar-absolute-from-gregorian
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
372 (list month 1 year))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
373 (calendar-absolute-from-gregorian
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
374 (list end-month
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
375 (calendar-last-day-of-month
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
376 end-month end-year)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
377 end-year)))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
378 (holidays (if cal-tex-holidays
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
379 (cal-tex-list-holidays
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
380 (calendar-absolute-from-gregorian
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
381 (list month 1 year))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
382 (calendar-absolute-from-gregorian
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
383 (list end-month
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
384 (calendar-last-day-of-month end-month end-year)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
385 end-year)))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
386 (other-month)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
387 (other-year)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
388 (small-months-at-start))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
389 (cal-tex-insert-preamble (cal-tex-number-weeks month year 1) t "12pt")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
390 (cal-tex-cmd cal-tex-cal-one-month)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
391 (calendar-for-loop i from 1 to n do
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
392 (setq other-month month)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
393 (setq other-year year)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
394 (increment-calendar-month other-month other-year -1)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
395 (insert (cal-tex-mini-calendar other-month other-year "lastmonth"
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
396 "\\cellwidth" "\\cellheight"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
397 (increment-calendar-month other-month other-year 2)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
398 (insert (cal-tex-mini-calendar other-month other-year "nextmonth"
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
399 "\\cellwidth" "\\cellheight"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
400 (cal-tex-insert-month-header 1 month year month year)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
401 (cal-tex-insert-day-names)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
402 (cal-tex-nl ".2cm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
403 (setq small-months-at-start
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
404 (< 1 (mod (- (calendar-day-of-week (list month 1 year))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
405 calendar-week-start-day)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
406 7)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
407 (if small-months-at-start
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
408 (insert "\\lastmonth\\nextmonth\\hspace*{-2\\cellwidth}"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
409 (cal-tex-insert-blank-days month year cal-tex-day-prefix)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
410 (cal-tex-insert-days month year diary-list holidays
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
411 cal-tex-day-prefix)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
412 (cal-tex-insert-blank-days-at-end month year cal-tex-day-prefix)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
413 (if (and (not small-months-at-start)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
414 (< 1 (mod (- (1- calendar-week-start-day)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
415 (calendar-day-of-week
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
416 (list month
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
417 (calendar-last-day-of-month month year)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
418 year)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
419 7)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
420 (insert "\\vspace*{-\\cellwidth}\\hspace*{-2\\cellwidth}"
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
421 "\\lastmonth\\nextmonth"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
422 (if (/= i n)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
423 (progn
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
424 (run-hooks 'cal-tex-month-hook)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
425 (cal-tex-newpage)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
426 (increment-calendar-month month year 1)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
427 (cal-tex-vspace "-2cm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
428 (cal-tex-insert-preamble
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
429 (cal-tex-number-weeks month year 1) t "12pt" t))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
430 (cal-tex-end-document)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
431 (run-hooks 'cal-tex-hook))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
432
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
433 (defun cal-tex-cursor-month (arg)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
434 "Make a buffer with LaTeX commands for the month cursor is on.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
435 Optional prefix argument specifies number of months to be produced.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
436 Calendar is condensed onto one page."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
437 (interactive "P")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
438 (let* ((date (calendar-cursor-to-date t))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
439 (month (extract-calendar-month date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
440 (year (extract-calendar-year date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
441 (end-month month)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
442 (end-year year)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
443 (n (if arg arg 1)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
444 (increment-calendar-month end-month end-year (1- n))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
445 (let ((diary-list (if cal-tex-diary
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
446 (cal-tex-list-diary-entries
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
447 (calendar-absolute-from-gregorian
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
448 (list month 1 year))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
449 (calendar-absolute-from-gregorian
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
450 (list end-month
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
451 (calendar-last-day-of-month
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
452 end-month end-year)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
453 end-year)))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
454 (holidays (if cal-tex-holidays
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
455 (cal-tex-list-holidays
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
456 (calendar-absolute-from-gregorian
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
457 (list month 1 year))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
458 (calendar-absolute-from-gregorian
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
459 (list end-month
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
460 (calendar-last-day-of-month end-month end-year)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
461 end-year)))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
462 (other-month)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
463 (other-year))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
464 (cal-tex-insert-preamble (cal-tex-number-weeks month year n) nil"12pt")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
465 (if (> n 1)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
466 (cal-tex-cmd cal-tex-cal-multi-month)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
467 (cal-tex-cmd cal-tex-cal-one-month))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
468 (cal-tex-insert-month-header n month year end-month end-year)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
469 (cal-tex-insert-day-names)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
470 (cal-tex-nl ".2cm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
471 (cal-tex-insert-blank-days month year cal-tex-day-prefix)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
472 (calendar-for-loop i from 1 to n do
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
473 (setq other-month month)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
474 (setq other-year year)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
475 (cal-tex-insert-days month year diary-list holidays
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
476 cal-tex-day-prefix)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
477 (increment-calendar-month month year 1))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
478 (cal-tex-insert-blank-days-at-end end-month end-year cal-tex-day-prefix)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
479 (cal-tex-end-document)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
480 (run-hooks 'cal-tex-hook))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
481
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
482 (defun cal-tex-insert-days (month year diary-list holidays day-format)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
483 "Insert LaTeX commands for a range of days in monthly calendars.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
484 LaTeX commands are inserted for the days of the MONTH in YEAR.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
485 Diary entries on DIARY-LIST are included. Holidays on HOLIDAYS are included.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
486 Each day is formatted using format DAY-FORMAT."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
487 (let* ((blank-days;; at start of month
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
488 (mod
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
489 (- (calendar-day-of-week (list month 1 year))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
490 calendar-week-start-day)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
491 7))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
492 (date)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
493 (last (calendar-last-day-of-month month year)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
494 (calendar-for-loop i from 1 to last do
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
495 (setq date (list month i year))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
496 (if (memq (calendar-day-of-week date) cal-tex-which-days)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
497 (progn
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
498 (insert (format day-format (calendar-month-name month) i))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
499 (cal-tex-arg (cal-tex-latexify-list diary-list date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
500 (cal-tex-arg (cal-tex-latexify-list holidays date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
501 (cal-tex-arg (eval cal-tex-daily-string))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
502 (cal-tex-arg)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
503 (cal-tex-comment)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
504 (if (and (zerop (mod (+ i blank-days) 7))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
505 (/= i last))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
506 (progn
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
507 (cal-tex-hfill)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
508 (cal-tex-nl))))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
509
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
510 (defun cal-tex-insert-day-names ()
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
511 "Insert the names of the days at top of a monthly calendar."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
512 (calendar-for-loop i from 0 to 6 do
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
513 (if (memq i cal-tex-which-days)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
514 (insert (format cal-tex-day-name-format
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
515 (aref calendar-day-name-array
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
516 (mod (+ calendar-week-start-day i) 7)))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
517 (cal-tex-comment)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
518
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
519 (defun cal-tex-insert-month-header (n month year end-month end-year)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
520 "Create a title for a calendar.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
521 A title is inserted for a calendar with N months starting with
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
522 MONTH YEAR and ending with END-MONTH END-YEAR."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
523 (let ( (month-name (calendar-month-name month))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
524 (end-month-name (calendar-month-name end-month)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
525 (if (= 1 n)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
526 (insert (format "\\calmonth{%s}{%s}\n\\vspace*{-0.5cm}"
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
527 month-name year) )
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
528 (insert (format "\\calmonth{%s}{%s}{%s}{%s}\n\\vspace*{-0.5cm}"
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
529 month-name year end-month-name end-year))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
530 (cal-tex-comment))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
531
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
532 (defun cal-tex-insert-blank-days (month year day-format)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
533 "Insert code for initial days not in calendar.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
534 Insert LaTeX code for the blank days at the beginning of the MONTH in
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
535 YEAR. The entry is formatted using DAY-FORMAT. If the entire week is
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
536 blank, no days are inserted."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
537 (if (cal-tex-first-blank-p month year)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
538 (let* ((blank-days;; at start of month
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
539 (mod
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
540 (- (calendar-day-of-week (list month 1 year))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
541 calendar-week-start-day)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
542 7)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
543 (calendar-for-loop i from 0 to (1- blank-days) do
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
544 (if (memq i cal-tex-which-days)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
545 (insert (format day-format " " " ") "{}{}{}{}%\n"))))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
546
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
547 (defun cal-tex-insert-blank-days-at-end (month year day-format)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
548 "Insert code for final days not in calendar.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
549 Insert LaTeX code for the blank days at the end of the MONTH in YEAR.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
550 The entry is formatted using DAY-FORMAT."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
551 (if (cal-tex-last-blank-p month year)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
552 (let* ((last-day (calendar-last-day-of-month month year))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
553 (blank-days;; at end of month
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
554 (mod
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
555 (- (calendar-day-of-week (list month last-day year))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
556 calendar-week-start-day)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
557 7)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
558 (calendar-for-loop i from (1+ blank-days) to 6 do
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
559 (if (memq i cal-tex-which-days)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
560 (insert (format day-format "" "") "{}{}{}{}%\n"))))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
561
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
562 (defun cal-tex-first-blank-p (month year)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
563 "Determine if any days of the first week will be printed.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
564 Return t if there will there be any days of the first week printed
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
565 in the calendar starting in MONTH YEAR."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
566 (let ((any-days nil)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
567 (the-saturday)) ;the day of week of 1st Saturday
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
568 (calendar-for-loop i from 1 to 7 do
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
569 (if (= 6 (calendar-day-of-week (list month i year)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
570 (setq the-saturday i)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
571 (calendar-for-loop i from 1 to the-saturday do
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
572 (if (memq (calendar-day-of-week (list month i year))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
573 cal-tex-which-days)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
574 (setq any-days t)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
575 any-days))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
576
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
577 (defun cal-tex-last-blank-p (month year)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
578 "Determine if any days of the last week will be printed.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
579 Return t if there will there be any days of the last week printed
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
580 in the calendar starting in MONTH YEAR."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
581 (let ((any-days nil)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
582 (last-day (calendar-last-day-of-month month year))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
583 (the-sunday)) ;the day of week of last Sunday
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
584 (calendar-for-loop i from (- last-day 6) to last-day do
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
585 (if (= 0 (calendar-day-of-week (list month i year)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
586 (setq the-sunday i)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
587 (calendar-for-loop i from the-sunday to last-day do
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
588 (if (memq (calendar-day-of-week (list month i year))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
589 cal-tex-which-days)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
590 (setq any-days t)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
591 any-days))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
592
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
593 (defun cal-tex-number-weeks (month year n)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
594 "Determine the number of weeks in a range of dates.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
595 Compute the number of weeks in the calendar starting with MONTH and YEAR,
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
596 and lasting N months, including only the days in WHICH-DAYS. As it stands,
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
597 this is only an upper bound."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
598 (let ((d (list month 1 year)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
599 (increment-calendar-month month year (1- n))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
600 (/ (- (calendar-dayname-on-or-before
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
601 calendar-week-start-day
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
602 (+ 7 (calendar-absolute-from-gregorian
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
603 (list month (calendar-last-day-of-month month year) year))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
604 (calendar-dayname-on-or-before
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
605 calendar-week-start-day
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
606 (calendar-absolute-from-gregorian d)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
607 7)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
608
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
609 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
610 ;;; Weekly calendars
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
611 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
612
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
613 (defun cal-tex-cursor-week (&optional arg)
13595
2af9ec0bc9cc (cal-tex-version): Deleted.
Richard M. Stallman <rms@gnu.org>
parents: 13206
diff changeset
614 "Make a buffer with LaTeX commands for a two-page one-week calendar.
2af9ec0bc9cc (cal-tex-version): Deleted.
Richard M. Stallman <rms@gnu.org>
parents: 13206
diff changeset
615 It applies to the week that point is in.
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
616 Optional prefix argument specifies number of weeks.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
617 Holidays are included if `cal-tex-holidays' is t."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
618 (interactive "P")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
619 (let* ((n (if arg arg 1))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
620 (date (calendar-gregorian-from-absolute
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
621 (calendar-dayname-on-or-before
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
622 calendar-week-start-day
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
623 (calendar-absolute-from-gregorian
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
624 (calendar-cursor-to-date t)))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
625 (month (extract-calendar-month date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
626 (year (extract-calendar-year date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
627 (holidays (if cal-tex-holidays
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
628 (cal-tex-list-holidays
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
629 (calendar-absolute-from-gregorian date)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
630 (+ (* 7 n)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
631 (calendar-absolute-from-gregorian date))))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
632 (cal-tex-preamble "11pt")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
633 (cal-tex-cmd "\\textwidth 6.5in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
634 (cal-tex-cmd "\\textheight 10.5in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
635 (cal-tex-cmd "\\oddsidemargin 0in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
636 (cal-tex-cmd "\\evensidemargin 0in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
637 (insert cal-tex-LaTeX-hourbox)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
638 (cal-tex-b-document)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
639 (cal-tex-cmd "\\pagestyle{empty}")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
640 (calendar-for-loop i from 1 to n do
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
641 (cal-tex-vspace "-1.5in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
642 (cal-tex-b-center)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
643 (cal-tex-Huge-bf (format "\\uppercase{%s}"
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
644 (calendar-month-name month)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
645 (cal-tex-hspace "2em")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
646 (cal-tex-Huge-bf (number-to-string year))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
647 (cal-tex-nl ".5cm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
648 (cal-tex-e-center)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
649 (cal-tex-hspace "-.2in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
650 (cal-tex-b-parbox "l" "7in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
651 (calendar-for-loop j from 1 to 7 do
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
652 (cal-tex-week-hours date holidays "3.1")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
653 (setq date (cal-tex-incr-date date)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
654 (cal-tex-e-parbox)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
655 (setq month (extract-calendar-month date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
656 (setq year (extract-calendar-year date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
657 (if (/= i n)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
658 (progn
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
659 (run-hooks 'cal-tex-week-hook)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
660 (cal-tex-newpage))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
661 (cal-tex-end-document)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
662 (run-hooks 'cal-tex-hook)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
663
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
664 (defun cal-tex-cursor-week2 (&optional arg)
13595
2af9ec0bc9cc (cal-tex-version): Deleted.
Richard M. Stallman <rms@gnu.org>
parents: 13206
diff changeset
665 "Make a buffer with LaTeX commands for a two-page one-week calendar.
2af9ec0bc9cc (cal-tex-version): Deleted.
Richard M. Stallman <rms@gnu.org>
parents: 13206
diff changeset
666 It applies to the week that point is in.
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
667 Optional prefix argument specifies number of weeks.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
668 Holidays are included if `cal-tex-holidays' is t."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
669 (interactive "P")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
670 (let* ((n (if arg arg 1))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
671 (date (calendar-gregorian-from-absolute
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
672 (calendar-dayname-on-or-before
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
673 calendar-week-start-day
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
674 (calendar-absolute-from-gregorian
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
675 (calendar-cursor-to-date t)))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
676 (month (extract-calendar-month date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
677 (year (extract-calendar-year date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
678 (d date)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
679 (holidays (if cal-tex-holidays
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
680 (cal-tex-list-holidays
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
681 (calendar-absolute-from-gregorian date)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
682 (+ (* 7 n)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
683 (calendar-absolute-from-gregorian date))))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
684 (cal-tex-preamble "12pt")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
685 (cal-tex-cmd "\\textwidth 6.5in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
686 (cal-tex-cmd "\\textheight 10.5in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
687 (cal-tex-cmd "\\oddsidemargin 0in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
688 (cal-tex-cmd "\\evensidemargin 0in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
689 (insert cal-tex-LaTeX-hourbox)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
690 (cal-tex-b-document)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
691 (cal-tex-cmd "\\pagestyle{empty}")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
692 (calendar-for-loop i from 1 to n do
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
693 (cal-tex-vspace "-1.5in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
694 (cal-tex-b-center)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
695 (cal-tex-Huge-bf (format "\\uppercase{%s}"
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
696 (calendar-month-name month)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
697 (cal-tex-hspace "2em")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
698 (cal-tex-Huge-bf (number-to-string year))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
699 (cal-tex-nl ".5cm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
700 (cal-tex-e-center)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
701 (cal-tex-hspace "-.2in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
702 (cal-tex-b-parbox "l" "\\textwidth")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
703 (calendar-for-loop j from 1 to 3 do
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
704 (cal-tex-week-hours date holidays "5")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
705 (setq date (cal-tex-incr-date date)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
706 (cal-tex-e-parbox)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
707 (cal-tex-nl)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
708 (insert (cal-tex-mini-calendar
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
709 (extract-calendar-month (cal-tex-previous-month date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
710 (extract-calendar-year (cal-tex-previous-month date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
711 "lastmonth" "1.1in" "1in"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
712 (insert (cal-tex-mini-calendar
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
713 (extract-calendar-month date)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
714 (extract-calendar-year date)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
715 "thismonth" "1.1in" "1in"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
716 (insert (cal-tex-mini-calendar
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
717 (extract-calendar-month (cal-tex-next-month date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
718 (extract-calendar-year (cal-tex-next-month date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
719 "nextmonth" "1.1in" "1in"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
720 (insert "\\hbox to \\textwidth{")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
721 (cal-tex-hfill)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
722 (insert "\\lastmonth")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
723 (cal-tex-hfill)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
724 (insert "\\thismonth")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
725 (cal-tex-hfill)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
726 (insert "\\nextmonth")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
727 (cal-tex-hfill)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
728 (insert "}")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
729 (cal-tex-nl)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
730 (cal-tex-b-parbox "l" "\\textwidth")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
731 (calendar-for-loop j from 4 to 7 do
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
732 (cal-tex-week-hours date holidays "5")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
733 (setq date (cal-tex-incr-date date)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
734 (cal-tex-e-parbox)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
735 (setq month (extract-calendar-month date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
736 (setq year (extract-calendar-year date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
737 (if (/= i n)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
738 (progn
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
739 (run-hooks 'cal-tex-week-hook)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
740 (cal-tex-newpage))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
741 (cal-tex-end-document)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
742 (run-hooks 'cal-tex-hook)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
743
13595
2af9ec0bc9cc (cal-tex-version): Deleted.
Richard M. Stallman <rms@gnu.org>
parents: 13206
diff changeset
744 (defun cal-tex-cursor-week-iso (&optional arg)
2af9ec0bc9cc (cal-tex-version): Deleted.
Richard M. Stallman <rms@gnu.org>
parents: 13206
diff changeset
745 "Make a buffer with LaTeX commands for a one page ISO-style weekly calendar.
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
746 Optional prefix argument specifies number of weeks.
13595
2af9ec0bc9cc (cal-tex-version): Deleted.
Richard M. Stallman <rms@gnu.org>
parents: 13206
diff changeset
747 Diary entries are included if `cal-tex-diary' is t.
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
748 Holidays are included if `cal-tex-holidays' is t."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
749 (interactive "P")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
750 (let* ((n (if arg arg 1))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
751 (date (calendar-gregorian-from-absolute
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
752 (calendar-dayname-on-or-before
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
753 1
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
754 (calendar-absolute-from-gregorian
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
755 (calendar-cursor-to-date t)))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
756 (month (extract-calendar-month date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
757 (year (extract-calendar-year date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
758 (day (extract-calendar-day date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
759 (holidays (if cal-tex-holidays
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
760 (cal-tex-list-holidays
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
761 (calendar-absolute-from-gregorian date)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
762 (+ (* 7 n)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
763 (calendar-absolute-from-gregorian date)))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
764 (diary-list (if cal-tex-diary
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
765 (cal-tex-list-diary-entries
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
766 (calendar-absolute-from-gregorian
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
767 (list month 1 year))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
768 (+ (* 7 n)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
769 (calendar-absolute-from-gregorian date))))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
770 (cal-tex-preamble "11pt")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
771 (cal-tex-cmd "\\textwidth 6.5in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
772 (cal-tex-cmd "\\textheight 10.5in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
773 (cal-tex-cmd "\\oddsidemargin 0in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
774 (cal-tex-cmd "\\evensidemargin 0in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
775 (cal-tex-b-document)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
776 (cal-tex-cmd "\\pagestyle{empty}")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
777 (calendar-for-loop i from 1 to n do
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
778 (cal-tex-vspace "-1.5in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
779 (cal-tex-b-center)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
780 (cal-tex-Huge-bf
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
781 (let* ((d (calendar-iso-from-absolute
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
782 (calendar-absolute-from-gregorian date))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
783 (format "Week %d of %d"
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
784 (extract-calendar-month d)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
785 (extract-calendar-year d))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
786 (cal-tex-nl ".5cm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
787 (cal-tex-e-center)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
788 (cal-tex-b-parbox "l" "\\textwidth")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
789 (calendar-for-loop j from 1 to 7 do
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
790 (cal-tex-b-parbox "t" "\\textwidth")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
791 (cal-tex-b-parbox "t" "\\textwidth")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
792 (cal-tex-rule "0pt" "\\textwidth" ".2mm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
793 (cal-tex-nl)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
794 (cal-tex-b-parbox "t" "\\textwidth")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
795 (cal-tex-large-bf (calendar-day-name date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
796 (insert ", ")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
797 (cal-tex-large-bf (calendar-month-name month))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
798 (insert " ")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
799 (cal-tex-large-bf (number-to-string day))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
800 (if (not (string= "" (cal-tex-latexify-list holidays date)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
801 (progn
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
802 (insert ": ")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
803 (cal-tex-large-bf (cal-tex-latexify-list holidays date "; "))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
804 (cal-tex-hfill)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
805 (insert " " (eval cal-tex-daily-string))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
806 (cal-tex-e-parbox)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
807 (cal-tex-nl)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
808 (cal-tex-noindent)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
809 (cal-tex-b-parbox "t" "\\textwidth")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
810 (if (not (string= "" (cal-tex-latexify-list diary-list date)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
811 (progn
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
812 (insert "\\vbox to 0pt{")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
813 (cal-tex-large-bf
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
814 (cal-tex-latexify-list diary-list date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
815 (insert "}")))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
816 (cal-tex-e-parbox)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
817 (cal-tex-nl)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
818 (setq date (cal-tex-incr-date date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
819 (setq month (extract-calendar-month date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
820 (setq day (extract-calendar-day date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
821 (cal-tex-e-parbox)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
822 (cal-tex-e-parbox "2cm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
823 (cal-tex-nl)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
824 (setq month (extract-calendar-month date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
825 (setq year (extract-calendar-year date)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
826 (cal-tex-e-parbox)%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
827 (if (/= i n)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
828 (progn
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
829 (run-hooks 'cal-tex-week-hook)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
830 (cal-tex-newpage))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
831 (cal-tex-end-document)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
832 (run-hooks 'cal-tex-hook)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
833
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
834 (defvar cal-tex-LaTeX-hourbox
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
835 "\\newcommand{\\hourbox}[2]%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
836 {\\makebox[2em]{\\rule{0cm}{#2ex}#1}\\rule{3in}{.15mm}}\n"
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
837 "One hour and a line on the right.")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
838
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
839 (defun cal-tex-week-hours (date holidays height)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
840 "Insert hourly entries for DATE with HOLIDAYS, with line height HEIGHT."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
841 (let ((month (extract-calendar-month date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
842 (day (extract-calendar-day date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
843 (year (extract-calendar-year date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
844 (afternoon))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
845 (cal-tex-comment "begin cal-tex-week-hours")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
846 (cal-tex-cmd "\\ \\\\[-.2cm]")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
847 (cal-tex-cmd "\\noindent")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
848 (cal-tex-b-parbox "l" "6.8in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
849 (cal-tex-large-bf (calendar-day-name date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
850 (insert ", ")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
851 (cal-tex-large-bf (calendar-month-name month))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
852 (insert " ")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
853 (cal-tex-large-bf (number-to-string day))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
854 (if (not (string= "" (cal-tex-latexify-list holidays date)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
855 (progn
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
856 (insert ": ")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
857 (cal-tex-large-bf (cal-tex-latexify-list holidays date "; "))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
858 (cal-tex-hfill)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
859 (insert " " (eval cal-tex-daily-string))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
860 (cal-tex-e-parbox)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
861 (cal-tex-nl "-.3cm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
862 (cal-tex-rule "0pt" "6.8in" ".2mm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
863 (cal-tex-nl "-.1cm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
864 (calendar-for-loop i from 8 to 12 do
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
865 (if cal-tex-24
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
866 (setq afternoon (+ i 5))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
867 (setq afternoon (- i 7)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
868 (cal-tex-cmd "\\hourbox" (number-to-string i))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
869 (cal-tex-arg height)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
870 (cal-tex-hspace ".4cm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
871 (cal-tex-cmd "\\hourbox" (number-to-string afternoon))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
872 (cal-tex-arg height)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
873 (cal-tex-nl))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
874
13595
2af9ec0bc9cc (cal-tex-version): Deleted.
Richard M. Stallman <rms@gnu.org>
parents: 13206
diff changeset
875 (defun cal-tex-cursor-week-monday (&optional arg)
2af9ec0bc9cc (cal-tex-version): Deleted.
Richard M. Stallman <rms@gnu.org>
parents: 13206
diff changeset
876 "Make a buffer with LaTeX commands for a two-page one-week calendar.
2af9ec0bc9cc (cal-tex-version): Deleted.
Richard M. Stallman <rms@gnu.org>
parents: 13206
diff changeset
877 It applies to the week that point is in, and starts on Monday.
2af9ec0bc9cc (cal-tex-version): Deleted.
Richard M. Stallman <rms@gnu.org>
parents: 13206
diff changeset
878 Optional prefix argument specifies number of weeks.
2af9ec0bc9cc (cal-tex-version): Deleted.
Richard M. Stallman <rms@gnu.org>
parents: 13206
diff changeset
879 Holidays are included if `cal-tex-holidays' is t."
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
880 (interactive "P")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
881 (let* ((n (if arg arg 1))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
882 (date (calendar-gregorian-from-absolute
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
883 (calendar-dayname-on-or-before
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
884 0
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
885 (calendar-absolute-from-gregorian
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
886 (calendar-cursor-to-date t))))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
887 (cal-tex-preamble "11pt")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
888 (cal-tex-cmd "\\textwidth 6.5in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
889 (cal-tex-cmd "\\textheight 10.5in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
890 (cal-tex-cmd "\\oddsidemargin 0in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
891 (cal-tex-cmd "\\evensidemargin 0in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
892 (cal-tex-b-document)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
893 (calendar-for-loop i from 1 to n do
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
894 (cal-tex-vspace "-1cm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
895 (insert "\\noindent ")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
896 (cal-tex-weekly4-box (cal-tex-incr-date date) nil)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
897 (cal-tex-weekly4-box (cal-tex-incr-date date 4) nil)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
898 (cal-tex-nl ".2cm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
899 (cal-tex-weekly4-box (cal-tex-incr-date date 2) nil)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
900 (cal-tex-weekly4-box (cal-tex-incr-date date 5) nil)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
901 (cal-tex-nl ".2cm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
902 (cal-tex-weekly4-box (cal-tex-incr-date date 3) nil)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
903 (cal-tex-weekly4-box (cal-tex-incr-date date 6) t)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
904 (if (/= i n)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
905 (progn
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
906 (run-hooks 'cal-tex-week-hook)
13206
2d1da471963a Minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13195
diff changeset
907 (setq date (cal-tex-incr-date date 7))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
908 (cal-tex-newpage))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
909 (cal-tex-end-document)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
910 (run-hooks 'cal-tex-hook)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
911
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
912 (defun cal-tex-weekly4-box (date weekend)
13206
2d1da471963a Minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13195
diff changeset
913 "Make one box for DATE, different if WEEKEND."
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
914 (let* (
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
915 (day (extract-calendar-day date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
916 (month (extract-calendar-month date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
917 (year (extract-calendar-year date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
918 (dayname (calendar-day-name date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
919 (date1 (cal-tex-incr-date date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
920 (day1 (extract-calendar-day date1))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
921 (month1 (extract-calendar-month date1))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
922 (year1 (extract-calendar-year date1))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
923 (dayname1 (calendar-day-name date1))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
924 )
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
925 (cal-tex-b-framebox "8cm" "l")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
926 (cal-tex-b-parbox "b" "7.5cm")
13206
2d1da471963a Minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13195
diff changeset
927 (insert (format "{\\Large\\bf %s,} %s/%s/%s\\\\\n" dayname month day year))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
928 (cal-tex-rule "0pt" "7.5cm" ".5mm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
929 (cal-tex-nl)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
930 (if (not weekend)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
931 (progn
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
932 (calendar-for-loop i from 8 to 12 do
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
933 (insert (format "{\\large\\sf %d}\\\\\n" i)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
934 (calendar-for-loop i from 1 to 5 do
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
935 (insert (format "{\\large\\sf %d}\\\\\n" i)))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
936 (cal-tex-nl ".5cm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
937 (if weekend
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
938 (progn
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
939 (cal-tex-vspace "1cm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
940 (insert "\\ \\vfill")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
941 (insert (format "{\\Large\\bf %s,} %s/%s/%s\\\\\n"
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
942 dayname1 month1 day1 year1))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
943 (cal-tex-rule "0pt" "7.5cm" ".5mm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
944 (cal-tex-nl "1.5cm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
945 (cal-tex-vspace "1cm")))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
946 (cal-tex-e-parbox)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
947 (cal-tex-e-framebox)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
948 (cal-tex-hspace "1cm")))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
949
13595
2af9ec0bc9cc (cal-tex-version): Deleted.
Richard M. Stallman <rms@gnu.org>
parents: 13206
diff changeset
950 (defun cal-tex-cursor-filofax-2week (&optional arg)
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
951 "Two-weeks-at-a-glance Filofax style calendar for week indicated by cursor.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
952 Optional prefix argument specifies number of weeks.
13595
2af9ec0bc9cc (cal-tex-version): Deleted.
Richard M. Stallman <rms@gnu.org>
parents: 13206
diff changeset
953 Diary entries are included if `cal-tex-diary' is t.
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
954 Holidays are included if `cal-tex-holidays' is t."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
955 (interactive "P")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
956 (let* ((n (if arg arg 1))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
957 (date (calendar-gregorian-from-absolute
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
958 (calendar-dayname-on-or-before
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
959 calendar-week-start-day
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
960 (calendar-absolute-from-gregorian
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
961 (calendar-cursor-to-date t)))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
962 (month (extract-calendar-month date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
963 (year (extract-calendar-year date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
964 (day (extract-calendar-day date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
965 (holidays (if cal-tex-holidays
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
966 (cal-tex-list-holidays
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
967 (calendar-absolute-from-gregorian date)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
968 (+ (* 7 n)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
969 (calendar-absolute-from-gregorian date)))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
970 (diary-list (if cal-tex-diary
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
971 (cal-tex-list-diary-entries
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
972 (calendar-absolute-from-gregorian
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
973 (list month 1 year))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
974 (+ (* 7 n)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
975 (calendar-absolute-from-gregorian date))))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
976 (cal-tex-preamble "twoside")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
977 (cal-tex-cmd "\\textwidth 3.25in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
978 (cal-tex-cmd "\\textheight 6.5in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
979 (cal-tex-cmd "\\oddsidemargin 1.75in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
980 (cal-tex-cmd "\\evensidemargin 1.5in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
981 (cal-tex-cmd "\\topmargin 0pt")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
982 (cal-tex-cmd "\\headheight -0.875in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
983 (cal-tex-cmd "\\headsep 0.125in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
984 (cal-tex-cmd "\\footskip .125in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
985 (insert "\\def\\righthead#1{\\hfill {\\normalsize \\bf #1}\\\\[-6pt]}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
986 \\long\\def\\rightday#1#2#3#4#5{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
987 \\rule{\\textwidth}{0.3pt}\\\\%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
988 \\hbox to \\textwidth{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
989 \\vbox to 0.7in{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
990 \\vspace*{2pt}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
991 \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
992 \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em #4}}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
993 \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
994 \\def\\lefthead#1{\\noindent {\\normalsize \\bf #1}\\hfill\\\\[-6pt]}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
995 \\long\\def\\leftday#1#2#3#4#5{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
996 \\rule{\\textwidth}{0.3pt}\\\\%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
997 \\hbox to \\textwidth{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
998 \\vbox to 0.7in{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
999 \\vspace*{2pt}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1000 \\hbox to \\textwidth{\\noindent {\\normalsize \\bf #2} \\small #1 \\hfill #5}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1001 \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize \\em #4}}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1002 \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1003 ")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1004 (cal-tex-b-document)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1005 (cal-tex-cmd "\\pagestyle{empty}")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1006 (calendar-for-loop i from 1 to n do
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1007 (if (= (mod i 2) 1)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1008 (insert "\\righthead")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1009 (insert "\\lefthead"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1010 (cal-tex-arg
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1011 (let ((d (cal-tex-incr-date date 6)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1012 (if (= (extract-calendar-month date)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1013 (extract-calendar-month d))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1014 (format "%s %s"
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1015 (calendar-month-name
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1016 (extract-calendar-month date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1017 (extract-calendar-year date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1018 (if (= (extract-calendar-year date)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1019 (extract-calendar-year d))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1020 (format "%s---%s %s"
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1021 (calendar-month-name
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1022 (extract-calendar-month date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1023 (calendar-month-name
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1024 (extract-calendar-month d))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1025 (extract-calendar-year date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1026 (format "%s %s---%s %s"
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1027 (calendar-month-name
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1028 (extract-calendar-month date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1029 (extract-calendar-year date)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1030 (calendar-month-name (extract-calendar-month d))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1031 (extract-calendar-year d))))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1032 (insert "%\n")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1033 (calendar-for-loop j from 1 to 7 do
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1034 (if (= (mod i 2) 1)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1035 (insert "\\rightday")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1036 (insert "\\leftday"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1037 (cal-tex-arg (calendar-day-name date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1038 (cal-tex-arg (int-to-string (extract-calendar-day date)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1039 (cal-tex-arg (cal-tex-latexify-list diary-list date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1040 (cal-tex-arg (cal-tex-latexify-list holidays date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1041 (cal-tex-arg (eval cal-tex-daily-string))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1042 (insert "%\n")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1043 (setq date (cal-tex-incr-date date)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1044 (if (/= i n)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1045 (progn
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1046 (run-hooks 'cal-tex-week-hook)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1047 (cal-tex-newpage))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1048 (cal-tex-end-document)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1049 (run-hooks 'cal-tex-hook)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1050
13595
2af9ec0bc9cc (cal-tex-version): Deleted.
Richard M. Stallman <rms@gnu.org>
parents: 13206
diff changeset
1051 (defun cal-tex-cursor-filofax-week (&optional arg)
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1052 "One-week-at-a-glance Filofax style calendar for week indicated by cursor.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1053 Optional prefix argument specifies number of weeks.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1054 Weeks start on Monday.
13595
2af9ec0bc9cc (cal-tex-version): Deleted.
Richard M. Stallman <rms@gnu.org>
parents: 13206
diff changeset
1055 Diary entries are included if `cal-tex-diary' is t.
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1056 Holidays are included if `cal-tex-holidays' is t."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1057 (interactive "P")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1058 (let* ((n (if arg arg 1))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1059 (date (calendar-gregorian-from-absolute
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1060 (calendar-dayname-on-or-before
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1061 1
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1062 (calendar-absolute-from-gregorian
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1063 (calendar-cursor-to-date t)))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1064 (month (extract-calendar-month date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1065 (year (extract-calendar-year date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1066 (day (extract-calendar-day date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1067 (holidays (if cal-tex-holidays
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1068 (cal-tex-list-holidays
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1069 (calendar-absolute-from-gregorian date)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1070 (+ (* 7 n)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1071 (calendar-absolute-from-gregorian date)))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1072 (diary-list (if cal-tex-diary
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1073 (cal-tex-list-diary-entries
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1074 (calendar-absolute-from-gregorian
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1075 (list month 1 year))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1076 (+ (* 7 n)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1077 (calendar-absolute-from-gregorian date))))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1078 (cal-tex-preamble "twoside")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1079 (cal-tex-cmd "\\textwidth 3.25in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1080 (cal-tex-cmd "\\textheight 6.5in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1081 (cal-tex-cmd "\\oddsidemargin 1.75in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1082 (cal-tex-cmd "\\evensidemargin 1.5in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1083 (cal-tex-cmd "\\topmargin 0pt")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1084 (cal-tex-cmd "\\headheight -0.875in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1085 (cal-tex-cmd "\\headsep 0.125in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1086 (cal-tex-cmd "\\footskip .125in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1087 (insert "\\def\\righthead#1{\\hfill {\\normalsize \\bf #1}\\\\[-6pt]}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1088 \\long\\def\\rightday#1#2#3#4#5{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1089 \\rule{\\textwidth}{0.3pt}\\\\%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1090 \\hbox to \\textwidth{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1091 \\vbox to 1.85in{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1092 \\vspace*{2pt}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1093 \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1094 \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em #4}}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1095 \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1096 \\long\\def\\weekend#1#2#3#4#5{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1097 \\rule{\\textwidth}{0.3pt}\\\\%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1098 \\hbox to \\textwidth{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1099 \\vbox to .8in{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1100 \\vspace*{2pt}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1101 \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1102 \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em #4}}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1103 \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1104 \\def\\lefthead#1{\\noindent {\\normalsize \\bf #1}\\hfill\\\\[-6pt]}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1105 \\long\\def\\leftday#1#2#3#4#5{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1106 \\rule{\\textwidth}{0.3pt}\\\\%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1107 \\hbox to \\textwidth{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1108 \\vbox to 1.85in{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1109 \\vspace*{2pt}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1110 \\hbox to \\textwidth{\\noindent {\\normalsize \\bf #2} \\small #1 \\hfill #5}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1111 \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize \\em #4}}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1112 \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1113 ")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1114 (cal-tex-b-document)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1115 (cal-tex-cmd "\\pagestyle{empty}\\ ")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1116 (cal-tex-newpage)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1117 (calendar-for-loop i from 1 to n do
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1118 (insert "\\lefthead")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1119 (cal-tex-arg
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1120 (let ((d (cal-tex-incr-date date 2)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1121 (if (= (extract-calendar-month date)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1122 (extract-calendar-month d))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1123 (format "%s %s"
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1124 (calendar-month-name
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1125 (extract-calendar-month date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1126 (extract-calendar-year date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1127 (if (= (extract-calendar-year date)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1128 (extract-calendar-year d))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1129 (format "%s---%s %s"
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1130 (calendar-month-name
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1131 (extract-calendar-month date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1132 (calendar-month-name
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1133 (extract-calendar-month d))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1134 (extract-calendar-year date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1135 (format "%s %s---%s %s"
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1136 (calendar-month-name
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1137 (extract-calendar-month date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1138 (extract-calendar-year date)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1139 (calendar-month-name (extract-calendar-month d))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1140 (extract-calendar-year d))))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1141 (insert "%\n")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1142 (calendar-for-loop j from 1 to 3 do
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1143 (insert "\\leftday")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1144 (cal-tex-arg (calendar-day-name date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1145 (cal-tex-arg (int-to-string (extract-calendar-day date)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1146 (cal-tex-arg (cal-tex-latexify-list diary-list date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1147 (cal-tex-arg (cal-tex-latexify-list holidays date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1148 (cal-tex-arg (eval cal-tex-daily-string))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1149 (insert "%\n")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1150 (setq date (cal-tex-incr-date date)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1151 (insert "\\noindent\\rule{\\textwidth}{0.3pt}\\\\%\n")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1152 (cal-tex-newpage)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1153 (insert "\\righthead")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1154 (cal-tex-arg
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1155 (let ((d (cal-tex-incr-date date 3)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1156 (if (= (extract-calendar-month date)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1157 (extract-calendar-month d))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1158 (format "%s %s"
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1159 (calendar-month-name
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1160 (extract-calendar-month date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1161 (extract-calendar-year date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1162 (if (= (extract-calendar-year date)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1163 (extract-calendar-year d))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1164 (format "%s---%s %s"
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1165 (calendar-month-name
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1166 (extract-calendar-month date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1167 (calendar-month-name
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1168 (extract-calendar-month d))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1169 (extract-calendar-year date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1170 (format "%s %s---%s %s"
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1171 (calendar-month-name
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1172 (extract-calendar-month date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1173 (extract-calendar-year date)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1174 (calendar-month-name (extract-calendar-month d))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1175 (extract-calendar-year d))))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1176 (insert "%\n")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1177 (calendar-for-loop j from 1 to 2 do
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1178 (insert "\\rightday")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1179 (cal-tex-arg (calendar-day-name date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1180 (cal-tex-arg (int-to-string (extract-calendar-day date)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1181 (cal-tex-arg (cal-tex-latexify-list diary-list date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1182 (cal-tex-arg (cal-tex-latexify-list holidays date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1183 (cal-tex-arg (eval cal-tex-daily-string))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1184 (insert "%\n")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1185 (setq date (cal-tex-incr-date date)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1186 (calendar-for-loop j from 1 to 2 do
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1187 (insert "\\weekend")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1188 (cal-tex-arg (calendar-day-name date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1189 (cal-tex-arg (int-to-string (extract-calendar-day date)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1190 (cal-tex-arg (cal-tex-latexify-list diary-list date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1191 (cal-tex-arg (cal-tex-latexify-list holidays date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1192 (cal-tex-arg (eval cal-tex-daily-string))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1193 (insert "%\n")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1194 (setq date (cal-tex-incr-date date)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1195 (if (/= i n)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1196 (progn
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1197 (run-hooks 'cal-tex-week-hook)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1198 (cal-tex-newpage))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1199 (cal-tex-end-document)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1200 (run-hooks 'cal-tex-hook)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1201 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1202 ;;; Daily calendars
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1203 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1204
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1205 (defun cal-tex-cursor-day (&optional arg)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1206 "Make a buffer with LaTeX commands for the day cursor is on.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1207 Optional prefix argument specifies number of days."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1208 (interactive "P")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1209 (let ((n (if arg arg 1))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1210 (date (calendar-absolute-from-gregorian (calendar-cursor-to-date t))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1211 (cal-tex-preamble "12pt")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1212 (cal-tex-cmd "\\textwidth 6.5in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1213 (cal-tex-cmd "\\textheight 10.5in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1214 (cal-tex-b-document)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1215 (cal-tex-cmd "\\pagestyle{empty}")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1216 (calendar-for-loop i from 1 to n do
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1217 (cal-tex-vspace "-1.7in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1218 (cal-tex-daily-page (calendar-gregorian-from-absolute date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1219 (setq date (1+ date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1220 (if (/= i n)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1221 (progn
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1222 (cal-tex-newpage)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1223 (run-hooks 'cal-tex-daily-hook))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1224 (cal-tex-end-document)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1225 (run-hooks 'cal-tex-hook)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1226
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1227 (defun cal-tex-daily-page (date)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1228 "Make a calendar page for Gregorian DATE on 8.5 by 11 paper."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1229 (let* ((hour)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1230 (month-name (calendar-month-name (extract-calendar-month date))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1231 (cal-tex-banner "cal-tex-daily-page")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1232 (cal-tex-b-makebox "4cm" "l")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1233 (cal-tex-b-parbox "b" "3.8cm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1234 (cal-tex-rule "0mm" "0mm" "2cm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1235 (cal-tex-Huge (number-to-string (extract-calendar-day date)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1236 (cal-tex-nl ".5cm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1237 (cal-tex-bf month-name )
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1238 (cal-tex-e-parbox)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1239 (cal-tex-hspace "1cm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1240 (cal-tex-scriptsize (eval cal-tex-daily-string))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1241 (cal-tex-hspace "3.5cm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1242 (cal-tex-e-makebox)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1243 (cal-tex-hfill)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1244 (cal-tex-b-makebox "4cm" "r")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1245 (cal-tex-bf (calendar-day-name date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1246 (cal-tex-e-makebox)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1247 (cal-tex-nl)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1248 (cal-tex-hspace ".4cm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1249 (cal-tex-rule "0mm" "16.1cm" "1mm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1250 (cal-tex-nl ".1cm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1251 (calendar-for-loop i from cal-tex-daily-start to cal-tex-daily-end do
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1252 (cal-tex-cmd "\\noindent")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1253 (setq hour (if cal-tex-24
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1254 i
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1255 (mod i 12)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1256 (if (= 0 hour) (setq hour 12))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1257 (cal-tex-b-makebox "1cm" "c")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1258 (cal-tex-arg (number-to-string hour))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1259 (cal-tex-e-makebox)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1260 (cal-tex-rule "0mm" "15.5cm" ".2mm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1261 (cal-tex-nl ".2cm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1262 (cal-tex-b-makebox "1cm" "c")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1263 (cal-tex-arg "$\\diamond$" )
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1264 (cal-tex-e-makebox)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1265 (cal-tex-rule "0mm" "15.5cm" ".2mm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1266 (cal-tex-nl ".2cm"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1267 (cal-tex-hfill)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1268 (insert (cal-tex-mini-calendar
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1269 (extract-calendar-month (cal-tex-previous-month date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1270 (extract-calendar-year (cal-tex-previous-month date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1271 "lastmonth" "1.1in" "1in"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1272 (insert (cal-tex-mini-calendar
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1273 (extract-calendar-month date)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1274 (extract-calendar-year date)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1275 "thismonth" "1.1in" "1in"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1276 (insert (cal-tex-mini-calendar
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1277 (extract-calendar-month (cal-tex-next-month date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1278 (extract-calendar-year (cal-tex-next-month date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1279 "nextmonth" "1.1in" "1in"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1280 (insert "\\hbox to \\textwidth{")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1281 (cal-tex-hfill)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1282 (insert "\\lastmonth")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1283 (cal-tex-hfill)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1284 (insert "\\thismonth")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1285 (cal-tex-hfill)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1286 (insert "\\nextmonth")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1287 (cal-tex-hfill)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1288 (insert "}")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1289 (cal-tex-banner "end of cal-tex-daily-page")))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1290
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1291 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1292 ;;; Mini calendars
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1293 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1294
15432
c76e8e8fdb0a Fix Filofax year output so that it's the correct size.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 14268
diff changeset
1295 (defun cal-tex-mini-calendar (month year name width height &optional ptsize colsep)
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1296 "Produce mini-calendar for MONTH, YEAR in macro NAME with WIDTH and HEIGHT.
15432
c76e8e8fdb0a Fix Filofax year output so that it's the correct size.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 14268
diff changeset
1297 Optional PTSIZE gives the point ptsize; scriptsize is the default. Optional
c76e8e8fdb0a Fix Filofax year output so that it's the correct size.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 14268
diff changeset
1298 COLSEP gives the column separation; 1mm is the default."
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1299 (let* ((blank-days;; at start of month
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1300 (mod
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1301 (- (calendar-day-of-week (list month 1 year))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1302 calendar-week-start-day)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1303 7))
15432
c76e8e8fdb0a Fix Filofax year output so that it's the correct size.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 14268
diff changeset
1304 (last (calendar-last-day-of-month month year))
c76e8e8fdb0a Fix Filofax year output so that it's the correct size.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 14268
diff changeset
1305 (colsep (if colsep colsep "1mm"))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1306 (str (concat "\\def\\" name "{\\hbox to" width "{%\n"
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1307 "\\vbox to" height "{%\n"
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1308 "\\vfil \\hbox to" width "{%\n"
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1309 "\\hfil\\"
15432
c76e8e8fdb0a Fix Filofax year output so that it's the correct size.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 14268
diff changeset
1310 (if ptsize ptsize "scriptsize")
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1311 "\\begin{tabular}"
15432
c76e8e8fdb0a Fix Filofax year output so that it's the correct size.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 14268
diff changeset
1312 "{@{\\hspace{0mm}}r@{\\hspace{" colsep
c76e8e8fdb0a Fix Filofax year output so that it's the correct size.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 14268
diff changeset
1313 "}}r@{\\hspace{" colsep "}}r@{\\hspace{" colsep
c76e8e8fdb0a Fix Filofax year output so that it's the correct size.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 14268
diff changeset
1314 "}}r@{\\hspace{" colsep "}}r@{\\hspace{" colsep
c76e8e8fdb0a Fix Filofax year output so that it's the correct size.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 14268
diff changeset
1315 "}}r@{\\hspace{" colsep "}}r@{\\hspace{0mm}}}%\n"
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1316 "\\multicolumn{7}{c}{"
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1317 (calendar-month-name month)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1318 " "
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1319 (int-to-string year)
15432
c76e8e8fdb0a Fix Filofax year output so that it's the correct size.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 14268
diff changeset
1320 "}\\\\[1mm]\n")))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1321 (calendar-for-loop i from 0 to 6 do
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1322 (setq str (concat str
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1323 (substring (aref calendar-day-name-array
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1324 (mod (+ calendar-week-start-day i) 7))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1325 0 2)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1326 (if (/= i 6)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1327 " & "
15432
c76e8e8fdb0a Fix Filofax year output so that it's the correct size.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 14268
diff changeset
1328 "\\\\[0.7mm]\n"))))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1329 (calendar-for-loop i from 1 to blank-days do
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1330 (setq str (concat str " & ")))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1331 (calendar-for-loop i from 1 to last do
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1332 (setq str (concat str (int-to-string i)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1333 (setq str (concat str (if (zerop (mod (+ i blank-days) 7))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1334 (if (/= i last) "\\\\[0.5mm]\n" "")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1335 " & "))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1336 (setq str (concat str "\n\\end{tabular}\\hfil}\\vfil}}}%\n"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1337 str))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1338
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1339 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1340 ;;; Various calendar functions
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1341 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1342
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1343 (defun cal-tex-incr-date (date &optional n)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1344 "The date of the day following DATE.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1345 If optional N is given, the date of N days after DATE."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1346 (calendar-gregorian-from-absolute
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1347 (+ (if n n 1) (calendar-absolute-from-gregorian date))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1348
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1349 (defun cal-tex-latexify-list (date-list date &optional separator)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1350 "Return string with concatenated, LaTeXified entries in DATE_LIST for DATE.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1351 Use double backslash as a separator unless optional SEPARATOR is given."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1352 (mapconcat '(lambda (x) (cal-tex-LaTeXify-string x))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1353 (let ((result)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1354 (p date-list))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1355 (while p
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1356 (and (car (car p))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1357 (calendar-date-equal date (car (car p)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1358 (setq result (append (cdr (car p)) result)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1359 (setq p (cdr p)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1360 result)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1361 (if separator separator "\\\\")))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1362
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1363 (defun cal-tex-previous-month (date)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1364 "Return the date of the first day in the month previous to DATE."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1365 (let* ((month (extract-calendar-month date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1366 (year (extract-calendar-year date)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1367 (increment-calendar-month month year -1)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1368 (list month 1 year)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1369
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1370 (defun cal-tex-next-month (date)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1371 "Return the date of the first day in the month following DATE."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1372 (let* ((month (extract-calendar-month date))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1373 (year (extract-calendar-year date)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1374 (increment-calendar-month month year 1)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1375 (list month 1 year)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1376
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1377 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1378 ;;; LaTeX Code
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1379 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1380
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1381 (defun cal-tex-end-document ()
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1382 "Finish the LaTeX document.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1383 Insert the trailer to LaTeX document, pop to LaTeX buffer, add
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1384 informative header, and run HOOK."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1385 (cal-tex-e-document)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1386 (latex-mode)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1387 (pop-to-buffer cal-tex-buffer)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1388 (goto-char (point-min))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1389 (cal-tex-comment " This buffer was produced by cal-tex.el.")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1390 (cal-tex-comment " To print a calendar, type")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1391 (cal-tex-comment " M-x tex-buffer RET")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1392 (cal-tex-comment " M-x tex-print RET")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1393 (goto-char (point-min)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1394
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1395 (defun cal-tex-insert-preamble (weeks landscape size &optional append)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1396 "Initialize the output buffer.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1397 Select the output buffer, and insert the preamble for a calendar of
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1398 WEEKS weeks. Insert code for landscape mode if LANDSCAPE is true.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1399 Use pointsize SIZE. Optional argument APPEND, if t, means add to end of
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1400 without erasing current contents."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1401 (let ((width "18cm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1402 (height "24cm"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1403 (if landscape
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1404 (progn
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1405 (setq width "24cm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1406 (setq height "18cm")))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1407 (if (not append)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1408 (progn
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1409 (cal-tex-preamble size)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1410 (if (not landscape)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1411 (progn
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1412 (cal-tex-cmd "\\oddsidemargin -1.75cm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1413 (cal-tex-cmd "\\def\\holidaymult{.06}"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1414 (cal-tex-cmd "\\special{landscape}")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1415 (cal-tex-cmd "\\textwidth 9.5in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1416 (cal-tex-cmd "\\textheight 7in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1417 (cal-tex-comment)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1418 (cal-tex-cmd "\\def\\holidaymult{.08}"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1419 (cal-tex-cmd cal-tex-caldate)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1420 (cal-tex-cmd cal-tex-myday)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1421 (cal-tex-b-document)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1422 (cal-tex-cmd "\\pagestyle{empty}")))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1423 (cal-tex-cmd "\\setlength{\\cellwidth}" width)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1424 (insert (format "\\setlength{\\cellwidth}{%f\\cellwidth}\n"
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1425 (/ 1.1 (length cal-tex-which-days))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1426 (cal-tex-cmd "\\setlength{\\cellheight}" height)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1427 (insert (format "\\setlength{\\cellheight}{%f\\cellheight}\n"
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1428 (/ 1.0 weeks)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1429 (cal-tex-cmd "\\ \\par")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1430 (cal-tex-vspace "-3cm")))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1431
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1432 (defvar cal-tex-LaTeX-subst-list
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1433 '(("\"". "``")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1434 ("\"". "''");; Quote changes meaning when list is reversed.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1435 ("@" . "\\verb|@|")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1436 ("&" . "\\&")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1437 ("%" . "\\%")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1438 ("$" . "\\$")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1439 ("#" . "\\#")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1440 ("_" . "\\_")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1441 ("{" . "\\{")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1442 ("}" . "\\}")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1443 ("<" . "$<$")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1444 (">" . "$>$")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1445 ("\n" . "\\ \\\\")) ;\\ needed for e.g \begin{center}\n AA\end{center}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1446 "List of symbols and their replacements.")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1447
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1448 (defun cal-tex-LaTeXify-string (string)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1449 "Protect special characters in STRING from LaTeX."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1450 (if (not string)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1451 ""
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1452 (let ((head "")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1453 (tail string)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1454 (list cal-tex-LaTeX-subst-list))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1455 (while (not (string-equal tail ""))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1456 (let* ((ch (substring tail 0 1))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1457 (pair (assoc ch list)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1458 (if (and pair (string-equal ch "\""))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1459 (setq list (reverse list)));; Quote changes meaning each time.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1460 (setq tail (substring tail 1))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1461 (setq head (concat head (if pair (cdr pair) ch)))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1462 head)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1463
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1464 (defun cal-tex-hfill () "Insert hfill." (insert "\\hfill"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1465
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1466 (defun cal-tex-newpage () "Insert newpage." (insert "\\newpage%\n"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1467
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1468 (defun cal-tex-noindent () "Insert noindent." (insert "\\noindent"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1469
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1470 (defun cal-tex-vspace (space)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1471 "Insert vspace command to move SPACE vertically."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1472 (insert "\\vspace*{" space "}")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1473 (cal-tex-comment))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1474
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1475 (defun cal-tex-hspace (space)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1476 "Insert hspace command to move SPACE horizontally."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1477 (insert "\\hspace*{" space "}")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1478 (cal-tex-comment))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1479
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1480 (defun cal-tex-comment (&optional comment)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1481 "Insert % at end of line, include COMMENT if present, and move
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1482 to next line."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1483 (insert "% ")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1484 (if comment
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1485 (insert comment))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1486 (insert "\n"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1487
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1488 (defun cal-tex-banner (comment)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1489 "Insert the COMMENT separated by blank lines."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1490 (cal-tex-comment)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1491 (cal-tex-comment)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1492 (cal-tex-comment (concat "\t\t\t" comment))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1493 (cal-tex-comment))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1494
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1495
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1496 (defun cal-tex-nl (&optional skip comment)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1497 "End a line with \\. If SKIP, then add that much spacing.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1498 Add COMMENT if present"
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1499 (insert "\\\\")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1500 (if skip
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1501 (insert "[" skip "]"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1502 (cal-tex-comment comment))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1503
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1504 (defun cal-tex-arg (&optional text)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1505 "Insert optional TEXT surrounded by braces."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1506 (insert "{")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1507 (if text (insert text))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1508 (insert "}"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1509
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1510 (defun cal-tex-cmd (cmd &optional arg)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1511 "Insert LaTeX CMD, with optional ARG, and end with %"
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1512 (insert cmd)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1513 (cal-tex-arg arg)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1514 (cal-tex-comment))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1515
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1516 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1517 ;;; Environments
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1518 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1519
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1520 (defun cal-tex-b-document ()
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1521 "Insert beginning of document."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1522 (cal-tex-cmd "\\begin{document}"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1523
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1524 (defun cal-tex-e-document ()
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1525 "Insert end of document."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1526 (cal-tex-cmd "\\end{document}"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1527
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1528 (defun cal-tex-b-center ()
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1529 "Insert beginning of centered block."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1530 (cal-tex-cmd "\\begin{center}"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1531
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1532 (defun cal-tex-e-center ()
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1533 "Insert end of centered block."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1534 (cal-tex-comment)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1535 (cal-tex-cmd "\\end{center}"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1536
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1537
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1538 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1539 ;;; Boxes
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1540 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1541
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1542
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1543 (defun cal-tex-b-parbox (position width)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1544 "Insert parbox with parameters POSITION and WIDTH."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1545 (insert "\\parbox[" position "]{" width "}{")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1546 (cal-tex-comment))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1547
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1548 (defun cal-tex-e-parbox (&optional height)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1549 "Insert end of parbox. Force it to be a given HEIGHT."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1550 (cal-tex-comment)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1551 (if height
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1552 (cal-tex-rule "0mm" "0mm" height))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1553 (insert "}")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1554 (cal-tex-comment "end parbox"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1555
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1556 (defun cal-tex-b-framebox ( width position )
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1557 "Insert framebox with parameters WIDTH and POSITION (clr)."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1558 (insert "\\framebox[" width "][" position "]{" )
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1559 (cal-tex-comment))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1560
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1561 (defun cal-tex-e-framebox ()
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1562 "Insert end of framebox."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1563 (cal-tex-comment)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1564 (insert "}")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1565 (cal-tex-comment "end framebox"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1566
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1567
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1568 (defun cal-tex-b-makebox ( width position )
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1569 "Insert makebox with parameters WIDTH and POSITION (clr)."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1570 (insert "\\makebox[" width "][" position "]{" )
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1571 (cal-tex-comment))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1572
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1573 (defun cal-tex-e-makebox ()
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1574 "Insert end of makebox."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1575 (cal-tex-comment)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1576 (insert "}")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1577 (cal-tex-comment "end makebox"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1578
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1579
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1580 (defun cal-tex-rule (lower width height)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1581 "Insert a rule with parameters LOWER WIDTH HEIGHT."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1582 (insert "\\rule[" lower "]{" width "}{" height "}"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1583
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1584 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1585 ;;; Fonts
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1586 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1587
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1588 (defun cal-tex-em (string)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1589 "Insert STRING in bf font."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1590 (insert "{\\em " string "}"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1591
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1592 (defun cal-tex-bf (string)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1593 "Insert STRING in bf font."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1594 (insert "{\\bf " string "}"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1595
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1596 (defun cal-tex-scriptsize (string)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1597 "Insert STRING in scriptsize font."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1598 (insert "{\\scriptsize " string "}"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1599
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1600 (defun cal-tex-huge (string)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1601 "Insert STRING in huge size."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1602 (insert "{\\huge " string "}"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1603
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1604 (defun cal-tex-Huge (string)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1605 "Insert STRING in Huge size."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1606 (insert "{\\Huge " string "}"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1607
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1608 (defun cal-tex-Huge-bf (string)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1609 "Insert STRING in Huge bf size."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1610 (insert "{\\Huge\\bf " string "}"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1611
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1612 (defun cal-tex-large (string)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1613 "Insert STRING in large size."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1614 (insert "{\\large " string "}"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1615
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1616 (defun cal-tex-large-bf (string)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1617 "Insert STRING in large bf size."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1618 (insert "{\\large\\bf " string "}"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1619
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1620 (provide 'cal-tex)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1621
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1622 ;;; cal-tex.el ends here