Function: reftex-format-bibitem

reftex-format-bibitem is a byte-compiled function defined in reftex-cite.el.gz.

Signature

(reftex-format-bibitem ITEM)

Documentation

Format a \bibitem entry in ITEM so that it is (relatively) nice to look at.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/reftex-cite.el.gz
(defun reftex-format-bibitem (item)
  "Format a \\bibitem entry in ITEM so that it is (relatively) nice to look at."
  (let ((text (reftex-get-bib-field "&text" item))
        (key  (reftex-get-bib-field "&key" item))
        (lines nil))

    ;; Wrap the text into several lines.
    (while (and (> (length text) 70)
                (string-match " " (substring text 60)))
        (push (substring text 0 (+ 60 (match-beginning 0))) lines)
        (setq text (substring text (+ 61 (match-beginning 0)))))
    (push text lines)
    (setq text (mapconcat #'identity (nreverse lines) "\n     "))

    (when reftex-use-fonts
      (put-text-property 0 (length text) 'face reftex-bib-author-face text))
    (concat key "\n     " text "\n\n")))