Function: LaTeX-completion-bib-annotation-function

LaTeX-completion-bib-annotation-function is a byte-compiled function defined in latex.el.

Signature

(LaTeX-completion-bib-annotation-function KEY)

Documentation

Return context for bib KEY in a TeX file.

Context is a string gathered from RefTeX. Context is the title field of the key stored in the bibtex database. For the \thebibliography environment, the text after the \bibitem is used.

Return nil if LaTeX-bib-annotation-max-length is set to 0 or RefTeX-mode is not activated. Context is stripped to the number of characters defined in LaTeX-bib-annotation-max-length.

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.2.0/latex.el
(defun LaTeX-completion-bib-annotation-function (key)
  "Return context for bib KEY in a TeX file.
Context is a string gathered from RefTeX.  Context is the `title' field
of the key stored in the bibtex database.  For the \\thebibliography
environment, the text after the \\bibitem is used.

Return nil if `LaTeX-bib-annotation-max-length' is set to 0 or
RefTeX-mode is not activated.  Context is stripped to the number of
characters defined in `LaTeX-bib-annotation-max-length'."
  (when (and LaTeX--completion-bib-list-from-reftex
             (bound-and-true-p reftex-mode)
             (> LaTeX-bib-annotation-max-length 0)
             (require 'reftex-cite nil t))
    (let ((annot (reftex-get-bib-field
                  (if (eq (reftex-bib-or-thebib) 'thebib)
                      "&text"
                    "title")
                  (assoc key LaTeX--completion-bib-list-from-reftex))))
      (unless (string-empty-p annot)
        (concat " "
                (string-trim-right
                 (substring-no-properties annot 0
                                          (when (>= (length annot)
                                                    LaTeX-bib-annotation-max-length)
                                            LaTeX-bib-annotation-max-length))))))))