From 7839fb891b5b5145104da016b8be6b439ffff806 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Mon, 27 Mar 2017 13:43:49 +0200 Subject: [PATCH] ox-latex: Fix user-defined align string in matrices * lisp/ox-latex.el (org-latex--align-string): Change signature. Center all cells in matrices, yet preserve user-defined align string. (org-latex--math-table): Apply signature change. Reported-by: Phil Regier --- lisp/ox-latex.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 99715c4bc..4f69f83ae 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -3312,9 +3312,12 @@ This function assumes TABLE has `org' as its `:type' property and ;; Environment. Also treat special cases. (cond ((member env '("array" "tabular")) ;; Make sure cells are always centered while preserving - ;; vertical separators. - (let ((align (replace-regexp-in-string - "[lr]" "c" (org-latex--align-string table info)))) + ;; vertical separators, unless user provided a special + ;; align string. + (let ((align + (or (org-export-read-attribute :attr_latex table :align) + (replace-regexp-in-string + "[lr]" "c" (org-latex--align-string table info))))) (format "\\begin{%s}{%s}\n%s\\end{%s}" env align contents env))) ((assoc env org-latex-table-matrix-macros) (format "\\%s%s{\n%s}"