diff options
author | Carsten Dominik <carsten.dominik@gmail.com> | 2010-02-16 05:41:12 +0100 |
---|---|---|
committer | Carsten Dominik <carsten.dominik@gmail.com> | 2010-02-16 05:41:12 +0100 |
commit | 8bb407117ba0c3fd5531c444f78b807daac96831 (patch) | |
tree | 2a9d72547becdd083b38d42982e8c8a35f1bddc4 | |
parent | 449e6b4560a5aec1152624ec0a0e7e2d73a51276 (diff) | |
download | org-mode-8bb407117ba0c3fd5531c444f78b807daac96831.tar.gz |
Better detection if point is inside a latex macro
Ruud Brekelmans writes about problems with spurious footnotes:
> I still find similar behavior when exporting to LaTeX with:
>
> #+BEGIN_LaTeX
> \newcommand{\norm}[1]{\lVert#1\rVert}
> #+END_LaTeX
-rwxr-xr-x | lisp/ChangeLog | 1 | ||||
-rw-r--r-- | lisp/org.el | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 43f3e7d..77b2982 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -2,6 +2,7 @@ * org.el (org-hide-archived-subtrees): Don't jump to end of subtree if the match was not in a headline. + (org-inside-latex-macro-p): Allow more complex arguments. 2010-02-15 Carsten Dominik <carsten.dominik@gmail.com> diff --git a/lisp/org.el b/lisp/org.el index 93e63da..a276d3b 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -14770,7 +14770,11 @@ looks only before point, not after." "Is point inside a LaTeX macro or its arguments?" (save-match-data (org-in-regexp - "\\\\[a-zA-Z]+\\*?\\(\\[[^][\n{}]*\\]\\)?\\({[^{}\n]*}\\)?"))) + "\\\\[a-zA-Z]+\\*?\\(\\(\\[[^][\n{}]*\\]\\)\\|\\({[^{}\n]*}\\)\\)*"))) + +(defun test () + (interactive) + (message "%s" (org-inside-latex-macro-p))) (defun org-try-cdlatex-tab () "Check if it makes sense to execute `cdlatex-tab', and do it if yes. |