Function: cal-tex-cursor-week

cal-tex-cursor-week is an autoloaded, interactive and byte-compiled function defined in cal-tex.el.gz.

Signature

(cal-tex-cursor-week &optional N EVENT)

Documentation

Make a one page LaTeX calendar for one week, showing hours of the day.

There are two columns; with 8-12am in the first and 1-5pm in the second. It shows holidays if cal-tex-holidays is non-nil. It does not show diary entries.

The optional prefix argument N specifies a number of weeks (default 1).

By default, the calendar is for the week at point; the optional argument EVENT specifies a different buffer position.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/cal-tex.el.gz
;; TODO cal-tex-diary-support.
;; TODO respect cal-tex-daily-start,end (see cal-tex-week-hours).
;;;###cal-autoload
(defun cal-tex-cursor-week (&optional n event)
  "Make a one page LaTeX calendar for one week, showing hours of the day.
There are two columns; with 8-12am in the first and 1-5pm in the second.
It shows holidays if `cal-tex-holidays' is non-nil.
It does not show diary entries.

The optional prefix argument N specifies a number of weeks (default 1).

By default, the calendar is for the week at point; the optional
argument EVENT specifies a different buffer position."
  (interactive (list (prefix-numeric-value current-prefix-arg)
                     last-nonmenu-event))
  (or n (setq n 1))
  (let* ((date (calendar-gregorian-from-absolute
                (calendar-dayname-on-or-before
                 calendar-week-start-day
                 (calendar-absolute-from-gregorian
                  (calendar-cursor-to-date t event)))))
         (month (calendar-extract-month date))
         (year (calendar-extract-year date))
         (d1 (calendar-absolute-from-gregorian date))
         (d2 (+ (* 7 n) d1))
         (holidays (if cal-tex-holidays
                       (holiday-in-range d1 d2))))
    (cal-tex-preamble "11pt")
    (cal-tex-weekly-paper)
    (insert cal-tex-LaTeX-hourbox)
    (cal-tex-b-document)
    (cal-tex-cmd "\\pagestyle" "empty")
    (dotimes (i n)
      (cal-tex-vspace "-1.5in")
      (cal-tex-b-center)
      (cal-tex-Huge-bf (format "\\uppercase{%s}"
                               (cal-tex-month-name month)))
      (cal-tex-hspace "2em")
      (cal-tex-Huge-bf (number-to-string year))
      (cal-tex-nl ".5cm")
      (cal-tex-e-center)
      (cal-tex-hspace "-.2in")
      (cal-tex-b-parbox "l" "7in")
      (dotimes (_jdummy 7)
        (cal-tex-week-hours date holidays "3.1")
        (setq date (cal-tex-incr-date date)))
      (cal-tex-e-parbox)
      (setq month (calendar-extract-month date)
            year (calendar-extract-year date))
      (unless (= i (1- n))
        (run-hooks 'cal-tex-week-hook)
        (cal-tex-newpage)))
    (cal-tex-end-document)
    (run-hooks 'cal-tex-hook)))