emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cal-tex.el landscape patch


From: Glenn Morris
Subject: Re: cal-tex.el landscape patch
Date: Thu, 24 Aug 2017 21:10:22 -0400
User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)

Fine by me, thanks. Trivial comments below.

> -(defun cal-tex-preamble (&optional args)
> +(defun cal-tex-preamble (&optional class-options)
>    "Insert the LaTeX calendar preamble into `cal-tex-buffer'.
>  Preamble includes initial definitions for various LaTeX commands.
> -Optional string ARGS are included as options for the article document class."
> +Optional string CLASS-OPTIONS are included as options for the article 
> document class."
>    (set-buffer (generate-new-buffer cal-tex-buffer))
>    (insert (format "\\documentclass%s{article}\n"
> -                  (if (stringp args)
> -                      (format "[%s]" args)
> +                  (if (stringp class-options)
> +                      (format "[%s]" class-options)
>                      "")))
> +  (if (and (stringp class-options) (string-match "\\<landscape\\>" 
> class-options))
> +      (insert "\\usepackage{geometry}\n"))


I'd prefer if the argument did not get renamed.


> -(defun cal-tex-insert-preamble (weeks landscape size &optional append)
> +(defun cal-tex-insert-preamble (weeks class-options &optional append)
>    "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
> -non-nil.  Use point-size SIZE.  Optional argument APPEND, if
> -non-nil, means add to end of buffer without erasing current contents."
> -  (let ((width "18cm")
> +of WEEKS weeks.  Insert code for landscape mode if CLASS-OPTIONS
> +contains landscape option. 
> +Optional argument APPEND, if non-nil, means add to end of buffer
> +without erasing current contents."

"Insert code for landscape mode if CLASS-OPTIONS contains landscape
option." seems a bit vague to me. Maybe something like

"Pass string CLASS-OPTIONS as options for the article document class.
If it contains \"landscape\", use the geometry package to produce
landscape format."

Maybe class-options could be optional, and default to "12pt"?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]