Function: cal-tex-mini-calendar
cal-tex-mini-calendar is a byte-compiled function defined in
cal-tex.el.gz.
Signature
(cal-tex-mini-calendar MONTH YEAR NAME WIDTH HEIGHT &optional PTSIZE COLSEP)
Documentation
Produce mini-calendar for MONTH, YEAR in macro NAME with WIDTH and HEIGHT.
Optional string PTSIZE gives the point size (default "scriptsize"). Optional string COLSEP gives the column separation (default "1mm").
Source Code
;; Defined in /usr/src/emacs/lisp/calendar/cal-tex.el.gz
;;;
;;; Mini calendars
;;;
(defun cal-tex-mini-calendar (month year name width height &optional ptsize colsep)
"Produce mini-calendar for MONTH, YEAR in macro NAME with WIDTH and HEIGHT.
Optional string PTSIZE gives the point size (default \"scriptsize\").
Optional string COLSEP gives the column separation (default \"1mm\")."
(or colsep (setq colsep "1mm"))
(or ptsize (setq ptsize "scriptsize"))
(let ((blank-days ; at start of month
(mod
(- (calendar-day-of-week (list month 1 year))
calendar-week-start-day)
7))
(last( calendar-last-day-of-month month year))
(str (concat "\\def\\" name "{\\hbox to" width "{%\n"
"\\vbox to" height "{%\n"
"\\vfil \\hbox to" width "{%\n"
"\\hfil\\" ptsize
"\\begin{tabular}"
"{@{\\hspace{0mm}}r@{\\hspace{" colsep
"}}r@{\\hspace{" colsep "}}r@{\\hspace{" colsep
"}}r@{\\hspace{" colsep "}}r@{\\hspace{" colsep
"}}r@{\\hspace{" colsep "}}r@{\\hspace{0mm}}}%\n"
"\\multicolumn{7}{c}{"
(cal-tex-month-name month)
" "
(number-to-string year)
"}\\\\[1mm]\n")))
(dotimes (i 7)
(setq str
(concat str
(cal-tex-LaTeXify-string
(substring (aref calendar-day-name-array
(mod (+ calendar-week-start-day i) 7))
0 2))
(if (= i 6)
"\\\\[0.7mm]\n"
" & "))))
(dotimes (_idummy blank-days)
(setq str (concat str " & ")))
(dotimes (i last)
(setq str (concat str (number-to-string (1+ i)))
str (concat str (if (zerop (mod (+ i 1 blank-days) 7))
(if (= i (1- last))
""
"\\\\[0.5mm]\n")
" & "))))
(setq str (concat str "\n\\end{tabular}\\hfil}\\vfil}}}%\n"))
str))