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