helm-bibtex

helm-bibtex

Emacs 文献管理插件 提供 Helm 和 Ivy 搜索界面

helm-bibtex 和 ivy-bibtex 是 Emacs 的文献管理插件,用于快速搜索和管理 BibTeX 文献数据库。这两个工具提供实时搜索结果、PDF 文件管理和引用插入等功能,与 LaTeX、电子邮件和 Org mode 集成。用户可以打开 PDF、URL 或 DOI,插入引用或 BibTeX 条目,并添加笔记。此外,它们还支持在线数据库搜索和 BibTeX 条目导入,适合管理大型文献库。

bibtex-completionhelm-bibtexivy-bibtex文献管理Emacs插件Github开源项目

#+TITLE: Bibtex-completion, helm-bibtex, ivy-bibtex #+Options: num:nil

Helm-bibtex: [[http://melpa.org/#/helm-bibtex][http://melpa.org/packages/helm-bibtex-badge.svg]] Ivy-bibtex: [[http://melpa.org/#/ivy-bibtex][http://melpa.org/packages/ivy-bibtex-badge.svg]]

Helm-bibtex and ivy-bibtex allow you to search and manage your BibTeX bibliography. They both share the same generic backend, bibtex-completion, but one uses the Helm completion framework and the other Ivy as a front-end.

  • News
  • 2024-01-09: New customization variable bibtex-completion-watch-bibliography. Can be used to deactivate automatic reloading of the bibliography.
  • 2022-01-17: More support for org-mode citations, see [[https://github.com/tmalsburg/helm-bibtex#use-helm-bibtex-or-ivy-bibtex-as-an-org-cite-follow-processor][here]]. (Thanks to [[https://github.com/akirakyle][akirakyle]].)
  • 2021-08-25: It is now possible to mark and act on multiple entries in ivy-bitex. See [[#apply-actions-to-multiple-entries][here]].
  • 2021-07-25: helm-bibtex-with-local-bibliography and ivy-bibtex-with-local-bibliography now also use locally and globally defined bibliographies in org files. These are bibliographies specified using the new #+BIBLIOGRAPHY: key word and those in the variable org-cite-global-bibliography.
  • 2021-07-18: Added a citation function for Org’s new citation system: bibtex-completion-format-citation-org-cite (for use in configuration variable bibtex-completion-format-citation-functions)
  • 2021-04-12: Added a section below explaining how the bibliography can be automatically reloaded when PDFs and notes are added. See [[https://github.com/tmalsburg/helm-bibtex#refresh-bibliography-when-new-pdfs-and-notes-are-added][here]].
  • 2021-04-08: It is now possible to search for entries with PDFs and notes by entering =has-pdf= and =has-note=.
  • 2020-04-29: New commands helm-bibtex-with-notes and ivy-bibtex-with-noted for searching just within the entries that have notes.
  • 2018-06-09: Added virtual APA field author-or-editor for use in notes templates.
  • 2018-06-02: Reload bibliography proactively when bib files are changed.
  • 2017-10-21: Added support for multiple PDFs or other file types. See sections “Additional PDFs” and “Other file types than PDF”.
  • 2017-10-10: Added support for @string constants.
  • 2017-10-02: Use date field if year is not defined.
  • 2017-09-29: If there is a BibTeX entry, citation macro, or org-bibtex entry at point, the corresponding publication will be pre-selected in helm-bibtex and ivy-bibtex giving quick access to PDFs and other functions.

See [[file:NEWS.org]] for old news.

  • Key features
  • Quick access to your bibliography from within Emacs
  • Powerful search capabilities
  • Provides instant search results as you type
  • Tightly integrated with LaTeX authoring, emails, Org mode, etc.
  • Open the PDFs, URLs, or DOIs associated with an entry
  • Insert LaTeX cite commands, Ebib links, or Pandoc citations, BibTeX entries, or plain text references at point, attach PDFs to emails
  • Support for note taking
  • Quick access to online bibliographic databases such as Pubmed, arXiv, Google Scholar, Library of Congress, etc.
  • Import BibTeX entries from CrossRef and other sources.

Helm-bibtex’ and ivy-bibtex’ main selling points are efficient search in large bibliographies using powerful search expressions and tight integration into your Emacs workflows. They both can perform the following actions on entries matching the search expression: open the PDF associated with an entry, its URL or DOI, insert a citation for that entry, the BibTeX key, the BibTeX entry, or a plain text reference, attach the PDF to an email, take notes, edit the BibTeX entry. Many aspects can be configured to suit personal preferences.

  • Example

Below is a screenshot showing a helm-bibtex search for entries containing the expression “eye tracking”.

#+CAPTION: A search for publications containing the expression “eye tracking” [[file:screenshot.png]]

The regular expression eye.?tracking allows searching for different spellings (“eye tracking”, “eye-tracking”, “eyetracking”). A looped square symbol (⌘) next to an entry indicates that a PDF is available. A pen symbol (✎) means that there are notes attached to this entry. At the bottom, there are entries that can be used to search in online databases.

  • Installation

The easiest way to install helm-bibtex or ivy-bibtex is through [[http://melpa.org/#/helm-bibtex][MELPA]]. Alternatively, put the files [[file:bibtex-completion.el]] and either [[file:helm-bibtex.el]] or [[file:ivy-bibtex.el]] in a directory included in your load-path and add the following line to your start-up file (typically init.el):

#+BEGIN_SRC emacs-lisp (autoload 'helm-bibtex "helm-bibtex" "" t) #+END_SRC

or

#+BEGIN_SRC emacs-lisp (autoload 'ivy-bibtex "ivy-bibtex" "" t) ;; ivy-bibtex requires ivy's ivy--regex-ignore-order regex builder, which ;; ignores the order of regexp tokens when searching for matching candidates. ;; Add something like this to your init file: (setq ivy-re-builders-alist '((ivy-bibtex . ivy--regex-ignore-order) (t . ivy--regex-plus))) #+END_SRC

Helm-bibtex and ivy-bibtex depend on a number of packages that will be automatically installed if you use MELPA.

When using helm-bibtex or ivy-bibtex, make sure that helm or ivy is correctly configured (see [[https://github.com/emacs-helm/helm#quick-install-from-git][helm documentation]] or [[http://oremacs.com/swiper/#installing-from-the-git-repository][ivy documentation]]).

  • Minimal configuration

A minimal configuration involves telling bibtex-completion where your bibliographies can be found:

#+BEGIN_SRC emacs-lisp (setq bibtex-completion-bibliography '("/path/to/bibtex-file-1.bib" "/path/to/bibtex-file-2.bib")) #+END_SRC

Org-bibtex users can also specify org-mode bibliography files, in which case it will be assumed that a BibTeX file exists with the same name and extension bib instead of org. If the bib file has a different name, use a cons cell ("orgfile.org" . “bibfile.bib") instead:

#+BEGIN_SRC emacs-lisp (setq bibtex-completion-bibliography '("/path/to/bibtex-file-1.bib" "/path/to/org-bibtex-file.org" ("/path/to/org-bibtex-file2.org" . "/path/to/bibtex-file.bib"))) #+END_SRC

  • Basic configuration (recommended) ** PDF files Specify where PDFs can be found:

#+BEGIN_SRC emacs-lisp (setq bibtex-completion-library-path '("/path1/to/pdfs" "/path2/to/pdfs")) #+END_SRC

Bibtex-completion assumes that the name of a PDF consists of the BibTeX key followed plus a user-defined suffix (.pdf by default). For example, if a BibTeX entry has the key Darwin1859, bibtex-completion searches for Darwin1859.pdf.

If the BibTeX entries have a field that specifies the full path to the PDFs, that field can also be used. For example, JabRef and Zotero store the location of PDFs in a field called File:

#+BEGIN_SRC emacs-lisp (setq bibtex-completion-pdf-field "File") #+END_SRC

If bibtex-completion-pdf-field is non-nil, bibtex-completion will first try to retrieve the file specified in this field. If the field is not set for an entry or if the specified file does not exists, bibtex-completion falls back to the method described above (searching for key + .pdf in the directories listed in bibtex-completion-library-path).

File specifications can be bare paths or follow the format used by JabRef, Zotero, Calibre, and Mendeley. This format also allows the specification of multiple files (e.g., the main paper and supplementary material). Examples:

  • File = {/path/to/article.pdf}
  • File = {:/path/to/article.pdf:PDF}
  • File = {:/path/to/article.pdf:PDF;:/path/to/supplementary_materials.pdf:PDF}

** Notes

Bibtex-completion supports two methods for storing notes. It can either store all notes in one file or store notes in multiple files, one file per publication. In the first case, the customization variable bibtex-completion-notes-path has to be set to the full path of the notes file:

#+BEGIN_SRC emacs-lisp (setq bibtex-completion-notes-path "/path/to/notes.org") #+END_SRC

If one file per publication is preferred, bibtex-completion-notes-path should point to the directory used for storing the notes files:

#+BEGIN_SRC emacs-lisp (setq bibtex-completion-notes-path "/path/to/notes") #+END_SRC

The names of these files consist of the BibTeX key plus a user-defined suffix (.org by default).

At this point most people will be ready to go. Skip to [[#usage][Usage]] below to see how to use helm-bibtex and ivy-bibtex.

** Follow processor for helm

Invoking helm-bibtex or ivy-bibtex when point is on an [[https://orgmode.org/manual/Citation-handling.html][org-mode citation]] will automatically select that key. However, the default org-open-at-point on a org citation will take you to the corresponding bibliography entry. The following code will change this behavior to instead open helm-bibtex-follow when following an org citation by entering RET or clicking on it:

#+BEGIN_SRC elisp (setq org-cite-follow-processor 'helm-bibtex-org-cite-follow) #+END_SRC

Note in the case of an org citation with multiple keys, the above code will not preselect any entry when the [cite: portion is selected. See [[https://github.com/tmalsburg/helm-bibtex#use-ivy-bibtex-as-an-org-cite-follow-processor][here]] for the ivy alternative.

  • Advanced configuration ** Customize layout of search results

The variable bibtex-completion-display-formats can be used to customize how search results are presented on a per-entry-type basis. The default is

#+BEGIN_SRC elisp '((t . "${author:36} ${title:*} ${year:4} ${=has-pdf=:1}${=has-note=:1} ${=type=:7}")) #+END_SRC

which means that all entry types are presented in the same way: authors, title, year, … In this format string, the numbers indicate how much space is reserved for the respective field. If there is a * instead of a number that means that this field gets whatever space remains. Here is a setup that uses a different layout for different entry types:

#+BEGIN_SRC elisp (setq bibtex-completion-display-formats '((article . "${=has-pdf=:1}${=has-note=:1} ${=type=:3} ${year:4} ${author:36} ${title:} ${journal:40}") (inbook . "${=has-pdf=:1}${=has-note=:1} ${=type=:3} ${year:4} ${author:36} ${title:} Chapter ${chapter:32}") (incollection . "${=has-pdf=:1}${=has-note=:1} ${=type=:3} ${year:4} ${author:36} ${title:} ${booktitle:40}") (inproceedings . "${=has-pdf=:1}${=has-note=:1} ${=type=:3} ${year:4} ${author:36} ${title:} ${booktitle:40}") (t . "${=has-pdf=:1}${=has-note=:1} ${=type=:3} ${year:4} ${author:36} ${title:*}"))) #+END_SRC

For this to work, you have to add journal and booktitle to bibtex-completion-additional-search-fields. See next section.

** Fields used for searching

The default fields used for searching are: author, title, year, BibTeX key, entry type (article, inproceedings, …). The variable bibtex-completion-addition-search-fields can be used to extend this list. Example:

#+BEGIN_SRC emacs-lisp (setq bibtex-completion-additional-search-fields '(keywords)) #+END_SRC

** Symbols used for indicating the availability of notes and PDF files

#+BEGIN_SRC emacs-lisp (setq bibtex-completion-pdf-symbol "⌘") (setq bibtex-completion-notes-symbol "✎") #+END_SRC

** Different naming schemes for PDF files

If the PDFs files follow a different naming scheme than BibTeX key + .pdf, the function bibtex-completion-find-pdf-in-library can be modified to accommodate that.

** Application used for opening PDFs

By default Emacs is used to open PDF files. This means that either DocView is used, or, if installed, the much superior [[https://github.com/politza/pdf-tools][pdf-tools]] extension which offers features such as incremental search in PDF files and creation and modification of annotations that are compatible with annotations created by Adobe software.

To configure another PDF viewer the customization variable bibtex-completion-pdf-open-function can be used. Here is an example configuration for the OS X PDF viewer Skim:

#+BEGIN_SRC emacs-lisp (setq bibtex-completion-pdf-open-function (lambda (fpath) (call-process "open" nil 0 nil "-a" "/Applications/Skim.app" fpath))) #+END_SRC

Here is another example for the Linux PDF viewer Evince:

#+BEGIN_SRC emacs-lisp (setq bibtex-completion-pdf-open-function (lambda (fpath) (call-process "evince" nil 0 nil fpath))) #+END_SRC

It is sometimes desirable to have both options (Emacs itself and external viewer) to open the PDF. The following adds an action with Evince as an external viewer bound to P, in addition to the regular Emacs viewer with p. The action works with ivy-bibtex; it would have to be adjusted for helm-bibtex (change the path to another viewer if necessary):

#+BEGIN_SRC emacs-lisp (defun bibtex-completion-open-pdf-external (keys &optional fallback-action) (let ((bibtex-completion-pdf-open-function (lambda (fpath) (start-process "evince" "helm-bibtex-evince" "/usr/bin/evince" fpath)))) (bibtex-completion-open-pdf keys fallback-action)))

(ivy-bibtex-ivify-action bibtex-completion-open-pdf-external ivy-bibtex-open-pdf-external)

(ivy-add-actions 'ivy-bibtex '(("P" ivy-bibtex-open-pdf-external "Open PDF file in external viewer (if present)"))) #+END_SRC

** Additional PDFs :PROPERTIES: :CUSTOM_ID: additionalpdfs :END:

You may store additional PDFs for a given entry, such as an annotated version of the original PDF, a file containing supplemental material, or chapter files. If the file field is used to link PDFs to entries (see section [[https://github.com/tmalsburg/helm-bibtex#pdf-files][PDF files]]), these additional PDFs can simply be added to that field. If the action “Open PDF file” is triggered, you will then be prompted for the file to open.

If the file field is not used but instead the naming scheme bibtex-key + .pdf (again see [[https://github.com/tmalsburg/helm-bibtex#pdf-files][PDF files]]), you can obtain the same behavior with:

#+BEGIN_SRC emacs-lisp (setq bibtex-completion-find-additional-pdfs t) #+END_SRC

All files whose name start with the BibTeX key will then be associated with an entry. It is then sufficient to name your files accordingly (for example with the [[http://askubuntu.com/questions/58546/how-to-easily-rename-files-using-command-line][rename utility]]). Examples:

  • bibtex-key-annotated.pdf
  • bibtex-key-supplemental.pdf
  • bibtex-key-chapter1.pdf

Note that for performance reasons, these additional files are only detected when triggering an action, such as "Open PDF file". When the whole bibliography is loaded, only the "main" PDF bibtex-key.pdf is detected.

** Other file types than PDF

If documents are referenced via the naming scheme bibtex-key.pdf but you are storing files in a different format than PDF, you can set the variable bibtex-completion-pdf-extension accordingly. Example:

#+BEGIN_SRC emacs-lisp (setq bibtex-completion-pdf-extension ".djvu") #+END_SRC

If you store files in various formats, then you can specify a list instead of a single file type:

#+BEGIN_SRC emacs-lisp (setq

编辑推荐精选

Trae

Trae

字节跳动发布的AI编程神器IDE

Trae是一种自适应的集成开发环境(IDE),通过自动化和多元协作改变开发流程。利用Trae,团队能够更快速、精确地编写和部署代码,从而提高编程效率和项目交付速度。Trae具备上下文感知和代码自动完成功能,是提升开发效率的理想工具。

AI工具TraeAI IDE协作生产力转型热门
蛙蛙写作

蛙蛙写作

AI小说写作助手,一站式润色、改写、扩写

蛙蛙写作—国内先进的AI写作平台,涵盖小说、学术、社交媒体等多场景。提供续写、改写、润色等功能,助力创作者高效优化写作流程。界面简洁,功能全面,适合各类写作者提升内容品质和工作效率。

AI辅助写作AI工具蛙蛙写作AI写作工具学术助手办公助手营销助手AI助手
问小白

问小白

全能AI智能助手,随时解答生活与工作的多样问题

问小白,由元石科技研发的AI智能助手,快速准确地解答各种生活和工作问题,包括但不限于搜索、规划和社交互动,帮助用户在日常生活中提高效率,轻松管理个人事务。

热门AI助手AI对话AI工具聊天机器人
Transly

Transly

实时语音翻译/同声传译工具

Transly是一个多场景的AI大语言模型驱动的同声传译、专业翻译助手,它拥有超精准的音频识别翻译能力,几乎零延迟的使用体验和支持多国语言可以让你带它走遍全球,无论你是留学生、商务人士、韩剧美剧爱好者,还是出国游玩、多国会议、跨国追星等等,都可以满足你所有需要同传的场景需求,线上线下通用,扫除语言障碍,让全世界的语言交流不再有国界。

讯飞智文

讯飞智文

一键生成PPT和Word,让学习生活更轻松

讯飞智文是一个利用 AI 技术的项目,能够帮助用户生成 PPT 以及各类文档。无论是商业领域的市场分析报告、年度目标制定,还是学生群体的职业生涯规划、实习避坑指南,亦或是活动策划、旅游攻略等内容,它都能提供支持,帮助用户精准表达,轻松呈现各种信息。

AI办公办公工具AI工具讯飞智文AI在线生成PPTAI撰写助手多语种文档生成AI自动配图热门
讯飞星火

讯飞星火

深度推理能力全新升级,全面对标OpenAI o1

科大讯飞的星火大模型,支持语言理解、知识问答和文本创作等多功能,适用于多种文件和业务场景,提升办公和日常生活的效率。讯飞星火是一个提供丰富智能服务的平台,涵盖科技资讯、图像创作、写作辅助、编程解答、科研文献解读等功能,能为不同需求的用户提供便捷高效的帮助,助力用户轻松获取信息、解决问题,满足多样化使用场景。

热门AI开发模型训练AI工具讯飞星火大模型智能问答内容创作多语种支持智慧生活
Spark-TTS

Spark-TTS

一种基于大语言模型的高效单流解耦语音令牌文本到语音合成模型

Spark-TTS 是一个基于 PyTorch 的开源文本到语音合成项目,由多个知名机构联合参与。该项目提供了高效的 LLM(大语言模型)驱动的语音合成方案,支持语音克隆和语音创建功能,可通过命令行界面(CLI)和 Web UI 两种方式使用。用户可以根据需求调整语音的性别、音高、速度等参数,生成高质量的语音。该项目适用于多种场景,如有声读物制作、智能语音助手开发等。

咔片PPT

咔片PPT

AI助力,做PPT更简单!

咔片是一款轻量化在线演示设计工具,借助 AI 技术,实现从内容生成到智能设计的一站式 PPT 制作服务。支持多种文档格式导入生成 PPT,提供海量模板、智能美化、素材替换等功能,适用于销售、教师、学生等各类人群,能高效制作出高品质 PPT,满足不同场景演示需求。

讯飞绘文

讯飞绘文

选题、配图、成文,一站式创作,让内容运营更高效

讯飞绘文,一个AI集成平台,支持写作、选题、配图、排版和发布。高效生成适用于各类媒体的定制内容,加速品牌传播,提升内容营销效果。

热门AI辅助写作AI工具讯飞绘文内容运营AI创作个性化文章多平台分发AI助手
材料星

材料星

专业的AI公文写作平台,公文写作神器

AI 材料星,专业的 AI 公文写作辅助平台,为体制内工作人员提供高效的公文写作解决方案。拥有海量公文文库、9 大核心 AI 功能,支持 30 + 文稿类型生成,助力快速完成领导讲话、工作总结、述职报告等材料,提升办公效率,是体制打工人的得力写作神器。

下拉加载更多