annotate lisp/calendar/cal-tex.el @ 69901:a1cf3efe0a2c

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