auctex-devel
[Top][All Lists]
Advanced

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

[AUCTeX-devel] Style for multicol


From: Mads Jensen
Subject: [AUCTeX-devel] Style for multicol
Date: Tue, 25 Jan 2011 09:57:53 +0100
User-agent: Thunderbird 2.0.0.24 (X11/20101027)

I came up with a very basic style for multicol, and thought you might
want to include in the AUCTeX distribution; it's attached with a few
commentary. I'm not sure how stuff like \columnseprule and
\columnseprulecolor should be included, if at all.
-- 
Med Venlig Hilsen / Kind Regards,
Mads Jensen
Rubinsteinsvej 31,st.th
DK-2450 Kbh. SV
Denmark
+45 6168 8518

;;; multicol.el --- AUCTeX style for `multicol.sty'

;; Author: Mads Jensen <address@hidden>
;; Maintainer: address@hidden
;; Created: 2011-01-24
;; Keywords: tex

;;; Commentary:

;; This file adds support for `multicol.sty'.

;;; Code:

(TeX-add-style-hook
 "multicol"
 (lambda ()
   (LaTeX-add-environments 
    '("multicols" (lambda (env &rest ignore)
                    (LaTeX-insert-environment
                     env (format "{%i}" (read-string "Number of columns: ")))))
    '("multicols*" (lambda (env &rest ignore)
                     (LaTeX-insert-environment
                      env (format "{%i}" (read-string "Number of columns: 
"))))))

   ;; not sure whether stuff like \columnseprulecolor and \columnseprule
   ;; should be added, and if so, as what? I couldn't find any sensible
   ;; snippet from the other style-files which matched the criteria
   (TeX-add-symbols 
    '("columnseprule" TeX-arg-macro "Length"))

   (add-to-list 'LaTeX-indent-environment-list
                '("multicols*" current-indentation)
                '("multicols" current-indentation))

   ;; Fontification
   (when (and (featurep 'font-latex)
              (eq TeX-install-font-lock 'font-latex-setup))
     ;; Tell font-lock about the update.
     (font-latex-add-keywords '("columnbreak") 'function)
     (font-latex-add-keywords '("columnseprule") 'function)
     (font-latex-add-keywords '("columnseprulecolor") 'function)     
     (setq font-lock-set-defaults nil)
     (font-lock-set-defaults))))

;; there weren't any mentioned in the manual; I might have missed them
(defvar LaTeX-multicol-package-options nil
  "Package options for the multicol package.")

;;; multicol.el ends here

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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