I've cobbled together some *very* basic support for how I use tabu.sty. I don't 
see a tabu.el in auctex-12.1.1, so attaching in case it is useful in any way.

Thanks for any feedback.
-mandar
;;; tabu.el --- AUCTeX style for the tabu package.

;; Author: Mandar Mitra

;;; Commentary:

;; This file adds very basic support for the tabu package.

;;; Code:

(defun LaTeX-env-tabu (environment)
  "Insert tabu with position and column specifications."
  (let* ((to-or-spread (read-string "to / spread: " nil nil
                                    '(" spread " " " " to ")))
         (target (unless (equal (length to-or-spread) 1)
                   (read-string "to / spread length: " nil nil
                                '("0in" "1.0\\linewidth"))))
         (fmt (read-string "Format 
X[coef,l/c/r/j(default),p(default)/m/b,$/$$]: " LaTeX-default-format)))
    (setq LaTeX-default-format fmt)
    (LaTeX-insert-environment environment
                              (concat
                               (unless (equal (length to-or-spread) 1) 
                                 to-or-spread)
                               (unless (zerop (length target)) 
                                 (concat target " "))
                               (concat TeX-grop fmt TeX-grcl)))))

(TeX-add-style-hook
 "tabu"
 (lambda ()
   ;; New symbols
   (TeX-add-symbols
    '("everyrow" (TeX-arg-literal "{") (TeX-arg-literal "}"))
    '("rowfont" [ "alignment" "c" ] ("family" "\\bfseries"))
    '("tabulinesep" (TeX-arg-literal "=") 
                    (TeX-arg-free "length" "4pt")))
   ;; New environments
   (LaTeX-add-environments
    '("tabu" LaTeX-env-tabu))))

;;; tabu.el ends here
_______________________________________________
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel

Reply via email to