summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2012-11-25 16:41:43 +0100
committerNicolas Goaziou <n.goaziou@gmail.com>2012-11-25 16:41:43 +0100
commit6c8bd67cae744921ba692e1cc29cf9f50497a71b (patch)
tree2c61aa99209dec8d3940bb86f5e4a1cf496cc388
parent755af2357729b15996d44d5d177a3b0caff072ff (diff)
downloadorg-mode-6c8bd67cae744921ba692e1cc29cf9f50497a71b.tar.gz
org-e-latex: Take into account default mode when building a cluster
* contrib/lisp/org-e-latex.el (org-e-latex--math-table): Take into account default mode when building a cluster.
-rw-r--r--contrib/lisp/org-e-latex.el18
1 files changed, 10 insertions, 8 deletions
diff --git a/contrib/lisp/org-e-latex.el b/contrib/lisp/org-e-latex.el
index bc83269..9dc08fa 100644
--- a/contrib/lisp/org-e-latex.el
+++ b/contrib/lisp/org-e-latex.el
@@ -2449,15 +2449,20 @@ This function assumes TABLE has `org' as its `:type' property and
;; of the same type).
(mode (org-export-read-attribute :attr_latex table :mode))
(prev (org-export-get-previous-element table info))
- (next (org-export-get-next-element table info)))
+ (next (org-export-get-next-element table info))
+ (same-mode-p
+ (lambda (table)
+ ;; Non-nil when TABLE has the same mode as current table.
+ (string= (or (org-export-read-attribute :attr_latex table :mode)
+ org-e-latex-default-table-mode)
+ mode))))
(concat
;; Opening string. If TABLE is in the middle of a table cluster,
;; do not insert any.
(cond ((and prev
(eq (org-element-type prev) 'table)
(memq (org-element-property :post-blank prev) '(0 nil))
- (string= (org-export-read-attribute :attr_latex prev :mode)
- mode))
+ (funcall same-mode-p prev))
nil)
(inlinep "\\(")
((org-string-nw-p caption) (concat "\\begin{equation}\n" caption))
@@ -2481,8 +2486,7 @@ This function assumes TABLE has `org' as its `:type' property and
(cond ((and next
(eq (org-element-type next) 'table)
(memq (org-element-property :post-blank table) '(0 nil))
- (string= (org-export-read-attribute :attr_latex next :mode)
- mode))
+ (funcall same-mode-p next))
nil)
(inlinep "\\)")
;; Find cluster beginning to know which environment to use.
@@ -2491,9 +2495,7 @@ This function assumes TABLE has `org' as its `:type' property and
cluster-beg info))
(memq (org-element-property :post-blank prev)
'(0 nil))
- (string=
- (org-export-read-attribute :attr_latex prev :mode)
- mode))
+ (funcall same-mode-p prev))
(setq cluster-beg prev))
(and (or (org-element-property :caption cluster-beg)
(org-element-property :name cluster-beg))