;;; 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