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