# HG changeset patch # User Karl Heuer # Date 875118514 0 # Node ID 45f02da6ebbbaff6246a8978e1569ac3f40e0055 # Parent fe92da0414ac4d281a6dedaa8fada56c5443e0c9 (cal-tex-cursor-filofax-daily): New function. Delete from "to do" list. diff -r fe92da0414ac -r 45f02da6ebbb lisp/calendar/cal-tex.el --- a/lisp/calendar/cal-tex.el Wed Sep 24 16:14:22 1997 +0000 +++ b/lisp/calendar/cal-tex.el Wed Sep 24 16:28:34 1997 +0000 @@ -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 @@ (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 ;;;