Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trigger bibliography completion list in-situ in TeX source document when typing \cite{} command. #430

Open
hongyi-zhao opened this issue May 10, 2023 · 0 comments

Comments

@hongyi-zhao
Copy link

I'm not sure whether it's possible to trigger bibliography completion list in-situ in TeX source document when typing \cite{} command. I noticed some related discussion here:

The documentation of reftex-citation is a bit confusing. It promises completion on known citation keys but I believe "known" refers to keys that have been used previously in this session rather than all keys in the appropriate bibliography. You can use the LaTeX-add-all-bibitems-from-bibtex command defined below to load all keys in your bibliography:

(defun get-bibtex-keys (file)
  (with-current-buffer (find-file-noselect file)
    (mapcar 'car (bibtex-parse-keys))))

(defun LaTeX-add-all-bibitems-from-bibtex ()
  (interactive)
  (mapc 'LaTeX-add-bibitems
        (apply 'append
               (mapcar 'get-bibtex-keys (reftex-get-bibfile-list)))))

Suggestions on appropriate hooks to make this happen automatically are welcome.

But I'm not sure whether helm-bibtex supports a similar feature.

Regards,
Zhao

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant