emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 75b9f46 2/2: Improve support for biblatex and cleveref macros


From: Tassilo Horn
Subject: master 75b9f46 2/2: Improve support for biblatex and cleveref macros
Date: Sat, 26 Oct 2019 14:40:09 -0400 (EDT)

branch: master
commit 75b9f4652bad2f408a45a51bc1bbff8bc70d3552
Author: Arash Esbati <address@hidden>
Commit: Tassilo Horn <address@hidden>

    Improve support for biblatex and cleveref macros
    
    * lisp/textmodes/reftex-cite.el (reftex-figure-out-cite-format):
    Extend regexp to match additional cite commands from biblatex.sty.
    
    * lisp/textmodes/reftex-dcr.el (reftex-view-crossref): Extend
    regexp to match additional cite commands from biblatex.sty and
    reference commands from cleveref.sty.
---
 lisp/textmodes/reftex-cite.el |  5 ++++-
 lisp/textmodes/reftex-dcr.el  | 12 ++++++++----
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/lisp/textmodes/reftex-cite.el b/lisp/textmodes/reftex-cite.el
index 9d45f9a..79f1913 100644
--- a/lisp/textmodes/reftex-cite.el
+++ b/lisp/textmodes/reftex-cite.el
@@ -763,7 +763,10 @@ in order to only add another reference in the same cite 
command."
       (setq format "%l"))
 
      ((and (stringp macro)
-           (string-match "\\`\\\\cite\\|cite\\'" macro))
+           ;; Match also commands from biblatex ending with `s'
+           ;; (\parencites) or `*' (\parencite*) and `texts?'
+           ;; (\footcitetext and \footcitetexts).
+           (string-match "\\`\\\\cite\\|cite\\([s*]\\|texts?\\)?\\'" macro))
       ;; We are already inside a cite macro
       (if (or (not arg) (not (listp arg)))
           (setq format
diff --git a/lisp/textmodes/reftex-dcr.el b/lisp/textmodes/reftex-dcr.el
index 8973e5d..95a3307 100644
--- a/lisp/textmodes/reftex-dcr.el
+++ b/lisp/textmodes/reftex-dcr.el
@@ -60,11 +60,15 @@ to the functions `reftex-view-cr-cite' and 
`reftex-view-cr-ref'."
       (setq reftex-call-back-to-this-buffer (current-buffer))
 
       (cond
-       ((string-match "\\`\\\\cite\\|cite\\*?\\'\\|bibentry" macro)
-       ;; A citation macro: search for bibitems or BibTeX entries
+       ((string-match "\\`\\\\cite\\|cite\\([s*]\\|texts?\\)?\\'\\|bibentry" 
macro)
+       ;; A citation macro: search for bibitems or BibTeX entries.
+        ;; Match also commands from biblatex ending with `s'
+        ;; (\parencites) or `*' (\parencite*) and `texts?'
+        ;; (\footcitetext and \footcitetexts).
        (setq dw (reftex-view-cr-cite arg key auto-how)))
-       ((string-match "\\`\\\\ref\\|ref\\(range\\)?\\*?\\'" macro)
-       ;; A reference macro: search for labels
+       ((string-match "\\`\\\\ref\\|ref\\(range\\|s\\)?\\*?\\'" macro)
+       ;; A reference macro: search for labels.
+        ;; Match also commands from cleveref ending with `s' (\namecrefs).
        (setq dw (reftex-view-cr-ref arg key auto-how)))
        (auto-how nil)  ;; No further action for automatic display (speed)
        ((or (equal macro "\\label")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]