Function: cal-tex-cursor-month-landscape

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

Signature

(cal-tex-cursor-month-landscape &optional N EVENT)

Documentation

Make a LaTeX calendar buffer for the month the cursor is on.

Optional prefix argument N specifies number of months to be produced (default 1). The output is in landscape format, one month to a page. It shows holiday and diary entries if cal-tex-holidays and cal-tex-diary, respectively, are non-nil. Optional EVENT indicates a buffer position to use instead of point.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/cal-tex.el.gz
;;;
;;;  Monthly calendars
;;;

;;;###cal-autoload
(defun cal-tex-cursor-month-landscape (&optional n event)
  "Make a LaTeX calendar buffer for the month the cursor is on.
Optional prefix argument N specifies number of months to be
produced (default 1).  The output is in landscape format, one
month to a page.  It shows holiday and diary entries if
`cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil.
Optional EVENT indicates a buffer position to use instead of point."
  (interactive (list (prefix-numeric-value current-prefix-arg)
                     last-nonmenu-event))
  (or n (setq n 1))
  (let* ((date (calendar-cursor-to-date t event))
         (month (calendar-extract-month date))
         (year (calendar-extract-year date))
         (end-month month)
         (end-year year)
         (cal-tex-which-days '(0 1 2 3 4 5 6))
         (d1 (calendar-absolute-from-gregorian (list month 1 year)))
         (d2 (progn
               (calendar-increment-month end-month end-year (1- n))
               (calendar-absolute-from-gregorian
                (list end-month
                      (calendar-last-day-of-month end-month end-year)
                      end-year))))
         (diary-list (if cal-tex-diary (cal-tex-list-diary-entries d1 d2)))
         (holidays (if cal-tex-holidays (holiday-in-range d1 d2)))
         other-month other-year small-months-at-start)
    (cal-tex-insert-preamble (cal-tex-number-weeks month year 1) "landscape")
    (cal-tex-cmd cal-tex-cal-one-month)
    (dotimes (i n)
      (setq other-month month
            other-year year)
      (calendar-increment-month other-month other-year -1)
      (insert (cal-tex-mini-calendar other-month other-year "lastmonth"
                                     "\\cellwidth" "\\cellheight"))
      (calendar-increment-month other-month other-year 2)
      (insert (cal-tex-mini-calendar other-month other-year "nextmonth"
                                     "\\cellwidth" "\\cellheight"))
      (cal-tex-insert-month-header 1 month year month year)
      (cal-tex-insert-day-names)
      (cal-tex-nl ".2cm")
      (if (setq small-months-at-start
                (< 1 (mod (- (calendar-day-of-week (list month 1 year))
                               calendar-week-start-day)
                          7)))
          (insert "\\lastmonth\\nextmonth\\hspace*{-2\\cellwidth}"))
      (cal-tex-insert-blank-days month year cal-tex-day-prefix)
      (cal-tex-insert-days month year diary-list holidays
                           cal-tex-day-prefix)
      (cal-tex-insert-blank-days-at-end month year cal-tex-day-prefix)
      (if (and (not small-months-at-start)
               (< 1 (mod (- (1- calendar-week-start-day)
                            (calendar-day-of-week
                             (list month
                                   (calendar-last-day-of-month month year)
                                   year)))
                         7)))
          (insert "\\vspace*{-\\cellwidth}\\hspace*{-2\\cellwidth}"
                  "\\lastmonth\\nextmonth%
"))
      (unless (= i (1- n))
        (run-hooks 'cal-tex-month-hook)
        (cal-tex-newpage)
        (calendar-increment-month month year 1)
        (cal-tex-vspace "-2cm")
        (cal-tex-insert-preamble
         (cal-tex-number-weeks month year 1) "landscape" t))))
  (cal-tex-end-document)
  (run-hooks 'cal-tex-hook))