annotate lisp/calendar/cal-tex.el @ 112439:5610f272341f

* src/image.c: Add cast to fix type clash
author Paul Eggert <eggert@cs.ucla.edu>
date Sat, 22 Jan 2011 20:34:48 -0800
parents ef719132ddfa
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38422
7a94f1c588c4 Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 36118
diff changeset
1 ;;; cal-tex.el --- calendar functions for printing calendars with LaTeX
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
2
109325
d916e52744cb cal-tex.el fixes for calendar-week-start-day != 0.
Glenn Morris <rgm@gnu.org>
parents: 107517
diff changeset
3 ;; Copyright (C) 1995, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
112218
376148b31b5e Add 2011 to FSF/AIST copyright years.
Glenn Morris <rgm@gnu.org>
parents: 109325
diff changeset
4 ;; 2009, 2010, 2011 Free Software Foundation, Inc.
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
5
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
6 ;; Author: Steve Fisk <fisk@bowdoin.edu>
92961
6392aaa2f903 (cal-tex-hook, cal-tex-insert-preamble, cal-tex-month-name): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 92856
diff changeset
7 ;; Edward M. Reingold <reingold@cs.uiuc.edu>
67465
a55ee709ec8d Update copyright pending Emacs 22.
Glenn Morris <rgm@gnu.org>
parents: 64085
diff changeset
8 ;; Maintainer: Glenn Morris <rgm@gnu.org>
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
9 ;; Keywords: calendar
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
10 ;; Human-Keywords: Calendar, LaTeX
110015
280c8ae2476d Add "Package:" file headers to denote built-in packages.
Chong Yidong <cyd@stupidchicken.com>
parents: 109325
diff changeset
11 ;; Package: calendar
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
12
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
13 ;; This file is part of GNU Emacs.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
14
94653
e49abd957e81 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93992
diff changeset
15 ;; GNU Emacs is free software: you can redistribute it and/or modify
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
16 ;; it under the terms of the GNU General Public License as published by
94653
e49abd957e81 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93992
diff changeset
17 ;; the Free Software Foundation, either version 3 of the License, or
e49abd957e81 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93992
diff changeset
18 ;; (at your option) any later version.
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
19
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
20 ;; 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
21 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
22 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
23 ;; GNU General Public License for more details.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
24
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
25 ;; You should have received a copy of the GNU General Public License
94653
e49abd957e81 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93992
diff changeset
26 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
27
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
28 ;;; Commentary:
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
29
13206
2d1da471963a Minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13195
diff changeset
30 ;; 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
31 ;; 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
32
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
33 ;; The user commands are:
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
34 ;; cal-tex-cursor-year
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
35 ;; cal-tex-cursor-year-landscape
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
36 ;; cal-tex-cursor-filofax-year
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
37 ;; cal-tex-cursor-month-landscape
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
38 ;; cal-tex-cursor-month
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
39 ;; cal-tex-cursor-week
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
40 ;; cal-tex-cursor-week2
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
41 ;; cal-tex-cursor-week-iso
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
42 ;; cal-tex-cursor-week-monday
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
43 ;; cal-tex-cursor-filofax-2week
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
44 ;; cal-tex-cursor-filofax-week
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
45 ;; cal-tex-cursor-filofax-daily
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
46 ;; cal-tex-cursor-day
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
47
14169
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13649
diff changeset
48 ;; TO DO
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13649
diff changeset
49 ;;
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13649
diff changeset
50 ;; (*) Add holidays and diary entries to daily calendar.
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13649
diff changeset
51 ;;
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13649
diff changeset
52 ;; (*) Add diary entries to weekly calendar functions.
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13649
diff changeset
53 ;;
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13649
diff changeset
54 ;; (*) Make calendar styles for A4 paper.
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13649
diff changeset
55 ;;
19973
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
56 ;; (*) Make monthly styles Filofax paper.
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
57
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
58 ;;; Code:
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
59
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
60 (require 'calendar)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
61
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
62 ;;;
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 44368
diff changeset
63 ;;; Customizable variables
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
64 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
65
92592
db21faafefb9 Add autoload cookies to functions formerly autoloaded in calendar.el.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
66 (defgroup calendar-tex nil
db21faafefb9 Add autoload cookies to functions formerly autoloaded in calendar.el.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
67 "Options for printing calendar with LaTeX."
db21faafefb9 Add autoload cookies to functions formerly autoloaded in calendar.el.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
68 :prefix "cal-tex-"
db21faafefb9 Add autoload cookies to functions formerly autoloaded in calendar.el.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
69 :group 'calendar)
db21faafefb9 Add autoload cookies to functions formerly autoloaded in calendar.el.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
70
17626
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
71 (defcustom cal-tex-which-days '(0 1 2 3 4 5 6)
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
72 "The days of the week that are displayed on the portrait monthly calendar.
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
73 Sunday is 0, Monday is 1, and so on. The default is to print from Sunday to
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
74 Saturday. For example, use '(1 3 5) to only print Monday, Wednesday, Friday."
17626
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
75 :type '(repeat integer)
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
76 :group 'calendar-tex)
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
77
17626
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
78 (defcustom cal-tex-holidays t
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
79 "Non-nil means holidays are printed in the LaTeX calendars that support it.
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
80 Setting this to nil may speed up calendar generation."
17626
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
81 :type 'boolean
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
82 :group 'calendar-tex)
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
83
17626
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
84 (defcustom cal-tex-diary nil
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
85 "Non-nil means diary entries are printed in LaTeX calendars that support it.
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
86 At present, this only affects the monthly, filofax, and iso-week
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
87 calendars (i.e. not the yearly, plain weekly, or daily calendars).
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
88 Setting this to nil may speed up calendar generation."
17626
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
89 :type 'boolean
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
90 :group 'calendar-tex)
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
91
25130
3f2b516f9ddc (cal-tex-cursor-filofax-daily): Add possibility of
Karl Heuer <kwzh@gnu.org>
parents: 23120
diff changeset
92 (defcustom cal-tex-rules nil
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
93 "Non-nil means pages will be ruled in some LaTeX calendar styles.
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
94 At present, this only affects the daily filofax calendar."
25130
3f2b516f9ddc (cal-tex-cursor-filofax-daily): Add possibility of
Karl Heuer <kwzh@gnu.org>
parents: 23120
diff changeset
95 :type 'boolean
3f2b516f9ddc (cal-tex-cursor-filofax-daily): Add possibility of
Karl Heuer <kwzh@gnu.org>
parents: 23120
diff changeset
96 :group 'calendar-tex)
3f2b516f9ddc (cal-tex-cursor-filofax-daily): Add possibility of
Karl Heuer <kwzh@gnu.org>
parents: 23120
diff changeset
97
17626
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
98 (defcustom cal-tex-daily-string
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
99 '(let* ((year (calendar-extract-year date))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
100 (day (calendar-day-number date))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
101 (days-remaining (- (calendar-day-number (list 12 31 year)) day)))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
102 (format "%d/%d" day days-remaining))
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
103 "Lisp expression giving the date format to use in the LaTeX calendars.
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
104 This should be an expression involving the variable `date'. When
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
105 this expression is called, `date' is a list of the form '(MONTH DAY YEAR)'.
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
106
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
107 The string resulting from evaluating this expression is placed at
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
108 the bottom center of each date in monthly calendars, next to the
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
109 date in the weekly calendars, and in the top center of daily calendars.
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
110
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
111 The default is ordinal day number of the year and the number of
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
112 days remaining. As an example, setting this to
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
113
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
114 '(calendar-hebrew-date-string date)
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
115
17626
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
116 will put the Hebrew date at the bottom of each day."
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
117 :type 'sexp
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
118 :group 'calendar-tex)
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
119
17626
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
120 (defcustom cal-tex-buffer "calendar.tex"
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
121 "The name for the output LaTeX calendar buffer."
17626
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
122 :type 'string
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
123 :group 'calendar-tex)
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
124
17626
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
125 (defcustom cal-tex-24 nil
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
126 "Non-nil means use a 24 hour clock in the daily calendar."
17626
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
127 :type 'boolean
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
128 :group 'calendar-tex)
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
129
17626
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
130 (defcustom cal-tex-daily-start 8
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
131 "The first hour of the daily LaTeX calendar page.
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
132 At present, this only affects `cal-tex-cursor-day'."
17626
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
133 :type 'integer
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
134 :group 'calendar-tex)
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
135
17626
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
136 (defcustom cal-tex-daily-end 20
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
137 "The last hour of the daily LaTeX calendar page.
107517
ed16fdd2685a Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
138 At present, this only affects `cal-tex-cursor-day'."
17626
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
139 :type 'integer
68cce262538d Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17196
diff changeset
140 :group 'calendar-tex)
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
141
70311
7551592e369e (cal-tex-preamble-extra): New variable.
Glenn Morris <rgm@gnu.org>
parents: 68721
diff changeset
142 (defcustom cal-tex-preamble-extra nil
7551592e369e (cal-tex-preamble-extra): New variable.
Glenn Morris <rgm@gnu.org>
parents: 68721
diff changeset
143 "A string giving extra LaTeX commands to insert in the calendar preamble.
7551592e369e (cal-tex-preamble-extra): New variable.
Glenn Morris <rgm@gnu.org>
parents: 68721
diff changeset
144 For example, to include extra packages:
7551592e369e (cal-tex-preamble-extra): New variable.
Glenn Morris <rgm@gnu.org>
parents: 68721
diff changeset
145 \"\\\\usepackage{foo}\\n\\\\usepackage{bar}\\n\"."
102591
f42a82e7d735 (cal-tex-preamble-extra): Add an example string value to help people
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
146 :type '(choice (const nil)
f42a82e7d735 (cal-tex-preamble-extra): Add an example string value to help people
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
147 ;; An example to help people format things in custom.
f42a82e7d735 (cal-tex-preamble-extra): Add an example string value to help people
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
148 (string :value "\\usepackage{foo}\n\\usepackage{bar}\n"))
70311
7551592e369e (cal-tex-preamble-extra): New variable.
Glenn Morris <rgm@gnu.org>
parents: 68721
diff changeset
149 :group 'calendar-tex
7551592e369e (cal-tex-preamble-extra): New variable.
Glenn Morris <rgm@gnu.org>
parents: 68721
diff changeset
150 :version "22.1")
7551592e369e (cal-tex-preamble-extra): New variable.
Glenn Morris <rgm@gnu.org>
parents: 68721
diff changeset
151
44368
ceb605d3c4dd (cal-tex-hook, cal-tex-year-hook, cal-tex-month-hook)
Richard M. Stallman <rms@gnu.org>
parents: 38422
diff changeset
152 (defcustom cal-tex-hook nil
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
153 "List of functions called after any LaTeX calendar buffer is generated.
92961
6392aaa2f903 (cal-tex-hook, cal-tex-insert-preamble, cal-tex-month-name): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 92856
diff changeset
154 You can use this to do post-processing on the buffer. For example, to change
44368
ceb605d3c4dd (cal-tex-hook, cal-tex-year-hook, cal-tex-month-hook)
Richard M. Stallman <rms@gnu.org>
parents: 38422
diff changeset
155 characters with diacritical marks to their LaTeX equivalents, use
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
156 (add-hook 'cal-tex-hook
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
157 (lambda () (iso-iso2tex (point-min) (point-max))))"
44368
ceb605d3c4dd (cal-tex-hook, cal-tex-year-hook, cal-tex-month-hook)
Richard M. Stallman <rms@gnu.org>
parents: 38422
diff changeset
158 :type 'hook
ceb605d3c4dd (cal-tex-hook, cal-tex-year-hook, cal-tex-month-hook)
Richard M. Stallman <rms@gnu.org>
parents: 38422
diff changeset
159 :group 'calendar-tex)
ceb605d3c4dd (cal-tex-hook, cal-tex-year-hook, cal-tex-month-hook)
Richard M. Stallman <rms@gnu.org>
parents: 38422
diff changeset
160
ceb605d3c4dd (cal-tex-hook, cal-tex-year-hook, cal-tex-month-hook)
Richard M. Stallman <rms@gnu.org>
parents: 38422
diff changeset
161 (defcustom cal-tex-year-hook nil
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
162 "List of functions called after a LaTeX year calendar buffer is generated."
44368
ceb605d3c4dd (cal-tex-hook, cal-tex-year-hook, cal-tex-month-hook)
Richard M. Stallman <rms@gnu.org>
parents: 38422
diff changeset
163 :type 'hook
ceb605d3c4dd (cal-tex-hook, cal-tex-year-hook, cal-tex-month-hook)
Richard M. Stallman <rms@gnu.org>
parents: 38422
diff changeset
164 :group 'calendar-tex)
ceb605d3c4dd (cal-tex-hook, cal-tex-year-hook, cal-tex-month-hook)
Richard M. Stallman <rms@gnu.org>
parents: 38422
diff changeset
165
ceb605d3c4dd (cal-tex-hook, cal-tex-year-hook, cal-tex-month-hook)
Richard M. Stallman <rms@gnu.org>
parents: 38422
diff changeset
166 (defcustom cal-tex-month-hook nil
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
167 "List of functions called after a LaTeX month calendar buffer is generated."
44368
ceb605d3c4dd (cal-tex-hook, cal-tex-year-hook, cal-tex-month-hook)
Richard M. Stallman <rms@gnu.org>
parents: 38422
diff changeset
168 :type 'hook
ceb605d3c4dd (cal-tex-hook, cal-tex-year-hook, cal-tex-month-hook)
Richard M. Stallman <rms@gnu.org>
parents: 38422
diff changeset
169 :group 'calendar-tex)
ceb605d3c4dd (cal-tex-hook, cal-tex-year-hook, cal-tex-month-hook)
Richard M. Stallman <rms@gnu.org>
parents: 38422
diff changeset
170
ceb605d3c4dd (cal-tex-hook, cal-tex-year-hook, cal-tex-month-hook)
Richard M. Stallman <rms@gnu.org>
parents: 38422
diff changeset
171 (defcustom cal-tex-week-hook nil
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
172 "List of functions called after a LaTeX week calendar buffer is generated."
44368
ceb605d3c4dd (cal-tex-hook, cal-tex-year-hook, cal-tex-month-hook)
Richard M. Stallman <rms@gnu.org>
parents: 38422
diff changeset
173 :type 'hook
ceb605d3c4dd (cal-tex-hook, cal-tex-year-hook, cal-tex-month-hook)
Richard M. Stallman <rms@gnu.org>
parents: 38422
diff changeset
174 :group 'calendar-tex)
ceb605d3c4dd (cal-tex-hook, cal-tex-year-hook, cal-tex-month-hook)
Richard M. Stallman <rms@gnu.org>
parents: 38422
diff changeset
175
ceb605d3c4dd (cal-tex-hook, cal-tex-year-hook, cal-tex-month-hook)
Richard M. Stallman <rms@gnu.org>
parents: 38422
diff changeset
176 (defcustom cal-tex-daily-hook nil
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
177 "List of functions called after a LaTeX daily calendar buffer is generated."
44368
ceb605d3c4dd (cal-tex-hook, cal-tex-year-hook, cal-tex-month-hook)
Richard M. Stallman <rms@gnu.org>
parents: 38422
diff changeset
178 :type 'hook
ceb605d3c4dd (cal-tex-hook, cal-tex-year-hook, cal-tex-month-hook)
Richard M. Stallman <rms@gnu.org>
parents: 38422
diff changeset
179 :group 'calendar-tex)
ceb605d3c4dd (cal-tex-hook, cal-tex-year-hook, cal-tex-month-hook)
Richard M. Stallman <rms@gnu.org>
parents: 38422
diff changeset
180
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
181 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
182 ;;; Definitions for LaTeX code
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
183 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
184
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
185 (defconst cal-tex-day-prefix "\\caldate{%s}{%s}"
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 44368
diff changeset
186 "The initial LaTeX code for a day.
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
187 The holidays, diary entries, bottom string, and the text follow.")
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 44368
diff changeset
188
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
189 (defconst cal-tex-day-name-format "\\myday{%s}%%"
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
190 "The format for LaTeX code for a day name.
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
191 The names are taken from `calendar-day-name-array'.")
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
192
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
193 (defconst cal-tex-cal-one-month
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
194 "\\def\\calmonth#1#2%
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
195 {\\begin{center}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
196 \\Huge\\bf\\uppercase{#1} #2 \\\\[1cm]%
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 44368
diff changeset
197 \\end{center}}%
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
198 \\vspace*{-1.5cm}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
199 %
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
200 "
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
201 "LaTeX code for the month header, for a single month calendar.")
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
202
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
203 (defconst cal-tex-cal-multi-month
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
204 "\\def\\calmonth#1#2#3#4%
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
205 {\\begin{center}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
206 \\Huge\\bf #1 #2---#3 #4\\\\[1cm]%
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 44368
diff changeset
207 \\end{center}}%
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
208 \\vspace*{-1.5cm}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
209 %
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
210 "
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
211 "LaTeX code for the month header, for a multi-month calendar.")
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
212
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
213 (defconst cal-tex-myday
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
214 "\\renewcommand{\\myday}[1]%
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
215 {\\makebox[\\cellwidth]{\\hfill\\large\\bf#1\\hfill}}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
216 %
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
217 "
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
218 "LaTeX code for a day heading.")
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
219
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
220 (defconst cal-tex-caldate
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
221 "\\fboxsep=0pt
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
222 \\long\\def\\caldate#1#2#3#4#5#6{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
223 \\fbox{\\hbox to\\cellwidth{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
224 \\vbox to\\cellheight{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
225 \\hbox to\\cellwidth{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
226 {\\hspace*{1mm}\\Large \\bf \\strut #2}\\hspace{.05\\cellwidth}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
227 \\raisebox{\\holidaymult\\cellheight}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
228 {\\parbox[t]{.75\\cellwidth}{\\tiny \\raggedright #4}}}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
229 \\hbox to\\cellwidth{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
230 \\hspace*{1mm}\\parbox{.95\\cellwidth}{\\tiny \\raggedright #3}}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
231 \\hspace*{1mm}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
232 \\hbox to\\cellwidth{#6}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
233 \\vfill%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
234 \\hbox to\\cellwidth{\\hfill \\tiny #5 \\hfill}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
235 \\vskip 1.4pt}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
236 \\hskip -0.4pt}}}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
237 "
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
238 "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
239 This definition is the heart of the calendar!")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
240
92838
26dc958b293b (calendar-holiday-list, diary-list-entries, calendar-iso-from-absolute):
Glenn Morris <rgm@gnu.org>
parents: 92592
diff changeset
241 (autoload 'calendar-holiday-list "holidays")
26dc958b293b (calendar-holiday-list, diary-list-entries, calendar-iso-from-absolute):
Glenn Morris <rgm@gnu.org>
parents: 92592
diff changeset
242
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
243 (defun cal-tex-list-holidays (d1 d2)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
244 "Generate a list of all holidays from absolute date D1 to D2."
22147
803bcc3c1a49 Rewrote cal-tex-list-holidays to get holidays in the range correctly (and more
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20216
diff changeset
245 (let* ((start (calendar-gregorian-from-absolute d1))
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
246 (displayed-month (calendar-extract-month start))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
247 (displayed-year (calendar-extract-year start))
22147
803bcc3c1a49 Rewrote cal-tex-list-holidays to get holidays in the range correctly (and more
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20216
diff changeset
248 (end (calendar-gregorian-from-absolute d2))
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
249 (end-month (calendar-extract-month end))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
250 (end-year (calendar-extract-year end))
22147
803bcc3c1a49 Rewrote cal-tex-list-holidays to get holidays in the range correctly (and more
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20216
diff changeset
251 (number-of-intervals
803bcc3c1a49 Rewrote cal-tex-list-holidays to get holidays in the range correctly (and more
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20216
diff changeset
252 (1+ (/ (calendar-interval displayed-month displayed-year
803bcc3c1a49 Rewrote cal-tex-list-holidays to get holidays in the range correctly (and more
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20216
diff changeset
253 end-month end-year)
803bcc3c1a49 Rewrote cal-tex-list-holidays to get holidays in the range correctly (and more
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20216
diff changeset
254 3)))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
255 holidays in-range a)
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
256 (calendar-increment-month displayed-month displayed-year 1)
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
257 (dotimes (idummy number-of-intervals)
22147
803bcc3c1a49 Rewrote cal-tex-list-holidays to get holidays in the range correctly (and more
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20216
diff changeset
258 (setq holidays (append holidays (calendar-holiday-list)))
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
259 (calendar-increment-month displayed-month displayed-year 3))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
260 (dolist (hol holidays)
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
261 (and (car hol)
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
262 (setq a (calendar-absolute-from-gregorian (car hol)))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
263 (and (<= d1 a) (<= a d2))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
264 (setq in-range (append (list hol) in-range))))
22147
803bcc3c1a49 Rewrote cal-tex-list-holidays to get holidays in the range correctly (and more
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20216
diff changeset
265 in-range))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
266
92838
26dc958b293b (calendar-holiday-list, diary-list-entries, calendar-iso-from-absolute):
Glenn Morris <rgm@gnu.org>
parents: 92592
diff changeset
267 (autoload 'diary-list-entries "diary-lib")
26dc958b293b (calendar-holiday-list, diary-list-entries, calendar-iso-from-absolute):
Glenn Morris <rgm@gnu.org>
parents: 92592
diff changeset
268
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
269 (defun cal-tex-list-diary-entries (d1 d2)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
270 "Generate a list of all diary-entries from absolute date D1 to D2."
95414
db35abe41bba (cal-tex-list-diary-entries): Use LIST-ONLY argument of
Glenn Morris <rgm@gnu.org>
parents: 94653
diff changeset
271 (let (diary-list-include-blanks)
db35abe41bba (cal-tex-list-diary-entries): Use LIST-ONLY argument of
Glenn Morris <rgm@gnu.org>
parents: 94653
diff changeset
272 (diary-list-entries (calendar-gregorian-from-absolute d1)
db35abe41bba (cal-tex-list-diary-entries): Use LIST-ONLY argument of
Glenn Morris <rgm@gnu.org>
parents: 94653
diff changeset
273 (1+ (- d2 d1)) t)))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
274
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
275 (defun cal-tex-preamble (&optional args)
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
276 "Insert the LaTeX calendar preamble into `cal-tex-buffer'.
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
277 Preamble includes initial definitions for various LaTeX commands.
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
278 Optional string ARGS are included as options for the article document class."
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
279 ;; FIXME use generate-new-buffer, and adjust cal-tex-end-document.
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
280 (set-buffer (get-buffer-create cal-tex-buffer))
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
281 (insert (format "\\documentclass%s{article}\n"
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
282 (if (stringp args)
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
283 (format "[%s]" args)
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
284 "")))
70311
7551592e369e (cal-tex-preamble-extra): New variable.
Glenn Morris <rgm@gnu.org>
parents: 68721
diff changeset
285 (if (stringp cal-tex-preamble-extra)
7551592e369e (cal-tex-preamble-extra): New variable.
Glenn Morris <rgm@gnu.org>
parents: 68721
diff changeset
286 (insert cal-tex-preamble-extra "\n"))
7551592e369e (cal-tex-preamble-extra): New variable.
Glenn Morris <rgm@gnu.org>
parents: 68721
diff changeset
287 (insert "\\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
288 \\hfuzz=1000pt
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
289 \\vbadness 20000
17196
1b2490698826 (cal-tex-preamble): Set \lineskip to 0pt.
Karl Heuer <kwzh@gnu.org>
parents: 15433
diff changeset
290 \\lineskip 0pt
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
291 \\marginparwidth 0pt
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
292 \\oddsidemargin -2cm
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
293 \\evensidemargin -2cm
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
294 \\marginparsep 0pt
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
295 \\topmargin 0pt
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
296 \\textwidth 7.5in
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
297 \\textheight 9.5in
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
298 \\newlength{\\cellwidth}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
299 \\newlength{\\cellheight}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
300 \\newlength{\\boxwidth}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
301 \\newlength{\\boxheight}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
302 \\newlength{\\cellsize}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
303 \\newcommand{\\myday}[1]{}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
304 \\newcommand{\\caldate}[6]{}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
305 \\newcommand{\\nocaldate}[6]{}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
306 \\newcommand{\\calsmall}[6]{}
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 "))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
309
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
310 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
311 ;;; Yearly calendars
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
312 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
313
92838
26dc958b293b (calendar-holiday-list, diary-list-entries, calendar-iso-from-absolute):
Glenn Morris <rgm@gnu.org>
parents: 92592
diff changeset
314 ;;;###cal-autoload
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
315 (defun cal-tex-cursor-year (&optional n event)
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
316 "Make a buffer with LaTeX commands for the year cursor is on.
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
317 Optional prefix argument N specifies number of years.
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
318 Optional EVENT indicates a buffer position to use instead of point."
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
319 (interactive (list (prefix-numeric-value current-prefix-arg)
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
320 last-nonmenu-event))
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
321 (cal-tex-year (calendar-extract-year (calendar-cursor-to-date t event))
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
322 (or n 1)))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
323
92838
26dc958b293b (calendar-holiday-list, diary-list-entries, calendar-iso-from-absolute):
Glenn Morris <rgm@gnu.org>
parents: 92592
diff changeset
324 ;;;###cal-autoload
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
325 (defun cal-tex-cursor-year-landscape (&optional n event)
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
326 "Make a buffer with LaTeX commands for the year cursor is on.
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
327 Optional prefix argument N specifies number of years.
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
328 Optional EVENT indicates a buffer position to use instead of point."
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
329 (interactive (list (prefix-numeric-value current-prefix-arg)
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
330 last-nonmenu-event))
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
331 (cal-tex-year (calendar-extract-year (calendar-cursor-to-date t event))
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
332 (or n 1) t))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
333
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
334 (defun cal-tex-year (year n &optional landscape)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
335 "Make a one page yearly calendar of YEAR; do this for N years.
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
336 There are four rows of three months each, unless optional
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
337 LANDSCAPE is non-nil, in which case the calendar is printed in
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
338 landscape mode with three rows of four months each."
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
339 (cal-tex-insert-preamble 1 landscape "12pt")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
340 (if landscape
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
341 (cal-tex-vspace "-.6cm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
342 (cal-tex-vspace "-3.1cm"))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
343 (dotimes (j n)
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
344 (insert "\\vfill%\n")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
345 (cal-tex-b-center)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
346 (cal-tex-Huge (number-to-string year))
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
347 (cal-tex-e-center)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
348 (cal-tex-vspace "1cm")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
349 (cal-tex-b-center)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
350 (cal-tex-b-parbox "l" (if landscape "5.9in" "4.3in"))
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
351 (insert "\n")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
352 (cal-tex-noindent)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
353 (cal-tex-nl)
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
354 (dotimes (i 12)
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
355 (insert (cal-tex-mini-calendar (1+ i) year "month" "1.1in" "1in"))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
356 (insert "\\month")
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
357 (cal-tex-hspace "0.5in")
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
358 (if (zerop (mod (1+ i) (if landscape 4 3)))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
359 (cal-tex-nl "0.5in")))
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
360 (cal-tex-e-parbox)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
361 (cal-tex-e-center)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
362 (insert "\\vfill%\n")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
363 (setq year (1+ year))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
364 (if (= j (1- n))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
365 (cal-tex-end-document)
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
366 (cal-tex-newpage))
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
367 (run-hooks 'cal-tex-year-hook))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
368 (run-hooks 'cal-tex-hook))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
369
92838
26dc958b293b (calendar-holiday-list, diary-list-entries, calendar-iso-from-absolute):
Glenn Morris <rgm@gnu.org>
parents: 92592
diff changeset
370 ;;;###cal-autoload
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
371 (defun cal-tex-cursor-filofax-year (&optional n event)
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
372 "Make a Filofax one page yearly calendar of year indicated by cursor.
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
373 Optional prefix argument N specifies number of years.
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
374 Optional EVENT indicates a buffer position to use instead of point."
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
375 (interactive (list (prefix-numeric-value current-prefix-arg)
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
376 last-nonmenu-event))
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
377 (or n (setq n 1))
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
378 (let ((year (calendar-extract-year (calendar-cursor-to-date t event))))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
379 (cal-tex-preamble "twoside")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
380 (cal-tex-cmd "\\textwidth 3.25in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
381 (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
382 (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
383 (cal-tex-cmd "\\evensidemargin 1.675in")
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
384 (cal-tex-cmd "\\topmargin 0pt")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
385 (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
386 (cal-tex-cmd "\\fboxsep 0.5mm")
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
387 (cal-tex-cmd "\\pagestyle{empty}")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
388 (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
389 (cal-tex-cmd "\\vspace*{0.25in}")
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
390 (dotimes (j n)
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
391 (insert (format "\\hfil \\textbf{\\Large %s} \\hfil\\\\\n" year))
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
392 (cal-tex-b-center)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
393 (cal-tex-b-parbox "l" "\\textwidth")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
394 (insert "\n")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
395 (cal-tex-noindent)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
396 (cal-tex-nl)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
397 (let ((month-names; don't use default in case user changed it
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
398 ;; These are only used to define the command names, not
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
399 ;; the names of the months they insert.
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
400 ["January" "February" "March" "April" "May" "June"
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
401 "July" "August" "September" "October" "November" "December"]))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
402 (dotimes (i 12)
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
403 (insert (cal-tex-mini-calendar (1+ i) year (aref month-names i)
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
404 "1in" ".9in" "tiny" "0.6mm"))))
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
405 (insert
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
406 "\\noindent\\fbox{\\January}\\fbox{\\February}\\fbox{\\March}\\\\
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
407 \\noindent\\fbox{\\April}\\fbox{\\May}\\fbox{\\June}\\\\
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
408 \\noindent\\fbox{\\July}\\fbox{\\August}\\fbox{\\September}\\\\
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
409 \\noindent\\fbox{\\October}\\fbox{\\November}\\fbox{\\December}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
410 ")
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
411 (cal-tex-e-parbox)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
412 (cal-tex-e-center)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
413 (setq year (1+ year))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
414 (if (= j (1- n))
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
415 (cal-tex-end-document)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
416 (cal-tex-newpage)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
417 (cal-tex-cmd "\\vspace*{0.25in}"))
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
418 (run-hooks 'cal-tex-year-hook))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
419 (run-hooks 'cal-tex-hook)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
420
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
421 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
422 ;;; Monthly calendars
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
423 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
424
92838
26dc958b293b (calendar-holiday-list, diary-list-entries, calendar-iso-from-absolute):
Glenn Morris <rgm@gnu.org>
parents: 92592
diff changeset
425 ;;;###cal-autoload
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
426 (defun cal-tex-cursor-month-landscape (&optional n event)
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
427 "Make a LaTeX calendar buffer for the month the cursor is on.
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
428 Optional prefix argument N specifies number of months to be
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
429 produced (default 1). The output is in landscape format, one
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
430 month to a page. It shows holiday and diary entries if
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
431 `cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil.
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
432 Optional EVENT indicates a buffer position to use instead of point."
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
433 (interactive (list (prefix-numeric-value current-prefix-arg)
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
434 last-nonmenu-event))
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
435 (or n (setq n 1))
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
436 (let* ((date (calendar-cursor-to-date t event))
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
437 (month (calendar-extract-month date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
438 (year (calendar-extract-year date))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
439 (end-month month)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
440 (end-year year)
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
441 (cal-tex-which-days '(0 1 2 3 4 5 6))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
442 (d1 (calendar-absolute-from-gregorian (list month 1 year)))
105476
e3bdbd8a2169 Matthew Junker <matthew.junker at sbcglobal.net> (tiny change)
Glenn Morris <rgm@gnu.org>
parents: 102591
diff changeset
443 (d2 (progn
e3bdbd8a2169 Matthew Junker <matthew.junker at sbcglobal.net> (tiny change)
Glenn Morris <rgm@gnu.org>
parents: 102591
diff changeset
444 (calendar-increment-month end-month end-year (1- n))
e3bdbd8a2169 Matthew Junker <matthew.junker at sbcglobal.net> (tiny change)
Glenn Morris <rgm@gnu.org>
parents: 102591
diff changeset
445 (calendar-absolute-from-gregorian
e3bdbd8a2169 Matthew Junker <matthew.junker at sbcglobal.net> (tiny change)
Glenn Morris <rgm@gnu.org>
parents: 102591
diff changeset
446 (list end-month
e3bdbd8a2169 Matthew Junker <matthew.junker at sbcglobal.net> (tiny change)
Glenn Morris <rgm@gnu.org>
parents: 102591
diff changeset
447 (calendar-last-day-of-month end-month end-year)
e3bdbd8a2169 Matthew Junker <matthew.junker at sbcglobal.net> (tiny change)
Glenn Morris <rgm@gnu.org>
parents: 102591
diff changeset
448 end-year))))
e3bdbd8a2169 Matthew Junker <matthew.junker at sbcglobal.net> (tiny change)
Glenn Morris <rgm@gnu.org>
parents: 102591
diff changeset
449 (diary-list (if cal-tex-diary (cal-tex-list-diary-entries d1 d2)))
93488
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
450 (holidays (if cal-tex-holidays (cal-tex-list-holidays d1 d2)))
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
451 other-month other-year small-months-at-start)
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
452 (cal-tex-insert-preamble (cal-tex-number-weeks month year 1) t "12pt")
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
453 (cal-tex-cmd cal-tex-cal-one-month)
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
454 (dotimes (i n)
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
455 (setq other-month month
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
456 other-year year)
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
457 (calendar-increment-month other-month other-year -1)
93488
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
458 (insert (cal-tex-mini-calendar other-month other-year "lastmonth"
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
459 "\\cellwidth" "\\cellheight"))
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
460 (calendar-increment-month other-month other-year 2)
93488
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
461 (insert (cal-tex-mini-calendar other-month other-year "nextmonth"
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
462 "\\cellwidth" "\\cellheight"))
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
463 (cal-tex-insert-month-header 1 month year month year)
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
464 (cal-tex-insert-day-names)
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
465 (cal-tex-nl ".2cm")
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
466 (if (setq small-months-at-start
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
467 (< 1 (mod (- (calendar-day-of-week (list month 1 year))
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
468 calendar-week-start-day)
93488
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
469 7)))
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
470 (insert "\\lastmonth\\nextmonth\\hspace*{-2\\cellwidth}"))
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
471 (cal-tex-insert-blank-days month year cal-tex-day-prefix)
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
472 (cal-tex-insert-days month year diary-list holidays
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
473 cal-tex-day-prefix)
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
474 (cal-tex-insert-blank-days-at-end month year cal-tex-day-prefix)
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
475 (if (and (not small-months-at-start)
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
476 (< 1 (mod (- (1- calendar-week-start-day)
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
477 (calendar-day-of-week
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
478 (list month
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
479 (calendar-last-day-of-month month year)
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
480 year)))
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
481 7)))
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
482 (insert "\\vspace*{-\\cellwidth}\\hspace*{-2\\cellwidth}"
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
483 "\\lastmonth\\nextmonth%
44368
ceb605d3c4dd (cal-tex-hook, cal-tex-year-hook, cal-tex-month-hook)
Richard M. Stallman <rms@gnu.org>
parents: 38422
diff changeset
484 "))
93488
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
485 (unless (= i (1- n))
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
486 (run-hooks 'cal-tex-month-hook)
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
487 (cal-tex-newpage)
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
488 (calendar-increment-month month year 1)
93488
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
489 (cal-tex-vspace "-2cm")
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
490 (cal-tex-insert-preamble
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
491 (cal-tex-number-weeks month year 1) t "12pt" t))))
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
492 (cal-tex-end-document)
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
493 (run-hooks 'cal-tex-hook))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
494
92838
26dc958b293b (calendar-holiday-list, diary-list-entries, calendar-iso-from-absolute):
Glenn Morris <rgm@gnu.org>
parents: 92592
diff changeset
495 ;;;###cal-autoload
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
496 (defun cal-tex-cursor-month (&optional n event)
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
497 "Make a LaTeX calendar buffer for the month the cursor is on.
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
498 Optional prefix argument N specifies number of months to be
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
499 produced (default 1). The calendar is condensed onto one page.
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
500 It shows holiday and diary entries if `cal-tex-holidays' and
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
501 `cal-tex-diary', respectively, are non-nil. Optional EVENT
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
502 indicates a buffer position to use instead of point."
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
503 (interactive (list (prefix-numeric-value current-prefix-arg)
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
504 last-nonmenu-event))
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
505 (or n (setq n 1))
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
506 (let* ((date (calendar-cursor-to-date t event))
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
507 (month (calendar-extract-month date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
508 (year (calendar-extract-year date))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
509 (end-month month)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
510 (end-year year)
109325
d916e52744cb cal-tex.el fixes for calendar-week-start-day != 0.
Glenn Morris <rgm@gnu.org>
parents: 107517
diff changeset
511 ;; FIXME -landscape sets cal-tex-which-days?
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
512 (d1 (calendar-absolute-from-gregorian (list month 1 year)))
105476
e3bdbd8a2169 Matthew Junker <matthew.junker at sbcglobal.net> (tiny change)
Glenn Morris <rgm@gnu.org>
parents: 102591
diff changeset
513 (d2 (progn
e3bdbd8a2169 Matthew Junker <matthew.junker at sbcglobal.net> (tiny change)
Glenn Morris <rgm@gnu.org>
parents: 102591
diff changeset
514 (calendar-increment-month end-month end-year (1- n))
e3bdbd8a2169 Matthew Junker <matthew.junker at sbcglobal.net> (tiny change)
Glenn Morris <rgm@gnu.org>
parents: 102591
diff changeset
515 (calendar-absolute-from-gregorian
e3bdbd8a2169 Matthew Junker <matthew.junker at sbcglobal.net> (tiny change)
Glenn Morris <rgm@gnu.org>
parents: 102591
diff changeset
516 (list end-month
e3bdbd8a2169 Matthew Junker <matthew.junker at sbcglobal.net> (tiny change)
Glenn Morris <rgm@gnu.org>
parents: 102591
diff changeset
517 (calendar-last-day-of-month end-month end-year)
e3bdbd8a2169 Matthew Junker <matthew.junker at sbcglobal.net> (tiny change)
Glenn Morris <rgm@gnu.org>
parents: 102591
diff changeset
518 end-year))))
e3bdbd8a2169 Matthew Junker <matthew.junker at sbcglobal.net> (tiny change)
Glenn Morris <rgm@gnu.org>
parents: 102591
diff changeset
519 (diary-list (if cal-tex-diary (cal-tex-list-diary-entries d1 d2)))
109325
d916e52744cb cal-tex.el fixes for calendar-week-start-day != 0.
Glenn Morris <rgm@gnu.org>
parents: 107517
diff changeset
520 (holidays (if cal-tex-holidays (cal-tex-list-holidays d1 d2))))
93488
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
521 (cal-tex-insert-preamble (cal-tex-number-weeks month year n) nil "12pt")
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
522 (if (> n 1)
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
523 (cal-tex-cmd cal-tex-cal-multi-month)
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
524 (cal-tex-cmd cal-tex-cal-one-month))
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
525 (cal-tex-insert-month-header n month year end-month end-year)
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
526 (cal-tex-insert-day-names)
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
527 (cal-tex-nl ".2cm")
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
528 (cal-tex-insert-blank-days month year cal-tex-day-prefix)
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
529 (dotimes (idummy n)
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
530 (cal-tex-insert-days month year diary-list holidays cal-tex-day-prefix)
109325
d916e52744cb cal-tex.el fixes for calendar-week-start-day != 0.
Glenn Morris <rgm@gnu.org>
parents: 107517
diff changeset
531 (when (= (calendar-week-end-day)
d916e52744cb cal-tex.el fixes for calendar-week-start-day != 0.
Glenn Morris <rgm@gnu.org>
parents: 107517
diff changeset
532 (calendar-day-of-week
d916e52744cb cal-tex.el fixes for calendar-week-start-day != 0.
Glenn Morris <rgm@gnu.org>
parents: 107517
diff changeset
533 (list month
d916e52744cb cal-tex.el fixes for calendar-week-start-day != 0.
Glenn Morris <rgm@gnu.org>
parents: 107517
diff changeset
534 (calendar-last-day-of-month month year)
d916e52744cb cal-tex.el fixes for calendar-week-start-day != 0.
Glenn Morris <rgm@gnu.org>
parents: 107517
diff changeset
535 year))) ; last day of month was last day of week
93488
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
536 (cal-tex-hfill)
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
537 (cal-tex-nl))
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
538 (calendar-increment-month month year 1))
93488
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
539 (cal-tex-insert-blank-days-at-end end-month end-year cal-tex-day-prefix))
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
540 (cal-tex-end-document)
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
541 (run-hooks 'cal-tex-hook))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
542
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 44368
diff changeset
543 (defun cal-tex-insert-days (month year diary-list holidays day-format)
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
544 "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
545 LaTeX commands are inserted for the days of the MONTH in YEAR.
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
546 Diary entries on DIARY-LIST are included. Holidays on HOLIDAYS
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
547 are included. Each day is formatted using format DAY-FORMAT."
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
548 (let ((blank-days ; at start of month
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
549 (mod
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
550 (- (calendar-day-of-week (list month 1 year))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
551 calendar-week-start-day)
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
552 7))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
553 (last (calendar-last-day-of-month month year))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
554 date j)
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
555 (dotimes (i last)
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
556 (setq j (1+ i) ; 1-last, incl
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
557 date (list month j year))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
558 (when (memq (calendar-day-of-week date) cal-tex-which-days)
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
559 (insert (format day-format (cal-tex-month-name month) j))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
560 (cal-tex-arg (cal-tex-latexify-list diary-list date))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
561 (cal-tex-arg (cal-tex-latexify-list holidays date))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
562 (cal-tex-arg (eval cal-tex-daily-string))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
563 (cal-tex-arg)
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
564 (cal-tex-comment))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
565 (when (and (zerop (mod (+ j blank-days) 7))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
566 (/= j last))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
567 (cal-tex-hfill)
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
568 (cal-tex-nl)))))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
569
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
570 (defun cal-tex-insert-day-names ()
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
571 "Insert the names of the days at top of a monthly calendar."
109325
d916e52744cb cal-tex.el fixes for calendar-week-start-day != 0.
Glenn Morris <rgm@gnu.org>
parents: 107517
diff changeset
572 (let (j)
d916e52744cb cal-tex.el fixes for calendar-week-start-day != 0.
Glenn Morris <rgm@gnu.org>
parents: 107517
diff changeset
573 (dotimes (i 7)
d916e52744cb cal-tex.el fixes for calendar-week-start-day != 0.
Glenn Morris <rgm@gnu.org>
parents: 107517
diff changeset
574 (if (memq (setq j (mod (+ calendar-week-start-day i) 7))
d916e52744cb cal-tex.el fixes for calendar-week-start-day != 0.
Glenn Morris <rgm@gnu.org>
parents: 107517
diff changeset
575 cal-tex-which-days)
d916e52744cb cal-tex.el fixes for calendar-week-start-day != 0.
Glenn Morris <rgm@gnu.org>
parents: 107517
diff changeset
576 (insert (format cal-tex-day-name-format
d916e52744cb cal-tex.el fixes for calendar-week-start-day != 0.
Glenn Morris <rgm@gnu.org>
parents: 107517
diff changeset
577 (cal-tex-LaTeXify-string
d916e52744cb cal-tex.el fixes for calendar-week-start-day != 0.
Glenn Morris <rgm@gnu.org>
parents: 107517
diff changeset
578 (aref calendar-day-name-array j)))))
d916e52744cb cal-tex.el fixes for calendar-week-start-day != 0.
Glenn Morris <rgm@gnu.org>
parents: 107517
diff changeset
579 (cal-tex-comment))))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
580
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
581 (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
582 "Create a title for a calendar.
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 44368
diff changeset
583 A title is inserted for a calendar with N months starting with
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
584 MONTH YEAR and ending with END-MONTH END-YEAR."
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
585 (let ((month-name (cal-tex-month-name month))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
586 (end-month-name (cal-tex-month-name end-month)))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
587 (if (= 1 n)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
588 (insert (format "\\calmonth{%s}{%s}\n\\vspace*{-0.5cm}"
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
589 month-name year) )
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
590 (insert (format "\\calmonth{%s}{%s}{%s}{%s}\n\\vspace*{-0.5cm}"
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
591 month-name year end-month-name end-year))))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
592 (cal-tex-comment))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
593
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
594 (defun cal-tex-insert-blank-days (month year day-format)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
595 "Insert code for initial days not in calendar.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
596 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
597 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
598 blank, no days are inserted."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
599 (if (cal-tex-first-blank-p month year)
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
600 (let ((blank-days ; at start of month
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
601 (mod
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
602 (- (calendar-day-of-week (list month 1 year))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
603 calendar-week-start-day)
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
604 7)))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
605 (dotimes (i blank-days)
109325
d916e52744cb cal-tex.el fixes for calendar-week-start-day != 0.
Glenn Morris <rgm@gnu.org>
parents: 107517
diff changeset
606 (if (memq (mod (+ calendar-week-start-day i) 7) cal-tex-which-days)
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
607 (insert (format day-format " " " ") "{}{}{}{}%\n"))))))
13195
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 (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
610 "Insert code for final days not in calendar.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
611 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
612 The entry is formatted using DAY-FORMAT."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
613 (if (cal-tex-last-blank-p month year)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
614 (let* ((last-day (calendar-last-day-of-month month year))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
615 (blank-days ; at end of month
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
616 (mod
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
617 (- (calendar-day-of-week (list month last-day year))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
618 calendar-week-start-day)
93524
6076b35285b8 (cal-tex-insert-blank-days-at-end, cal-tex-last-blank-p)
Glenn Morris <rgm@gnu.org>
parents: 93488
diff changeset
619 7))
6076b35285b8 (cal-tex-insert-blank-days-at-end, cal-tex-last-blank-p)
Glenn Morris <rgm@gnu.org>
parents: 93488
diff changeset
620 (i blank-days))
6076b35285b8 (cal-tex-insert-blank-days-at-end, cal-tex-last-blank-p)
Glenn Morris <rgm@gnu.org>
parents: 93488
diff changeset
621 (while (<= (setq i (1+ i)) 6)
109325
d916e52744cb cal-tex.el fixes for calendar-week-start-day != 0.
Glenn Morris <rgm@gnu.org>
parents: 107517
diff changeset
622 (if (memq (mod (+ calendar-week-start-day i) 7) cal-tex-which-days)
93524
6076b35285b8 (cal-tex-insert-blank-days-at-end, cal-tex-last-blank-p)
Glenn Morris <rgm@gnu.org>
parents: 93488
diff changeset
623 (insert (format day-format "" "") "{}{}{}{}%\n"))))))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
624
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
625 (defun cal-tex-first-blank-p (month year)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
626 "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
627 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
628 in the calendar starting in MONTH YEAR."
109325
d916e52744cb cal-tex.el fixes for calendar-week-start-day != 0.
Glenn Morris <rgm@gnu.org>
parents: 107517
diff changeset
629 ;; Check days 1-7 of the month, until we find the last day of the week.
d916e52744cb cal-tex.el fixes for calendar-week-start-day != 0.
Glenn Morris <rgm@gnu.org>
parents: 107517
diff changeset
630 (catch 'found
d916e52744cb cal-tex.el fixes for calendar-week-start-day != 0.
Glenn Morris <rgm@gnu.org>
parents: 107517
diff changeset
631 (let (dow)
d916e52744cb cal-tex.el fixes for calendar-week-start-day != 0.
Glenn Morris <rgm@gnu.org>
parents: 107517
diff changeset
632 (dotimes (i 7)
d916e52744cb cal-tex.el fixes for calendar-week-start-day != 0.
Glenn Morris <rgm@gnu.org>
parents: 107517
diff changeset
633 (if (memq (setq dow (calendar-day-of-week (list month (1+ i) year)))
d916e52744cb cal-tex.el fixes for calendar-week-start-day != 0.
Glenn Morris <rgm@gnu.org>
parents: 107517
diff changeset
634 cal-tex-which-days)
d916e52744cb cal-tex.el fixes for calendar-week-start-day != 0.
Glenn Morris <rgm@gnu.org>
parents: 107517
diff changeset
635 (throw 'found t)
d916e52744cb cal-tex.el fixes for calendar-week-start-day != 0.
Glenn Morris <rgm@gnu.org>
parents: 107517
diff changeset
636 (if (= dow (calendar-week-end-day)) (throw 'found nil)))))))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
637
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
638 (defun cal-tex-last-blank-p (month year)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
639 "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
640 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
641 in the calendar starting in MONTH YEAR."
109325
d916e52744cb cal-tex.el fixes for calendar-week-start-day != 0.
Glenn Morris <rgm@gnu.org>
parents: 107517
diff changeset
642 ;; Check backwards from the last day of the month, until we find the
d916e52744cb cal-tex.el fixes for calendar-week-start-day != 0.
Glenn Morris <rgm@gnu.org>
parents: 107517
diff changeset
643 ;; start of the last week in the month.
d916e52744cb cal-tex.el fixes for calendar-week-start-day != 0.
Glenn Morris <rgm@gnu.org>
parents: 107517
diff changeset
644 (catch 'found
d916e52744cb cal-tex.el fixes for calendar-week-start-day != 0.
Glenn Morris <rgm@gnu.org>
parents: 107517
diff changeset
645 (let ((last-day (calendar-last-day-of-month month year))
d916e52744cb cal-tex.el fixes for calendar-week-start-day != 0.
Glenn Morris <rgm@gnu.org>
parents: 107517
diff changeset
646 day dow)
d916e52744cb cal-tex.el fixes for calendar-week-start-day != 0.
Glenn Morris <rgm@gnu.org>
parents: 107517
diff changeset
647 (dotimes (i 7)
d916e52744cb cal-tex.el fixes for calendar-week-start-day != 0.
Glenn Morris <rgm@gnu.org>
parents: 107517
diff changeset
648 (if (memq (setq dow (calendar-day-of-week
d916e52744cb cal-tex.el fixes for calendar-week-start-day != 0.
Glenn Morris <rgm@gnu.org>
parents: 107517
diff changeset
649 (list month (- last-day i) year)))
d916e52744cb cal-tex.el fixes for calendar-week-start-day != 0.
Glenn Morris <rgm@gnu.org>
parents: 107517
diff changeset
650 cal-tex-which-days)
d916e52744cb cal-tex.el fixes for calendar-week-start-day != 0.
Glenn Morris <rgm@gnu.org>
parents: 107517
diff changeset
651 (throw 'found t)
d916e52744cb cal-tex.el fixes for calendar-week-start-day != 0.
Glenn Morris <rgm@gnu.org>
parents: 107517
diff changeset
652 (if (= dow calendar-week-start-day) (throw 'found nil)))))))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
653
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
654 (defun cal-tex-number-weeks (month year n)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
655 "Determine the number of weeks in a range of dates.
107517
ed16fdd2685a Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
656 Compute the number of weeks in the calendar starting with MONTH and YEAR,
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
657 and lasting N months, including only the days in WHICH-DAYS. As it stands,
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
658 this is only an upper bound."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
659 (let ((d (list month 1 year)))
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
660 (calendar-increment-month month year (1- n))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
661 (/ (- (calendar-dayname-on-or-before
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
662 calendar-week-start-day
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
663 (+ 7 (calendar-absolute-from-gregorian
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
664 (list month (calendar-last-day-of-month month year) year))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
665 (calendar-dayname-on-or-before
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
666 calendar-week-start-day
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
667 (calendar-absolute-from-gregorian d)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
668 7)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
669
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
670 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
671 ;;; Weekly calendars
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
672 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
673
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
674 (defconst cal-tex-LaTeX-hourbox
52114
48c133ab94d7 (cal-tex-day-name-format): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
675 "\\newcommand{\\hourbox}[2]%
48c133ab94d7 (cal-tex-day-name-format): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
676 {\\makebox[2em]{\\rule{0cm}{#2ex}#1}\\rule{3in}{.15mm}}\n"
48c133ab94d7 (cal-tex-day-name-format): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
677 "One hour and a line on the right.")
48c133ab94d7 (cal-tex-day-name-format): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
678
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
679 ;; TODO cal-tex-diary-support.
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
680 ;; TODO respect cal-tex-daily-start,end (see cal-tex-week-hours).
92838
26dc958b293b (calendar-holiday-list, diary-list-entries, calendar-iso-from-absolute):
Glenn Morris <rgm@gnu.org>
parents: 92592
diff changeset
681 ;;;###cal-autoload
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
682 (defun cal-tex-cursor-week (&optional n event)
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
683 "Make a LaTeX calendar buffer for a two-page one-week calendar.
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
684 It applies to the week that point is in. The optional prefix
107517
ed16fdd2685a Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
685 argument N specifies number of weeks (default 1). The calendar
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
686 shows holidays if `cal-tex-holidays' is non-nil (note that diary
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
687 entries are not shown). The calendar shows the hours 8-12am, 1-5pm."
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
688 (interactive (list (prefix-numeric-value current-prefix-arg)
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
689 last-nonmenu-event))
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
690 (or n (setq n 1))
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
691 (let* ((date (calendar-gregorian-from-absolute
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
692 (calendar-dayname-on-or-before
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
693 calendar-week-start-day
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
694 (calendar-absolute-from-gregorian
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
695 (calendar-cursor-to-date t event)))))
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
696 (month (calendar-extract-month date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
697 (year (calendar-extract-year date))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
698 (d1 (calendar-absolute-from-gregorian date))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
699 (d2 (+ (* 7 n) d1))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
700 (holidays (if cal-tex-holidays
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
701 (cal-tex-list-holidays d1 d2))))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
702 (cal-tex-preamble "11pt")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
703 (cal-tex-cmd "\\textwidth 6.5in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
704 (cal-tex-cmd "\\textheight 10.5in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
705 (cal-tex-cmd "\\oddsidemargin 0in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
706 (cal-tex-cmd "\\evensidemargin 0in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
707 (insert cal-tex-LaTeX-hourbox)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
708 (cal-tex-b-document)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
709 (cal-tex-cmd "\\pagestyle{empty}")
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
710 (dotimes (i n)
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
711 (cal-tex-vspace "-1.5in")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
712 (cal-tex-b-center)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
713 (cal-tex-Huge-bf (format "\\uppercase{%s}"
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
714 (cal-tex-month-name month)))
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
715 (cal-tex-hspace "2em")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
716 (cal-tex-Huge-bf (number-to-string year))
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
717 (cal-tex-nl ".5cm")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
718 (cal-tex-e-center)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
719 (cal-tex-hspace "-.2in")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
720 (cal-tex-b-parbox "l" "7in")
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
721 (dotimes (jdummy 7)
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
722 (cal-tex-week-hours date holidays "3.1")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
723 (setq date (cal-tex-incr-date date)))
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
724 (cal-tex-e-parbox)
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
725 (setq month (calendar-extract-month date)
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
726 year (calendar-extract-year date))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
727 (unless (= i (1- n))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
728 (run-hooks 'cal-tex-week-hook)
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
729 (cal-tex-newpage)))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
730 (cal-tex-end-document)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
731 (run-hooks 'cal-tex-hook)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
732
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
733 ;; TODO cal-tex-diary support.
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
734 ;; TODO respect cal-tex-daily-start,end (see cal-tex-week-hours).
92838
26dc958b293b (calendar-holiday-list, diary-list-entries, calendar-iso-from-absolute):
Glenn Morris <rgm@gnu.org>
parents: 92592
diff changeset
735 ;;;###cal-autoload
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
736 (defun cal-tex-cursor-week2 (&optional n event)
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
737 "Make a LaTeX calendar buffer for a two-page one-week calendar.
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
738 It applies to the week that point is in. Optional prefix
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
739 argument N specifies number of weeks (default 1). The calendar
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
740 shows holidays if `cal-tex-holidays' is non-nil (note that diary
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
741 entries are not shown). The calendar shows the hours 8-12am, 1-5pm.
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
742 Optional EVENT indicates a buffer position to use instead of point."
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
743 (interactive (list (prefix-numeric-value current-prefix-arg)
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
744 last-nonmenu-event))
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
745 (or n (setq n 1))
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
746 (let* ((date (calendar-gregorian-from-absolute
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
747 (calendar-dayname-on-or-before
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
748 calendar-week-start-day
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
749 (calendar-absolute-from-gregorian
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
750 (calendar-cursor-to-date t event)))))
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
751 (month (calendar-extract-month date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
752 (year (calendar-extract-year date))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
753 (d date)
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
754 (d1 (calendar-absolute-from-gregorian date))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
755 (d2 (+ (* 7 n) d1))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
756 (holidays (if cal-tex-holidays
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
757 (cal-tex-list-holidays d1 d2))))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
758 (cal-tex-preamble "12pt")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
759 (cal-tex-cmd "\\textwidth 6.5in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
760 (cal-tex-cmd "\\textheight 10.5in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
761 (cal-tex-cmd "\\oddsidemargin 0in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
762 (cal-tex-cmd "\\evensidemargin 0in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
763 (insert cal-tex-LaTeX-hourbox)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
764 (cal-tex-b-document)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
765 (cal-tex-cmd "\\pagestyle{empty}")
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
766 (dotimes (i n)
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
767 (cal-tex-vspace "-1.5in")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
768 (cal-tex-b-center)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
769 (cal-tex-Huge-bf (format "\\uppercase{%s}"
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
770 (cal-tex-month-name month)))
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
771 (cal-tex-hspace "2em")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
772 (cal-tex-Huge-bf (number-to-string year))
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
773 (cal-tex-nl ".5cm")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
774 (cal-tex-e-center)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
775 (cal-tex-hspace "-.2in")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
776 (cal-tex-b-parbox "l" "\\textwidth")
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
777 (dotimes (jdummy 3)
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
778 (cal-tex-week-hours date holidays "5")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
779 (setq date (cal-tex-incr-date date)))
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
780 (cal-tex-e-parbox)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
781 (cal-tex-nl)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
782 (insert (cal-tex-mini-calendar
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
783 (calendar-extract-month (cal-tex-previous-month date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
784 (calendar-extract-year (cal-tex-previous-month date))
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
785 "lastmonth" "1.1in" "1in"))
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
786 (insert (cal-tex-mini-calendar
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
787 (calendar-extract-month date)
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
788 (calendar-extract-year date)
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
789 "thismonth" "1.1in" "1in"))
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
790 (insert (cal-tex-mini-calendar
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
791 (calendar-extract-month (cal-tex-next-month date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
792 (calendar-extract-year (cal-tex-next-month date))
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
793 "nextmonth" "1.1in" "1in"))
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
794 (insert "\\hbox to \\textwidth{")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
795 (cal-tex-hfill)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
796 (insert "\\lastmonth")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
797 (cal-tex-hfill)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
798 (insert "\\thismonth")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
799 (cal-tex-hfill)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
800 (insert "\\nextmonth")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
801 (cal-tex-hfill)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
802 (insert "}")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
803 (cal-tex-nl)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
804 (cal-tex-b-parbox "l" "\\textwidth")
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
805 (dotimes (jdummy 4)
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
806 (cal-tex-week-hours date holidays "5")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
807 (setq date (cal-tex-incr-date date)))
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
808 (cal-tex-e-parbox)
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
809 (setq month (calendar-extract-month date)
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
810 year (calendar-extract-year date))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
811 (unless (= i (1- n))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
812 (run-hooks 'cal-tex-week-hook)
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
813 (cal-tex-newpage)))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
814 (cal-tex-end-document)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
815 (run-hooks 'cal-tex-hook)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
816
92838
26dc958b293b (calendar-holiday-list, diary-list-entries, calendar-iso-from-absolute):
Glenn Morris <rgm@gnu.org>
parents: 92592
diff changeset
817 (autoload 'calendar-iso-from-absolute "cal-iso")
26dc958b293b (calendar-holiday-list, diary-list-entries, calendar-iso-from-absolute):
Glenn Morris <rgm@gnu.org>
parents: 92592
diff changeset
818
26dc958b293b (calendar-holiday-list, diary-list-entries, calendar-iso-from-absolute):
Glenn Morris <rgm@gnu.org>
parents: 92592
diff changeset
819 ;;;###cal-autoload
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
820 (defun cal-tex-cursor-week-iso (&optional n event)
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
821 "Make a LaTeX calendar buffer for a one page ISO-style weekly calendar.
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
822 Optional prefix argument N specifies number of weeks (default 1).
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
823 The calendar shows holiday and diary entries if
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
824 `cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil.
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
825 It does not show hours of the day. Optional EVENT indicates a buffer
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
826 position to use instead of point."
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
827 (interactive (list (prefix-numeric-value current-prefix-arg)
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
828 last-nonmenu-event))
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
829 (or n (setq n 1))
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
830 (let* ((date (calendar-gregorian-from-absolute
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
831 (calendar-dayname-on-or-before
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
832 1
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
833 (calendar-absolute-from-gregorian
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
834 (calendar-cursor-to-date t event)))))
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
835 (month (calendar-extract-month date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
836 (year (calendar-extract-year date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
837 (day (calendar-extract-day date))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
838 (d1 (calendar-absolute-from-gregorian date))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
839 (d2 (+ (* 7 n) d1))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
840 (holidays (if cal-tex-holidays
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
841 (cal-tex-list-holidays d1 d2)))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
842 (diary-list (if cal-tex-diary
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
843 (cal-tex-list-diary-entries
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
844 ;; FIXME d1?
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
845 (calendar-absolute-from-gregorian (list month 1 year))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
846 d2)))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
847 s)
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
848 (cal-tex-preamble "11pt")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
849 (cal-tex-cmd "\\textwidth 6.5in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
850 (cal-tex-cmd "\\textheight 10.5in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
851 (cal-tex-cmd "\\oddsidemargin 0in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
852 (cal-tex-cmd "\\evensidemargin 0in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
853 (cal-tex-b-document)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
854 (cal-tex-cmd "\\pagestyle{empty}")
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
855 (dotimes (i n)
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
856 (cal-tex-vspace "-1.5in")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
857 (cal-tex-b-center)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
858 (cal-tex-Huge-bf
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
859 (let ((d (calendar-iso-from-absolute
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
860 (calendar-absolute-from-gregorian date))))
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
861 (format "Week %d of %d"
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
862 (calendar-extract-month d)
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
863 (calendar-extract-year d))))
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
864 (cal-tex-nl ".5cm")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
865 (cal-tex-e-center)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
866 (cal-tex-b-parbox "l" "\\textwidth")
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
867 (dotimes (j 7)
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
868 (cal-tex-b-parbox "t" "\\textwidth")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
869 (cal-tex-b-parbox "t" "\\textwidth")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
870 (cal-tex-rule "0pt" "\\textwidth" ".2mm")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
871 (cal-tex-nl)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
872 (cal-tex-b-parbox "t" "\\textwidth")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
873 (cal-tex-large-bf (cal-tex-LaTeXify-string (calendar-day-name date)))
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
874 (insert ", ")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
875 (cal-tex-large-bf (cal-tex-month-name month))
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
876 (insert " ")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
877 (cal-tex-large-bf (number-to-string day))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
878 (unless (string-equal "" (setq s (cal-tex-latexify-list
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
879 holidays date "; ")))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
880 (insert ": ")
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
881 (cal-tex-large-bf s))
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
882 (cal-tex-hfill)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
883 (insert " " (eval cal-tex-daily-string))
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
884 (cal-tex-e-parbox)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
885 (cal-tex-nl)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
886 (cal-tex-noindent)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
887 (cal-tex-b-parbox "t" "\\textwidth")
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
888 (unless (string-equal "" (setq s (cal-tex-latexify-list
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
889 diary-list date)))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
890 (insert "\\vbox to 0pt{")
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
891 (cal-tex-large-bf s)
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
892 (insert "}"))
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
893 (cal-tex-e-parbox)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
894 (cal-tex-nl)
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
895 (setq date (cal-tex-incr-date date)
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
896 month (calendar-extract-month date)
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
897 day (calendar-extract-day date))
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
898 (cal-tex-e-parbox)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
899 (cal-tex-e-parbox "2cm")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
900 (cal-tex-nl)
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
901 (setq month (calendar-extract-month date)
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
902 year (calendar-extract-year date)))
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
903 (cal-tex-e-parbox)
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
904 (unless (= i (1- n))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
905 (run-hooks 'cal-tex-week-hook)
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
906 (cal-tex-newpage)))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
907 (cal-tex-end-document)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
908 (run-hooks 'cal-tex-hook)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
909
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
910 ;; TODO respect cal-tex-daily-start,end?
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
911 ;; Using different numbers of hours will probably break some layouts.
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
912 (defun cal-tex-week-hours (date holidays height)
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
913 "Insert hourly entries for DATE with HOLIDAYS, with line height HEIGHT.
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
914 Uses the 24-hour clock if `cal-tex-24' is non-nil. Note that the hours
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
915 shown are hard-coded to 8-12, 13-17."
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
916 (let ((month (calendar-extract-month date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
917 (day (calendar-extract-day date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
918 (year (calendar-extract-year date))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
919 morning afternoon s)
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
920 (cal-tex-comment "begin cal-tex-week-hours")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
921 (cal-tex-cmd "\\ \\\\[-.2cm]")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
922 (cal-tex-cmd "\\noindent")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
923 (cal-tex-b-parbox "l" "6.8in")
44368
ceb605d3c4dd (cal-tex-hook, cal-tex-year-hook, cal-tex-month-hook)
Richard M. Stallman <rms@gnu.org>
parents: 38422
diff changeset
924 (cal-tex-large-bf (cal-tex-LaTeXify-string (calendar-day-name date)))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
925 (insert ", ")
44368
ceb605d3c4dd (cal-tex-hook, cal-tex-year-hook, cal-tex-month-hook)
Richard M. Stallman <rms@gnu.org>
parents: 38422
diff changeset
926 (cal-tex-large-bf (cal-tex-month-name month))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
927 (insert " ")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
928 (cal-tex-large-bf (number-to-string day))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
929 (unless (string-equal "" (setq s (cal-tex-latexify-list
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
930 holidays date "; ")))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
931 (insert ": ")
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
932 (cal-tex-large-bf s))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
933 (cal-tex-hfill)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
934 (insert " " (eval cal-tex-daily-string))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
935 (cal-tex-e-parbox)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
936 (cal-tex-nl "-.3cm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
937 (cal-tex-rule "0pt" "6.8in" ".2mm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
938 (cal-tex-nl "-.1cm")
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
939 (dotimes (i 5)
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
940 (setq morning (+ i 8) ; 8-12 incl
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
941 afternoon (if cal-tex-24
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
942 (+ i 13) ; 13-17 incl
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
943 (1+ i))) ; 1-5 incl
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
944 (cal-tex-cmd "\\hourbox" (number-to-string morning))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
945 (cal-tex-arg height)
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
946 (cal-tex-hspace ".4cm")
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
947 (cal-tex-cmd "\\hourbox" (number-to-string afternoon))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
948 (cal-tex-arg height)
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
949 (cal-tex-nl))))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
950
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
951 ;; TODO cal-tex-diary support.
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
952 ;; TODO respect cal-tex-daily-start,end (see cal-tex-weekly4-box).
92838
26dc958b293b (calendar-holiday-list, diary-list-entries, calendar-iso-from-absolute):
Glenn Morris <rgm@gnu.org>
parents: 92592
diff changeset
953 ;;;###cal-autoload
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
954 (defun cal-tex-cursor-week-monday (&optional n event)
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
955 "Make a LaTeX calendar buffer for a two-page one-week calendar.
13595
2af9ec0bc9cc (cal-tex-version): Deleted.
Richard M. Stallman <rms@gnu.org>
parents: 13206
diff changeset
956 It applies to the week that point is in, and starts on Monday.
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
957 Optional prefix argument N specifies number of weeks (default 1).
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
958 The calendar shows holidays if `cal-tex-holidays' is
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
959 non-nil (note that diary entries are not shown). The calendar shows
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
960 the hours 8-12am, 1-5pm. Optional EVENT indicates a buffer position
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
961 to use instead of point."
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
962 (interactive (list (prefix-numeric-value current-prefix-arg)
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
963 last-nonmenu-event))
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
964 (or n (setq n 1))
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
965 (let ((date (calendar-gregorian-from-absolute
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
966 (calendar-dayname-on-or-before
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
967 0
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
968 (calendar-absolute-from-gregorian
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
969 (calendar-cursor-to-date t event))))))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
970 (cal-tex-preamble "11pt")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
971 (cal-tex-cmd "\\textwidth 6.5in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
972 (cal-tex-cmd "\\textheight 10.5in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
973 (cal-tex-cmd "\\oddsidemargin 0in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
974 (cal-tex-cmd "\\evensidemargin 0in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
975 (cal-tex-b-document)
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
976 (dotimes (i n)
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
977 (cal-tex-vspace "-1cm")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
978 (insert "\\noindent ")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
979 (cal-tex-weekly4-box (cal-tex-incr-date date) nil)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
980 (cal-tex-weekly4-box (cal-tex-incr-date date 4) nil)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
981 (cal-tex-nl ".2cm")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
982 (cal-tex-weekly4-box (cal-tex-incr-date date 2) nil)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
983 (cal-tex-weekly4-box (cal-tex-incr-date date 5) nil)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
984 (cal-tex-nl ".2cm")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
985 (cal-tex-weekly4-box (cal-tex-incr-date date 3) nil)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
986 (cal-tex-weekly4-box (cal-tex-incr-date date 6) t)
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
987 (unless (= i (1- n))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
988 (run-hooks 'cal-tex-week-hook)
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
989 (setq date (cal-tex-incr-date date 7))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
990 (cal-tex-newpage)))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
991 (cal-tex-end-document)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
992 (run-hooks 'cal-tex-hook)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
993
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
994 ;; TODO respect cal-tex-daily-start,end?
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
995 ;; Using different numbers of hours will probably break some layouts.
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
996 (defun cal-tex-weekly4-box (date weekend)
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
997 "Make one box for DATE, different if WEEKEND.
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
998 Uses the 24-hour clock if `cal-tex-24' is non-nil. Note that the hours
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
999 shown are hard-coded to 8-12, 13-17."
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1000 (let* ((day (calendar-extract-day date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1001 (month (calendar-extract-month date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1002 (year (calendar-extract-year date))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1003 (dayname (cal-tex-LaTeXify-string (calendar-day-name date)))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1004 (date1 (cal-tex-incr-date date))
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1005 (day1 (calendar-extract-day date1))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1006 (month1 (calendar-extract-month date1))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1007 (year1 (calendar-extract-year date1))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1008 (dayname1 (cal-tex-LaTeXify-string (calendar-day-name date1))))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1009 (cal-tex-b-framebox "8cm" "l")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1010 (cal-tex-b-parbox "b" "7.5cm")
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1011 (insert (format "\\textbf{\\Large %s,} %s/%s/%s\\\\\n"
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1012 dayname month day year))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1013 (cal-tex-rule "0pt" "7.5cm" ".5mm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1014 (cal-tex-nl)
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1015 (unless weekend
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1016 (dotimes (i 5)
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1017 (insert (format "\\textsf{\\large %d}\\\\\n" (+ i 8))))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1018 (dotimes (i 5)
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1019 (insert (format "\\textsf{\\large %d}\\\\\n"
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1020 (if cal-tex-24
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1021 (+ i 13) ; 13-17 incl
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1022 (1+ i)))))) ; 1-5 incl
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1023 (cal-tex-nl ".5cm")
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1024 (when weekend
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1025 (cal-tex-vspace "1cm")
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1026 (insert "\\ \\vfill")
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1027 (insert (format "\\textbf{\\Large %s,} %s/%s/%s\\\\\n"
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1028 dayname1 month1 day1 year1))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1029 (cal-tex-rule "0pt" "7.5cm" ".5mm")
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1030 (cal-tex-nl "1.5cm")
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1031 (cal-tex-vspace "1cm"))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1032 (cal-tex-e-parbox)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1033 (cal-tex-e-framebox)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1034 (cal-tex-hspace "1cm")))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1035
92838
26dc958b293b (calendar-holiday-list, diary-list-entries, calendar-iso-from-absolute):
Glenn Morris <rgm@gnu.org>
parents: 92592
diff changeset
1036 ;;;###cal-autoload
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
1037 (defun cal-tex-cursor-filofax-2week (&optional n event)
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1038 "Two-weeks-at-a-glance Filofax style calendar for week cursor is in.
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
1039 Optional prefix argument N specifies number of weeks (default 1).
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1040 The calendar shows holiday and diary entries if
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
1041 `cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil.
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
1042 Optional EVENT indicates a buffer position to use instead of point."
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
1043 (interactive (list (prefix-numeric-value current-prefix-arg)
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
1044 last-nonmenu-event))
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
1045 (or n (setq n 1))
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
1046 (let* ((date (calendar-gregorian-from-absolute
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1047 (calendar-dayname-on-or-before
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1048 calendar-week-start-day
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1049 (calendar-absolute-from-gregorian
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
1050 (calendar-cursor-to-date t event)))))
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1051 (month (calendar-extract-month date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1052 (year (calendar-extract-year date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1053 (day (calendar-extract-day date))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1054 (d1 (calendar-absolute-from-gregorian date))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1055 (d2 (+ (* 7 n) d1))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1056 (holidays (if cal-tex-holidays
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1057 (cal-tex-list-holidays d1 d2)))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1058 (diary-list (if cal-tex-diary
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1059 (cal-tex-list-diary-entries
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1060 ;; FIXME d1?
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1061 (calendar-absolute-from-gregorian (list month 1 year))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1062 d2))))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1063 (cal-tex-preamble "twoside")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1064 (cal-tex-cmd "\\textwidth 3.25in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1065 (cal-tex-cmd "\\textheight 6.5in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1066 (cal-tex-cmd "\\oddsidemargin 1.75in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1067 (cal-tex-cmd "\\evensidemargin 1.5in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1068 (cal-tex-cmd "\\topmargin 0pt")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1069 (cal-tex-cmd "\\headheight -0.875in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1070 (cal-tex-cmd "\\headsep 0.125in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1071 (cal-tex-cmd "\\footskip .125in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1072 (insert "\\def\\righthead#1{\\hfill {\\normalsize \\bf #1}\\\\[-6pt]}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1073 \\long\\def\\rightday#1#2#3#4#5{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1074 \\rule{\\textwidth}{0.3pt}\\\\%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1075 \\hbox to \\textwidth{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1076 \\vbox to 0.7in{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1077 \\vspace*{2pt}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1078 \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1079 \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em #4}}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1080 \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1081 \\def\\lefthead#1{\\noindent {\\normalsize \\bf #1}\\hfill\\\\[-6pt]}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1082 \\long\\def\\leftday#1#2#3#4#5{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1083 \\rule{\\textwidth}{0.3pt}\\\\%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1084 \\hbox to \\textwidth{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1085 \\vbox to 0.7in{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1086 \\vspace*{2pt}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1087 \\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
1088 \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize \\em #4}}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1089 \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1090 ")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1091 (cal-tex-b-document)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1092 (cal-tex-cmd "\\pagestyle{empty}")
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1093 (dotimes (i n)
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1094 (if (zerop (mod i 2))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1095 (insert "\\righthead")
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1096 (insert "\\lefthead"))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1097 (cal-tex-arg
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1098 (let ((d (cal-tex-incr-date date 6)))
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1099 (if (= (calendar-extract-month date)
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1100 (calendar-extract-month d))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1101 (format "%s %s"
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1102 (cal-tex-month-name (calendar-extract-month date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1103 (calendar-extract-year date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1104 (if (= (calendar-extract-year date)
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1105 (calendar-extract-year d))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1106 (format "%s---%s %s"
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1107 (cal-tex-month-name (calendar-extract-month date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1108 (cal-tex-month-name (calendar-extract-month d))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1109 (calendar-extract-year date))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1110 (format "%s %s---%s %s"
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1111 (cal-tex-month-name (calendar-extract-month date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1112 (calendar-extract-year date)
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1113 (cal-tex-month-name (calendar-extract-month d))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1114 (calendar-extract-year d))))))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1115 (insert "%\n")
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1116 (dotimes (jdummy 7)
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1117 (if (zerop (mod i 2))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1118 (insert "\\rightday")
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1119 (insert "\\leftday"))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1120 (cal-tex-arg (cal-tex-LaTeXify-string (calendar-day-name date)))
93844
bf9ef749c23e Replace int-to-string with number-to-string.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
1121 (cal-tex-arg (number-to-string (calendar-extract-day date)))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1122 (cal-tex-arg (cal-tex-latexify-list diary-list date))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1123 (cal-tex-arg (cal-tex-latexify-list holidays date))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1124 (cal-tex-arg (eval cal-tex-daily-string))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1125 (insert "%\n")
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1126 (setq date (cal-tex-incr-date date)))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1127 (unless (= i (1- n))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1128 (run-hooks 'cal-tex-week-hook)
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1129 (cal-tex-newpage)))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1130 (cal-tex-end-document)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1131 (run-hooks 'cal-tex-hook)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1132
92838
26dc958b293b (calendar-holiday-list, diary-list-entries, calendar-iso-from-absolute):
Glenn Morris <rgm@gnu.org>
parents: 92592
diff changeset
1133 ;;;###cal-autoload
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
1134 (defun cal-tex-cursor-filofax-week (&optional n event)
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1135 "One-week-at-a-glance Filofax style calendar for week indicated by cursor.
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
1136 Optional prefix argument N specifies number of weeks (default 1),
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1137 starting on Mondays. The calendar shows holiday and diary entries
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
1138 if `cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil.
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
1139 Optional EVENT indicates a buffer position to use instead of point."
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
1140 (interactive (list (prefix-numeric-value current-prefix-arg)
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
1141 last-nonmenu-event))
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
1142 (or n (setq n 1))
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
1143 (let* ((date (calendar-gregorian-from-absolute
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1144 (calendar-dayname-on-or-before
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1145 1
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1146 (calendar-absolute-from-gregorian
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
1147 (calendar-cursor-to-date t event)))))
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1148 (month (calendar-extract-month date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1149 (year (calendar-extract-year date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1150 (day (calendar-extract-day date))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1151 (d1 (calendar-absolute-from-gregorian date))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1152 (d2 (+ (* 7 n) d1))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1153 (holidays (if cal-tex-holidays
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1154 (cal-tex-list-holidays d1 d2)))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1155 (diary-list (if cal-tex-diary
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1156 (cal-tex-list-diary-entries
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1157 ;; FIXME d1?
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1158 (calendar-absolute-from-gregorian (list month 1 year))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1159 d2))))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1160 (cal-tex-preamble "twoside")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1161 (cal-tex-cmd "\\textwidth 3.25in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1162 (cal-tex-cmd "\\textheight 6.5in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1163 (cal-tex-cmd "\\oddsidemargin 1.75in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1164 (cal-tex-cmd "\\evensidemargin 1.5in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1165 (cal-tex-cmd "\\topmargin 0pt")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1166 (cal-tex-cmd "\\headheight -0.875in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1167 (cal-tex-cmd "\\headsep 0.125in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1168 (cal-tex-cmd "\\footskip .125in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1169 (insert "\\def\\righthead#1{\\hfill {\\normalsize \\bf #1}\\\\[-6pt]}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1170 \\long\\def\\rightday#1#2#3#4#5{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1171 \\rule{\\textwidth}{0.3pt}\\\\%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1172 \\hbox to \\textwidth{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1173 \\vbox to 1.85in{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1174 \\vspace*{2pt}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1175 \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1176 \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em #4}}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1177 \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1178 \\long\\def\\weekend#1#2#3#4#5{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1179 \\rule{\\textwidth}{0.3pt}\\\\%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1180 \\hbox to \\textwidth{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1181 \\vbox to .8in{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1182 \\vspace*{2pt}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1183 \\hbox to \\textwidth{\\small #5 \\hfill #1 {\\normalsize \\bf #2}}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1184 \\hbox to \\textwidth{\\vbox {\\raggedleft \\footnotesize \\em #4}}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1185 \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1186 \\def\\lefthead#1{\\noindent {\\normalsize \\bf #1}\\hfill\\\\[-6pt]}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1187 \\long\\def\\leftday#1#2#3#4#5{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1188 \\rule{\\textwidth}{0.3pt}\\\\%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1189 \\hbox to \\textwidth{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1190 \\vbox to 1.85in{%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1191 \\vspace*{2pt}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1192 \\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
1193 \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize \\em #4}}%
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1194 \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\}
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1195 ")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1196 (cal-tex-b-document)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1197 (cal-tex-cmd "\\pagestyle{empty}\\ ")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1198 (cal-tex-newpage)
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1199 (dotimes (i n)
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1200 (insert "\\lefthead")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1201 (cal-tex-arg
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1202 (let ((d (cal-tex-incr-date date 2)))
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1203 (if (= (calendar-extract-month date)
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1204 (calendar-extract-month d))
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1205 (format "%s %s"
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1206 (cal-tex-month-name (calendar-extract-month date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1207 (calendar-extract-year date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1208 (if (= (calendar-extract-year date)
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1209 (calendar-extract-year d))
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1210 (format "%s---%s %s"
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1211 (cal-tex-month-name (calendar-extract-month date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1212 (cal-tex-month-name (calendar-extract-month d))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1213 (calendar-extract-year date))
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1214 (format "%s %s---%s %s"
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1215 (cal-tex-month-name (calendar-extract-month date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1216 (calendar-extract-year date)
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1217 (cal-tex-month-name (calendar-extract-month d))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1218 (calendar-extract-year d))))))
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1219 (insert "%\n")
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1220 (dotimes (jdummy 3)
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1221 (insert "\\leftday")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1222 (cal-tex-arg (cal-tex-LaTeXify-string (calendar-day-name date)))
93844
bf9ef749c23e Replace int-to-string with number-to-string.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
1223 (cal-tex-arg (number-to-string (calendar-extract-day date)))
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1224 (cal-tex-arg (cal-tex-latexify-list diary-list date))
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1225 (cal-tex-arg (cal-tex-latexify-list holidays date))
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1226 (cal-tex-arg (eval cal-tex-daily-string))
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1227 (insert "%\n")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1228 (setq date (cal-tex-incr-date date)))
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1229 (insert "\\noindent\\rule{\\textwidth}{0.3pt}\\\\%\n")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1230 (cal-tex-newpage)
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1231 (insert "\\righthead")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1232 (cal-tex-arg
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1233 (let ((d (cal-tex-incr-date date 3)))
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1234 (if (= (calendar-extract-month date)
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1235 (calendar-extract-month d))
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1236 (format "%s %s"
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1237 (cal-tex-month-name (calendar-extract-month date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1238 (calendar-extract-year date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1239 (if (= (calendar-extract-year date)
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1240 (calendar-extract-year d))
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1241 (format "%s---%s %s"
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1242 (cal-tex-month-name (calendar-extract-month date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1243 (cal-tex-month-name (calendar-extract-month d))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1244 (calendar-extract-year date))
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1245 (format "%s %s---%s %s"
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1246 (cal-tex-month-name (calendar-extract-month date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1247 (calendar-extract-year date)
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1248 (cal-tex-month-name (calendar-extract-month d))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1249 (calendar-extract-year d))))))
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1250 (insert "%\n")
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1251 (dotimes (jdummy 2)
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1252 (insert "\\rightday")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1253 (cal-tex-arg (cal-tex-LaTeXify-string (calendar-day-name date)))
93844
bf9ef749c23e Replace int-to-string with number-to-string.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
1254 (cal-tex-arg (number-to-string (calendar-extract-day date)))
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1255 (cal-tex-arg (cal-tex-latexify-list diary-list date))
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1256 (cal-tex-arg (cal-tex-latexify-list holidays date))
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1257 (cal-tex-arg (eval cal-tex-daily-string))
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1258 (insert "%\n")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1259 (setq date (cal-tex-incr-date date)))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1260 (dotimes (jdummy 2)
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1261 (insert "\\weekend")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1262 (cal-tex-arg (cal-tex-LaTeXify-string (calendar-day-name date)))
93844
bf9ef749c23e Replace int-to-string with number-to-string.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
1263 (cal-tex-arg (number-to-string (calendar-extract-day date)))
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1264 (cal-tex-arg (cal-tex-latexify-list diary-list date))
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1265 (cal-tex-arg (cal-tex-latexify-list holidays date))
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1266 (cal-tex-arg (eval cal-tex-daily-string))
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1267 (insert "%\n")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1268 (setq date (cal-tex-incr-date date)))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1269 (unless (= i (1- n))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1270 (run-hooks 'cal-tex-week-hook)
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1271 (cal-tex-newpage)))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1272 (cal-tex-end-document)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1273 (run-hooks 'cal-tex-hook)))
19973
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1274
92838
26dc958b293b (calendar-holiday-list, diary-list-entries, calendar-iso-from-absolute):
Glenn Morris <rgm@gnu.org>
parents: 92592
diff changeset
1275 ;;;###cal-autoload
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
1276 (defun cal-tex-cursor-filofax-daily (&optional n event)
19973
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1277 "Day-per-page Filofax style calendar for week indicated by cursor.
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
1278 Optional prefix argument N specifies number of weeks (default 1),
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1279 starting on Mondays. The calendar shows holiday and diary
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1280 entries if `cal-tex-holidays' and `cal-tex-diary', respectively,
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
1281 are non-nil. Pages are ruled if `cal-tex-rules' is non-nil.
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
1282 Optional EVENT indicates a buffer position to use instead of point."
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
1283 (interactive (list (prefix-numeric-value current-prefix-arg)
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
1284 last-nonmenu-event))
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
1285 (or n (setq n 1))
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
1286 (let* ((date (calendar-gregorian-from-absolute
19973
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1287 (calendar-dayname-on-or-before
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1288 1
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1289 (calendar-absolute-from-gregorian
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
1290 (calendar-cursor-to-date t event)))))
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1291 (month (calendar-extract-month date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1292 (year (calendar-extract-year date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1293 (day (calendar-extract-day date))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1294 (d1 (calendar-absolute-from-gregorian date))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1295 (d2 (+ (* 7 n) d1))
19973
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1296 (holidays (if cal-tex-holidays
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1297 (cal-tex-list-holidays d1 d2)))
19973
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1298 (diary-list (if cal-tex-diary
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1299 (cal-tex-list-diary-entries
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1300 ;; FIXME d1?
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1301 (calendar-absolute-from-gregorian (list month 1 year))
92856
68e88df4a24b Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92838
diff changeset
1302 d2))))
19973
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1303 (cal-tex-preamble "twoside")
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1304 (cal-tex-cmd "\\textwidth 3.25in")
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1305 (cal-tex-cmd "\\textheight 6.5in")
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1306 (cal-tex-cmd "\\oddsidemargin 1.75in")
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1307 (cal-tex-cmd "\\evensidemargin 1.5in")
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1308 (cal-tex-cmd "\\topmargin 0pt")
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1309 (cal-tex-cmd "\\headheight -0.875in")
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1310 (cal-tex-cmd "\\headsep 0.125in")
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1311 (cal-tex-cmd "\\footskip .125in")
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1312 (insert "\\def\\righthead#1{\\hfill {\\normalsize \\bf #1}\\\\[-6pt]}
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1313 \\long\\def\\rightday#1#2#3{%
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1314 \\rule{\\textwidth}{0.3pt}\\\\%
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1315 \\hbox to \\textwidth{%
25130
3f2b516f9ddc (cal-tex-cursor-filofax-daily): Add possibility of
Karl Heuer <kwzh@gnu.org>
parents: 23120
diff changeset
1316 \\vbox {%
19973
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1317 \\vspace*{2pt}%
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1318 \\hbox to \\textwidth{\\hfill \\small #3 \\hfill}%
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1319 \\hbox to \\textwidth{\\vbox {\\raggedleft \\em #2}}%
25130
3f2b516f9ddc (cal-tex-cursor-filofax-daily): Add possibility of
Karl Heuer <kwzh@gnu.org>
parents: 23120
diff changeset
1320 \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize #1}}}}}
19973
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1321 \\long\\def\\weekend#1#2#3{%
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1322 \\rule{\\textwidth}{0.3pt}\\\\%
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1323 \\hbox to \\textwidth{%
25130
3f2b516f9ddc (cal-tex-cursor-filofax-daily): Add possibility of
Karl Heuer <kwzh@gnu.org>
parents: 23120
diff changeset
1324 \\vbox {%
19973
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1325 \\vspace*{2pt}%
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1326 \\hbox to \\textwidth{\\hfill \\small #3 \\hfill}%
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1327 \\hbox to \\textwidth{\\vbox {\\noindent \\em #2}}%
25130
3f2b516f9ddc (cal-tex-cursor-filofax-daily): Add possibility of
Karl Heuer <kwzh@gnu.org>
parents: 23120
diff changeset
1328 \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize #1}}}}}
19973
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1329 \\def\\lefthead#1{\\noindent {\\normalsize \\bf #1}\\hfill\\\\[-6pt]}
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1330 \\long\\def\\leftday#1#2#3{%
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1331 \\rule{\\textwidth}{0.3pt}\\\\%
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1332 \\hbox to \\textwidth{%
25130
3f2b516f9ddc (cal-tex-cursor-filofax-daily): Add possibility of
Karl Heuer <kwzh@gnu.org>
parents: 23120
diff changeset
1333 \\vbox {%
19973
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1334 \\vspace*{2pt}%
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1335 \\hbox to \\textwidth{\\hfill \\small #3 \\hfill}%
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1336 \\hbox to \\textwidth{\\vbox {\\noindent \\em #2}}%
25130
3f2b516f9ddc (cal-tex-cursor-filofax-daily): Add possibility of
Karl Heuer <kwzh@gnu.org>
parents: 23120
diff changeset
1337 \\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize #1}}}}}
3f2b516f9ddc (cal-tex-cursor-filofax-daily): Add possibility of
Karl Heuer <kwzh@gnu.org>
parents: 23120
diff changeset
1338 \\newbox\\LineBox
3f2b516f9ddc (cal-tex-cursor-filofax-daily): Add possibility of
Karl Heuer <kwzh@gnu.org>
parents: 23120
diff changeset
1339 \\setbox\\LineBox=\\hbox to\\textwidth{%
3f2b516f9ddc (cal-tex-cursor-filofax-daily): Add possibility of
Karl Heuer <kwzh@gnu.org>
parents: 23120
diff changeset
1340 \\vrule height.2in width0pt\\leaders\\hrule\\hfill}
3f2b516f9ddc (cal-tex-cursor-filofax-daily): Add possibility of
Karl Heuer <kwzh@gnu.org>
parents: 23120
diff changeset
1341 \\def\\linesfill{\\par\\leaders\\copy\\LineBox\\vfill}
19973
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1342 ")
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1343 (cal-tex-b-document)
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1344 (cal-tex-cmd "\\pagestyle{empty}")
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1345 (dotimes (i n)
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1346 (dotimes (j 4)
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1347 (let ((even (zerop (% j 2))))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1348 (insert (if even
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1349 "\\righthead"
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1350 "\\lefthead"))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1351 (cal-tex-arg (calendar-date-string date))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1352 (insert "%\n")
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1353 (insert (if even
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1354 "\\rightday"
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1355 "\\leftday")))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1356 (cal-tex-arg (cal-tex-latexify-list diary-list date))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1357 (cal-tex-arg (cal-tex-latexify-list holidays date "\\\\" t))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1358 (cal-tex-arg (eval cal-tex-daily-string))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1359 (insert "%\n")
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1360 (if cal-tex-rules
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1361 (insert "\\linesfill\n")
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1362 (insert "\\vfill\\noindent\\rule{\\textwidth}{0.3pt}\\\\%\n"))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1363 (cal-tex-newpage)
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1364 (setq date (cal-tex-incr-date date)))
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1365 (insert "%\n")
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1366 (dotimes (jdummy 2)
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1367 (insert "\\lefthead")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1368 (cal-tex-arg (calendar-date-string date))
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1369 (insert "\\weekend")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1370 (cal-tex-arg (cal-tex-latexify-list diary-list date))
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1371 (cal-tex-arg (cal-tex-latexify-list holidays date "\\\\" t))
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1372 (cal-tex-arg (eval cal-tex-daily-string))
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1373 (insert "%\n")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1374 (if cal-tex-rules
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1375 (insert "\\linesfill\n")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1376 (insert "\\vfill"))
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1377 (setq date (cal-tex-incr-date date)))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1378 (or cal-tex-rules
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1379 (insert "\\noindent\\rule{\\textwidth}{0.3pt}\\\\%\n"))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1380 (unless (= i (1- n))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1381 (run-hooks 'cal-tex-week-hook)
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1382 (cal-tex-newpage)))
19973
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1383 (cal-tex-end-document)
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1384 (run-hooks 'cal-tex-hook)))
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1385
45f02da6ebbb (cal-tex-cursor-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19312
diff changeset
1386
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1387 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1388 ;;; Daily calendars
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1389 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1390
92838
26dc958b293b (calendar-holiday-list, diary-list-entries, calendar-iso-from-absolute):
Glenn Morris <rgm@gnu.org>
parents: 92592
diff changeset
1391 ;;;###cal-autoload
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
1392 (defun cal-tex-cursor-day (&optional n event)
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1393 "Make a buffer with LaTeX commands for the day cursor is on.
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
1394 Optional prefix argument N specifies number of days. The calendar shows
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1395 the hours between `cal-tex-daily-start' and `cal-tex-daily-end', using
96065
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
1396 the 24-hour clock if `cal-tex-24' is non-nil. Optional EVENT indicates
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
1397 a buffer position to use instead of point."
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
1398 (interactive (list (prefix-numeric-value current-prefix-arg)
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
1399 last-nonmenu-event))
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
1400 (or n (setq n 1))
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
1401 (let ((date (calendar-absolute-from-gregorian
ee2671797b73 (cal-tex-cursor-year)
Glenn Morris <rgm@gnu.org>
parents: 95414
diff changeset
1402 (calendar-cursor-to-date t event))))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1403 (cal-tex-preamble "12pt")
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1404 (cal-tex-cmd "\\textwidth 6.5in")
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1405 (cal-tex-cmd "\\textheight 10.5in")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1406 (cal-tex-b-document)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1407 (cal-tex-cmd "\\pagestyle{empty}")
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1408 (dotimes (i n)
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1409 (cal-tex-vspace "-1.7in")
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1410 (cal-tex-daily-page (calendar-gregorian-from-absolute date))
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1411 (setq date (1+ date))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1412 (unless (= i (1- n))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1413 (cal-tex-newpage)
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1414 (run-hooks 'cal-tex-daily-hook)))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1415 (cal-tex-end-document)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1416 (run-hooks 'cal-tex-hook)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1417
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1418 (defun cal-tex-daily-page (date)
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1419 "Make a calendar page for Gregorian DATE on 8.5 by 11 paper.
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1420 Uses the 24-hour clock if `cal-tex-24' is non-nil. Produces
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1421 hourly sections for the period specified by `cal-tex-daily-start'
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1422 and `cal-tex-daily-end'."
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1423 (let ((month-name (cal-tex-month-name (calendar-extract-month date)))
93524
6076b35285b8 (cal-tex-insert-blank-days-at-end, cal-tex-last-blank-p)
Glenn Morris <rgm@gnu.org>
parents: 93488
diff changeset
1424 (i (1- cal-tex-daily-start))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1425 hour)
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1426 (cal-tex-banner "cal-tex-daily-page")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1427 (cal-tex-b-makebox "4cm" "l")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1428 (cal-tex-b-parbox "b" "3.8cm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1429 (cal-tex-rule "0mm" "0mm" "2cm")
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1430 (cal-tex-Huge (number-to-string (calendar-extract-day date)))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1431 (cal-tex-nl ".5cm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1432 (cal-tex-bf month-name )
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1433 (cal-tex-e-parbox)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1434 (cal-tex-hspace "1cm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1435 (cal-tex-scriptsize (eval cal-tex-daily-string))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1436 (cal-tex-hspace "3.5cm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1437 (cal-tex-e-makebox)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1438 (cal-tex-hfill)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1439 (cal-tex-b-makebox "4cm" "r")
44368
ceb605d3c4dd (cal-tex-hook, cal-tex-year-hook, cal-tex-month-hook)
Richard M. Stallman <rms@gnu.org>
parents: 38422
diff changeset
1440 (cal-tex-bf (cal-tex-LaTeXify-string (calendar-day-name date)))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1441 (cal-tex-e-makebox)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1442 (cal-tex-nl)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1443 (cal-tex-hspace ".4cm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1444 (cal-tex-rule "0mm" "16.1cm" "1mm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1445 (cal-tex-nl ".1cm")
93524
6076b35285b8 (cal-tex-insert-blank-days-at-end, cal-tex-last-blank-p)
Glenn Morris <rgm@gnu.org>
parents: 93488
diff changeset
1446 (while (<= (setq i (1+ i)) cal-tex-daily-end)
6076b35285b8 (cal-tex-insert-blank-days-at-end, cal-tex-last-blank-p)
Glenn Morris <rgm@gnu.org>
parents: 93488
diff changeset
1447 (cal-tex-cmd "\\noindent")
6076b35285b8 (cal-tex-insert-blank-days-at-end, cal-tex-last-blank-p)
Glenn Morris <rgm@gnu.org>
parents: 93488
diff changeset
1448 (setq hour (if cal-tex-24
6076b35285b8 (cal-tex-insert-blank-days-at-end, cal-tex-last-blank-p)
Glenn Morris <rgm@gnu.org>
parents: 93488
diff changeset
1449 i
6076b35285b8 (cal-tex-insert-blank-days-at-end, cal-tex-last-blank-p)
Glenn Morris <rgm@gnu.org>
parents: 93488
diff changeset
1450 (mod i 12)))
6076b35285b8 (cal-tex-insert-blank-days-at-end, cal-tex-last-blank-p)
Glenn Morris <rgm@gnu.org>
parents: 93488
diff changeset
1451 (if (zerop hour) (setq hour 12))
6076b35285b8 (cal-tex-insert-blank-days-at-end, cal-tex-last-blank-p)
Glenn Morris <rgm@gnu.org>
parents: 93488
diff changeset
1452 (cal-tex-b-makebox "1cm" "c")
6076b35285b8 (cal-tex-insert-blank-days-at-end, cal-tex-last-blank-p)
Glenn Morris <rgm@gnu.org>
parents: 93488
diff changeset
1453 (cal-tex-arg (number-to-string hour))
6076b35285b8 (cal-tex-insert-blank-days-at-end, cal-tex-last-blank-p)
Glenn Morris <rgm@gnu.org>
parents: 93488
diff changeset
1454 (cal-tex-e-makebox)
6076b35285b8 (cal-tex-insert-blank-days-at-end, cal-tex-last-blank-p)
Glenn Morris <rgm@gnu.org>
parents: 93488
diff changeset
1455 (cal-tex-rule "0mm" "15.5cm" ".2mm")
6076b35285b8 (cal-tex-insert-blank-days-at-end, cal-tex-last-blank-p)
Glenn Morris <rgm@gnu.org>
parents: 93488
diff changeset
1456 (cal-tex-nl ".2cm")
6076b35285b8 (cal-tex-insert-blank-days-at-end, cal-tex-last-blank-p)
Glenn Morris <rgm@gnu.org>
parents: 93488
diff changeset
1457 (cal-tex-b-makebox "1cm" "c")
6076b35285b8 (cal-tex-insert-blank-days-at-end, cal-tex-last-blank-p)
Glenn Morris <rgm@gnu.org>
parents: 93488
diff changeset
1458 (cal-tex-arg "$\\diamond$" )
6076b35285b8 (cal-tex-insert-blank-days-at-end, cal-tex-last-blank-p)
Glenn Morris <rgm@gnu.org>
parents: 93488
diff changeset
1459 (cal-tex-e-makebox)
6076b35285b8 (cal-tex-insert-blank-days-at-end, cal-tex-last-blank-p)
Glenn Morris <rgm@gnu.org>
parents: 93488
diff changeset
1460 (cal-tex-rule "0mm" "15.5cm" ".2mm")
6076b35285b8 (cal-tex-insert-blank-days-at-end, cal-tex-last-blank-p)
Glenn Morris <rgm@gnu.org>
parents: 93488
diff changeset
1461 (cal-tex-nl ".2cm"))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1462 (cal-tex-hfill)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1463 (insert (cal-tex-mini-calendar
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1464 (calendar-extract-month (cal-tex-previous-month date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1465 (calendar-extract-year (cal-tex-previous-month date))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1466 "lastmonth" "1.1in" "1in"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1467 (insert (cal-tex-mini-calendar
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1468 (calendar-extract-month date)
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1469 (calendar-extract-year date)
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1470 "thismonth" "1.1in" "1in"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1471 (insert (cal-tex-mini-calendar
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1472 (calendar-extract-month (cal-tex-next-month date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1473 (calendar-extract-year (cal-tex-next-month date))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1474 "nextmonth" "1.1in" "1in"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1475 (insert "\\hbox to \\textwidth{")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1476 (cal-tex-hfill)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1477 (insert "\\lastmonth")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1478 (cal-tex-hfill)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1479 (insert "\\thismonth")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1480 (cal-tex-hfill)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1481 (insert "\\nextmonth")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1482 (cal-tex-hfill)
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 (cal-tex-banner "end of cal-tex-daily-page")))
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 44368
diff changeset
1485
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1486 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1487 ;;; Mini calendars
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1488 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1489
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
1490 (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
1491 "Produce mini-calendar for MONTH, YEAR in macro NAME with WIDTH and HEIGHT.
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1492 Optional string PTSIZE gives the point size (default \"scriptsize\").
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1493 Optional string COLSEP gives the column separation (default \"1mm\")."
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1494 (or colsep (setq colsep "1mm"))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1495 (or ptsize (setq ptsize "scriptsize"))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1496 (let ((blank-days ; at start of month
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1497 (mod
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1498 (- (calendar-day-of-week (list month 1 year))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1499 calendar-week-start-day)
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1500 7))
109325
d916e52744cb cal-tex.el fixes for calendar-week-start-day != 0.
Glenn Morris <rgm@gnu.org>
parents: 107517
diff changeset
1501 (last( calendar-last-day-of-month month year))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1502 (str (concat "\\def\\" name "{\\hbox to" width "{%\n"
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1503 "\\vbox to" height "{%\n"
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1504 "\\vfil \\hbox to" width "{%\n"
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1505 "\\hfil\\" ptsize
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1506 "\\begin{tabular}"
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1507 "{@{\\hspace{0mm}}r@{\\hspace{" colsep
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1508 "}}r@{\\hspace{" colsep "}}r@{\\hspace{" colsep
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1509 "}}r@{\\hspace{" colsep "}}r@{\\hspace{" colsep
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1510 "}}r@{\\hspace{" colsep "}}r@{\\hspace{0mm}}}%\n"
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1511 "\\multicolumn{7}{c}{"
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1512 (cal-tex-month-name month)
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1513 " "
93844
bf9ef749c23e Replace int-to-string with number-to-string.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
1514 (number-to-string year)
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1515 "}\\\\[1mm]\n")))
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1516 (dotimes (i 7)
44368
ceb605d3c4dd (cal-tex-hook, cal-tex-year-hook, cal-tex-month-hook)
Richard M. Stallman <rms@gnu.org>
parents: 38422
diff changeset
1517 (setq str
ceb605d3c4dd (cal-tex-hook, cal-tex-year-hook, cal-tex-month-hook)
Richard M. Stallman <rms@gnu.org>
parents: 38422
diff changeset
1518 (concat str
ceb605d3c4dd (cal-tex-hook, cal-tex-year-hook, cal-tex-month-hook)
Richard M. Stallman <rms@gnu.org>
parents: 38422
diff changeset
1519 (cal-tex-LaTeXify-string
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 44368
diff changeset
1520 (substring (aref calendar-day-name-array
44368
ceb605d3c4dd (cal-tex-hook, cal-tex-year-hook, cal-tex-month-hook)
Richard M. Stallman <rms@gnu.org>
parents: 38422
diff changeset
1521 (mod (+ calendar-week-start-day i) 7))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1522
44368
ceb605d3c4dd (cal-tex-hook, cal-tex-year-hook, cal-tex-month-hook)
Richard M. Stallman <rms@gnu.org>
parents: 38422
diff changeset
1523 0 2))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1524 (if (= i 6)
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1525 "\\\\[0.7mm]\n"
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1526 " & "))))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1527 (dotimes (idummy blank-days)
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1528 (setq str (concat str " & ")))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1529 (dotimes (i last)
93844
bf9ef749c23e Replace int-to-string with number-to-string.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
1530 (setq str (concat str (number-to-string (1+ i)))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1531 str (concat str (if (zerop (mod (+ i 1 blank-days) 7))
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1532 (if (= i (1- last))
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1533 ""
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1534 "\\\\[0.5mm]\n")
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1535 " & "))))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1536 (setq str (concat str "\n\\end{tabular}\\hfil}\\vfil}}}%\n"))
78205
0be3f4770a65 (cal-tex-holidays, cal-tex-diary)
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
1537 str))
13195
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 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1540 ;;; Various calendar functions
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-incr-date (date &optional n)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1544 "The date of the day following DATE.
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1545 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
1546 (calendar-gregorian-from-absolute
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1547 (+ (or n 1) (calendar-absolute-from-gregorian date))))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1548
25130
3f2b516f9ddc (cal-tex-cursor-filofax-daily): Add possibility of
Karl Heuer <kwzh@gnu.org>
parents: 23120
diff changeset
1549 (defun cal-tex-latexify-list (date-list date &optional separator final-separator)
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1550 "Return string with concatenated, LaTeX-ified entries in DATE-LIST for DATE.
25130
3f2b516f9ddc (cal-tex-cursor-filofax-daily): Add possibility of
Karl Heuer <kwzh@gnu.org>
parents: 23120
diff changeset
1551 Use double backslash as a separator unless optional SEPARATOR is given.
3f2b516f9ddc (cal-tex-cursor-filofax-daily): Add possibility of
Karl Heuer <kwzh@gnu.org>
parents: 23120
diff changeset
1552 If resulting string is not empty, put separator at end if optional
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1553 FINAL-SEPARATOR is non-nil."
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1554 (or separator (setq separator "\\\\"))
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1555 (let (result)
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1556 (setq result
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1557 (mapconcat (lambda (x) (cal-tex-LaTeXify-string x))
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1558 (dolist (d date-list (reverse result))
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1559 (and (car d)
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1560 (calendar-date-equal date (car d))
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1561 (setq result (cons (cadr d) result))))
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1562 separator))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1563 (if (and final-separator
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1564 (not (string-equal result "")))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1565 (concat result separator)
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1566 result)))
13195
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-previous-month (date)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1569 "Return the date of the first day in the month previous to DATE."
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1570 (let ((month (calendar-extract-month date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1571 (year (calendar-extract-year date)))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1572 (calendar-increment-month month year -1)
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1573 (list month 1 year)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1574
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1575 (defun cal-tex-next-month (date)
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1576 "Return the date of the first day in the month following DATE."
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1577 (let ((month (calendar-extract-month date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1578 (year (calendar-extract-year date)))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93524
diff changeset
1579 (calendar-increment-month month year 1)
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1580 (list month 1 year)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1581
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1582 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1583 ;;; LaTeX Code
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
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1586 (defun cal-tex-end-document ()
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1587 "Finish the LaTeX document.
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 44368
diff changeset
1588 Insert the trailer to LaTeX document, pop to LaTeX buffer, add
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1589 informative header, and run HOOK."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1590 (cal-tex-e-document)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1591 (latex-mode)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1592 (pop-to-buffer cal-tex-buffer)
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 44368
diff changeset
1593 (goto-char (point-min))
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1594 ;; FIXME auctex equivalents?
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1595 (cal-tex-comment
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1596 (format "\tThis buffer was produced by cal-tex.el.
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1597 \tTo print a calendar, type
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1598 \t\tM-x tex-buffer RET
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1599 \t\tM-x tex-print RET")))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1600
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1601 (defun cal-tex-insert-preamble (weeks landscape size &optional append)
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1602 "Initialize the output LaTeX calendar buffer, `cal-tex-buffer'.
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1603 Select the output buffer, and insert the preamble for a calendar
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1604 of WEEKS weeks. Insert code for landscape mode if LANDSCAPE is
92961
6392aaa2f903 (cal-tex-hook, cal-tex-insert-preamble, cal-tex-month-name): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 92856
diff changeset
1605 non-nil. Use point-size SIZE. Optional argument APPEND, if
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1606 non-nil, means add to end of buffer without erasing current contents."
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1607 (let ((width "18cm")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1608 (height "24cm"))
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1609 (when landscape
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1610 (setq width "24cm"
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1611 height "18cm"))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1612 (unless append
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1613 (cal-tex-preamble size)
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1614 (if (not landscape)
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1615 (progn
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1616 (cal-tex-cmd "\\oddsidemargin -1.75cm")
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1617 (cal-tex-cmd "\\def\\holidaymult{.06}"))
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1618 (cal-tex-cmd "\\special{landscape}")
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1619 (cal-tex-cmd "\\textwidth 9.5in")
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1620 (cal-tex-cmd "\\textheight 7in")
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1621 (cal-tex-comment)
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1622 (cal-tex-cmd "\\def\\holidaymult{.08}"))
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1623 (cal-tex-cmd cal-tex-caldate)
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1624 (cal-tex-cmd cal-tex-myday)
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1625 (cal-tex-b-document)
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1626 (cal-tex-cmd "\\pagestyle{empty}"))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1627 (cal-tex-cmd "\\setlength{\\cellwidth}" width)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1628 (insert (format "\\setlength{\\cellwidth}{%f\\cellwidth}\n"
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1629 (/ 1.1 (length cal-tex-which-days))))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1630 (cal-tex-cmd "\\setlength{\\cellheight}" height)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1631 (insert (format "\\setlength{\\cellheight}{%f\\cellheight}\n"
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 44368
diff changeset
1632 (/ 1.0 weeks)))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1633 (cal-tex-cmd "\\ \\par")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1634 (cal-tex-vspace "-3cm")))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1635
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1636 (defconst cal-tex-LaTeX-subst-list
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1637 '(("\"". "``")
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1638 ("\"". "''") ; quote changes meaning when list is reversed
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1639 ;; Don't think this is necessary, and in any case, does not work:
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1640 ;; "LaTeX Error: \verb illegal in command argument".
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1641 ;;; ("@" . "\\verb|@|")
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 44368
diff changeset
1642 ("&" . "\\&")
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 44368
diff changeset
1643 ("%" . "\\%")
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1644 ("$" . "\\$")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1645 ("#" . "\\#")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1646 ("_" . "\\_")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1647 ("{" . "\\{")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1648 ("}" . "\\}")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1649 ("<" . "$<$")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1650 (">" . "$>$")
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1651 ("\n" . "\\ \\\\")) ; \\ needed for e.g \begin{center}\n AA\end{center}
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1652 "Alist of symbols and their LaTeX replacements.")
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1653
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1654 (defun cal-tex-LaTeXify-string (string)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1655 "Protect special characters in STRING from LaTeX."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1656 (if (not string)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1657 ""
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1658 (let ((head "")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1659 (tail string)
93488
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
1660 (list cal-tex-LaTeX-subst-list)
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
1661 ch pair)
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1662 (while (not (string-equal tail ""))
93488
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
1663 (setq ch (substring-no-properties tail 0 1)
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
1664 pair (assoc ch list))
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
1665 (if (and pair (string-equal ch "\""))
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
1666 (setq list (reverse list))) ; quote changes meaning each time
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
1667 (setq tail (substring-no-properties tail 1)
1098ddbb4486 (cal-tex-cursor-month-landscape)
Glenn Morris <rgm@gnu.org>
parents: 92961
diff changeset
1668 head (concat head (if pair (cdr pair) ch))))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1669 head)))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1670
44368
ceb605d3c4dd (cal-tex-hook, cal-tex-year-hook, cal-tex-month-hook)
Richard M. Stallman <rms@gnu.org>
parents: 38422
diff changeset
1671 (defun cal-tex-month-name (month)
92961
6392aaa2f903 (cal-tex-hook, cal-tex-insert-preamble, cal-tex-month-name): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 92856
diff changeset
1672 "The name of MONTH, LaTeX-ified."
44368
ceb605d3c4dd (cal-tex-hook, cal-tex-year-hook, cal-tex-month-hook)
Richard M. Stallman <rms@gnu.org>
parents: 38422
diff changeset
1673 (cal-tex-LaTeXify-string (calendar-month-name month)))
ceb605d3c4dd (cal-tex-hook, cal-tex-year-hook, cal-tex-month-hook)
Richard M. Stallman <rms@gnu.org>
parents: 38422
diff changeset
1674
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1675 (defun cal-tex-hfill ()
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1676 "Insert hfill."
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1677 (insert "\\hfill"))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1678
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1679 (defun cal-tex-newpage ()
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1680 "Insert newpage."
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1681 (insert "\\newpage%\n"))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1682
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1683 (defun cal-tex-noindent ()
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1684 "Insert noindent."
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1685 (insert "\\noindent"))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1686
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1687 (defun cal-tex-vspace (space)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1688 "Insert vspace command to move SPACE vertically."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1689 (insert "\\vspace*{" space "}")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1690 (cal-tex-comment))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1691
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1692 (defun cal-tex-hspace (space)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1693 "Insert hspace command to move SPACE horizontally."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1694 (insert "\\hspace*{" space "}")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1695 (cal-tex-comment))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1696
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1697 (defun cal-tex-comment (&optional comment)
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1698 "Insert `% ', followed by optional string COMMENT, followed by newline.
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1699 COMMENT may contain newlines, which are prefixed by `% ' in the output."
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1700 (insert (format "%% %s\n"
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1701 (if comment
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1702 (replace-regexp-in-string "\n" "\n% " comment)
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1703 ""))))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1704
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1705 (defun cal-tex-banner (comment)
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1706 "Insert string COMMENT, separated by blank lines."
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1707 (cal-tex-comment (format "\n\n\n\t\t\t%s\n" comment)))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1708
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1709 (defun cal-tex-nl (&optional skip comment)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1710 "End a line with \\. If SKIP, then add that much spacing.
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1711 Add trailing COMMENT if present."
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1712 (insert (format "\\\\%s"
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1713 (if skip
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1714 (format "[%s]" skip)
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1715 "")))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1716 (cal-tex-comment comment))
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 44368
diff changeset
1717
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1718 (defun cal-tex-arg (&optional text)
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1719 "Insert a brace {} pair containing the optional string TEXT."
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1720 (insert (format "{%s}" (or text ""))))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1721
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1722 (defun cal-tex-cmd (cmd &optional arg)
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1723 "Insert LaTeX CMD, with optional argument ARG, and end with %."
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1724 (insert cmd)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1725 (cal-tex-arg arg)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1726 (cal-tex-comment))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1727
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1728 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1729 ;;; Environments
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1730 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1731
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1732 (defun cal-tex-b-document ()
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1733 "Insert beginning of document."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1734 (cal-tex-cmd "\\begin{document}"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1735
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1736 (defun cal-tex-e-document ()
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1737 "Insert end of document."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1738 (cal-tex-cmd "\\end{document}"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1739
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1740 (defun cal-tex-b-center ()
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1741 "Insert beginning of centered block."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1742 (cal-tex-cmd "\\begin{center}"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1743
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1744 (defun cal-tex-e-center ()
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1745 "Insert end of centered block."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1746 (cal-tex-comment)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1747 (cal-tex-cmd "\\end{center}"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1748
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1749
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1750 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1751 ;;; Boxes
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1752 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1753
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1754
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1755 (defun cal-tex-b-parbox (position width)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1756 "Insert parbox with parameters POSITION and WIDTH."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1757 (insert "\\parbox[" position "]{" width "}{")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1758 (cal-tex-comment))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1759
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1760 (defun cal-tex-e-parbox (&optional height)
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1761 "Insert end of parbox. Optionally, force it to be a given HEIGHT."
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1762 (cal-tex-comment)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1763 (if height
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1764 (cal-tex-rule "0mm" "0mm" height))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1765 (insert "}")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1766 (cal-tex-comment "end parbox"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1767
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1768 (defun cal-tex-b-framebox (width position)
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1769 "Insert framebox with parameters WIDTH and POSITION (clr)."
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1770 (insert "\\framebox[" width "][" position "]{" )
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1771 (cal-tex-comment))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1772
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1773 (defun cal-tex-e-framebox ()
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1774 "Insert end of framebox."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1775 (cal-tex-comment)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1776 (insert "}")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1777 (cal-tex-comment "end framebox"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1778
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1779
107517
ed16fdd2685a Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
1780 (defun cal-tex-b-makebox (width position)
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1781 "Insert makebox with parameters WIDTH and POSITION (clr)."
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1782 (insert "\\makebox[" width "][" position "]{" )
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1783 (cal-tex-comment))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1784
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1785 (defun cal-tex-e-makebox ()
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1786 "Insert end of makebox."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1787 (cal-tex-comment)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1788 (insert "}")
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1789 (cal-tex-comment "end makebox"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1790
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1791
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1792 (defun cal-tex-rule (lower width height)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1793 "Insert a rule with parameters LOWER WIDTH HEIGHT."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1794 (insert "\\rule[" lower "]{" width "}{" height "}"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1795
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1796 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1797 ;;; Fonts
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1798 ;;;
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1799
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1800 (defun cal-tex-em (string)
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1801 "Insert STRING in italic font."
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1802 (insert "\\textit{" string "}"))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1803
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1804 (defun cal-tex-bf (string)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1805 "Insert STRING in bf font."
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1806 (insert "\\textbf{ " string "}"))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1807
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1808 (defun cal-tex-scriptsize (string)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1809 "Insert STRING in scriptsize font."
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1810 (insert "{\\scriptsize " string "}"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1811
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1812 (defun cal-tex-huge (string)
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1813 "Insert STRING in huge font."
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1814 (insert "{\\huge " string "}"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1815
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1816 (defun cal-tex-Huge (string)
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1817 "Insert STRING in Huge font."
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1818 (insert "{\\Huge " string "}"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1819
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1820 (defun cal-tex-Huge-bf (string)
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1821 "Insert STRING in Huge bf font."
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1822 (insert "\\textbf{\\Huge " string "}"))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1823
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1824 (defun cal-tex-large (string)
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1825 "Insert STRING in large font."
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1826 (insert "{\\large " string "}"))
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1827
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1828 (defun cal-tex-large-bf (string)
82105
e684bfddd6f3 (cal-tex-which-days, cal-tex-holidays)
Glenn Morris <rgm@gnu.org>
parents: 82080
diff changeset
1829 "Insert STRING in large bf font."
82080
68cd480a70cd Remove leading `*' from defcustom docs.
Glenn Morris <rgm@gnu.org>
parents: 78205
diff changeset
1830 (insert "\\textbf{\\large " string "}"))
13195
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1831
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1832
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1833 (provide 'cal-tex)
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1834
b558ab9fbef4 Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1835 ;;; cal-tex.el ends here