Function: cal-tex-cursor-week-iso

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

Signature

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

Documentation

Make a one page LaTeX calendar for one week, in the ISO-style.

It does not show hours of the day. It shows holidays if cal-tex-holidays is non-nil. It shows diary entries if cal-tex-diary is non-nil.

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
;;;###cal-autoload
(defun cal-tex-cursor-week-iso (&optional n event)
  "Make a one page LaTeX calendar for one week, in the ISO-style.
It does not show hours of the day.
It shows holidays if `cal-tex-holidays' is non-nil.
It shows diary entries if `cal-tex-diary' is non-nil.

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))
  (with-suppressed-warnings ((lexical date))
    (defvar date))                      ;For `cal-tex-daily-string'.
  (let* ((date (calendar-gregorian-from-absolute
                (calendar-dayname-on-or-before
                 1
                 (calendar-absolute-from-gregorian
                  (calendar-cursor-to-date t event)))))
         (month (calendar-extract-month date))
         ;; (year (calendar-extract-year date))
         (day (calendar-extract-day date))
         (d1 (calendar-absolute-from-gregorian date))
         (d2 (+ (* 7 n) d1))
         (holidays (if cal-tex-holidays
                       (holiday-in-range d1 d2)))
         (diary-list (if cal-tex-diary
                         (cal-tex-list-diary-entries d1 d2)))
         s)
    (cal-tex-preamble "11pt")
    (cal-tex-weekly-paper)
    (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
       (let ((d (calendar-iso-from-absolute
                 (calendar-absolute-from-gregorian date))))
         (format "Week %d of %d"
                 (calendar-extract-month d)
                 (calendar-extract-year d))))
      (cal-tex-nl ".5cm")
      (cal-tex-e-center)
      (cal-tex-b-parbox "l" "\\textwidth")
      (dotimes (_j 7)
        (cal-tex-b-parbox "t" "\\textwidth")
        (cal-tex-b-parbox "t" "\\textwidth")
        (cal-tex-rule "0pt" "\\textwidth" ".2mm")
        (cal-tex-nl)
        (cal-tex-b-parbox "t" "\\textwidth")
        (cal-tex-large-bf (cal-tex-LaTeXify-string (calendar-day-name date)))
        (insert ", ")
        (cal-tex-large-bf (cal-tex-month-name month))
        (insert "\\ ")
        (cal-tex-large-bf (number-to-string day))
        (unless (string-equal "" (setq s (cal-tex-latexify-list
                                          holidays date "; ")))
          (insert ": ")
          (cal-tex-large-bf s))
        (cal-tex-hfill)
        (insert " " (eval cal-tex-daily-string t))
        (cal-tex-e-parbox)
        (cal-tex-nl)
        (cal-tex-noindent)
        (cal-tex-b-parbox "t" "\\textwidth")
        (unless (string-equal "" (setq s (cal-tex-latexify-list
                                          diary-list date)))
          (insert "\\vbox to 0pt{")
          (cal-tex-large-bf s)
          (insert "}"))
        (cal-tex-e-parbox)
        (cal-tex-nl)
        (setq date (cal-tex-incr-date date)
              month (calendar-extract-month date)
              day (calendar-extract-day date))
        (cal-tex-e-parbox)
        (cal-tex-e-parbox "2cm")
        (cal-tex-nl)
        (setq month (calendar-extract-month date)
              ;; year (calendar-extract-year date)
              ))
      (cal-tex-e-parbox)
      (unless (= i (1- n))
        (run-hooks 'cal-tex-week-hook)
        (cal-tex-newpage)))
    (cal-tex-end-document)
    (run-hooks 'cal-tex-hook)))