GNU bug report logs -
#38249
12.2.0; reftex-create-bibtex-file and biblatex
Previous Next
Reported by: Gustavo Barros <gusbrs.2016 <at> gmail.com>
Date: Sun, 17 Nov 2019 19:58:01 UTC
Severity: normal
Tags: wontfix
Found in version 12.2.0
Done: Arash Esbati <arash <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Hi Arash,
On Thu, 11 Apr 2024 at 12:46, Arash Esbati <arash <at> gnu.org> wrote:
> I think AUCTeX/RefTeX are here, if we can improve them, we should do it.
> And if someone wants to replace it with something better, we can do it
> as well. It is always a matter of "I need that", and best case is one
> implements that as well.
Just "someone" playing a little with this:
(defun reftex-all-used-citation-keys-alt ()
(let* (keys)
(if (reftex-using-biblatex-p)
(let* ((master (reftex-TeX-master-file))
(bbl-file (file-name-with-extension master ".bbl")))
(when (file-exists-p bbl-file)
(with-temp-buffer
(insert-file-contents bbl-file)
(goto-char (point-min))
(while (re-search-forward "\\\\entry{\\([^}]*\\)}" nil t)
(push (match-string-no-properties 1) keys)))))
(reftex-access-scan-info)
(let* ((files (reftex-all-document-files))
(aux-files (mapcar (lambda (x) (file-name-with-extension x ".aux"))
files))
file)
(while (setq file (pop aux-files))
(when (file-exists-p file)
(with-temp-buffer
(insert-file-contents file)
(goto-char (point-min))
(while (re-search-forward "^\\\\citation{\\([^}]*\\)}" nil t)
(let ((key (match-string-no-properties 1)))
(unless (member key keys)
(push key keys)))))))))
(nreverse keys)))
Quickly cooked, certainly needs polishing. But not a bad proof of
concept, I think. Of course, this approach requires that the document
has been compiled and the generated files are up to date with the main
document.
(This is still tricked by biblatex's xdata, but I see no way around it
at this level).
Best,
gusbrs
This bug report was last modified 1 year and 38 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.