Doom-emacs: "bibliographic" module

Created on 5 Apr 2020  Â·  13Comments  Â·  Source: hlissner/doom-emacs

Description

We need a “bibtex” or “bibliographic” module, similar to the bibtex layer in spacemacs.

There’s an earlier PR #698, which started as a suggested “reference” module, but then evolved into a +reference flag on the org module, and I guess was never finished.

I would argue it would be better to have a separate module, since the functionality here needs to provide integration into document authoring workflows in org, markdown (see screeenshot below of what this looks like), and latex, along with support for working from bibtex and biblatex files.

Screenshot from 2020-04-05 10-54-09

Spacemacs Implementation

What I'm proposing is similar to the spacemacs bibtex layer, which integrates the following packages:

  • Auctex
  • Org
  • Org-ref
  • Markdown-mode
  • Helm-bibtex
  • Biblio
  • biblio-core

All of the above are on MELPA.

A doom module should obviously also integrate ivy-bibtex (which provides equivalent functionality to helm-bibtex) depending on which completion engine feature is selected.

I also wonder about two other packages:

  1. org-noter (when the pdf and org features are selected?); #698 contemplates adding this to the pdf module, but I think it belongs here
  2. ebib (here I'm less sure; maybe others with experience could weigh in?)

Conclusion

I know a lot about bibliographic tools in general (I created the CSL language that is used by a lot of bibliographic tools and services), less about emacs and doom, and elisp programming. But I am doing what I can to cobble this together here, where the doom org module and org-roam support is the core.

I will continue to work on this and do what I can, but hoping someone with greater expertise than I will ultimately submit a proper doom module.

If this is an appropriate request, I can post additional details (like commands) as a needed.

new

All 13 comments

modules/lang/latex has most of the setup. The notable exceptions are org-ref and org-noter.

Now that I'm thinking about this more, am not exactly sure how this should all fit together in the context of doom. We basically have a few use cases:

  1. editing and working with bib(la)tex files
  2. finding and importing bibliographic data and adding to those bib(la)tex files (biblio, org-ref, and ivy/helm-bibtex all have overlapping functionality here, it seems)
  3. browsing and inserting citations (sourced from the above bib(la)tex files) into different authoring workflows; notably org, markdown, latex.

Maybe the simplest, but flexible. option would be:

  • add +ref flags on the markdown and org modes, to mirror the existing one in latex, which would simply load ivy/helm-bibtex (and maybe org-ref for org) and provide a small number of keybindings, for 3 above, with "insert citation" being the most important
  • a small biblio module to support 1 and 2
  • a +noter flag for the org module, to add org-noter

Given #2838 it would seem that "small biblio module" I mention in my last comment might start with simply providing something like this, and a few keybindings, and then expand in time as needed?

(use-package! ivy-bibtex
  :when (featurep! :completion ivy)
  :commands (ivy-bibtex)
  :config
  (setq ivy-bibtex-default-action 'ivy-bibtex-insert-key)
  (add-to-list 'ivy-re-builders-alist '(ivy-bibtex . ivy--regex-plus)))

(use-package! helm-bibtex
  :when (featurep! :completion helm)
  :commands helm-bibtex)

I like this idea. I already do something like this myself in my private config. I'd suggest SPC n b as a reasonably mnemonic keybinding.

Regarding other possible targets for inclusion in this module:

I'm intrigued by ebib, but it looks like it will be a lot of work to create a set of keybindings for. I started putting together a doom module for it ages ago. You can find the code here, if you're interested! https://github.com/patrl/.doom.d/tree/master/modules/tools/ebib

I'm not sure org-noter really belongs here, personally. It's purely a tool for document annotation, so adding a +noter flag or similar to the pdf module would make more sense. One integration that could be nice would be a custom ivy-bibtex action that starts an org-noter session, just in case the +noter flag is active on the pdf module.

I like this idea. I already do something like this myself in my private config. I'd suggest SPC n b as a reasonably mnemonic keybinding.

+1.

I modified my setup with this basic idea (though a different keybinding), here.

Regarding other possible targets for inclusion in this module:

I'm intrigued by ebib, but it looks like it will be a lot of work to create a set of keybindings for. I started putting together a doom module for it ages ago. You can find the code here, if you're interested! https://github.com/patrl/.doom.d/tree/master/modules/tools/ebib

I'm not sure org-noter really belongs here, personally. It's purely a tool for document annotation, so adding a +noter flag or similar to the pdf module would make more sense.

Yeah, @brianmcgillion has WIP that is going with this idea, which I fully support. Except, he puts it on the org module, which makes more sense to me.

One integration that could be nice would be a custom ivy-bibtex action that starts an org-noter session, just in case the +noter flag is active on the pdf module.

Good idea!

One integration that could be nice would be a custom ivy-bibtex action that starts an org-noter session

Do you mean an option inserted here, as a distinct option, or that if one selected "edit notes," org-noter would open if available?

Screenshot from 2020-04-08 05-35-52

I _think_ the existing "Edit notes" action simply opens an associated org file, so starting a new noter session with that org file feels like a strictly improvement on the existing functionality - so, maybe it makes sense for this to replace the "edit notes" action. Not sure of the best way of accomplishing this however.

I _think_ the existing "Edit notes" action simply opens an associated org file, so starting a new noter session with that org file feels like a strictly improvement on the existing functionality - so, maybe it makes sense for this to replace the "edit notes" action. Not sure of the best way of accomplishing this however.

ivy/helm-bibtex does have support for adding new actions; not sure about modifying existing ones though.

https://github.com/tmalsburg/helm-bibtex#create-new-actions

Where should a "bibilio" module go? Tools?

That would be the natural home I think, yes. Let me know if you want me to create the PR for whatever reason, but otherwise if you want to put something together I'd be happy to review.

Done @patrl - review away. I really don't know what I'm doing, but tried my best ;-)

@bdarcus maybe you could close this as the biblio module now exists and we are almost ready with the additions. https://github.com/hlissner/doom-emacs/pull/2888 ?

Done. I didn't realize it was still open.

Was this page helpful?
0 / 5 - 0 ratings