This minor change underlines table headers and overlines table footers in LaTeX
styles, which is about the easiest way to make them visually distinct from the
table body.

(defun muse-latex-markup-table ()
  (let* ((str (prog1
                  (match-string 1)
                (delete-region (match-beginning 0) (match-end 0))))
         (fields (split-string str "\\s-*|+\\s-*"))
         (type (and (string-match "\\s-*\\(|+\\)\\s-*" str)
                    (length (match-string 1 str)))))
    (insert "\\begin{tabular}{" (make-string (length fields) ?l) "}\n")
    (when (= type 3) (insert "\\hline\n")) ; added line
    (insert (mapconcat 'identity fields " & "))
    (insert " \\\\\n")                       ; added line
    (when (= type 2) (insert "\\hline\n"))   ; added line
    (insert "\\end{tabular}")))              ; changed line

-- 
Trent Buck, Student Errant


_______________________________________________
emacs-wiki-discuss mailing list
emacs-wiki-discuss@nongnu.org
http://lists.nongnu.org/mailman/listinfo/emacs-wiki-discuss

Reply via email to