summaryrefslogtreecommitdiff
path: root/lisp/calendar
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1997-09-24 16:28:34 +0000
committerKarl Heuer <kwzh@gnu.org>1997-09-24 16:28:34 +0000
commit315fe9369e862efad03328cd16257f905d330263 (patch)
treeb7b2cff1f0953cb9fb20ce7495d008c59a6d5382 /lisp/calendar
parentfbd45f82c32e6c1856d1349bac5ea4a0b108b715 (diff)
downloademacs-315fe9369e862efad03328cd16257f905d330263.tar.gz
(cal-tex-cursor-filofax-daily): New function.
Delete from "to do" list.
Diffstat (limited to 'lisp/calendar')
-rw-r--r--lisp/calendar/cal-tex.el100
1 files changed, 99 insertions, 1 deletions
diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el
index 172f5d5ff84..14cb64cfce5 100644
--- a/lisp/calendar/cal-tex.el
+++ b/lisp/calendar/cal-tex.el
@@ -37,7 +37,7 @@
;;
;; (*) Make calendar styles for A4 paper.
;;
-;; (*) Make daily and monthly styles Filofax paper.
+;; (*) Make monthly styles Filofax paper.
;;; Code:
@@ -1199,6 +1199,104 @@ Holidays are included if `cal-tex-holidays' is t."
(cal-tex-newpage))))
(cal-tex-end-document)
(run-hooks 'cal-tex-hook)))
+
+(defun cal-tex-cursor-filofax-daily (&optional arg)
+ "Day-per-page Filofax style calendar for week indicated by cursor.
+Optional prefix argument specifies number of weeks. Weeks start on Monday.
+Diary entries are included if `cal-tex-diary' is t.
+Holidays are included if `cal-tex-holidays' is t."
+ (interactive "P")
+ (let* ((n (if arg arg 1))
+ (date (calendar-gregorian-from-absolute
+ (calendar-dayname-on-or-before
+ 1
+ (calendar-absolute-from-gregorian
+ (calendar-cursor-to-date t)))))
+ (month (extract-calendar-month date))
+ (year (extract-calendar-year date))
+ (day (extract-calendar-day date))
+ (holidays (if cal-tex-holidays
+ (cal-tex-list-holidays
+ (calendar-absolute-from-gregorian date)
+ (+ (* 7 n)
+ (calendar-absolute-from-gregorian date)))))
+ (diary-list (if cal-tex-diary
+ (cal-tex-list-diary-entries
+ (calendar-absolute-from-gregorian
+ (list month 1 year))
+ (+ (* 7 n)
+ (calendar-absolute-from-gregorian date))))))
+ (cal-tex-preamble "twoside")
+ (cal-tex-cmd "\\textwidth 3.25in")
+ (cal-tex-cmd "\\textheight 6.5in")
+ (cal-tex-cmd "\\oddsidemargin 1.75in")
+ (cal-tex-cmd "\\evensidemargin 1.5in")
+ (cal-tex-cmd "\\topmargin 0pt")
+ (cal-tex-cmd "\\headheight -0.875in")
+ (cal-tex-cmd "\\headsep 0.125in")
+ (cal-tex-cmd "\\footskip .125in")
+ (insert "\\def\\righthead#1{\\hfill {\\normalsize \\bf #1}\\\\[-6pt]}
+\\long\\def\\rightday#1#2#3{%
+ \\rule{\\textwidth}{0.3pt}\\\\%
+ \\hbox to \\textwidth{%
+ \\vbox to 1.85in{%
+ \\vspace*{2pt}%
+ \\hbox to \\textwidth{\\hfill \\small #3 \\hfill}%
+ \\hbox to \\textwidth{\\vbox {\\raggedleft \\em #2}}%
+ \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #1}}}}}
+\\long\\def\\weekend#1#2#3{%
+ \\rule{\\textwidth}{0.3pt}\\\\%
+ \\hbox to \\textwidth{%
+ \\vbox to 2in{%
+ \\vspace*{2pt}%
+ \\hbox to \\textwidth{\\hfill \\small #3 \\hfill}%
+ \\hbox to \\textwidth{\\vbox {\\noindent \\em #2}}%
+ \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #1}}}}}
+\\def\\lefthead#1{\\noindent {\\normalsize \\bf #1}\\hfill\\\\[-6pt]}
+\\long\\def\\leftday#1#2#3{%
+ \\rule{\\textwidth}{0.3pt}\\\\%
+ \\hbox to \\textwidth{%
+ \\vbox to 1.85in{%
+ \\vspace*{2pt}%
+ \\hbox to \\textwidth{\\hfill \\small #3 \\hfill}%
+ \\hbox to \\textwidth{\\vbox {\\noindent \\em #2}}%
+ \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #1}}}}}
+")
+ (cal-tex-b-document)
+ (cal-tex-cmd "\\pagestyle{empty}")
+ (calendar-for-loop i from 1 to n do
+ (calendar-for-loop j from 1 to 5 do
+ (insert (if (oddp j) "\\righthead" "\\lefthead"))
+ (cal-tex-arg (calendar-date-string date))
+ (insert "%\n")
+ (insert (if (oddp j) "\\rightday" "\\leftday"))
+ (cal-tex-arg (cal-tex-latexify-list diary-list date))
+ (cal-tex-arg (cal-tex-latexify-list holidays date))
+ (cal-tex-arg (eval cal-tex-daily-string))
+ (insert "%\n")
+ (insert "\\vfill\\noindent\\rule{\\textwidth}{0.3pt}\\\\%\n")
+ (cal-tex-newpage)
+ (setq date (cal-tex-incr-date date)))
+ (insert "%\n")
+ (calendar-for-loop j from 1 to 2 do
+ (insert "\\lefthead")
+ (cal-tex-arg (calendar-date-string date))
+ (insert "\\weekend")
+ (cal-tex-arg (cal-tex-latexify-list diary-list date))
+ (cal-tex-arg (cal-tex-latexify-list holidays date))
+ (cal-tex-arg (eval cal-tex-daily-string))
+ (insert "%\n")
+ (insert "\\vfill")
+ (setq date (cal-tex-incr-date date)))
+ (insert "\\noindent\\rule{\\textwidth}{0.3pt}\\\\%\n")
+ (if (/= i n)
+ (progn
+ (run-hooks 'cal-tex-week-hook)
+ (cal-tex-newpage))))
+ (cal-tex-end-document)
+ (run-hooks 'cal-tex-hook)))
+
+
;;;
;;; Daily calendars
;;;