comparison lisp/calendar/cal-tex.el @ 96065:ee2671797b73

(cal-tex-cursor-year) (cal-tex-cursor-year-landscape, cal-tex-cursor-filofax-year) (cal-tex-cursor-month-landscape, cal-tex-cursor-month) (cal-tex-cursor-week, cal-tex-cursor-week2, cal-tex-cursor-week-iso) (cal-tex-cursor-week-monday, cal-tex-cursor-filofax-2week) (cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily) (cal-tex-cursor-day): Handle mouse events. Rename ARG to N. (cal-tex-cursor-month): Mark N as optional.
author Glenn Morris <rgm@gnu.org>
date Wed, 18 Jun 2008 02:55:13 +0000
parents db35abe41bba
children a9dc0e7c3f2b
comparison
equal deleted inserted replaced
96064:1a48e0bd73d8 96065:ee2671797b73
307 ;;; 307 ;;;
308 ;;; Yearly calendars 308 ;;; Yearly calendars
309 ;;; 309 ;;;
310 310
311 ;;;###cal-autoload 311 ;;;###cal-autoload
312 (defun cal-tex-cursor-year (&optional arg) 312 (defun cal-tex-cursor-year (&optional n event)
313 "Make a buffer with LaTeX commands for the year cursor is on. 313 "Make a buffer with LaTeX commands for the year cursor is on.
314 Optional prefix argument ARG specifies number of years." 314 Optional prefix argument N specifies number of years.
315 (interactive "p") 315 Optional EVENT indicates a buffer position to use instead of point."
316 (cal-tex-year (calendar-extract-year (calendar-cursor-to-date t)) 316 (interactive (list (prefix-numeric-value current-prefix-arg)
317 (or arg 1))) 317 last-nonmenu-event))
318 (cal-tex-year (calendar-extract-year (calendar-cursor-to-date t event))
319 (or n 1)))
318 320
319 ;;;###cal-autoload 321 ;;;###cal-autoload
320 (defun cal-tex-cursor-year-landscape (&optional arg) 322 (defun cal-tex-cursor-year-landscape (&optional n event)
321 "Make a buffer with LaTeX commands for the year cursor is on. 323 "Make a buffer with LaTeX commands for the year cursor is on.
322 Optional prefix argument ARG specifies number of years." 324 Optional prefix argument N specifies number of years.
323 (interactive "p") 325 Optional EVENT indicates a buffer position to use instead of point."
324 (cal-tex-year (calendar-extract-year (calendar-cursor-to-date t)) 326 (interactive (list (prefix-numeric-value current-prefix-arg)
325 (or arg 1) t)) 327 last-nonmenu-event))
328 (cal-tex-year (calendar-extract-year (calendar-cursor-to-date t event))
329 (or n 1) t))
326 330
327 (defun cal-tex-year (year n &optional landscape) 331 (defun cal-tex-year (year n &optional landscape)
328 "Make a one page yearly calendar of YEAR; do this for N years. 332 "Make a one page yearly calendar of YEAR; do this for N years.
329 There are four rows of three months each, unless optional 333 There are four rows of three months each, unless optional
330 LANDSCAPE is non-nil, in which case the calendar is printed in 334 LANDSCAPE is non-nil, in which case the calendar is printed in
359 (cal-tex-newpage)) 363 (cal-tex-newpage))
360 (run-hooks 'cal-tex-year-hook)) 364 (run-hooks 'cal-tex-year-hook))
361 (run-hooks 'cal-tex-hook)) 365 (run-hooks 'cal-tex-hook))
362 366
363 ;;;###cal-autoload 367 ;;;###cal-autoload
364 (defun cal-tex-cursor-filofax-year (&optional arg) 368 (defun cal-tex-cursor-filofax-year (&optional n event)
365 "Make a Filofax one page yearly calendar of year indicated by cursor. 369 "Make a Filofax one page yearly calendar of year indicated by cursor.
366 Optional prefix argument ARG specifies number of years." 370 Optional prefix argument N specifies number of years.
367 (interactive "p") 371 Optional EVENT indicates a buffer position to use instead of point."
368 (let ((n (or arg 1)) 372 (interactive (list (prefix-numeric-value current-prefix-arg)
369 (year (calendar-extract-year (calendar-cursor-to-date t)))) 373 last-nonmenu-event))
374 (or n (setq n 1))
375 (let ((year (calendar-extract-year (calendar-cursor-to-date t event))))
370 (cal-tex-preamble "twoside") 376 (cal-tex-preamble "twoside")
371 (cal-tex-cmd "\\textwidth 3.25in") 377 (cal-tex-cmd "\\textwidth 3.25in")
372 (cal-tex-cmd "\\textheight 6.5in") 378 (cal-tex-cmd "\\textheight 6.5in")
373 (cal-tex-cmd "\\oddsidemargin 1.675in") 379 (cal-tex-cmd "\\oddsidemargin 1.675in")
374 (cal-tex-cmd "\\evensidemargin 1.675in") 380 (cal-tex-cmd "\\evensidemargin 1.675in")
412 ;;; 418 ;;;
413 ;;; Monthly calendars 419 ;;; Monthly calendars
414 ;;; 420 ;;;
415 421
416 ;;;###cal-autoload 422 ;;;###cal-autoload
417 (defun cal-tex-cursor-month-landscape (&optional arg) 423 (defun cal-tex-cursor-month-landscape (&optional n event)
418 "Make a LaTeX calendar buffer for the month the cursor is on. 424 "Make a LaTeX calendar buffer for the month the cursor is on.
419 Optional prefix argument ARG specifies number of months to be 425 Optional prefix argument N specifies number of months to be
420 produced (default 1). The output is in landscape format, one 426 produced (default 1). The output is in landscape format, one
421 month to a page. It shows holiday and diary entries if 427 month to a page. It shows holiday and diary entries if
422 `cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil." 428 `cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil.
423 (interactive "p") 429 Optional EVENT indicates a buffer position to use instead of point."
424 (let* ((n (or arg 1)) 430 (interactive (list (prefix-numeric-value current-prefix-arg)
425 (date (calendar-cursor-to-date t)) 431 last-nonmenu-event))
432 (or n (setq n 1))
433 (let* ((date (calendar-cursor-to-date t event))
426 (month (calendar-extract-month date)) 434 (month (calendar-extract-month date))
427 (year (calendar-extract-year date)) 435 (year (calendar-extract-year date))
428 (end-month month) 436 (end-month month)
429 (end-year year) 437 (end-year year)
430 (cal-tex-which-days '(0 1 2 3 4 5 6)) 438 (cal-tex-which-days '(0 1 2 3 4 5 6))
480 (cal-tex-number-weeks month year 1) t "12pt" t)))) 488 (cal-tex-number-weeks month year 1) t "12pt" t))))
481 (cal-tex-end-document) 489 (cal-tex-end-document)
482 (run-hooks 'cal-tex-hook)) 490 (run-hooks 'cal-tex-hook))
483 491
484 ;;;###cal-autoload 492 ;;;###cal-autoload
485 (defun cal-tex-cursor-month (arg) 493 (defun cal-tex-cursor-month (&optional n event)
486 "Make a LaTeX calendar buffer for the month the cursor is on. 494 "Make a LaTeX calendar buffer for the month the cursor is on.
487 Optional prefix argument ARG specifies number of months to be 495 Optional prefix argument N specifies number of months to be
488 produced (default 1). The calendar is condensed onto one page. 496 produced (default 1). The calendar is condensed onto one page.
489 It shows holiday and diary entries if `cal-tex-holidays' and 497 It shows holiday and diary entries if `cal-tex-holidays' and
490 `cal-tex-diary', respectively, are non-nil." 498 `cal-tex-diary', respectively, are non-nil. Optional EVENT
491 (interactive "p") 499 indicates a buffer position to use instead of point."
492 (let* ((n (or arg 1)) 500 (interactive (list (prefix-numeric-value current-prefix-arg)
493 (date (calendar-cursor-to-date t)) 501 last-nonmenu-event))
502 (or n (setq n 1))
503 (let* ((date (calendar-cursor-to-date t event))
494 (month (calendar-extract-month date)) 504 (month (calendar-extract-month date))
495 (year (calendar-extract-year date)) 505 (year (calendar-extract-year date))
496 (end-month month) 506 (end-month month)
497 (end-year year) 507 (end-year year)
498 (d1 (calendar-absolute-from-gregorian (list month 1 year))) 508 (d1 (calendar-absolute-from-gregorian (list month 1 year)))
666 "One hour and a line on the right.") 676 "One hour and a line on the right.")
667 677
668 ;; TODO cal-tex-diary-support. 678 ;; TODO cal-tex-diary-support.
669 ;; TODO respect cal-tex-daily-start,end (see cal-tex-week-hours). 679 ;; TODO respect cal-tex-daily-start,end (see cal-tex-week-hours).
670 ;;;###cal-autoload 680 ;;;###cal-autoload
671 (defun cal-tex-cursor-week (&optional arg) 681 (defun cal-tex-cursor-week (&optional n event)
672 "Make a LaTeX calendar buffer for a two-page one-week calendar. 682 "Make a LaTeX calendar buffer for a two-page one-week calendar.
673 It applies to the week that point is in. The optional prefix 683 It applies to the week that point is in. The optional prefix
674 argument ARG specifies the number of weeks (default 1). The calendar 684 argument N specifies the number of weeks (default 1). The calendar
675 shows holidays if `cal-tex-holidays' is non-nil (note that diary 685 shows holidays if `cal-tex-holidays' is non-nil (note that diary
676 entries are not shown). The calendar shows the hours 8-12am, 1-5pm." 686 entries are not shown). The calendar shows the hours 8-12am, 1-5pm."
677 (interactive "p") 687 (interactive (list (prefix-numeric-value current-prefix-arg)
678 (let* ((n (or arg 1)) 688 last-nonmenu-event))
679 (date (calendar-gregorian-from-absolute 689 (or n (setq n 1))
690 (let* ((date (calendar-gregorian-from-absolute
680 (calendar-dayname-on-or-before 691 (calendar-dayname-on-or-before
681 calendar-week-start-day 692 calendar-week-start-day
682 (calendar-absolute-from-gregorian 693 (calendar-absolute-from-gregorian
683 (calendar-cursor-to-date t))))) 694 (calendar-cursor-to-date t event)))))
684 (month (calendar-extract-month date)) 695 (month (calendar-extract-month date))
685 (year (calendar-extract-year date)) 696 (year (calendar-extract-year date))
686 (d1 (calendar-absolute-from-gregorian date)) 697 (d1 (calendar-absolute-from-gregorian date))
687 (d2 (+ (* 7 n) d1)) 698 (d2 (+ (* 7 n) d1))
688 (holidays (if cal-tex-holidays 699 (holidays (if cal-tex-holidays
719 (run-hooks 'cal-tex-hook))) 730 (run-hooks 'cal-tex-hook)))
720 731
721 ;; TODO cal-tex-diary support. 732 ;; TODO cal-tex-diary support.
722 ;; TODO respect cal-tex-daily-start,end (see cal-tex-week-hours). 733 ;; TODO respect cal-tex-daily-start,end (see cal-tex-week-hours).
723 ;;;###cal-autoload 734 ;;;###cal-autoload
724 (defun cal-tex-cursor-week2 (&optional arg) 735 (defun cal-tex-cursor-week2 (&optional n event)
725 "Make a LaTeX calendar buffer for a two-page one-week calendar. 736 "Make a LaTeX calendar buffer for a two-page one-week calendar.
726 It applies to the week that point is in. Optional prefix 737 It applies to the week that point is in. Optional prefix
727 argument ARG specifies number of weeks (default 1). The calendar 738 argument N specifies number of weeks (default 1). The calendar
728 shows holidays if `cal-tex-holidays' is non-nil (note that diary 739 shows holidays if `cal-tex-holidays' is non-nil (note that diary
729 entries are not shown). The calendar shows the hours 8-12am, 1-5pm" 740 entries are not shown). The calendar shows the hours 8-12am, 1-5pm.
730 (interactive "p") 741 Optional EVENT indicates a buffer position to use instead of point."
731 (let* ((n (or arg 1)) 742 (interactive (list (prefix-numeric-value current-prefix-arg)
732 (date (calendar-gregorian-from-absolute 743 last-nonmenu-event))
744 (or n (setq n 1))
745 (let* ((date (calendar-gregorian-from-absolute
733 (calendar-dayname-on-or-before 746 (calendar-dayname-on-or-before
734 calendar-week-start-day 747 calendar-week-start-day
735 (calendar-absolute-from-gregorian 748 (calendar-absolute-from-gregorian
736 (calendar-cursor-to-date t))))) 749 (calendar-cursor-to-date t event)))))
737 (month (calendar-extract-month date)) 750 (month (calendar-extract-month date))
738 (year (calendar-extract-year date)) 751 (year (calendar-extract-year date))
739 (d date) 752 (d date)
740 (d1 (calendar-absolute-from-gregorian date)) 753 (d1 (calendar-absolute-from-gregorian date))
741 (d2 (+ (* 7 n) d1)) 754 (d2 (+ (* 7 n) d1))
801 (run-hooks 'cal-tex-hook))) 814 (run-hooks 'cal-tex-hook)))
802 815
803 (autoload 'calendar-iso-from-absolute "cal-iso") 816 (autoload 'calendar-iso-from-absolute "cal-iso")
804 817
805 ;;;###cal-autoload 818 ;;;###cal-autoload
806 (defun cal-tex-cursor-week-iso (&optional arg) 819 (defun cal-tex-cursor-week-iso (&optional n event)
807 "Make a LaTeX calendar buffer for a one page ISO-style weekly calendar. 820 "Make a LaTeX calendar buffer for a one page ISO-style weekly calendar.
808 Optional prefix argument ARG specifies number of weeks (default 1). 821 Optional prefix argument N specifies number of weeks (default 1).
809 The calendar shows holiday and diary entries if 822 The calendar shows holiday and diary entries if
810 `cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil. 823 `cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil.
811 It does not show hours of the day." 824 It does not show hours of the day. Optional EVENT indicates a buffer
812 (interactive "p") 825 position to use instead of point."
813 (let* ((n (or arg 1)) 826 (interactive (list (prefix-numeric-value current-prefix-arg)
814 (date (calendar-gregorian-from-absolute 827 last-nonmenu-event))
828 (or n (setq n 1))
829 (let* ((date (calendar-gregorian-from-absolute
815 (calendar-dayname-on-or-before 830 (calendar-dayname-on-or-before
816 1 831 1
817 (calendar-absolute-from-gregorian 832 (calendar-absolute-from-gregorian
818 (calendar-cursor-to-date t))))) 833 (calendar-cursor-to-date t event)))))
819 (month (calendar-extract-month date)) 834 (month (calendar-extract-month date))
820 (year (calendar-extract-year date)) 835 (year (calendar-extract-year date))
821 (day (calendar-extract-day date)) 836 (day (calendar-extract-day date))
822 (d1 (calendar-absolute-from-gregorian date)) 837 (d1 (calendar-absolute-from-gregorian date))
823 (d2 (+ (* 7 n) d1)) 838 (d2 (+ (* 7 n) d1))
933 (cal-tex-nl)))) 948 (cal-tex-nl))))
934 949
935 ;; TODO cal-tex-diary support. 950 ;; TODO cal-tex-diary support.
936 ;; TODO respect cal-tex-daily-start,end (see cal-tex-weekly4-box). 951 ;; TODO respect cal-tex-daily-start,end (see cal-tex-weekly4-box).
937 ;;;###cal-autoload 952 ;;;###cal-autoload
938 (defun cal-tex-cursor-week-monday (&optional arg) 953 (defun cal-tex-cursor-week-monday (&optional n event)
939 "Make a LaTeX calendar buffer for a two-page one-week calendar. 954 "Make a LaTeX calendar buffer for a two-page one-week calendar.
940 It applies to the week that point is in, and starts on Monday. 955 It applies to the week that point is in, and starts on Monday.
941 Optional prefix argument ARG specifies number of weeks (default 1). 956 Optional prefix argument N specifies number of weeks (default 1).
942 The calendar shows holidays if `cal-tex-holidays' is 957 The calendar shows holidays if `cal-tex-holidays' is
943 non-nil (note that diary entries are not shown). The calendar shows 958 non-nil (note that diary entries are not shown). The calendar shows
944 the hours 8-12am, 1-5pm." 959 the hours 8-12am, 1-5pm. Optional EVENT indicates a buffer position
945 (interactive "p") 960 to use instead of point."
946 (let ((n (or arg 1)) 961 (interactive (list (prefix-numeric-value current-prefix-arg)
947 (date (calendar-gregorian-from-absolute 962 last-nonmenu-event))
963 (or n (setq n 1))
964 (let ((date (calendar-gregorian-from-absolute
948 (calendar-dayname-on-or-before 965 (calendar-dayname-on-or-before
949 0 966 0
950 (calendar-absolute-from-gregorian 967 (calendar-absolute-from-gregorian
951 (calendar-cursor-to-date t)))))) 968 (calendar-cursor-to-date t event))))))
952 (cal-tex-preamble "11pt") 969 (cal-tex-preamble "11pt")
953 (cal-tex-cmd "\\textwidth 6.5in") 970 (cal-tex-cmd "\\textwidth 6.5in")
954 (cal-tex-cmd "\\textheight 10.5in") 971 (cal-tex-cmd "\\textheight 10.5in")
955 (cal-tex-cmd "\\oddsidemargin 0in") 972 (cal-tex-cmd "\\oddsidemargin 0in")
956 (cal-tex-cmd "\\evensidemargin 0in") 973 (cal-tex-cmd "\\evensidemargin 0in")
1014 (cal-tex-e-parbox) 1031 (cal-tex-e-parbox)
1015 (cal-tex-e-framebox) 1032 (cal-tex-e-framebox)
1016 (cal-tex-hspace "1cm"))) 1033 (cal-tex-hspace "1cm")))
1017 1034
1018 ;;;###cal-autoload 1035 ;;;###cal-autoload
1019 (defun cal-tex-cursor-filofax-2week (&optional arg) 1036 (defun cal-tex-cursor-filofax-2week (&optional n event)
1020 "Two-weeks-at-a-glance Filofax style calendar for week cursor is in. 1037 "Two-weeks-at-a-glance Filofax style calendar for week cursor is in.
1021 Optional prefix argument ARG specifies number of weeks (default 1). 1038 Optional prefix argument N specifies number of weeks (default 1).
1022 The calendar shows holiday and diary entries if 1039 The calendar shows holiday and diary entries if
1023 `cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil." 1040 `cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil.
1024 (interactive "p") 1041 Optional EVENT indicates a buffer position to use instead of point."
1025 (let* ((n (or arg 1)) 1042 (interactive (list (prefix-numeric-value current-prefix-arg)
1026 (date (calendar-gregorian-from-absolute 1043 last-nonmenu-event))
1044 (or n (setq n 1))
1045 (let* ((date (calendar-gregorian-from-absolute
1027 (calendar-dayname-on-or-before 1046 (calendar-dayname-on-or-before
1028 calendar-week-start-day 1047 calendar-week-start-day
1029 (calendar-absolute-from-gregorian 1048 (calendar-absolute-from-gregorian
1030 (calendar-cursor-to-date t))))) 1049 (calendar-cursor-to-date t event)))))
1031 (month (calendar-extract-month date)) 1050 (month (calendar-extract-month date))
1032 (year (calendar-extract-year date)) 1051 (year (calendar-extract-year date))
1033 (day (calendar-extract-day date)) 1052 (day (calendar-extract-day date))
1034 (d1 (calendar-absolute-from-gregorian date)) 1053 (d1 (calendar-absolute-from-gregorian date))
1035 (d2 (+ (* 7 n) d1)) 1054 (d2 (+ (* 7 n) d1))
1109 (cal-tex-newpage))) 1128 (cal-tex-newpage)))
1110 (cal-tex-end-document) 1129 (cal-tex-end-document)
1111 (run-hooks 'cal-tex-hook))) 1130 (run-hooks 'cal-tex-hook)))
1112 1131
1113 ;;;###cal-autoload 1132 ;;;###cal-autoload
1114 (defun cal-tex-cursor-filofax-week (&optional arg) 1133 (defun cal-tex-cursor-filofax-week (&optional n event)
1115 "One-week-at-a-glance Filofax style calendar for week indicated by cursor. 1134 "One-week-at-a-glance Filofax style calendar for week indicated by cursor.
1116 Optional prefix argument ARG specifies number of weeks (default 1), 1135 Optional prefix argument N specifies number of weeks (default 1),
1117 starting on Mondays. The calendar shows holiday and diary entries 1136 starting on Mondays. The calendar shows holiday and diary entries
1118 if `cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil." 1137 if `cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil.
1119 (interactive "p") 1138 Optional EVENT indicates a buffer position to use instead of point."
1120 (let* ((n (or arg 1)) 1139 (interactive (list (prefix-numeric-value current-prefix-arg)
1121 (date (calendar-gregorian-from-absolute 1140 last-nonmenu-event))
1141 (or n (setq n 1))
1142 (let* ((date (calendar-gregorian-from-absolute
1122 (calendar-dayname-on-or-before 1143 (calendar-dayname-on-or-before
1123 1 1144 1
1124 (calendar-absolute-from-gregorian 1145 (calendar-absolute-from-gregorian
1125 (calendar-cursor-to-date t))))) 1146 (calendar-cursor-to-date t event)))))
1126 (month (calendar-extract-month date)) 1147 (month (calendar-extract-month date))
1127 (year (calendar-extract-year date)) 1148 (year (calendar-extract-year date))
1128 (day (calendar-extract-day date)) 1149 (day (calendar-extract-day date))
1129 (d1 (calendar-absolute-from-gregorian date)) 1150 (d1 (calendar-absolute-from-gregorian date))
1130 (d2 (+ (* 7 n) d1)) 1151 (d2 (+ (* 7 n) d1))
1249 (cal-tex-newpage))) 1270 (cal-tex-newpage)))
1250 (cal-tex-end-document) 1271 (cal-tex-end-document)
1251 (run-hooks 'cal-tex-hook))) 1272 (run-hooks 'cal-tex-hook)))
1252 1273
1253 ;;;###cal-autoload 1274 ;;;###cal-autoload
1254 (defun cal-tex-cursor-filofax-daily (&optional arg) 1275 (defun cal-tex-cursor-filofax-daily (&optional n event)
1255 "Day-per-page Filofax style calendar for week indicated by cursor. 1276 "Day-per-page Filofax style calendar for week indicated by cursor.
1256 Optional prefix argument ARG specifies number of weeks (default 1), 1277 Optional prefix argument N specifies number of weeks (default 1),
1257 starting on Mondays. The calendar shows holiday and diary 1278 starting on Mondays. The calendar shows holiday and diary
1258 entries if `cal-tex-holidays' and `cal-tex-diary', respectively, 1279 entries if `cal-tex-holidays' and `cal-tex-diary', respectively,
1259 are non-nil. Pages are ruled if `cal-tex-rules' is non-nil." 1280 are non-nil. Pages are ruled if `cal-tex-rules' is non-nil.
1260 (interactive "p") 1281 Optional EVENT indicates a buffer position to use instead of point."
1261 (let* ((n (or arg 1)) 1282 (interactive (list (prefix-numeric-value current-prefix-arg)
1262 (date (calendar-gregorian-from-absolute 1283 last-nonmenu-event))
1284 (or n (setq n 1))
1285 (let* ((date (calendar-gregorian-from-absolute
1263 (calendar-dayname-on-or-before 1286 (calendar-dayname-on-or-before
1264 1 1287 1
1265 (calendar-absolute-from-gregorian 1288 (calendar-absolute-from-gregorian
1266 (calendar-cursor-to-date t))))) 1289 (calendar-cursor-to-date t event)))))
1267 (month (calendar-extract-month date)) 1290 (month (calendar-extract-month date))
1268 (year (calendar-extract-year date)) 1291 (year (calendar-extract-year date))
1269 (day (calendar-extract-day date)) 1292 (day (calendar-extract-day date))
1270 (d1 (calendar-absolute-from-gregorian date)) 1293 (d1 (calendar-absolute-from-gregorian date))
1271 (d2 (+ (* 7 n) d1)) 1294 (d2 (+ (* 7 n) d1))
1363 ;;; 1386 ;;;
1364 ;;; Daily calendars 1387 ;;; Daily calendars
1365 ;;; 1388 ;;;
1366 1389
1367 ;;;###cal-autoload 1390 ;;;###cal-autoload
1368 (defun cal-tex-cursor-day (&optional arg) 1391 (defun cal-tex-cursor-day (&optional n event)
1369 "Make a buffer with LaTeX commands for the day cursor is on. 1392 "Make a buffer with LaTeX commands for the day cursor is on.
1370 Optional prefix argument ARG specifies number of days. The calendar shows 1393 Optional prefix argument N specifies number of days. The calendar shows
1371 the hours between `cal-tex-daily-start' and `cal-tex-daily-end', using 1394 the hours between `cal-tex-daily-start' and `cal-tex-daily-end', using
1372 the 24-hour clock if `cal-tex-24' is non-nil." 1395 the 24-hour clock if `cal-tex-24' is non-nil. Optional EVENT indicates
1373 (interactive "p") 1396 a buffer position to use instead of point."
1374 (let ((n (or arg 1)) 1397 (interactive (list (prefix-numeric-value current-prefix-arg)
1375 (date (calendar-absolute-from-gregorian (calendar-cursor-to-date t)))) 1398 last-nonmenu-event))
1399 (or n (setq n 1))
1400 (let ((date (calendar-absolute-from-gregorian
1401 (calendar-cursor-to-date t event))))
1376 (cal-tex-preamble "12pt") 1402 (cal-tex-preamble "12pt")
1377 (cal-tex-cmd "\\textwidth 6.5in") 1403 (cal-tex-cmd "\\textwidth 6.5in")
1378 (cal-tex-cmd "\\textheight 10.5in") 1404 (cal-tex-cmd "\\textheight 10.5in")
1379 (cal-tex-b-document) 1405 (cal-tex-b-document)
1380 (cal-tex-cmd "\\pagestyle{empty}") 1406 (cal-tex-cmd "\\pagestyle{empty}")