annotate lisp/calendar/cal-tex.el @ 92250:a2c5eb229cdf

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