summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArash Esbati <arash@gnu.org>2021-10-06 11:14:45 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2021-10-06 11:14:45 +0200
commit74aaf8b72762ea65eb755321f0cb8561aca54479 (patch)
tree9d249c7ed37423274e68233af728d6243becb17d
parentc5c545e45eba866ca7c5931a6f4a86891035222b (diff)
downloademacs-74aaf8b72762ea65eb755321f0cb8561aca54479.tar.gz
Improve finding external documents in reftext
* lisp/textmodes/reftex-parse.el (reftex-parse-from-file): Extend regexp in order to support \externalcitedocument macro and a second optional argument provided by LaTeX package xr-hyper (bug#51054).
-rw-r--r--lisp/textmodes/reftex-parse.el12
1 files changed, 11 insertions, 1 deletions
diff --git a/lisp/textmodes/reftex-parse.el b/lisp/textmodes/reftex-parse.el
index c521a07f192..b8c75cb21b6 100644
--- a/lisp/textmodes/reftex-parse.el
+++ b/lisp/textmodes/reftex-parse.el
@@ -345,7 +345,17 @@ of master file."
;; Find external document specifications
(goto-char 1)
- (while (re-search-forward "[\n\r][ \t]*\\\\externaldocument\\(\\[\\([^]]*\\)\\]\\)?{\\([^}]+\\)}" nil t)
+ (while (re-search-forward
+ (concat "[\n\r][ \t]*"
+ ;; Support \externalcitedocument macro
+ "\\\\external\\(?:cite\\)?document"
+ ;; The optional prefix
+ "\\(\\[\\([^]]*\\)\\]\\)?"
+ ;; The 2nd opt. arg can only be nocite
+ "\\(?:\\[nocite\\]\\)?"
+ ;; Mandatory file argument
+ "{\\([^}]+\\)}")
+ nil t)
(push (list 'xr-doc (reftex-match-string 2)
(reftex-match-string 3))
docstruct))