Skip to content

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

@hongyi-zhao

Description

@hongyi-zhao

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions