2001-07-16 07:46:48 +00:00
|
|
|
;;; cal-tex.el --- calendar functions for printing calendars with LaTeX
|
1995-10-12 15:28:46 +00:00
|
|
|
|
2014-01-01 07:43:34 +00:00
|
|
|
;; Copyright (C) 1995, 2001-2014 Free Software Foundation, Inc.
|
1995-10-12 15:28:46 +00:00
|
|
|
|
|
|
|
;; Author: Steve Fisk <fisk@bowdoin.edu>
|
2008-03-15 02:56:30 +00:00
|
|
|
;; Edward M. Reingold <reingold@cs.uiuc.edu>
|
2005-12-10 05:46:09 +00:00
|
|
|
;; Maintainer: Glenn Morris <rgm@gnu.org>
|
1995-10-12 15:28:46 +00:00
|
|
|
;; Keywords: calendar
|
|
|
|
;; Human-Keywords: Calendar, LaTeX
|
2010-08-29 16:17:13 +00:00
|
|
|
;; Package: calendar
|
1995-10-12 15:28:46 +00:00
|
|
|
|
|
|
|
;; This file is part of GNU Emacs.
|
|
|
|
|
2008-05-06 03:07:58 +00:00
|
|
|
;; GNU Emacs is free software: you can redistribute it and/or modify
|
1995-10-12 15:28:46 +00:00
|
|
|
;; it under the terms of the GNU General Public License as published by
|
2008-05-06 03:07:58 +00:00
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
;; (at your option) any later version.
|
1995-10-12 15:28:46 +00:00
|
|
|
|
|
|
|
;; GNU Emacs is distributed in the hope that it will be useful,
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
2008-05-06 03:07:58 +00:00
|
|
|
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
|
1995-10-12 15:28:46 +00:00
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
1995-10-13 13:06:37 +00:00
|
|
|
;; This collection of functions implements the creation of LaTeX calendars
|
|
|
|
;; based on the user's holiday choices and diary file.
|
1995-10-12 15:28:46 +00:00
|
|
|
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
;; The user commands are:
|
|
|
|
;; 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
|
2012-10-06 18:34:23 +00:00
|
|
|
;; cal-tex-cursor-week2-summary
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
;; 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
|
|
|
|
|
1996-01-14 07:34:30 +00:00
|
|
|
;; TO DO
|
|
|
|
;;
|
|
|
|
;; (*) Add holidays and diary entries to daily calendar.
|
|
|
|
;;
|
|
|
|
;; (*) Add diary entries to weekly calendar functions.
|
|
|
|
;;
|
|
|
|
;; (*) Make calendar styles for A4 paper.
|
|
|
|
;;
|
1997-09-24 16:28:34 +00:00
|
|
|
;; (*) Make monthly styles Filofax paper.
|
1995-10-12 15:28:46 +00:00
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
|
|
|
(require 'calendar)
|
|
|
|
|
|
|
|
;;;
|
2003-02-04 13:24:35 +00:00
|
|
|
;;; Customizable variables
|
1995-10-12 15:28:46 +00:00
|
|
|
;;;
|
|
|
|
|
2008-03-08 03:46:13 +00:00
|
|
|
(defgroup calendar-tex nil
|
|
|
|
"Options for printing calendar with LaTeX."
|
|
|
|
:prefix "cal-tex-"
|
|
|
|
:group 'calendar)
|
|
|
|
|
1997-05-03 04:58:13 +00:00
|
|
|
(defcustom cal-tex-which-days '(0 1 2 3 4 5 6)
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
"The days of the week that are displayed on the portrait monthly calendar.
|
1995-10-12 15:28:46 +00:00
|
|
|
Sunday is 0, Monday is 1, and so on. The default is to print from Sunday to
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
Saturday. For example, use '(1 3 5) to only print Monday, Wednesday, Friday."
|
1997-05-03 04:58:13 +00:00
|
|
|
:type '(repeat integer)
|
|
|
|
:group 'calendar-tex)
|
1995-10-12 15:28:46 +00:00
|
|
|
|
1997-05-03 04:58:13 +00:00
|
|
|
(defcustom cal-tex-holidays t
|
2007-07-24 02:43:16 +00:00
|
|
|
"Non-nil means holidays are printed in the LaTeX calendars that support it.
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
Setting this to nil may speed up calendar generation."
|
1997-05-03 04:58:13 +00:00
|
|
|
:type 'boolean
|
|
|
|
:group 'calendar-tex)
|
1995-10-12 15:28:46 +00:00
|
|
|
|
1997-05-03 04:58:13 +00:00
|
|
|
(defcustom cal-tex-diary nil
|
2007-07-24 02:43:16 +00:00
|
|
|
"Non-nil means diary entries are printed in LaTeX calendars that support it.
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
Setting this to nil may speed up calendar generation."
|
1997-05-03 04:58:13 +00:00
|
|
|
:type 'boolean
|
|
|
|
:group 'calendar-tex)
|
1995-10-12 15:28:46 +00:00
|
|
|
|
1999-07-30 15:15:57 +00:00
|
|
|
(defcustom cal-tex-rules nil
|
2007-07-24 02:43:16 +00:00
|
|
|
"Non-nil means pages will be ruled in some LaTeX calendar styles.
|
|
|
|
At present, this only affects the daily filofax calendar."
|
1999-07-30 15:15:57 +00:00
|
|
|
:type 'boolean
|
|
|
|
:group 'calendar-tex)
|
|
|
|
|
1997-05-03 04:58:13 +00:00
|
|
|
(defcustom cal-tex-daily-string
|
2008-04-07 01:59:37 +00:00
|
|
|
'(let* ((year (calendar-extract-year date))
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(day (calendar-day-number date))
|
1995-10-12 15:28:46 +00:00
|
|
|
(days-remaining (- (calendar-day-number (list 12 31 year)) day)))
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(format "%d/%d" day days-remaining))
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
"Lisp expression giving the date format to use in the LaTeX calendars.
|
|
|
|
This should be an expression involving the variable `date'. When
|
|
|
|
this expression is called, `date' is a list of the form '(MONTH DAY YEAR)'.
|
|
|
|
|
|
|
|
The string resulting from evaluating this expression is placed at
|
|
|
|
the bottom center of each date in monthly calendars, next to the
|
|
|
|
date in the weekly calendars, and in the top center of daily calendars.
|
1995-10-12 15:28:46 +00:00
|
|
|
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
The default is ordinal day number of the year and the number of
|
|
|
|
days remaining. As an example, setting this to
|
1995-10-12 15:28:46 +00:00
|
|
|
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
'(calendar-hebrew-date-string date)
|
1995-10-12 15:28:46 +00:00
|
|
|
|
1997-05-03 04:58:13 +00:00
|
|
|
will put the Hebrew date at the bottom of each day."
|
|
|
|
:type 'sexp
|
|
|
|
:group 'calendar-tex)
|
|
|
|
|
|
|
|
(defcustom cal-tex-buffer "calendar.tex"
|
2007-07-24 02:43:16 +00:00
|
|
|
"The name for the output LaTeX calendar buffer."
|
1997-05-03 04:58:13 +00:00
|
|
|
:type 'string
|
|
|
|
:group 'calendar-tex)
|
|
|
|
|
|
|
|
(defcustom cal-tex-24 nil
|
2007-07-24 02:43:16 +00:00
|
|
|
"Non-nil means use a 24 hour clock in the daily calendar."
|
1997-05-03 04:58:13 +00:00
|
|
|
:type 'boolean
|
|
|
|
:group 'calendar-tex)
|
|
|
|
|
|
|
|
(defcustom cal-tex-daily-start 8
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
"The first hour of the daily LaTeX calendar page.
|
|
|
|
At present, this only affects `cal-tex-cursor-day'."
|
1997-05-03 04:58:13 +00:00
|
|
|
:type 'integer
|
|
|
|
:group 'calendar-tex)
|
|
|
|
|
|
|
|
(defcustom cal-tex-daily-end 20
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
"The last hour of the daily LaTeX calendar page.
|
Fix typos in docstrings.
* image-dired.el (image-dired-display-thumbs): Fix typo in docstring.
(image-dired-read-comment): Doc fix.
* json.el (json-object-type, json-array-type, json-key-type, json-false)
(json-null, json-read-number):
* minibuffer.el (completion-in-region-functions):
* calendar/cal-tex.el (cal-tex-daily-end, cal-tex-number-weeks)
(cal-tex-cursor-week):
* emacs-lisp/trace.el (trace-function):
* eshell/em-basic.el (eshell/printnl):
* eshell/em-dirs.el (eshell-last-dir-ring, eshell-parse-drive-letter)
(eshell-read-last-dir-ring, eshell-write-last-dir-ring):
* obsolete/levents.el (allocate-event, event-key, event-object)
(event-point, event-process, event-timestamp, event-to-character)
(event-window, event-x, event-x-pixel, event-y, event-y-pixel):
* textmodes/reftex-vars.el (reftex-index-macros-builtin)
(reftex-section-levels, reftex-auto-recenter-toc, reftex-toc-mode-hook)
(reftex-cite-punctuation, reftex-search-unrecursed-path-first)
(reftex-highlight-selection): Fix typos in docstrings.
2010-03-22 16:50:29 +00:00
|
|
|
At present, this only affects `cal-tex-cursor-day'."
|
1997-05-03 04:58:13 +00:00
|
|
|
:type 'integer
|
|
|
|
:group 'calendar-tex)
|
1995-10-12 15:28:46 +00:00
|
|
|
|
2006-05-01 03:29:19 +00:00
|
|
|
(defcustom cal-tex-preamble-extra nil
|
|
|
|
"A string giving extra LaTeX commands to insert in the calendar preamble.
|
|
|
|
For example, to include extra packages:
|
|
|
|
\"\\\\usepackage{foo}\\n\\\\usepackage{bar}\\n\"."
|
2009-03-15 21:32:14 +00:00
|
|
|
:type '(choice (const nil)
|
|
|
|
;; An example to help people format things in custom.
|
|
|
|
(string :value "\\usepackage{foo}\n\\usepackage{bar}\n"))
|
2006-05-01 03:29:19 +00:00
|
|
|
:group 'calendar-tex
|
|
|
|
:version "22.1")
|
|
|
|
|
2002-04-03 14:35:33 +00:00
|
|
|
(defcustom cal-tex-hook nil
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
"List of functions called after any LaTeX calendar buffer is generated.
|
2008-03-15 02:56:30 +00:00
|
|
|
You can use this to do post-processing on the buffer. For example, to change
|
2002-04-03 14:35:33 +00:00
|
|
|
characters with diacritical marks to their LaTeX equivalents, use
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
(add-hook 'cal-tex-hook
|
|
|
|
(lambda () (iso-iso2tex (point-min) (point-max))))"
|
2002-04-03 14:35:33 +00:00
|
|
|
:type 'hook
|
|
|
|
:group 'calendar-tex)
|
|
|
|
|
|
|
|
(defcustom cal-tex-year-hook nil
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
"List of functions called after a LaTeX year calendar buffer is generated."
|
2002-04-03 14:35:33 +00:00
|
|
|
:type 'hook
|
|
|
|
:group 'calendar-tex)
|
|
|
|
|
|
|
|
(defcustom cal-tex-month-hook nil
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
"List of functions called after a LaTeX month calendar buffer is generated."
|
2002-04-03 14:35:33 +00:00
|
|
|
:type 'hook
|
|
|
|
:group 'calendar-tex)
|
|
|
|
|
|
|
|
(defcustom cal-tex-week-hook nil
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
"List of functions called after a LaTeX week calendar buffer is generated."
|
2002-04-03 14:35:33 +00:00
|
|
|
:type 'hook
|
|
|
|
:group 'calendar-tex)
|
|
|
|
|
|
|
|
(defcustom cal-tex-daily-hook nil
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
"List of functions called after a LaTeX daily calendar buffer is generated."
|
2002-04-03 14:35:33 +00:00
|
|
|
:type 'hook
|
|
|
|
:group 'calendar-tex)
|
|
|
|
|
1995-10-12 15:28:46 +00:00
|
|
|
;;;
|
|
|
|
;;; Definitions for LaTeX code
|
|
|
|
;;;
|
|
|
|
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
(defconst cal-tex-day-prefix "\\caldate{%s}{%s}"
|
2003-02-04 13:24:35 +00:00
|
|
|
"The initial LaTeX code for a day.
|
1995-10-12 15:28:46 +00:00
|
|
|
The holidays, diary entries, bottom string, and the text follow.")
|
2003-02-04 13:24:35 +00:00
|
|
|
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
(defconst cal-tex-day-name-format "\\myday{%s}%%"
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
"The format for LaTeX code for a day name.
|
|
|
|
The names are taken from `calendar-day-name-array'.")
|
1995-10-12 15:28:46 +00:00
|
|
|
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
(defconst cal-tex-cal-one-month
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
"\\def\\calmonth#1#2%
|
1995-10-12 15:28:46 +00:00
|
|
|
{\\begin{center}%
|
|
|
|
\\Huge\\bf\\uppercase{#1} #2 \\\\[1cm]%
|
2003-02-04 13:24:35 +00:00
|
|
|
\\end{center}}%
|
1995-10-12 15:28:46 +00:00
|
|
|
\\vspace*{-1.5cm}%
|
|
|
|
%
|
|
|
|
"
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
"LaTeX code for the month header, for a single month calendar.")
|
1995-10-12 15:28:46 +00:00
|
|
|
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
(defconst cal-tex-cal-multi-month
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
"\\def\\calmonth#1#2#3#4%
|
1995-10-12 15:28:46 +00:00
|
|
|
{\\begin{center}%
|
|
|
|
\\Huge\\bf #1 #2---#3 #4\\\\[1cm]%
|
2003-02-04 13:24:35 +00:00
|
|
|
\\end{center}}%
|
1995-10-12 15:28:46 +00:00
|
|
|
\\vspace*{-1.5cm}%
|
|
|
|
%
|
|
|
|
"
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
"LaTeX code for the month header, for a multi-month calendar.")
|
1995-10-12 15:28:46 +00:00
|
|
|
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
(defconst cal-tex-myday
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
"\\renewcommand{\\myday}[1]%
|
1995-10-12 15:28:46 +00:00
|
|
|
{\\makebox[\\cellwidth]{\\hfill\\large\\bf#1\\hfill}}
|
|
|
|
%
|
|
|
|
"
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
"LaTeX code for a day heading.")
|
1995-10-12 15:28:46 +00:00
|
|
|
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
(defconst cal-tex-caldate
|
1995-10-12 15:28:46 +00:00
|
|
|
"\\fboxsep=0pt
|
|
|
|
\\long\\def\\caldate#1#2#3#4#5#6{%
|
|
|
|
\\fbox{\\hbox to\\cellwidth{%
|
|
|
|
\\vbox to\\cellheight{%
|
|
|
|
\\hbox to\\cellwidth{%
|
|
|
|
{\\hspace*{1mm}\\Large \\bf \\strut #2}\\hspace{.05\\cellwidth}%
|
|
|
|
\\raisebox{\\holidaymult\\cellheight}%
|
|
|
|
{\\parbox[t]{.75\\cellwidth}{\\tiny \\raggedright #4}}}
|
|
|
|
\\hbox to\\cellwidth{%
|
|
|
|
\\hspace*{1mm}\\parbox{.95\\cellwidth}{\\tiny \\raggedright #3}}
|
|
|
|
\\hspace*{1mm}%
|
|
|
|
\\hbox to\\cellwidth{#6}%
|
|
|
|
\\vfill%
|
|
|
|
\\hbox to\\cellwidth{\\hfill \\tiny #5 \\hfill}%
|
|
|
|
\\vskip 1.4pt}%
|
|
|
|
\\hskip -0.4pt}}}
|
|
|
|
"
|
|
|
|
"LaTeX code to insert one box with date info in calendar.
|
|
|
|
This definition is the heart of the calendar!")
|
|
|
|
|
2012-08-21 07:46:47 +00:00
|
|
|
(defconst cal-tex-lefthead
|
|
|
|
"\\def\\lefthead#1{\\noindent {\\normalsize \\bf #1}\\hfill\\\\[-6pt]}\n"
|
|
|
|
"LaTeX code for left header.")
|
|
|
|
|
|
|
|
(defconst cal-tex-righthead
|
|
|
|
"\\def\\righthead#1{\\hfill {\\normalsize \\bf #1}\\\\[-6pt]}\n"
|
|
|
|
"LaTeX code for right header.")
|
|
|
|
|
2012-05-05 20:58:14 +00:00
|
|
|
(autoload 'holiday-in-range "holidays")
|
|
|
|
|
2012-08-15 16:29:11 +00:00
|
|
|
(define-obsolete-function-alias 'cal-tex-list-holidays 'holiday-in-range "24.3")
|
1995-10-12 15:28:46 +00:00
|
|
|
|
2008-03-13 05:47:55 +00:00
|
|
|
(autoload 'diary-list-entries "diary-lib")
|
|
|
|
|
1995-10-12 15:28:46 +00:00
|
|
|
(defun cal-tex-list-diary-entries (d1 d2)
|
|
|
|
"Generate a list of all diary-entries from absolute date D1 to D2."
|
2008-05-30 02:58:50 +00:00
|
|
|
(let (diary-list-include-blanks)
|
|
|
|
(diary-list-entries (calendar-gregorian-from-absolute d1)
|
|
|
|
(1+ (- d2 d1)) t)))
|
1995-10-12 15:28:46 +00:00
|
|
|
|
|
|
|
(defun cal-tex-preamble (&optional args)
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
"Insert the LaTeX calendar preamble into `cal-tex-buffer'.
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
Preamble includes initial definitions for various LaTeX commands.
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
Optional string ARGS are included as options for the article document class."
|
2012-08-21 07:08:50 +00:00
|
|
|
(set-buffer (generate-new-buffer cal-tex-buffer))
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
(insert (format "\\documentclass%s{article}\n"
|
|
|
|
(if (stringp args)
|
|
|
|
(format "[%s]" args)
|
|
|
|
"")))
|
2006-05-01 03:29:19 +00:00
|
|
|
(if (stringp cal-tex-preamble-extra)
|
|
|
|
(insert cal-tex-preamble-extra "\n"))
|
2012-08-21 18:15:56 +00:00
|
|
|
;; FIXME boxwidth and boxheight unused?
|
2006-05-01 03:29:19 +00:00
|
|
|
(insert "\\hbadness 20000
|
1996-01-24 15:58:39 +00:00
|
|
|
\\hfuzz=1000pt
|
1995-10-12 15:28:46 +00:00
|
|
|
\\vbadness 20000
|
1997-03-19 19:00:22 +00:00
|
|
|
\\lineskip 0pt
|
1995-10-12 15:28:46 +00:00
|
|
|
\\marginparwidth 0pt
|
|
|
|
\\oddsidemargin -2cm
|
|
|
|
\\evensidemargin -2cm
|
|
|
|
\\marginparsep 0pt
|
|
|
|
\\topmargin 0pt
|
|
|
|
\\textwidth 7.5in
|
|
|
|
\\textheight 9.5in
|
|
|
|
\\newlength{\\cellwidth}
|
|
|
|
\\newlength{\\cellheight}
|
|
|
|
\\newlength{\\boxwidth}
|
|
|
|
\\newlength{\\boxheight}
|
|
|
|
\\newlength{\\cellsize}
|
|
|
|
\\newcommand{\\myday}[1]{}
|
|
|
|
\\newcommand{\\caldate}[6]{}
|
|
|
|
\\newcommand{\\nocaldate}[6]{}
|
|
|
|
\\newcommand{\\calsmall}[6]{}
|
|
|
|
%
|
|
|
|
"))
|
|
|
|
|
|
|
|
;;;
|
|
|
|
;;; Yearly calendars
|
|
|
|
;;;
|
|
|
|
|
2008-03-13 05:47:55 +00:00
|
|
|
;;;###cal-autoload
|
2008-06-18 02:55:13 +00:00
|
|
|
(defun cal-tex-cursor-year (&optional n event)
|
1995-10-12 15:28:46 +00:00
|
|
|
"Make a buffer with LaTeX commands for the year cursor is on.
|
2008-06-18 02:55:13 +00:00
|
|
|
Optional prefix argument N specifies number of years.
|
|
|
|
Optional EVENT indicates a buffer position to use instead of point."
|
|
|
|
(interactive (list (prefix-numeric-value current-prefix-arg)
|
|
|
|
last-nonmenu-event))
|
|
|
|
(cal-tex-year (calendar-extract-year (calendar-cursor-to-date t event))
|
|
|
|
(or n 1)))
|
1995-10-12 15:28:46 +00:00
|
|
|
|
2008-03-13 05:47:55 +00:00
|
|
|
;;;###cal-autoload
|
2008-06-18 02:55:13 +00:00
|
|
|
(defun cal-tex-cursor-year-landscape (&optional n event)
|
1995-10-12 15:28:46 +00:00
|
|
|
"Make a buffer with LaTeX commands for the year cursor is on.
|
2008-06-18 02:55:13 +00:00
|
|
|
Optional prefix argument N specifies number of years.
|
|
|
|
Optional EVENT indicates a buffer position to use instead of point."
|
|
|
|
(interactive (list (prefix-numeric-value current-prefix-arg)
|
|
|
|
last-nonmenu-event))
|
|
|
|
(cal-tex-year (calendar-extract-year (calendar-cursor-to-date t event))
|
|
|
|
(or n 1) t))
|
1995-10-12 15:28:46 +00:00
|
|
|
|
|
|
|
(defun cal-tex-year (year n &optional landscape)
|
|
|
|
"Make a one page yearly calendar of YEAR; do this for N years.
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
There are four rows of three months each, unless optional
|
|
|
|
LANDSCAPE is non-nil, in which case the calendar is printed in
|
|
|
|
landscape mode with three rows of four months each."
|
1995-10-12 15:28:46 +00:00
|
|
|
(cal-tex-insert-preamble 1 landscape "12pt")
|
|
|
|
(if landscape
|
|
|
|
(cal-tex-vspace "-.6cm")
|
|
|
|
(cal-tex-vspace "-3.1cm"))
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(dotimes (j n)
|
2007-07-24 02:43:16 +00:00
|
|
|
(insert "\\vfill%\n")
|
|
|
|
(cal-tex-b-center)
|
|
|
|
(cal-tex-Huge (number-to-string year))
|
|
|
|
(cal-tex-e-center)
|
|
|
|
(cal-tex-vspace "1cm")
|
|
|
|
(cal-tex-b-center)
|
|
|
|
(cal-tex-b-parbox "l" (if landscape "5.9in" "4.3in"))
|
|
|
|
(insert "\n")
|
|
|
|
(cal-tex-noindent)
|
|
|
|
(cal-tex-nl)
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(dotimes (i 12)
|
|
|
|
(insert (cal-tex-mini-calendar (1+ i) year "month" "1.1in" "1in"))
|
|
|
|
(insert "\\month")
|
|
|
|
(cal-tex-hspace "0.5in")
|
|
|
|
(if (zerop (mod (1+ i) (if landscape 4 3)))
|
|
|
|
(cal-tex-nl "0.5in")))
|
2007-07-24 02:43:16 +00:00
|
|
|
(cal-tex-e-parbox)
|
|
|
|
(cal-tex-e-center)
|
|
|
|
(insert "\\vfill%\n")
|
|
|
|
(setq year (1+ year))
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(if (= j (1- n))
|
|
|
|
(cal-tex-end-document)
|
|
|
|
(cal-tex-newpage))
|
2007-07-24 02:43:16 +00:00
|
|
|
(run-hooks 'cal-tex-year-hook))
|
1995-10-12 15:28:46 +00:00
|
|
|
(run-hooks 'cal-tex-hook))
|
|
|
|
|
2012-08-21 02:29:25 +00:00
|
|
|
|
|
|
|
(defun cal-tex-filofax-paper (&optional year)
|
|
|
|
"Insert some page size settings for filofax layouts."
|
|
|
|
(insert "\\textwidth 3.25in
|
|
|
|
\\textheight 6.5in
|
|
|
|
\\headheight -0.875in
|
|
|
|
\\topmargin 0pt
|
|
|
|
")
|
|
|
|
(insert
|
|
|
|
;; Why is this one subtly different? Who knows...
|
|
|
|
(if year "\\oddsidemargin 1.675in
|
|
|
|
\\evensidemargin 1.675in
|
|
|
|
"
|
|
|
|
"\\oddsidemargin 1.75in
|
|
|
|
\\evensidemargin 1.5in
|
|
|
|
\\headsep 0.125in
|
|
|
|
\\footskip 0.125in
|
|
|
|
")))
|
|
|
|
|
2012-08-22 00:39:44 +00:00
|
|
|
(defun cal-tex-longday (funcname height)
|
|
|
|
"Insert LaTeX code for a long day function."
|
|
|
|
(insert "\\long\\def\\" funcname "#1#2#3#4#5{%
|
2012-08-21 07:59:25 +00:00
|
|
|
\\rule{\\textwidth}{0.3pt}\\\\%
|
|
|
|
\\hbox to \\textwidth{%
|
|
|
|
\\vbox to " height "{%
|
2012-08-22 00:39:44 +00:00
|
|
|
\\vspace*{2pt}%
|
|
|
|
\\hbox to \\textwidth{"
|
|
|
|
(if (string-equal funcname "leftday")
|
|
|
|
"\\noindent {\\normalsize \\bf #2} \\small #1 \\hfill #5}%\n"
|
|
|
|
"\\small #5 \\hfill #1 {\\normalsize \\bf #2}}%\n")
|
|
|
|
" \\hbox to \\textwidth{\\vbox {\\"
|
|
|
|
(if (string-equal funcname "leftday") "noindent" "raggedleft")
|
|
|
|
" \\footnotesize \\em #4}}%
|
|
|
|
\\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\}\n"))
|
2012-08-21 07:59:25 +00:00
|
|
|
|
2012-08-21 18:15:56 +00:00
|
|
|
(defun cal-tex-shortday (funcname)
|
|
|
|
"Insert LaTeX code for a short day function."
|
|
|
|
(insert "\\long\\def\\" funcname "#1#2#3{%
|
|
|
|
\\rule{\\textwidth}{0.3pt}\\\\%
|
|
|
|
\\hbox to \\textwidth{%
|
|
|
|
\\vbox {%
|
|
|
|
\\vspace*{2pt}%
|
|
|
|
\\hbox to \\textwidth{\\hfill \\small #3 \\hfill}%
|
|
|
|
\\hbox to \\textwidth{\\vbox {\\"
|
|
|
|
(if (string-equal funcname "rightday") "raggedleft" "noindent")
|
|
|
|
" \\em #2}}%
|
|
|
|
\\hbox to \\textwidth{\\vbox {\\noindent \\footnotesize #1}}}}}\n"))
|
|
|
|
|
2008-03-13 05:47:55 +00:00
|
|
|
;;;###cal-autoload
|
2008-06-18 02:55:13 +00:00
|
|
|
(defun cal-tex-cursor-filofax-year (&optional n event)
|
1995-10-12 15:28:46 +00:00
|
|
|
"Make a Filofax one page yearly calendar of year indicated by cursor.
|
2008-06-18 02:55:13 +00:00
|
|
|
Optional prefix argument N specifies number of years.
|
|
|
|
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 ((year (calendar-extract-year (calendar-cursor-to-date t event))))
|
1995-10-12 15:28:46 +00:00
|
|
|
(cal-tex-preamble "twoside")
|
2012-08-21 02:29:25 +00:00
|
|
|
(cal-tex-filofax-paper 'year)
|
1996-06-14 18:39:08 +00:00
|
|
|
(cal-tex-cmd "\\fboxsep 0.5mm")
|
2012-08-21 06:35:48 +00:00
|
|
|
(cal-tex-cmd "\\pagestyle" "empty")
|
1995-10-12 15:28:46 +00:00
|
|
|
(cal-tex-b-document)
|
2012-08-21 06:50:55 +00:00
|
|
|
(cal-tex-vspace "0.25in")
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(dotimes (j n)
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
(insert (format "\\hfil \\textbf{\\Large %s} \\hfil\\\\\n" year))
|
2007-07-24 02:43:16 +00:00
|
|
|
(cal-tex-b-center)
|
|
|
|
(cal-tex-b-parbox "l" "\\textwidth")
|
|
|
|
(insert "\n")
|
|
|
|
(cal-tex-noindent)
|
|
|
|
(cal-tex-nl)
|
|
|
|
(let ((month-names; don't use default in case user changed it
|
|
|
|
;; These are only used to define the command names, not
|
|
|
|
;; the names of the months they insert.
|
|
|
|
["January" "February" "March" "April" "May" "June"
|
|
|
|
"July" "August" "September" "October" "November" "December"]))
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(dotimes (i 12)
|
|
|
|
(insert (cal-tex-mini-calendar (1+ i) year (aref month-names i)
|
2007-07-24 02:43:16 +00:00
|
|
|
"1in" ".9in" "tiny" "0.6mm"))))
|
|
|
|
(insert
|
|
|
|
"\\noindent\\fbox{\\January}\\fbox{\\February}\\fbox{\\March}\\\\
|
1995-10-12 15:28:46 +00:00
|
|
|
\\noindent\\fbox{\\April}\\fbox{\\May}\\fbox{\\June}\\\\
|
|
|
|
\\noindent\\fbox{\\July}\\fbox{\\August}\\fbox{\\September}\\\\
|
|
|
|
\\noindent\\fbox{\\October}\\fbox{\\November}\\fbox{\\December}
|
|
|
|
")
|
2007-07-24 02:43:16 +00:00
|
|
|
(cal-tex-e-parbox)
|
|
|
|
(cal-tex-e-center)
|
|
|
|
(setq year (1+ year))
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(if (= j (1- n))
|
2007-07-24 02:43:16 +00:00
|
|
|
(cal-tex-end-document)
|
|
|
|
(cal-tex-newpage)
|
2012-08-21 06:50:55 +00:00
|
|
|
(cal-tex-vspace "0.25in"))
|
2007-07-24 02:43:16 +00:00
|
|
|
(run-hooks 'cal-tex-year-hook))
|
1995-10-12 15:28:46 +00:00
|
|
|
(run-hooks 'cal-tex-hook)))
|
|
|
|
|
|
|
|
;;;
|
|
|
|
;;; Monthly calendars
|
|
|
|
;;;
|
|
|
|
|
2008-03-13 05:47:55 +00:00
|
|
|
;;;###cal-autoload
|
2008-06-18 02:55:13 +00:00
|
|
|
(defun cal-tex-cursor-month-landscape (&optional n event)
|
2007-07-24 02:43:16 +00:00
|
|
|
"Make a LaTeX calendar buffer for the month the cursor is on.
|
2008-06-18 02:55:13 +00:00
|
|
|
Optional prefix argument N specifies number of months to be
|
2007-07-24 02:43:16 +00:00
|
|
|
produced (default 1). The output is in landscape format, one
|
|
|
|
month to a page. It shows holiday and diary entries if
|
2008-06-18 02:55:13 +00:00
|
|
|
`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))
|
2008-04-07 01:59:37 +00:00
|
|
|
(month (calendar-extract-month date))
|
|
|
|
(year (calendar-extract-year date))
|
1995-10-12 15:28:46 +00:00
|
|
|
(end-month month)
|
|
|
|
(end-year year)
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(cal-tex-which-days '(0 1 2 3 4 5 6))
|
|
|
|
(d1 (calendar-absolute-from-gregorian (list month 1 year)))
|
2009-10-06 02:36:35 +00:00
|
|
|
(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)))
|
2012-05-05 20:58:14 +00:00
|
|
|
(holidays (if cal-tex-holidays (holiday-in-range d1 d2)))
|
2008-04-01 02:43:57 +00:00
|
|
|
other-month other-year small-months-at-start)
|
|
|
|
(cal-tex-insert-preamble (cal-tex-number-weeks month year 1) t "12pt")
|
|
|
|
(cal-tex-cmd cal-tex-cal-one-month)
|
|
|
|
(dotimes (i n)
|
|
|
|
(setq other-month month
|
|
|
|
other-year year)
|
2008-04-07 01:59:37 +00:00
|
|
|
(calendar-increment-month other-month other-year -1)
|
2008-04-01 02:43:57 +00:00
|
|
|
(insert (cal-tex-mini-calendar other-month other-year "lastmonth"
|
|
|
|
"\\cellwidth" "\\cellheight"))
|
2008-04-07 01:59:37 +00:00
|
|
|
(calendar-increment-month other-month other-year 2)
|
2008-04-01 02:43:57 +00:00
|
|
|
(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))
|
2007-07-24 02:43:16 +00:00
|
|
|
calendar-week-start-day)
|
2008-04-01 02:43:57 +00:00
|
|
|
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%
|
2002-04-03 14:35:33 +00:00
|
|
|
"))
|
2008-04-01 02:43:57 +00:00
|
|
|
(unless (= i (1- n))
|
|
|
|
(run-hooks 'cal-tex-month-hook)
|
|
|
|
(cal-tex-newpage)
|
2008-04-07 01:59:37 +00:00
|
|
|
(calendar-increment-month month year 1)
|
2008-04-01 02:43:57 +00:00
|
|
|
(cal-tex-vspace "-2cm")
|
|
|
|
(cal-tex-insert-preamble
|
|
|
|
(cal-tex-number-weeks month year 1) t "12pt" t))))
|
|
|
|
(cal-tex-end-document)
|
|
|
|
(run-hooks 'cal-tex-hook))
|
1995-10-12 15:28:46 +00:00
|
|
|
|
2008-03-13 05:47:55 +00:00
|
|
|
;;;###cal-autoload
|
2008-06-18 02:55:13 +00:00
|
|
|
(defun cal-tex-cursor-month (&optional n event)
|
2007-07-24 02:43:16 +00:00
|
|
|
"Make a LaTeX calendar buffer for the month the cursor is on.
|
2008-06-18 02:55:13 +00:00
|
|
|
Optional prefix argument N specifies number of months to be
|
2007-07-24 02:43:16 +00:00
|
|
|
produced (default 1). The calendar is condensed onto one page.
|
|
|
|
It shows holiday and diary entries if `cal-tex-holidays' and
|
2008-06-18 02:55:13 +00:00
|
|
|
`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))
|
2008-04-07 01:59:37 +00:00
|
|
|
(month (calendar-extract-month date))
|
|
|
|
(year (calendar-extract-year date))
|
1995-10-12 15:28:46 +00:00
|
|
|
(end-month month)
|
|
|
|
(end-year year)
|
2010-07-10 23:34:57 +00:00
|
|
|
;; FIXME -landscape sets cal-tex-which-days?
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(d1 (calendar-absolute-from-gregorian (list month 1 year)))
|
2009-10-06 02:36:35 +00:00
|
|
|
(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)))
|
2012-05-05 20:58:14 +00:00
|
|
|
(holidays (if cal-tex-holidays (holiday-in-range d1 d2))))
|
2008-04-01 02:43:57 +00:00
|
|
|
(cal-tex-insert-preamble (cal-tex-number-weeks month year n) nil "12pt")
|
|
|
|
(if (> n 1)
|
|
|
|
(cal-tex-cmd cal-tex-cal-multi-month)
|
|
|
|
(cal-tex-cmd cal-tex-cal-one-month))
|
|
|
|
(cal-tex-insert-month-header n month year end-month end-year)
|
|
|
|
(cal-tex-insert-day-names)
|
|
|
|
(cal-tex-nl ".2cm")
|
|
|
|
(cal-tex-insert-blank-days month year cal-tex-day-prefix)
|
2011-04-19 04:11:01 +00:00
|
|
|
(dotimes (_idummy n)
|
2008-04-01 02:43:57 +00:00
|
|
|
(cal-tex-insert-days month year diary-list holidays cal-tex-day-prefix)
|
2010-07-10 23:34:57 +00:00
|
|
|
(when (= (calendar-week-end-day)
|
|
|
|
(calendar-day-of-week
|
|
|
|
(list month
|
|
|
|
(calendar-last-day-of-month month year)
|
|
|
|
year))) ; last day of month was last day of week
|
2008-04-01 02:43:57 +00:00
|
|
|
(cal-tex-hfill)
|
|
|
|
(cal-tex-nl))
|
2008-04-07 01:59:37 +00:00
|
|
|
(calendar-increment-month month year 1))
|
2008-04-01 02:43:57 +00:00
|
|
|
(cal-tex-insert-blank-days-at-end end-month end-year cal-tex-day-prefix))
|
|
|
|
(cal-tex-end-document)
|
1995-10-12 15:28:46 +00:00
|
|
|
(run-hooks 'cal-tex-hook))
|
|
|
|
|
2003-02-04 13:24:35 +00:00
|
|
|
(defun cal-tex-insert-days (month year diary-list holidays day-format)
|
1995-10-12 15:28:46 +00:00
|
|
|
"Insert LaTeX commands for a range of days in monthly calendars.
|
|
|
|
LaTeX commands are inserted for the days of the MONTH in YEAR.
|
2007-07-24 02:43:16 +00:00
|
|
|
Diary entries on DIARY-LIST are included. Holidays on HOLIDAYS
|
|
|
|
are included. Each day is formatted using format DAY-FORMAT."
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(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))
|
|
|
|
date j)
|
|
|
|
(dotimes (i last)
|
|
|
|
(setq j (1+ i) ; 1-last, incl
|
|
|
|
date (list month j year))
|
|
|
|
(when (memq (calendar-day-of-week date) cal-tex-which-days)
|
|
|
|
(insert (format day-format (cal-tex-month-name month) j))
|
|
|
|
(cal-tex-arg (cal-tex-latexify-list diary-list date))
|
|
|
|
(cal-tex-arg (cal-tex-latexify-list holidays date))
|
|
|
|
(cal-tex-arg (eval cal-tex-daily-string))
|
|
|
|
(cal-tex-arg)
|
|
|
|
(cal-tex-comment))
|
|
|
|
(when (and (zerop (mod (+ j blank-days) 7))
|
|
|
|
(/= j last))
|
|
|
|
(cal-tex-hfill)
|
|
|
|
(cal-tex-nl)))))
|
1995-10-12 15:28:46 +00:00
|
|
|
|
|
|
|
(defun cal-tex-insert-day-names ()
|
|
|
|
"Insert the names of the days at top of a monthly calendar."
|
2010-07-10 23:34:57 +00:00
|
|
|
(let (j)
|
|
|
|
(dotimes (i 7)
|
|
|
|
(if (memq (setq j (mod (+ calendar-week-start-day i) 7))
|
|
|
|
cal-tex-which-days)
|
|
|
|
(insert (format cal-tex-day-name-format
|
|
|
|
(cal-tex-LaTeXify-string
|
|
|
|
(aref calendar-day-name-array j)))))
|
|
|
|
(cal-tex-comment))))
|
1995-10-12 15:28:46 +00:00
|
|
|
|
|
|
|
(defun cal-tex-insert-month-header (n month year end-month end-year)
|
|
|
|
"Create a title for a calendar.
|
2003-02-04 13:24:35 +00:00
|
|
|
A title is inserted for a calendar with N months starting with
|
1995-10-12 15:28:46 +00:00
|
|
|
MONTH YEAR and ending with END-MONTH END-YEAR."
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(let ((month-name (cal-tex-month-name month))
|
|
|
|
(end-month-name (cal-tex-month-name end-month)))
|
1995-10-12 15:28:46 +00:00
|
|
|
(if (= 1 n)
|
|
|
|
(insert (format "\\calmonth{%s}{%s}\n\\vspace*{-0.5cm}"
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
month-name year) )
|
|
|
|
(insert (format "\\calmonth{%s}{%s}{%s}{%s}\n\\vspace*{-0.5cm}"
|
|
|
|
month-name year end-month-name end-year))))
|
1995-10-12 15:28:46 +00:00
|
|
|
(cal-tex-comment))
|
|
|
|
|
|
|
|
(defun cal-tex-insert-blank-days (month year day-format)
|
|
|
|
"Insert code for initial days not in calendar.
|
|
|
|
Insert LaTeX code for the blank days at the beginning of the MONTH in
|
|
|
|
YEAR. The entry is formatted using DAY-FORMAT. If the entire week is
|
|
|
|
blank, no days are inserted."
|
|
|
|
(if (cal-tex-first-blank-p month year)
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(let ((blank-days ; at start of month
|
|
|
|
(mod
|
|
|
|
(- (calendar-day-of-week (list month 1 year))
|
|
|
|
calendar-week-start-day)
|
|
|
|
7)))
|
|
|
|
(dotimes (i blank-days)
|
2010-07-10 23:34:57 +00:00
|
|
|
(if (memq (mod (+ calendar-week-start-day i) 7) cal-tex-which-days)
|
2007-07-24 02:43:16 +00:00
|
|
|
(insert (format day-format " " " ") "{}{}{}{}%\n"))))))
|
1995-10-12 15:28:46 +00:00
|
|
|
|
|
|
|
(defun cal-tex-insert-blank-days-at-end (month year day-format)
|
|
|
|
"Insert code for final days not in calendar.
|
|
|
|
Insert LaTeX code for the blank days at the end of the MONTH in YEAR.
|
|
|
|
The entry is formatted using DAY-FORMAT."
|
|
|
|
(if (cal-tex-last-blank-p month year)
|
|
|
|
(let* ((last-day (calendar-last-day-of-month month year))
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(blank-days ; at end of month
|
1995-10-12 15:28:46 +00:00
|
|
|
(mod
|
|
|
|
(- (calendar-day-of-week (list month last-day year))
|
|
|
|
calendar-week-start-day)
|
2008-04-02 03:16:47 +00:00
|
|
|
7))
|
|
|
|
(i blank-days))
|
|
|
|
(while (<= (setq i (1+ i)) 6)
|
2010-07-10 23:34:57 +00:00
|
|
|
(if (memq (mod (+ calendar-week-start-day i) 7) cal-tex-which-days)
|
2008-04-02 03:16:47 +00:00
|
|
|
(insert (format day-format "" "") "{}{}{}{}%\n"))))))
|
1995-10-12 15:28:46 +00:00
|
|
|
|
|
|
|
(defun cal-tex-first-blank-p (month year)
|
|
|
|
"Determine if any days of the first week will be printed.
|
|
|
|
Return t if there will there be any days of the first week printed
|
|
|
|
in the calendar starting in MONTH YEAR."
|
2010-07-10 23:34:57 +00:00
|
|
|
;; Check days 1-7 of the month, until we find the last day of the week.
|
|
|
|
(catch 'found
|
|
|
|
(let (dow)
|
|
|
|
(dotimes (i 7)
|
|
|
|
(if (memq (setq dow (calendar-day-of-week (list month (1+ i) year)))
|
|
|
|
cal-tex-which-days)
|
|
|
|
(throw 'found t)
|
|
|
|
(if (= dow (calendar-week-end-day)) (throw 'found nil)))))))
|
1995-10-12 15:28:46 +00:00
|
|
|
|
|
|
|
(defun cal-tex-last-blank-p (month year)
|
|
|
|
"Determine if any days of the last week will be printed.
|
|
|
|
Return t if there will there be any days of the last week printed
|
|
|
|
in the calendar starting in MONTH YEAR."
|
2010-07-10 23:34:57 +00:00
|
|
|
;; Check backwards from the last day of the month, until we find the
|
|
|
|
;; start of the last week in the month.
|
|
|
|
(catch 'found
|
|
|
|
(let ((last-day (calendar-last-day-of-month month year))
|
2011-04-19 04:11:01 +00:00
|
|
|
dow)
|
2010-07-10 23:34:57 +00:00
|
|
|
(dotimes (i 7)
|
|
|
|
(if (memq (setq dow (calendar-day-of-week
|
|
|
|
(list month (- last-day i) year)))
|
|
|
|
cal-tex-which-days)
|
|
|
|
(throw 'found t)
|
|
|
|
(if (= dow calendar-week-start-day) (throw 'found nil)))))))
|
1995-10-12 15:28:46 +00:00
|
|
|
|
|
|
|
(defun cal-tex-number-weeks (month year n)
|
|
|
|
"Determine the number of weeks in a range of dates.
|
Fix typos in docstrings.
* image-dired.el (image-dired-display-thumbs): Fix typo in docstring.
(image-dired-read-comment): Doc fix.
* json.el (json-object-type, json-array-type, json-key-type, json-false)
(json-null, json-read-number):
* minibuffer.el (completion-in-region-functions):
* calendar/cal-tex.el (cal-tex-daily-end, cal-tex-number-weeks)
(cal-tex-cursor-week):
* emacs-lisp/trace.el (trace-function):
* eshell/em-basic.el (eshell/printnl):
* eshell/em-dirs.el (eshell-last-dir-ring, eshell-parse-drive-letter)
(eshell-read-last-dir-ring, eshell-write-last-dir-ring):
* obsolete/levents.el (allocate-event, event-key, event-object)
(event-point, event-process, event-timestamp, event-to-character)
(event-window, event-x, event-x-pixel, event-y, event-y-pixel):
* textmodes/reftex-vars.el (reftex-index-macros-builtin)
(reftex-section-levels, reftex-auto-recenter-toc, reftex-toc-mode-hook)
(reftex-cite-punctuation, reftex-search-unrecursed-path-first)
(reftex-highlight-selection): Fix typos in docstrings.
2010-03-22 16:50:29 +00:00
|
|
|
Compute the number of weeks in the calendar starting with MONTH and YEAR,
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
and lasting N months, including only the days in WHICH-DAYS. As it stands,
|
1995-10-12 15:28:46 +00:00
|
|
|
this is only an upper bound."
|
|
|
|
(let ((d (list month 1 year)))
|
2008-04-07 01:59:37 +00:00
|
|
|
(calendar-increment-month month year (1- n))
|
1995-10-12 15:28:46 +00:00
|
|
|
(/ (- (calendar-dayname-on-or-before
|
|
|
|
calendar-week-start-day
|
|
|
|
(+ 7 (calendar-absolute-from-gregorian
|
|
|
|
(list month (calendar-last-day-of-month month year) year))))
|
|
|
|
(calendar-dayname-on-or-before
|
|
|
|
calendar-week-start-day
|
|
|
|
(calendar-absolute-from-gregorian d)))
|
|
|
|
7)))
|
|
|
|
|
|
|
|
;;;
|
|
|
|
;;; Weekly calendars
|
|
|
|
;;;
|
|
|
|
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
(defconst cal-tex-LaTeX-hourbox
|
2003-08-03 13:58:39 +00:00
|
|
|
"\\newcommand{\\hourbox}[2]%
|
|
|
|
{\\makebox[2em]{\\rule{0cm}{#2ex}#1}\\rule{3in}{.15mm}}\n"
|
|
|
|
"One hour and a line on the right.")
|
|
|
|
|
2012-08-21 02:29:25 +00:00
|
|
|
(defun cal-tex-weekly-paper (&optional nomargins)
|
|
|
|
"Insert some page size settings for weekly layouts."
|
|
|
|
(insert "\\textwidth 6.5in
|
|
|
|
\\textheight 10.5in
|
|
|
|
")
|
|
|
|
(or nomargins (insert "\\oddsidemargin 0in
|
|
|
|
\\evensidemargin 0in
|
|
|
|
")))
|
|
|
|
|
2007-07-24 02:43:16 +00:00
|
|
|
;; TODO cal-tex-diary-support.
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
;; TODO respect cal-tex-daily-start,end (see cal-tex-week-hours).
|
2008-03-13 05:47:55 +00:00
|
|
|
;;;###cal-autoload
|
2008-06-18 02:55:13 +00:00
|
|
|
(defun cal-tex-cursor-week (&optional n event)
|
2012-10-06 18:34:23 +00:00
|
|
|
"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."
|
2008-06-18 02:55:13 +00:00
|
|
|
(interactive (list (prefix-numeric-value current-prefix-arg)
|
|
|
|
last-nonmenu-event))
|
|
|
|
(or n (setq n 1))
|
|
|
|
(let* ((date (calendar-gregorian-from-absolute
|
1995-10-12 15:28:46 +00:00
|
|
|
(calendar-dayname-on-or-before
|
|
|
|
calendar-week-start-day
|
|
|
|
(calendar-absolute-from-gregorian
|
2008-06-18 02:55:13 +00:00
|
|
|
(calendar-cursor-to-date t event)))))
|
2008-04-07 01:59:37 +00:00
|
|
|
(month (calendar-extract-month date))
|
|
|
|
(year (calendar-extract-year date))
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(d1 (calendar-absolute-from-gregorian date))
|
|
|
|
(d2 (+ (* 7 n) d1))
|
1995-10-12 15:28:46 +00:00
|
|
|
(holidays (if cal-tex-holidays
|
2012-05-05 20:58:14 +00:00
|
|
|
(holiday-in-range d1 d2))))
|
1995-10-12 15:28:46 +00:00
|
|
|
(cal-tex-preamble "11pt")
|
2012-08-21 02:29:25 +00:00
|
|
|
(cal-tex-weekly-paper)
|
1995-10-12 15:28:46 +00:00
|
|
|
(insert cal-tex-LaTeX-hourbox)
|
|
|
|
(cal-tex-b-document)
|
2012-08-21 06:35:48 +00:00
|
|
|
(cal-tex-cmd "\\pagestyle" "empty")
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(dotimes (i n)
|
2007-07-24 02:43:16 +00:00
|
|
|
(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")
|
2011-04-19 04:11:01 +00:00
|
|
|
(dotimes (_jdummy 7)
|
2007-07-24 02:43:16 +00:00
|
|
|
(cal-tex-week-hours date holidays "3.1")
|
|
|
|
(setq date (cal-tex-incr-date date)))
|
|
|
|
(cal-tex-e-parbox)
|
2008-04-07 01:59:37 +00:00
|
|
|
(setq month (calendar-extract-month date)
|
|
|
|
year (calendar-extract-year date))
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(unless (= i (1- n))
|
|
|
|
(run-hooks 'cal-tex-week-hook)
|
|
|
|
(cal-tex-newpage)))
|
1995-10-12 15:28:46 +00:00
|
|
|
(cal-tex-end-document)
|
|
|
|
(run-hooks 'cal-tex-hook)))
|
|
|
|
|
2007-07-24 02:43:16 +00:00
|
|
|
;; TODO cal-tex-diary support.
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
;; TODO respect cal-tex-daily-start,end (see cal-tex-week-hours).
|
2008-03-13 05:47:55 +00:00
|
|
|
;;;###cal-autoload
|
2008-06-18 02:55:13 +00:00
|
|
|
(defun cal-tex-cursor-week2 (&optional n event)
|
2012-10-06 18:34:23 +00:00
|
|
|
"Make a two 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."
|
2008-06-18 02:55:13 +00:00
|
|
|
(interactive (list (prefix-numeric-value current-prefix-arg)
|
|
|
|
last-nonmenu-event))
|
|
|
|
(or n (setq n 1))
|
|
|
|
(let* ((date (calendar-gregorian-from-absolute
|
1995-10-12 15:28:46 +00:00
|
|
|
(calendar-dayname-on-or-before
|
|
|
|
calendar-week-start-day
|
|
|
|
(calendar-absolute-from-gregorian
|
2008-06-18 02:55:13 +00:00
|
|
|
(calendar-cursor-to-date t event)))))
|
2008-04-07 01:59:37 +00:00
|
|
|
(month (calendar-extract-month date))
|
|
|
|
(year (calendar-extract-year date))
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(d1 (calendar-absolute-from-gregorian date))
|
|
|
|
(d2 (+ (* 7 n) d1))
|
1995-10-12 15:28:46 +00:00
|
|
|
(holidays (if cal-tex-holidays
|
2012-05-05 20:58:14 +00:00
|
|
|
(holiday-in-range d1 d2))))
|
1995-10-12 15:28:46 +00:00
|
|
|
(cal-tex-preamble "12pt")
|
2012-08-21 02:29:25 +00:00
|
|
|
(cal-tex-weekly-paper)
|
1995-10-12 15:28:46 +00:00
|
|
|
(insert cal-tex-LaTeX-hourbox)
|
|
|
|
(cal-tex-b-document)
|
2012-08-21 06:35:48 +00:00
|
|
|
(cal-tex-cmd "\\pagestyle" "empty")
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(dotimes (i n)
|
2007-07-24 02:43:16 +00:00
|
|
|
(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" "\\textwidth")
|
2011-04-19 04:11:01 +00:00
|
|
|
(dotimes (_jdummy 3)
|
2007-07-24 02:43:16 +00:00
|
|
|
(cal-tex-week-hours date holidays "5")
|
|
|
|
(setq date (cal-tex-incr-date date)))
|
|
|
|
(cal-tex-e-parbox)
|
|
|
|
(cal-tex-nl)
|
|
|
|
(insert (cal-tex-mini-calendar
|
2008-04-07 01:59:37 +00:00
|
|
|
(calendar-extract-month (cal-tex-previous-month date))
|
|
|
|
(calendar-extract-year (cal-tex-previous-month date))
|
2007-07-24 02:43:16 +00:00
|
|
|
"lastmonth" "1.1in" "1in"))
|
|
|
|
(insert (cal-tex-mini-calendar
|
2008-04-07 01:59:37 +00:00
|
|
|
(calendar-extract-month date)
|
|
|
|
(calendar-extract-year date)
|
2007-07-24 02:43:16 +00:00
|
|
|
"thismonth" "1.1in" "1in"))
|
|
|
|
(insert (cal-tex-mini-calendar
|
2008-04-07 01:59:37 +00:00
|
|
|
(calendar-extract-month (cal-tex-next-month date))
|
|
|
|
(calendar-extract-year (cal-tex-next-month date))
|
2007-07-24 02:43:16 +00:00
|
|
|
"nextmonth" "1.1in" "1in"))
|
|
|
|
(insert "\\hbox to \\textwidth{")
|
|
|
|
(cal-tex-hfill)
|
|
|
|
(insert "\\lastmonth")
|
|
|
|
(cal-tex-hfill)
|
|
|
|
(insert "\\thismonth")
|
|
|
|
(cal-tex-hfill)
|
|
|
|
(insert "\\nextmonth")
|
|
|
|
(cal-tex-hfill)
|
|
|
|
(insert "}")
|
|
|
|
(cal-tex-nl)
|
|
|
|
(cal-tex-b-parbox "l" "\\textwidth")
|
2011-04-19 04:11:01 +00:00
|
|
|
(dotimes (_jdummy 4)
|
2007-07-24 02:43:16 +00:00
|
|
|
(cal-tex-week-hours date holidays "5")
|
|
|
|
(setq date (cal-tex-incr-date date)))
|
|
|
|
(cal-tex-e-parbox)
|
2008-04-07 01:59:37 +00:00
|
|
|
(setq month (calendar-extract-month date)
|
|
|
|
year (calendar-extract-year date))
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(unless (= i (1- n))
|
|
|
|
(run-hooks 'cal-tex-week-hook)
|
|
|
|
(cal-tex-newpage)))
|
1995-10-12 15:28:46 +00:00
|
|
|
(cal-tex-end-document)
|
|
|
|
(run-hooks 'cal-tex-hook)))
|
|
|
|
|
2008-03-13 05:47:55 +00:00
|
|
|
(autoload 'calendar-iso-from-absolute "cal-iso")
|
|
|
|
|
|
|
|
;;;###cal-autoload
|
2008-06-18 02:55:13 +00:00
|
|
|
(defun cal-tex-cursor-week-iso (&optional n event)
|
2012-10-06 18:34:23 +00:00
|
|
|
"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."
|
2008-06-18 02:55:13 +00:00
|
|
|
(interactive (list (prefix-numeric-value current-prefix-arg)
|
|
|
|
last-nonmenu-event))
|
|
|
|
(or n (setq n 1))
|
|
|
|
(let* ((date (calendar-gregorian-from-absolute
|
1995-10-12 15:28:46 +00:00
|
|
|
(calendar-dayname-on-or-before
|
|
|
|
1
|
|
|
|
(calendar-absolute-from-gregorian
|
2008-06-18 02:55:13 +00:00
|
|
|
(calendar-cursor-to-date t event)))))
|
2008-04-07 01:59:37 +00:00
|
|
|
(month (calendar-extract-month date))
|
|
|
|
(year (calendar-extract-year date))
|
|
|
|
(day (calendar-extract-day date))
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(d1 (calendar-absolute-from-gregorian date))
|
|
|
|
(d2 (+ (* 7 n) d1))
|
1995-10-12 15:28:46 +00:00
|
|
|
(holidays (if cal-tex-holidays
|
2012-05-05 20:58:14 +00:00
|
|
|
(holiday-in-range d1 d2)))
|
1995-10-12 15:28:46 +00:00
|
|
|
(diary-list (if cal-tex-diary
|
2012-08-21 01:10:27 +00:00
|
|
|
(cal-tex-list-diary-entries d1 d2)))
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
s)
|
1995-10-12 15:28:46 +00:00
|
|
|
(cal-tex-preamble "11pt")
|
2012-08-21 02:29:25 +00:00
|
|
|
(cal-tex-weekly-paper)
|
1995-10-12 15:28:46 +00:00
|
|
|
(cal-tex-b-document)
|
2012-08-21 06:35:48 +00:00
|
|
|
(cal-tex-cmd "\\pagestyle" "empty")
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(dotimes (i n)
|
2007-07-24 02:43:16 +00:00
|
|
|
(cal-tex-vspace "-1.5in")
|
|
|
|
(cal-tex-b-center)
|
|
|
|
(cal-tex-Huge-bf
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(let ((d (calendar-iso-from-absolute
|
|
|
|
(calendar-absolute-from-gregorian date))))
|
2007-07-24 02:43:16 +00:00
|
|
|
(format "Week %d of %d"
|
2008-04-07 01:59:37 +00:00
|
|
|
(calendar-extract-month d)
|
|
|
|
(calendar-extract-year d))))
|
2007-07-24 02:43:16 +00:00
|
|
|
(cal-tex-nl ".5cm")
|
|
|
|
(cal-tex-e-center)
|
|
|
|
(cal-tex-b-parbox "l" "\\textwidth")
|
2011-04-19 04:11:01 +00:00
|
|
|
(dotimes (_j 7)
|
2007-07-24 02:43:16 +00:00
|
|
|
(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))
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(unless (string-equal "" (setq s (cal-tex-latexify-list
|
|
|
|
holidays date "; ")))
|
|
|
|
(insert ": ")
|
|
|
|
(cal-tex-large-bf s))
|
2007-07-24 02:43:16 +00:00
|
|
|
(cal-tex-hfill)
|
|
|
|
(insert " " (eval cal-tex-daily-string))
|
|
|
|
(cal-tex-e-parbox)
|
|
|
|
(cal-tex-nl)
|
|
|
|
(cal-tex-noindent)
|
|
|
|
(cal-tex-b-parbox "t" "\\textwidth")
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(unless (string-equal "" (setq s (cal-tex-latexify-list
|
|
|
|
diary-list date)))
|
|
|
|
(insert "\\vbox to 0pt{")
|
|
|
|
(cal-tex-large-bf s)
|
|
|
|
(insert "}"))
|
2007-07-24 02:43:16 +00:00
|
|
|
(cal-tex-e-parbox)
|
|
|
|
(cal-tex-nl)
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(setq date (cal-tex-incr-date date)
|
2008-04-07 01:59:37 +00:00
|
|
|
month (calendar-extract-month date)
|
|
|
|
day (calendar-extract-day date))
|
2007-07-24 02:43:16 +00:00
|
|
|
(cal-tex-e-parbox)
|
|
|
|
(cal-tex-e-parbox "2cm")
|
|
|
|
(cal-tex-nl)
|
2008-04-07 01:59:37 +00:00
|
|
|
(setq month (calendar-extract-month date)
|
|
|
|
year (calendar-extract-year date)))
|
2007-07-24 02:43:16 +00:00
|
|
|
(cal-tex-e-parbox)
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(unless (= i (1- n))
|
|
|
|
(run-hooks 'cal-tex-week-hook)
|
|
|
|
(cal-tex-newpage)))
|
1995-10-12 15:28:46 +00:00
|
|
|
(cal-tex-end-document)
|
|
|
|
(run-hooks 'cal-tex-hook)))
|
|
|
|
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
;; TODO respect cal-tex-daily-start,end?
|
|
|
|
;; Using different numbers of hours will probably break some layouts.
|
1995-10-12 15:28:46 +00:00
|
|
|
(defun cal-tex-week-hours (date holidays height)
|
2007-07-24 02:43:16 +00:00
|
|
|
"Insert hourly entries for DATE with HOLIDAYS, with line height HEIGHT.
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
Uses the 24-hour clock if `cal-tex-24' is non-nil. Note that the hours
|
|
|
|
shown are hard-coded to 8-12, 13-17."
|
2008-04-07 01:59:37 +00:00
|
|
|
(let ((month (calendar-extract-month date))
|
|
|
|
(day (calendar-extract-day date))
|
|
|
|
(year (calendar-extract-year date))
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
morning afternoon s)
|
1995-10-12 15:28:46 +00:00
|
|
|
(cal-tex-comment "begin cal-tex-week-hours")
|
|
|
|
(cal-tex-cmd "\\ \\\\[-.2cm]")
|
|
|
|
(cal-tex-cmd "\\noindent")
|
|
|
|
(cal-tex-b-parbox "l" "6.8in")
|
2002-04-03 14:35:33 +00:00
|
|
|
(cal-tex-large-bf (cal-tex-LaTeXify-string (calendar-day-name date)))
|
1995-10-12 15:28:46 +00:00
|
|
|
(insert ", ")
|
2002-04-03 14:35:33 +00:00
|
|
|
(cal-tex-large-bf (cal-tex-month-name month))
|
1995-10-12 15:28:46 +00:00
|
|
|
(insert " ")
|
|
|
|
(cal-tex-large-bf (number-to-string day))
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(unless (string-equal "" (setq s (cal-tex-latexify-list
|
|
|
|
holidays date "; ")))
|
|
|
|
(insert ": ")
|
|
|
|
(cal-tex-large-bf s))
|
1995-10-12 15:28:46 +00:00
|
|
|
(cal-tex-hfill)
|
|
|
|
(insert " " (eval cal-tex-daily-string))
|
|
|
|
(cal-tex-e-parbox)
|
|
|
|
(cal-tex-nl "-.3cm")
|
|
|
|
(cal-tex-rule "0pt" "6.8in" ".2mm")
|
|
|
|
(cal-tex-nl "-.1cm")
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(dotimes (i 5)
|
|
|
|
(setq morning (+ i 8) ; 8-12 incl
|
|
|
|
afternoon (if cal-tex-24
|
|
|
|
(+ i 13) ; 13-17 incl
|
|
|
|
(1+ i))) ; 1-5 incl
|
|
|
|
(cal-tex-cmd "\\hourbox" (number-to-string morning))
|
|
|
|
(cal-tex-arg height)
|
|
|
|
(cal-tex-hspace ".4cm")
|
|
|
|
(cal-tex-cmd "\\hourbox" (number-to-string afternoon))
|
|
|
|
(cal-tex-arg height)
|
|
|
|
(cal-tex-nl))))
|
1995-10-12 15:28:46 +00:00
|
|
|
|
2007-07-24 02:43:16 +00:00
|
|
|
;; TODO cal-tex-diary support.
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
;; TODO respect cal-tex-daily-start,end (see cal-tex-weekly4-box).
|
2008-03-13 05:47:55 +00:00
|
|
|
;;;###cal-autoload
|
2008-06-18 02:55:13 +00:00
|
|
|
(defun cal-tex-cursor-week-monday (&optional n event)
|
2012-10-06 18:34:23 +00:00
|
|
|
"Make a one page LaTeX calendar for one week, showing hours of the day.
|
|
|
|
There are two columns; with M-W in the first and T-S in the second.
|
|
|
|
It shows the hours 8-12am and 1-5pm.
|
|
|
|
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."
|
2008-06-18 02:55:13 +00:00
|
|
|
(interactive (list (prefix-numeric-value current-prefix-arg)
|
|
|
|
last-nonmenu-event))
|
|
|
|
(or n (setq n 1))
|
|
|
|
(let ((date (calendar-gregorian-from-absolute
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(calendar-dayname-on-or-before
|
|
|
|
0
|
|
|
|
(calendar-absolute-from-gregorian
|
2008-06-18 02:55:13 +00:00
|
|
|
(calendar-cursor-to-date t event))))))
|
1995-10-12 15:28:46 +00:00
|
|
|
(cal-tex-preamble "11pt")
|
2012-08-21 02:29:25 +00:00
|
|
|
(cal-tex-weekly-paper)
|
1995-10-12 15:28:46 +00:00
|
|
|
(cal-tex-b-document)
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(dotimes (i n)
|
2007-07-24 02:43:16 +00:00
|
|
|
(cal-tex-vspace "-1cm")
|
|
|
|
(insert "\\noindent ")
|
|
|
|
(cal-tex-weekly4-box (cal-tex-incr-date date) nil)
|
|
|
|
(cal-tex-weekly4-box (cal-tex-incr-date date 4) nil)
|
|
|
|
(cal-tex-nl ".2cm")
|
|
|
|
(cal-tex-weekly4-box (cal-tex-incr-date date 2) nil)
|
|
|
|
(cal-tex-weekly4-box (cal-tex-incr-date date 5) nil)
|
|
|
|
(cal-tex-nl ".2cm")
|
|
|
|
(cal-tex-weekly4-box (cal-tex-incr-date date 3) nil)
|
|
|
|
(cal-tex-weekly4-box (cal-tex-incr-date date 6) t)
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(unless (= i (1- n))
|
|
|
|
(run-hooks 'cal-tex-week-hook)
|
|
|
|
(setq date (cal-tex-incr-date date 7))
|
|
|
|
(cal-tex-newpage)))
|
1995-10-12 15:28:46 +00:00
|
|
|
(cal-tex-end-document)
|
|
|
|
(run-hooks 'cal-tex-hook)))
|
|
|
|
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
;; TODO respect cal-tex-daily-start,end?
|
|
|
|
;; Using different numbers of hours will probably break some layouts.
|
1995-10-12 15:28:46 +00:00
|
|
|
(defun cal-tex-weekly4-box (date weekend)
|
2007-07-24 02:43:16 +00:00
|
|
|
"Make one box for DATE, different if WEEKEND.
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
Uses the 24-hour clock if `cal-tex-24' is non-nil. Note that the hours
|
|
|
|
shown are hard-coded to 8-12, 13-17."
|
2008-04-07 01:59:37 +00:00
|
|
|
(let* ((day (calendar-extract-day date))
|
|
|
|
(month (calendar-extract-month date))
|
|
|
|
(year (calendar-extract-year date))
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(dayname (cal-tex-LaTeXify-string (calendar-day-name date)))
|
|
|
|
(date1 (cal-tex-incr-date date))
|
2008-04-07 01:59:37 +00:00
|
|
|
(day1 (calendar-extract-day date1))
|
|
|
|
(month1 (calendar-extract-month date1))
|
|
|
|
(year1 (calendar-extract-year date1))
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(dayname1 (cal-tex-LaTeXify-string (calendar-day-name date1))))
|
1995-10-12 15:28:46 +00:00
|
|
|
(cal-tex-b-framebox "8cm" "l")
|
|
|
|
(cal-tex-b-parbox "b" "7.5cm")
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
(insert (format "\\textbf{\\Large %s,} %s/%s/%s\\\\\n"
|
|
|
|
dayname month day year))
|
1995-10-12 15:28:46 +00:00
|
|
|
(cal-tex-rule "0pt" "7.5cm" ".5mm")
|
|
|
|
(cal-tex-nl)
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(unless weekend
|
|
|
|
(dotimes (i 5)
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
(insert (format "\\textsf{\\large %d}\\\\\n" (+ i 8))))
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(dotimes (i 5)
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
(insert (format "\\textsf{\\large %d}\\\\\n"
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(if cal-tex-24
|
|
|
|
(+ i 13) ; 13-17 incl
|
|
|
|
(1+ i)))))) ; 1-5 incl
|
1995-10-12 15:28:46 +00:00
|
|
|
(cal-tex-nl ".5cm")
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(when weekend
|
|
|
|
(cal-tex-vspace "1cm")
|
|
|
|
(insert "\\ \\vfill")
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
(insert (format "\\textbf{\\Large %s,} %s/%s/%s\\\\\n"
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
dayname1 month1 day1 year1))
|
|
|
|
(cal-tex-rule "0pt" "7.5cm" ".5mm")
|
|
|
|
(cal-tex-nl "1.5cm")
|
|
|
|
(cal-tex-vspace "1cm"))
|
1995-10-12 15:28:46 +00:00
|
|
|
(cal-tex-e-parbox)
|
|
|
|
(cal-tex-e-framebox)
|
|
|
|
(cal-tex-hspace "1cm")))
|
|
|
|
|
2012-08-21 18:27:14 +00:00
|
|
|
(defun cal-tex-weekly-common (n event &optional filofax)
|
|
|
|
"Common code for weekly calendars."
|
2012-08-20 07:23:51 +00:00
|
|
|
(or n (setq n 1))
|
|
|
|
(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))))
|
2012-08-21 18:27:14 +00:00
|
|
|
(if filofax
|
|
|
|
(progn
|
|
|
|
(cal-tex-preamble "twoside")
|
|
|
|
(cal-tex-filofax-paper)
|
|
|
|
(insert cal-tex-righthead)
|
2012-08-22 00:39:44 +00:00
|
|
|
(cal-tex-longday "rightday" "1.85in")
|
|
|
|
(cal-tex-longday "weekend" "0.8in")
|
2012-08-21 18:27:14 +00:00
|
|
|
(insert cal-tex-lefthead)
|
2012-08-22 00:39:44 +00:00
|
|
|
(cal-tex-longday "leftday" "1.85in"))
|
2012-08-22 17:55:19 +00:00
|
|
|
(cal-tex-preamble "twoside,12pt")
|
|
|
|
(insert "\\textwidth 7in
|
2012-08-21 06:35:48 +00:00
|
|
|
\\textheight 10.5in
|
|
|
|
\\oddsidemargin 0in
|
|
|
|
\\evensidemargin 0in
|
|
|
|
\\topmargin 0pt
|
|
|
|
\\headheight -0.875in
|
|
|
|
\\headsep 0.125in
|
|
|
|
\\footskip .125in
|
|
|
|
")
|
2012-08-22 17:55:19 +00:00
|
|
|
(insert cal-tex-righthead)
|
|
|
|
(cal-tex-longday "rightday" "2.75in")
|
|
|
|
(cal-tex-longday "weekend" "1.8in")
|
|
|
|
(insert cal-tex-lefthead)
|
|
|
|
(cal-tex-longday "leftday" "2.75in"))
|
2012-08-20 07:23:51 +00:00
|
|
|
(cal-tex-b-document)
|
2012-08-21 06:35:48 +00:00
|
|
|
(cal-tex-cmd "\\pagestyle" "empty")
|
2012-09-27 06:47:12 +00:00
|
|
|
;; Let's assume this is something to do with twopage documents.
|
2012-08-22 17:55:19 +00:00
|
|
|
;; It has the downside that we start with a blank page.
|
|
|
|
;; It doesn't make obvious sense when oddside and evenside margins
|
|
|
|
;; are the same (non-filofax), but consider the left and right
|
|
|
|
;; versions of various functions as applicable to even and odd pages.
|
|
|
|
(cal-tex-newpage)
|
2012-08-20 07:23:51 +00:00
|
|
|
(dotimes (i n)
|
|
|
|
(insert "\\lefthead")
|
|
|
|
(cal-tex-arg
|
|
|
|
(let ((d (cal-tex-incr-date date 2)))
|
|
|
|
(if (= (calendar-extract-month date)
|
|
|
|
(calendar-extract-month d))
|
|
|
|
(format "%s %s"
|
|
|
|
(cal-tex-month-name (calendar-extract-month date))
|
|
|
|
(calendar-extract-year date))
|
|
|
|
(if (= (calendar-extract-year date)
|
|
|
|
(calendar-extract-year d))
|
|
|
|
(format "%s---%s %s"
|
|
|
|
(cal-tex-month-name (calendar-extract-month date))
|
|
|
|
(cal-tex-month-name (calendar-extract-month d))
|
|
|
|
(calendar-extract-year date))
|
|
|
|
(format "%s %s---%s %s"
|
|
|
|
(cal-tex-month-name (calendar-extract-month date))
|
|
|
|
(calendar-extract-year date)
|
|
|
|
(cal-tex-month-name (calendar-extract-month d))
|
|
|
|
(calendar-extract-year d))))))
|
|
|
|
(insert "%\n")
|
|
|
|
(dotimes (_jdummy 3)
|
|
|
|
(insert "\\leftday")
|
|
|
|
(cal-tex-arg (cal-tex-LaTeXify-string (calendar-day-name date)))
|
|
|
|
(cal-tex-arg (number-to-string (calendar-extract-day date)))
|
|
|
|
(cal-tex-arg (cal-tex-latexify-list diary-list date))
|
|
|
|
(cal-tex-arg (cal-tex-latexify-list holidays date))
|
|
|
|
(cal-tex-arg (eval cal-tex-daily-string))
|
|
|
|
(insert "%\n")
|
|
|
|
(setq date (cal-tex-incr-date date)))
|
|
|
|
(insert "\\noindent\\rule{\\textwidth}{0.3pt}\\\\%\n")
|
2012-08-21 18:27:14 +00:00
|
|
|
(unless filofax
|
|
|
|
(cal-tex-nl)
|
|
|
|
(insert (cal-tex-mini-calendar
|
|
|
|
(calendar-extract-month (cal-tex-previous-month date))
|
|
|
|
(calendar-extract-year (cal-tex-previous-month date))
|
|
|
|
"lastmonth" "1.1in" "1in"))
|
|
|
|
(insert (cal-tex-mini-calendar
|
|
|
|
(calendar-extract-month date)
|
|
|
|
(calendar-extract-year date)
|
|
|
|
"thismonth" "1.1in" "1in"))
|
|
|
|
(insert (cal-tex-mini-calendar
|
|
|
|
(calendar-extract-month (cal-tex-next-month date))
|
|
|
|
(calendar-extract-year (cal-tex-next-month date))
|
|
|
|
"nextmonth" "1.1in" "1in"))
|
|
|
|
(insert "\\hbox to \\textwidth{")
|
|
|
|
(cal-tex-hfill)
|
|
|
|
(insert "\\lastmonth")
|
|
|
|
(cal-tex-hfill)
|
|
|
|
(insert "\\thismonth")
|
|
|
|
(cal-tex-hfill)
|
|
|
|
(insert "\\nextmonth")
|
|
|
|
(cal-tex-hfill)
|
|
|
|
(insert "}"))
|
2012-08-20 07:23:51 +00:00
|
|
|
(cal-tex-newpage)
|
|
|
|
(insert "\\righthead")
|
|
|
|
(cal-tex-arg
|
|
|
|
(let ((d (cal-tex-incr-date date 3)))
|
|
|
|
(if (= (calendar-extract-month date)
|
2012-08-21 18:27:14 +00:00
|
|
|
(calendar-extract-month d))
|
2012-08-20 07:23:51 +00:00
|
|
|
(format "%s %s"
|
|
|
|
(cal-tex-month-name (calendar-extract-month date))
|
|
|
|
(calendar-extract-year date))
|
|
|
|
(if (= (calendar-extract-year date)
|
|
|
|
(calendar-extract-year d))
|
|
|
|
(format "%s---%s %s"
|
|
|
|
(cal-tex-month-name (calendar-extract-month date))
|
|
|
|
(cal-tex-month-name (calendar-extract-month d))
|
|
|
|
(calendar-extract-year date))
|
|
|
|
(format "%s %s---%s %s"
|
|
|
|
(cal-tex-month-name (calendar-extract-month date))
|
|
|
|
(calendar-extract-year date)
|
|
|
|
(cal-tex-month-name (calendar-extract-month d))
|
|
|
|
(calendar-extract-year d))))))
|
|
|
|
(insert "%\n")
|
|
|
|
(dotimes (_jdummy 2)
|
|
|
|
(insert "\\rightday")
|
|
|
|
(cal-tex-arg (cal-tex-LaTeXify-string (calendar-day-name date)))
|
|
|
|
(cal-tex-arg (number-to-string (calendar-extract-day date)))
|
|
|
|
(cal-tex-arg (cal-tex-latexify-list diary-list date))
|
|
|
|
(cal-tex-arg (cal-tex-latexify-list holidays date))
|
|
|
|
(cal-tex-arg (eval cal-tex-daily-string))
|
|
|
|
(insert "%\n")
|
|
|
|
(setq date (cal-tex-incr-date date)))
|
|
|
|
(dotimes (_jdummy 2)
|
|
|
|
(insert "\\weekend")
|
|
|
|
(cal-tex-arg (cal-tex-LaTeXify-string (calendar-day-name date)))
|
|
|
|
(cal-tex-arg (number-to-string (calendar-extract-day date)))
|
|
|
|
(cal-tex-arg (cal-tex-latexify-list diary-list date))
|
|
|
|
(cal-tex-arg (cal-tex-latexify-list holidays date))
|
|
|
|
(cal-tex-arg (eval cal-tex-daily-string))
|
|
|
|
(insert "%\n")
|
|
|
|
(setq date (cal-tex-incr-date date)))
|
|
|
|
(unless (= i (1- n))
|
|
|
|
(run-hooks 'cal-tex-week-hook)
|
|
|
|
(cal-tex-newpage)))
|
|
|
|
(cal-tex-end-document)
|
|
|
|
(run-hooks 'cal-tex-hook)))
|
|
|
|
|
2008-03-13 05:47:55 +00:00
|
|
|
;;;###cal-autoload
|
2012-10-06 18:34:23 +00:00
|
|
|
(defun cal-tex-cursor-week2-summary (&optional n event)
|
|
|
|
"Make a two page LaTeX calendar for one week, with optional diary entries.
|
|
|
|
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."
|
2008-06-18 02:55:13 +00:00
|
|
|
(interactive (list (prefix-numeric-value current-prefix-arg)
|
|
|
|
last-nonmenu-event))
|
2012-08-21 18:27:14 +00:00
|
|
|
(cal-tex-weekly-common n event))
|
1995-10-12 15:28:46 +00:00
|
|
|
|
2012-08-21 19:18:56 +00:00
|
|
|
;;;###cal-autoload
|
|
|
|
(defun cal-tex-cursor-filofax-2week (&optional n event)
|
|
|
|
"Two-weeks-at-a-glance Filofax style calendar for week cursor is in.
|
|
|
|
Optional prefix argument N specifies number of weeks (default 1).
|
|
|
|
The calendar 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-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))
|
|
|
|
(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))))
|
|
|
|
(cal-tex-preamble "twoside")
|
|
|
|
(cal-tex-filofax-paper)
|
|
|
|
(insert cal-tex-righthead)
|
2012-08-22 00:39:44 +00:00
|
|
|
(cal-tex-longday "rightday" "0.7in")
|
2012-08-21 19:18:56 +00:00
|
|
|
(insert cal-tex-lefthead)
|
2012-08-22 00:39:44 +00:00
|
|
|
(cal-tex-longday "leftday" "0.7in")
|
2012-08-21 19:18:56 +00:00
|
|
|
(cal-tex-b-document)
|
|
|
|
(cal-tex-cmd "\\pagestyle" "empty")
|
|
|
|
(dotimes (i n)
|
|
|
|
(if (zerop (mod i 2))
|
|
|
|
(insert "\\righthead")
|
|
|
|
(insert "\\lefthead"))
|
|
|
|
(cal-tex-arg
|
|
|
|
(let ((d (cal-tex-incr-date date 6)))
|
|
|
|
(if (= (calendar-extract-month date)
|
|
|
|
(calendar-extract-month d))
|
|
|
|
(format "%s %s"
|
|
|
|
(cal-tex-month-name (calendar-extract-month date))
|
|
|
|
(calendar-extract-year date))
|
|
|
|
(if (= (calendar-extract-year date)
|
|
|
|
(calendar-extract-year d))
|
|
|
|
(format "%s---%s %s"
|
|
|
|
(cal-tex-month-name (calendar-extract-month date))
|
|
|
|
(cal-tex-month-name (calendar-extract-month d))
|
|
|
|
(calendar-extract-year date))
|
|
|
|
(format "%s %s---%s %s"
|
|
|
|
(cal-tex-month-name (calendar-extract-month date))
|
|
|
|
(calendar-extract-year date)
|
|
|
|
(cal-tex-month-name (calendar-extract-month d))
|
|
|
|
(calendar-extract-year d))))))
|
|
|
|
(insert "%\n")
|
|
|
|
(dotimes (_jdummy 7)
|
|
|
|
(if (zerop (mod i 2))
|
|
|
|
(insert "\\rightday")
|
|
|
|
(insert "\\leftday"))
|
|
|
|
(cal-tex-arg (cal-tex-LaTeXify-string (calendar-day-name date)))
|
|
|
|
(cal-tex-arg (number-to-string (calendar-extract-day date)))
|
|
|
|
(cal-tex-arg (cal-tex-latexify-list diary-list date))
|
|
|
|
(cal-tex-arg (cal-tex-latexify-list holidays date))
|
|
|
|
(cal-tex-arg (eval cal-tex-daily-string))
|
|
|
|
(insert "%\n")
|
|
|
|
(setq date (cal-tex-incr-date date)))
|
|
|
|
(unless (= i (1- n))
|
|
|
|
(run-hooks 'cal-tex-week-hook)
|
|
|
|
(cal-tex-newpage)))
|
|
|
|
(cal-tex-end-document)
|
|
|
|
(run-hooks 'cal-tex-hook)))
|
|
|
|
|
2008-03-13 05:47:55 +00:00
|
|
|
;;;###cal-autoload
|
2008-06-18 02:55:13 +00:00
|
|
|
(defun cal-tex-cursor-filofax-week (&optional n event)
|
1995-10-12 15:28:46 +00:00
|
|
|
"One-week-at-a-glance Filofax style calendar for week indicated by cursor.
|
2008-06-18 02:55:13 +00:00
|
|
|
Optional prefix argument N specifies number of weeks (default 1),
|
2007-07-24 02:43:16 +00:00
|
|
|
starting on Mondays. The calendar shows holiday and diary entries
|
2008-06-18 02:55:13 +00:00
|
|
|
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))
|
2012-08-21 19:18:56 +00:00
|
|
|
(cal-tex-weekly-common n event t))
|
|
|
|
|
|
|
|
;;;###cal-autoload
|
|
|
|
(defun cal-tex-cursor-filofax-daily (&optional n event)
|
|
|
|
"Day-per-page Filofax style calendar for week indicated by cursor.
|
|
|
|
Optional prefix argument N specifies number of weeks (default 1),
|
|
|
|
starting on Mondays. The calendar shows holiday and diary
|
|
|
|
entries if `cal-tex-holidays' and `cal-tex-diary', respectively,
|
|
|
|
are non-nil. Pages are ruled if `cal-tex-rules' is 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-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))))
|
|
|
|
(cal-tex-preamble "twoside")
|
|
|
|
(cal-tex-filofax-paper)
|
|
|
|
(insert cal-tex-righthead)
|
|
|
|
(cal-tex-shortday "rightday")
|
|
|
|
(cal-tex-shortday "weekend")
|
|
|
|
(insert cal-tex-lefthead)
|
|
|
|
(cal-tex-shortday "leftday")
|
|
|
|
(insert "\\newbox\\LineBox
|
|
|
|
\\setbox\\LineBox=\\hbox to\\textwidth{%
|
|
|
|
\\vrule height.2in width0pt\\leaders\\hrule\\hfill}
|
|
|
|
\\def\\linesfill{\\par\\leaders\\copy\\LineBox\\vfill}
|
|
|
|
")
|
|
|
|
(cal-tex-b-document)
|
|
|
|
(cal-tex-cmd "\\pagestyle" "empty")
|
|
|
|
(dotimes (i n)
|
|
|
|
(dotimes (j 4)
|
|
|
|
(let ((even (zerop (% j 2))))
|
|
|
|
(insert (if even
|
|
|
|
"\\righthead"
|
|
|
|
"\\lefthead"))
|
|
|
|
(cal-tex-arg (calendar-date-string date))
|
|
|
|
(insert "%\n")
|
|
|
|
(insert (if even
|
|
|
|
"\\rightday"
|
|
|
|
"\\leftday")))
|
|
|
|
(cal-tex-arg (cal-tex-latexify-list diary-list date))
|
|
|
|
(cal-tex-arg (cal-tex-latexify-list holidays date "\\\\" t))
|
|
|
|
(cal-tex-arg (eval cal-tex-daily-string))
|
|
|
|
(insert "%\n")
|
|
|
|
(if cal-tex-rules
|
|
|
|
(insert "\\linesfill\n")
|
|
|
|
(insert "\\vfill\\noindent\\rule{\\textwidth}{0.3pt}\\\\%\n"))
|
|
|
|
(cal-tex-newpage)
|
|
|
|
(setq date (cal-tex-incr-date date)))
|
|
|
|
(insert "%\n")
|
|
|
|
(dotimes (_jdummy 2)
|
|
|
|
(insert "\\lefthead")
|
|
|
|
(cal-tex-arg (calendar-date-string date))
|
|
|
|
(insert "\\weekend")
|
|
|
|
(cal-tex-arg (cal-tex-latexify-list diary-list date))
|
|
|
|
(cal-tex-arg (cal-tex-latexify-list holidays date "\\\\" t))
|
|
|
|
(cal-tex-arg (eval cal-tex-daily-string))
|
|
|
|
(insert "%\n")
|
|
|
|
(if cal-tex-rules
|
|
|
|
(insert "\\linesfill\n")
|
|
|
|
(insert "\\vfill"))
|
|
|
|
(setq date (cal-tex-incr-date date)))
|
|
|
|
(or cal-tex-rules
|
|
|
|
(insert "\\noindent\\rule{\\textwidth}{0.3pt}\\\\%\n"))
|
|
|
|
(unless (= i (1- n))
|
|
|
|
(run-hooks 'cal-tex-week-hook)
|
|
|
|
(cal-tex-newpage)))
|
|
|
|
(cal-tex-end-document)
|
|
|
|
(run-hooks 'cal-tex-hook)))
|
|
|
|
|
1997-09-24 16:28:34 +00:00
|
|
|
|
1995-10-12 15:28:46 +00:00
|
|
|
;;;
|
|
|
|
;;; Daily calendars
|
|
|
|
;;;
|
|
|
|
|
2008-03-13 05:47:55 +00:00
|
|
|
;;;###cal-autoload
|
2008-06-18 02:55:13 +00:00
|
|
|
(defun cal-tex-cursor-day (&optional n event)
|
1995-10-12 15:28:46 +00:00
|
|
|
"Make a buffer with LaTeX commands for the day cursor is on.
|
2008-06-18 02:55:13 +00:00
|
|
|
Optional prefix argument N specifies number of days. The calendar shows
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
the hours between `cal-tex-daily-start' and `cal-tex-daily-end', using
|
2008-06-18 02:55:13 +00:00
|
|
|
the 24-hour clock if `cal-tex-24' is 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-absolute-from-gregorian
|
|
|
|
(calendar-cursor-to-date t event))))
|
1995-10-12 15:28:46 +00:00
|
|
|
(cal-tex-preamble "12pt")
|
2012-08-21 02:29:25 +00:00
|
|
|
(cal-tex-weekly-paper 'nomargins)
|
1995-10-12 15:28:46 +00:00
|
|
|
(cal-tex-b-document)
|
2012-08-21 06:35:48 +00:00
|
|
|
(cal-tex-cmd "\\pagestyle" "empty")
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(dotimes (i n)
|
2007-07-24 02:43:16 +00:00
|
|
|
(cal-tex-vspace "-1.7in")
|
|
|
|
(cal-tex-daily-page (calendar-gregorian-from-absolute date))
|
|
|
|
(setq date (1+ date))
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(unless (= i (1- n))
|
|
|
|
(cal-tex-newpage)
|
|
|
|
(run-hooks 'cal-tex-daily-hook)))
|
1995-10-12 15:28:46 +00:00
|
|
|
(cal-tex-end-document)
|
|
|
|
(run-hooks 'cal-tex-hook)))
|
|
|
|
|
|
|
|
(defun cal-tex-daily-page (date)
|
2007-07-24 02:43:16 +00:00
|
|
|
"Make a calendar page for Gregorian DATE on 8.5 by 11 paper.
|
|
|
|
Uses the 24-hour clock if `cal-tex-24' is non-nil. Produces
|
|
|
|
hourly sections for the period specified by `cal-tex-daily-start'
|
|
|
|
and `cal-tex-daily-end'."
|
2008-04-07 01:59:37 +00:00
|
|
|
(let ((month-name (cal-tex-month-name (calendar-extract-month date)))
|
2008-04-02 03:16:47 +00:00
|
|
|
(i (1- cal-tex-daily-start))
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
hour)
|
1995-10-12 15:28:46 +00:00
|
|
|
(cal-tex-banner "cal-tex-daily-page")
|
|
|
|
(cal-tex-b-makebox "4cm" "l")
|
|
|
|
(cal-tex-b-parbox "b" "3.8cm")
|
|
|
|
(cal-tex-rule "0mm" "0mm" "2cm")
|
2008-04-07 01:59:37 +00:00
|
|
|
(cal-tex-Huge (number-to-string (calendar-extract-day date)))
|
1995-10-12 15:28:46 +00:00
|
|
|
(cal-tex-nl ".5cm")
|
|
|
|
(cal-tex-bf month-name )
|
|
|
|
(cal-tex-e-parbox)
|
|
|
|
(cal-tex-hspace "1cm")
|
|
|
|
(cal-tex-scriptsize (eval cal-tex-daily-string))
|
|
|
|
(cal-tex-hspace "3.5cm")
|
|
|
|
(cal-tex-e-makebox)
|
|
|
|
(cal-tex-hfill)
|
|
|
|
(cal-tex-b-makebox "4cm" "r")
|
2002-04-03 14:35:33 +00:00
|
|
|
(cal-tex-bf (cal-tex-LaTeXify-string (calendar-day-name date)))
|
1995-10-12 15:28:46 +00:00
|
|
|
(cal-tex-e-makebox)
|
|
|
|
(cal-tex-nl)
|
|
|
|
(cal-tex-hspace ".4cm")
|
|
|
|
(cal-tex-rule "0mm" "16.1cm" "1mm")
|
|
|
|
(cal-tex-nl ".1cm")
|
2008-04-02 03:16:47 +00:00
|
|
|
(while (<= (setq i (1+ i)) cal-tex-daily-end)
|
|
|
|
(cal-tex-cmd "\\noindent")
|
|
|
|
(setq hour (if cal-tex-24
|
|
|
|
i
|
|
|
|
(mod i 12)))
|
|
|
|
(if (zerop hour) (setq hour 12))
|
|
|
|
(cal-tex-b-makebox "1cm" "c")
|
|
|
|
(cal-tex-arg (number-to-string hour))
|
|
|
|
(cal-tex-e-makebox)
|
|
|
|
(cal-tex-rule "0mm" "15.5cm" ".2mm")
|
|
|
|
(cal-tex-nl ".2cm")
|
|
|
|
(cal-tex-b-makebox "1cm" "c")
|
|
|
|
(cal-tex-arg "$\\diamond$" )
|
|
|
|
(cal-tex-e-makebox)
|
|
|
|
(cal-tex-rule "0mm" "15.5cm" ".2mm")
|
|
|
|
(cal-tex-nl ".2cm"))
|
1995-10-12 15:28:46 +00:00
|
|
|
(cal-tex-hfill)
|
|
|
|
(insert (cal-tex-mini-calendar
|
2008-04-07 01:59:37 +00:00
|
|
|
(calendar-extract-month (cal-tex-previous-month date))
|
|
|
|
(calendar-extract-year (cal-tex-previous-month date))
|
1995-10-12 15:28:46 +00:00
|
|
|
"lastmonth" "1.1in" "1in"))
|
|
|
|
(insert (cal-tex-mini-calendar
|
2008-04-07 01:59:37 +00:00
|
|
|
(calendar-extract-month date)
|
|
|
|
(calendar-extract-year date)
|
1995-10-12 15:28:46 +00:00
|
|
|
"thismonth" "1.1in" "1in"))
|
|
|
|
(insert (cal-tex-mini-calendar
|
2008-04-07 01:59:37 +00:00
|
|
|
(calendar-extract-month (cal-tex-next-month date))
|
|
|
|
(calendar-extract-year (cal-tex-next-month date))
|
1995-10-12 15:28:46 +00:00
|
|
|
"nextmonth" "1.1in" "1in"))
|
|
|
|
(insert "\\hbox to \\textwidth{")
|
|
|
|
(cal-tex-hfill)
|
|
|
|
(insert "\\lastmonth")
|
|
|
|
(cal-tex-hfill)
|
|
|
|
(insert "\\thismonth")
|
|
|
|
(cal-tex-hfill)
|
|
|
|
(insert "\\nextmonth")
|
|
|
|
(cal-tex-hfill)
|
|
|
|
(insert "}")
|
|
|
|
(cal-tex-banner "end of cal-tex-daily-page")))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
1995-10-12 15:28:46 +00:00
|
|
|
;;;
|
|
|
|
;;; Mini calendars
|
|
|
|
;;;
|
|
|
|
|
1996-06-14 18:39:08 +00:00
|
|
|
(defun cal-tex-mini-calendar (month year name width height &optional ptsize colsep)
|
1995-10-12 15:28:46 +00:00
|
|
|
"Produce mini-calendar for MONTH, YEAR in macro NAME with WIDTH and HEIGHT.
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
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))
|
2010-07-10 23:34:57 +00:00
|
|
|
(last( calendar-last-day-of-month month year))
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(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)
|
|
|
|
" "
|
2008-04-08 07:08:24 +00:00
|
|
|
(number-to-string year)
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
"}\\\\[1mm]\n")))
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
(dotimes (i 7)
|
2002-04-03 14:35:33 +00:00
|
|
|
(setq str
|
|
|
|
(concat str
|
|
|
|
(cal-tex-LaTeXify-string
|
2003-02-04 13:24:35 +00:00
|
|
|
(substring (aref calendar-day-name-array
|
2002-04-03 14:35:33 +00:00
|
|
|
(mod (+ calendar-week-start-day i) 7))
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
|
2002-04-03 14:35:33 +00:00
|
|
|
0 2))
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(if (= i 6)
|
|
|
|
"\\\\[0.7mm]\n"
|
|
|
|
" & "))))
|
2011-04-19 04:11:01 +00:00
|
|
|
(dotimes (_idummy blank-days)
|
1995-10-12 15:28:46 +00:00
|
|
|
(setq str (concat str " & ")))
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(dotimes (i last)
|
2008-04-08 07:08:24 +00:00
|
|
|
(setq str (concat str (number-to-string (1+ i)))
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
str (concat str (if (zerop (mod (+ i 1 blank-days) 7))
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
(if (= i (1- last))
|
|
|
|
""
|
|
|
|
"\\\\[0.5mm]\n")
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
" & "))))
|
1995-10-12 15:28:46 +00:00
|
|
|
(setq str (concat str "\n\\end{tabular}\\hfil}\\vfil}}}%\n"))
|
2007-07-24 02:43:16 +00:00
|
|
|
str))
|
1995-10-12 15:28:46 +00:00
|
|
|
|
|
|
|
;;;
|
|
|
|
;;; Various calendar functions
|
|
|
|
;;;
|
|
|
|
|
|
|
|
(defun cal-tex-incr-date (date &optional n)
|
|
|
|
"The date of the day following DATE.
|
|
|
|
If optional N is given, the date of N days after DATE."
|
|
|
|
(calendar-gregorian-from-absolute
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(+ (or n 1) (calendar-absolute-from-gregorian date))))
|
1995-10-12 15:28:46 +00:00
|
|
|
|
1999-07-30 15:15:57 +00:00
|
|
|
(defun cal-tex-latexify-list (date-list date &optional separator final-separator)
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
"Return string with concatenated, LaTeX-ified entries in DATE-LIST for DATE.
|
1999-07-30 15:15:57 +00:00
|
|
|
Use double backslash as a separator unless optional SEPARATOR is given.
|
|
|
|
If resulting string is not empty, put separator at end if optional
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
FINAL-SEPARATOR is non-nil."
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(or separator (setq separator "\\\\"))
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
(let (result)
|
|
|
|
(setq result
|
|
|
|
(mapconcat (lambda (x) (cal-tex-LaTeXify-string x))
|
|
|
|
(dolist (d date-list (reverse result))
|
|
|
|
(and (car d)
|
|
|
|
(calendar-date-equal date (car d))
|
|
|
|
(setq result (cons (cadr d) result))))
|
|
|
|
separator))
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(if (and final-separator
|
|
|
|
(not (string-equal result "")))
|
|
|
|
(concat result separator)
|
|
|
|
result)))
|
1995-10-12 15:28:46 +00:00
|
|
|
|
|
|
|
(defun cal-tex-previous-month (date)
|
|
|
|
"Return the date of the first day in the month previous to DATE."
|
2008-04-07 01:59:37 +00:00
|
|
|
(let ((month (calendar-extract-month date))
|
|
|
|
(year (calendar-extract-year date)))
|
|
|
|
(calendar-increment-month month year -1)
|
1995-10-12 15:28:46 +00:00
|
|
|
(list month 1 year)))
|
|
|
|
|
|
|
|
(defun cal-tex-next-month (date)
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
"Return the date of the first day in the month following DATE."
|
2008-04-07 01:59:37 +00:00
|
|
|
(let ((month (calendar-extract-month date))
|
|
|
|
(year (calendar-extract-year date)))
|
|
|
|
(calendar-increment-month month year 1)
|
1995-10-12 15:28:46 +00:00
|
|
|
(list month 1 year)))
|
|
|
|
|
|
|
|
;;;
|
|
|
|
;;; LaTeX Code
|
|
|
|
;;;
|
|
|
|
|
|
|
|
(defun cal-tex-end-document ()
|
|
|
|
"Finish the LaTeX document.
|
2003-02-04 13:24:35 +00:00
|
|
|
Insert the trailer to LaTeX document, pop to LaTeX buffer, add
|
1995-10-12 15:28:46 +00:00
|
|
|
informative header, and run HOOK."
|
|
|
|
(cal-tex-e-document)
|
2011-04-12 07:03:52 +00:00
|
|
|
(or (and cal-tex-preamble-extra
|
|
|
|
(string-match "inputenc" cal-tex-preamble-extra))
|
2012-04-16 19:18:36 +00:00
|
|
|
(when (re-search-backward "[^[:ascii:]]" nil 'move)
|
2011-04-12 07:03:52 +00:00
|
|
|
(goto-char (point-min))
|
|
|
|
(when (search-forward "documentclass" nil t)
|
|
|
|
(forward-line 1)
|
|
|
|
;; Eg for some Bahai holidays.
|
|
|
|
;; FIXME latin1 might not always be right.
|
|
|
|
(insert "\\usepackage[latin1]{inputenc}\n"))))
|
1995-10-12 15:28:46 +00:00
|
|
|
(latex-mode)
|
2012-08-21 07:08:50 +00:00
|
|
|
(pop-to-buffer (current-buffer))
|
2003-02-04 13:24:35 +00:00
|
|
|
(goto-char (point-min))
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
;; FIXME auctex equivalents?
|
|
|
|
(cal-tex-comment
|
|
|
|
(format "\tThis buffer was produced by cal-tex.el.
|
|
|
|
\tTo print a calendar, type
|
|
|
|
\t\tM-x tex-buffer RET
|
|
|
|
\t\tM-x tex-print RET")))
|
1995-10-12 15:28:46 +00:00
|
|
|
|
|
|
|
(defun cal-tex-insert-preamble (weeks landscape size &optional append)
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
"Initialize the output LaTeX calendar buffer, `cal-tex-buffer'.
|
|
|
|
Select the output buffer, and insert the preamble for a calendar
|
|
|
|
of WEEKS weeks. Insert code for landscape mode if LANDSCAPE is
|
2008-03-15 02:56:30 +00:00
|
|
|
non-nil. Use point-size SIZE. Optional argument APPEND, if
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
non-nil, means add to end of buffer without erasing current contents."
|
1995-10-12 15:28:46 +00:00
|
|
|
(let ((width "18cm")
|
|
|
|
(height "24cm"))
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(when landscape
|
|
|
|
(setq width "24cm"
|
|
|
|
height "18cm"))
|
|
|
|
(unless append
|
|
|
|
(cal-tex-preamble size)
|
|
|
|
(if (not landscape)
|
|
|
|
(progn
|
|
|
|
(cal-tex-cmd "\\oddsidemargin -1.75cm")
|
2012-08-21 06:35:48 +00:00
|
|
|
(cal-tex-cmd "\\def\\holidaymult" ".06"))
|
|
|
|
(cal-tex-cmd "\\special" "landscape")
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
(cal-tex-cmd "\\textwidth 9.5in")
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(cal-tex-cmd "\\textheight 7in")
|
|
|
|
(cal-tex-comment)
|
2012-08-21 06:35:48 +00:00
|
|
|
(cal-tex-cmd "\\def\\holidaymult" ".08"))
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
(cal-tex-cmd cal-tex-caldate)
|
|
|
|
(cal-tex-cmd cal-tex-myday)
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(cal-tex-b-document)
|
2012-08-21 06:35:48 +00:00
|
|
|
(cal-tex-cmd "\\pagestyle" "empty"))
|
1995-10-12 15:28:46 +00:00
|
|
|
(cal-tex-cmd "\\setlength{\\cellwidth}" width)
|
|
|
|
(insert (format "\\setlength{\\cellwidth}{%f\\cellwidth}\n"
|
|
|
|
(/ 1.1 (length cal-tex-which-days))))
|
|
|
|
(cal-tex-cmd "\\setlength{\\cellheight}" height)
|
|
|
|
(insert (format "\\setlength{\\cellheight}{%f\\cellheight}\n"
|
2003-02-04 13:24:35 +00:00
|
|
|
(/ 1.0 weeks)))
|
1995-10-12 15:28:46 +00:00
|
|
|
(cal-tex-cmd "\\ \\par")
|
|
|
|
(cal-tex-vspace "-3cm")))
|
|
|
|
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
(defconst cal-tex-LaTeX-subst-list
|
1995-10-12 15:28:46 +00:00
|
|
|
'(("\"". "``")
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
("\"". "''") ; quote changes meaning when list is reversed
|
|
|
|
;; Don't think this is necessary, and in any case, does not work:
|
|
|
|
;; "LaTeX Error: \verb illegal in command argument".
|
|
|
|
;;; ("@" . "\\verb|@|")
|
2003-02-04 13:24:35 +00:00
|
|
|
("&" . "\\&")
|
|
|
|
("%" . "\\%")
|
1995-10-12 15:28:46 +00:00
|
|
|
("$" . "\\$")
|
|
|
|
("#" . "\\#")
|
|
|
|
("_" . "\\_")
|
|
|
|
("{" . "\\{")
|
|
|
|
("}" . "\\}")
|
|
|
|
("<" . "$<$")
|
|
|
|
(">" . "$>$")
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
("\n" . "\\ \\\\")) ; \\ needed for e.g \begin{center}\n AA\end{center}
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
"Alist of symbols and their LaTeX replacements.")
|
1995-10-12 15:28:46 +00:00
|
|
|
|
|
|
|
(defun cal-tex-LaTeXify-string (string)
|
|
|
|
"Protect special characters in STRING from LaTeX."
|
|
|
|
(if (not string)
|
|
|
|
""
|
|
|
|
(let ((head "")
|
|
|
|
(tail string)
|
2008-04-01 02:43:57 +00:00
|
|
|
(list cal-tex-LaTeX-subst-list)
|
|
|
|
ch pair)
|
1995-10-12 15:28:46 +00:00
|
|
|
(while (not (string-equal tail ""))
|
2008-04-01 02:43:57 +00:00
|
|
|
(setq ch (substring-no-properties tail 0 1)
|
|
|
|
pair (assoc ch list))
|
|
|
|
(if (and pair (string-equal ch "\""))
|
|
|
|
(setq list (reverse list))) ; quote changes meaning each time
|
|
|
|
(setq tail (substring-no-properties tail 1)
|
|
|
|
head (concat head (if pair (cdr pair) ch))))
|
1995-10-12 15:28:46 +00:00
|
|
|
head)))
|
|
|
|
|
2002-04-03 14:35:33 +00:00
|
|
|
(defun cal-tex-month-name (month)
|
2008-03-15 02:56:30 +00:00
|
|
|
"The name of MONTH, LaTeX-ified."
|
2002-04-03 14:35:33 +00:00
|
|
|
(cal-tex-LaTeXify-string (calendar-month-name month)))
|
|
|
|
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(defun cal-tex-hfill ()
|
|
|
|
"Insert hfill."
|
|
|
|
(insert "\\hfill"))
|
1995-10-12 15:28:46 +00:00
|
|
|
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(defun cal-tex-newpage ()
|
|
|
|
"Insert newpage."
|
|
|
|
(insert "\\newpage%\n"))
|
1995-10-12 15:28:46 +00:00
|
|
|
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(defun cal-tex-noindent ()
|
|
|
|
"Insert noindent."
|
|
|
|
(insert "\\noindent"))
|
1995-10-12 15:28:46 +00:00
|
|
|
|
|
|
|
(defun cal-tex-vspace (space)
|
|
|
|
"Insert vspace command to move SPACE vertically."
|
2012-08-21 06:50:55 +00:00
|
|
|
(cal-tex-cmd "\\vspace*" space))
|
1995-10-12 15:28:46 +00:00
|
|
|
|
|
|
|
(defun cal-tex-hspace (space)
|
|
|
|
"Insert hspace command to move SPACE horizontally."
|
2012-08-21 06:50:55 +00:00
|
|
|
(cal-tex-cmd "\\hspace*" space))
|
1995-10-12 15:28:46 +00:00
|
|
|
|
|
|
|
(defun cal-tex-comment (&optional comment)
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
"Insert `% ', followed by optional string COMMENT, followed by newline.
|
|
|
|
COMMENT may contain newlines, which are prefixed by `% ' in the output."
|
|
|
|
(insert (format "%% %s\n"
|
|
|
|
(if comment
|
|
|
|
(replace-regexp-in-string "\n" "\n% " comment)
|
|
|
|
""))))
|
1995-10-12 15:28:46 +00:00
|
|
|
|
|
|
|
(defun cal-tex-banner (comment)
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
"Insert string COMMENT, separated by blank lines."
|
|
|
|
(cal-tex-comment (format "\n\n\n\t\t\t%s\n" comment)))
|
1995-10-12 15:28:46 +00:00
|
|
|
|
|
|
|
(defun cal-tex-nl (&optional skip comment)
|
|
|
|
"End a line with \\. If SKIP, then add that much spacing.
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
Add trailing COMMENT if present."
|
|
|
|
(insert (format "\\\\%s"
|
|
|
|
(if skip
|
|
|
|
(format "[%s]" skip)
|
|
|
|
"")))
|
1995-10-12 15:28:46 +00:00
|
|
|
(cal-tex-comment comment))
|
2003-02-04 13:24:35 +00:00
|
|
|
|
1995-10-12 15:28:46 +00:00
|
|
|
(defun cal-tex-arg (&optional text)
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
"Insert a brace {} pair containing the optional string TEXT."
|
|
|
|
(insert (format "{%s}" (or text ""))))
|
1995-10-12 15:28:46 +00:00
|
|
|
|
|
|
|
(defun cal-tex-cmd (cmd &optional arg)
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
"Insert LaTeX CMD, with optional argument ARG, and end with %."
|
1995-10-12 15:28:46 +00:00
|
|
|
(insert cmd)
|
|
|
|
(cal-tex-arg arg)
|
|
|
|
(cal-tex-comment))
|
|
|
|
|
|
|
|
;;;
|
|
|
|
;;; Environments
|
|
|
|
;;;
|
|
|
|
|
|
|
|
(defun cal-tex-b-document ()
|
|
|
|
"Insert beginning of document."
|
2012-08-21 06:35:48 +00:00
|
|
|
(cal-tex-cmd "\\begin" "document"))
|
1995-10-12 15:28:46 +00:00
|
|
|
|
|
|
|
(defun cal-tex-e-document ()
|
|
|
|
"Insert end of document."
|
2012-08-21 06:35:48 +00:00
|
|
|
(cal-tex-cmd "\\end" "document"))
|
1995-10-12 15:28:46 +00:00
|
|
|
|
|
|
|
(defun cal-tex-b-center ()
|
|
|
|
"Insert beginning of centered block."
|
2012-08-21 06:35:48 +00:00
|
|
|
(cal-tex-cmd "\\begin" "center"))
|
1995-10-12 15:28:46 +00:00
|
|
|
|
|
|
|
(defun cal-tex-e-center ()
|
|
|
|
"Insert end of centered block."
|
|
|
|
(cal-tex-comment)
|
2012-08-21 06:35:48 +00:00
|
|
|
(cal-tex-cmd "\\end" "center"))
|
1995-10-12 15:28:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
;;;
|
|
|
|
;;; Boxes
|
|
|
|
;;;
|
|
|
|
|
|
|
|
|
|
|
|
(defun cal-tex-b-parbox (position width)
|
|
|
|
"Insert parbox with parameters POSITION and WIDTH."
|
|
|
|
(insert "\\parbox[" position "]{" width "}{")
|
|
|
|
(cal-tex-comment))
|
|
|
|
|
|
|
|
(defun cal-tex-e-parbox (&optional height)
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
"Insert end of parbox. Optionally, force it to be a given HEIGHT."
|
1995-10-12 15:28:46 +00:00
|
|
|
(cal-tex-comment)
|
|
|
|
(if height
|
|
|
|
(cal-tex-rule "0mm" "0mm" height))
|
|
|
|
(insert "}")
|
|
|
|
(cal-tex-comment "end parbox"))
|
|
|
|
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
(defun cal-tex-b-framebox (width position)
|
|
|
|
"Insert framebox with parameters WIDTH and POSITION (clr)."
|
1995-10-12 15:28:46 +00:00
|
|
|
(insert "\\framebox[" width "][" position "]{" )
|
|
|
|
(cal-tex-comment))
|
|
|
|
|
|
|
|
(defun cal-tex-e-framebox ()
|
|
|
|
"Insert end of framebox."
|
|
|
|
(cal-tex-comment)
|
|
|
|
(insert "}")
|
|
|
|
(cal-tex-comment "end framebox"))
|
|
|
|
|
|
|
|
|
Fix typos in docstrings.
* image-dired.el (image-dired-display-thumbs): Fix typo in docstring.
(image-dired-read-comment): Doc fix.
* json.el (json-object-type, json-array-type, json-key-type, json-false)
(json-null, json-read-number):
* minibuffer.el (completion-in-region-functions):
* calendar/cal-tex.el (cal-tex-daily-end, cal-tex-number-weeks)
(cal-tex-cursor-week):
* emacs-lisp/trace.el (trace-function):
* eshell/em-basic.el (eshell/printnl):
* eshell/em-dirs.el (eshell-last-dir-ring, eshell-parse-drive-letter)
(eshell-read-last-dir-ring, eshell-write-last-dir-ring):
* obsolete/levents.el (allocate-event, event-key, event-object)
(event-point, event-process, event-timestamp, event-to-character)
(event-window, event-x, event-x-pixel, event-y, event-y-pixel):
* textmodes/reftex-vars.el (reftex-index-macros-builtin)
(reftex-section-levels, reftex-auto-recenter-toc, reftex-toc-mode-hook)
(reftex-cite-punctuation, reftex-search-unrecursed-path-first)
(reftex-highlight-selection): Fix typos in docstrings.
2010-03-22 16:50:29 +00:00
|
|
|
(defun cal-tex-b-makebox (width position)
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
"Insert makebox with parameters WIDTH and POSITION (clr)."
|
1995-10-12 15:28:46 +00:00
|
|
|
(insert "\\makebox[" width "][" position "]{" )
|
|
|
|
(cal-tex-comment))
|
|
|
|
|
|
|
|
(defun cal-tex-e-makebox ()
|
|
|
|
"Insert end of makebox."
|
|
|
|
(cal-tex-comment)
|
|
|
|
(insert "}")
|
|
|
|
(cal-tex-comment "end makebox"))
|
|
|
|
|
|
|
|
|
|
|
|
(defun cal-tex-rule (lower width height)
|
|
|
|
"Insert a rule with parameters LOWER WIDTH HEIGHT."
|
|
|
|
(insert "\\rule[" lower "]{" width "}{" height "}"))
|
|
|
|
|
|
|
|
;;;
|
|
|
|
;;; Fonts
|
|
|
|
;;;
|
|
|
|
|
|
|
|
(defun cal-tex-em (string)
|
Remove leading `*' from defcustom docs.
(cal-tex-daily-string, cal-tex-daily-start, cal-tex-daily-end)
(cal-tex-day-name-format, cal-tex-cal-one-month)
(cal-tex-cal-multi-month, cal-tex-myday, cal-tex-preamble)
(cal-tex-comment, cal-tex-nl, cal-tex-cmd, cal-tex-e-parbox)
(cal-tex-mini-calendar, cal-tex-em): Doc fix.
(cal-tex-list-holidays, cal-tex-cursor-year)
(cal-tex-cursor-year-landscape, cal-tex-year)
(cal-tex-cursor-filofax-year, cal-tex-cursor-month-landscape)
(cal-tex-cursor-month, cal-tex-insert-days)
(cal-tex-insert-day-names, cal-tex-insert-blank-days)
(cal-tex-first-blank-p, cal-tex-cursor-week)
(cal-tex-cursor-week2, cal-tex-cursor-week-iso)
(cal-tex-week-hours, cal-tex-cursor-week-monday)
(cal-tex-weekly4-box, cal-tex-cursor-filofax-2week)
(cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily)
(cal-tex-cursor-day, cal-tex-daily-page, cal-tex-mini-calendar)
(cal-tex-latexify-list, cal-tex-previous-month)
(cal-tex-next-month, cal-tex-insert-preamble): General tidy-up and
modernization, mainly using dotimes rather than calendar-for-loop.
(cal-tex-LaTeX-subst-list): Remove `@'.
(cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
\textit and \textbf rather than \em and \it.
2007-07-24 06:01:40 +00:00
|
|
|
"Insert STRING in italic font."
|
2012-08-21 06:50:55 +00:00
|
|
|
(cal-tex-cmd "\\textit" string))
|
1995-10-12 15:28:46 +00:00
|
|
|
|
|
|
|
(defun cal-tex-bf (string)
|
|
|
|
"Insert STRING in bf font."
|
2012-08-21 06:50:55 +00:00
|
|
|
(cal-tex-cmd "\\textbf" string))
|
1995-10-12 15:28:46 +00:00
|
|
|
|
|
|
|
(defun cal-tex-scriptsize (string)
|
|
|
|
"Insert STRING in scriptsize font."
|
2012-08-21 07:01:29 +00:00
|
|
|
(cal-tex-arg (concat "\\scriptsize " string)))
|
1995-10-12 15:28:46 +00:00
|
|
|
|
|
|
|
(defun cal-tex-huge (string)
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
"Insert STRING in huge font."
|
2012-08-21 07:01:29 +00:00
|
|
|
(cal-tex-arg (concat "\\huge " string)))
|
1995-10-12 15:28:46 +00:00
|
|
|
|
|
|
|
(defun cal-tex-Huge (string)
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
"Insert STRING in Huge font."
|
2012-08-21 07:01:29 +00:00
|
|
|
(cal-tex-arg (concat "\\Huge " string)))
|
1995-10-12 15:28:46 +00:00
|
|
|
|
|
|
|
(defun cal-tex-Huge-bf (string)
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
"Insert STRING in Huge bf font."
|
2012-08-21 06:50:55 +00:00
|
|
|
(cal-tex-cmd "\\textbf" (concat "\\Huge " string)))
|
1995-10-12 15:28:46 +00:00
|
|
|
|
|
|
|
(defun cal-tex-large (string)
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
"Insert STRING in large font."
|
2012-08-21 07:01:29 +00:00
|
|
|
(cal-tex-arg (concat "\\large " string)))
|
1995-10-12 15:28:46 +00:00
|
|
|
|
|
|
|
(defun cal-tex-large-bf (string)
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
"Insert STRING in large bf font."
|
2012-08-21 06:50:55 +00:00
|
|
|
(cal-tex-cmd "\\textbf" (concat "\\large " string)))
|
1995-10-12 15:28:46 +00:00
|
|
|
|
(cal-tex-which-days, cal-tex-holidays)
(cal-tex-diary, cal-tex-daily-string, cal-tex-daily-start)
(cal-tex-daily-end, cal-tex-hook)
(cal-tex-cal-one-month, cal-tex-cal-multi-month)
(cal-tex-year, cal-tex-cursor-week, cal-tex-cursor-week2)
(cal-tex-cursor-week-iso, cal-tex-week-hours)
(cal-tex-cursor-week-monday, cal-tex-weekly4-box)
(cal-tex-cursor-day, cal-tex-insert-preamble): Doc fix.
(cal-tex-day-prefix, cal-tex-day-name-format)
(cal-tex-cal-one-month, cal-tex-cal-multi-month, cal-tex-myday)
(cal-tex-caldate, cal-tex-LaTeX-hourbox)
(cal-tex-LaTeX-subst-list): Change from variables to constants.
(cal-tex-preamble, cal-tex-arg, cal-tex-nl): Simplify with `format'.
(cal-tex-cursor-filofax-year, cal-tex-weekly4-box): Use \textbf,
etc, rather than \bf.
(cal-tex-mini-calendar): Fix typos in previous change.
(cal-tex-latexify-list): Remove inner let binding.
(cal-tex-end-document, cal-tex-banner): Use multi-line
cal-tex-comment.
(cal-tex-comment): Handle embedded newlines.
(cal-tex-LaTeXify-string): Use substring-no-properties.
2007-07-25 08:52:43 +00:00
|
|
|
|
1995-10-12 15:28:46 +00:00
|
|
|
(provide 'cal-tex)
|
|
|
|
|
|
|
|
;;; cal-tex.el ends here
|