How to understand the bibtex + search options?

As an Emacs beginner, I am having trouble understanding how the packages helm, ivy, deft, and company relate to org-roam and bibtex. I have seen config and workflow descriptions that refer to all of these packages. They seem to have overlapping functionality with both search and auto-complete. I cannot tell which are optional for org-roam and org-roam-bibtex to work and which are necessary. I take it that search can be done in different ways, and there is an element of personal preference here, but what are the differences and trade-offs? Which are required for searching or inserting different types of links or backlinks, different types of capture and template definitions, and different ways of finding and navigating notes? Thanks for providing some context.

Helm and ivy are both completion frameworks that are used for command completion, etc. One typically chooses one or the other to use in one’s Emacs config. I don’t believe doing so is required for ORB, but I do recommend it.

In part, you should do so because there are packages that provide extensions to both: helm-bibtex and ivy-bibtex. Each of those is a frontend for a more general bibtex-completion package.

I’m pretty sure they’re functionality equivalent, so just a question of helm vs ivy.

Company provides completion within the buffer. This is optional in ORB.

Deft is just a general interface for search org files.

@bruce, I appreciate your response. Unfortunately, it assumes more knowledge than I currently have and is thus not at a level that I can follow.

How is a completion framework similar to or different from a search function?

You recommend that the user install either helm or ivy but not both, “because there are packages that provide extensions to both: helm-bibtex and ivy-bibtex. Each of those is a frontend for a more general bibtex-completion package.” I simply do not follow how the quoted sentence provides a reason to not use both. There is some assumed and unstated knowledge here preventing communication.

Are helm and ivy really functionally equivalent? I saw a video of @zaeph using helm to bring up a menu of template options (I think). Can ivy do that?

Re: Company, what does “completion within the buffer” mean? How does providing “completion within the buffer” differ from providing “command completion” the way helm or ivy does? You say “this is optional in ORB.” What is optional in ORB? ORB does not require completion within the buffer? Is that a function that most users will want?

Re: Deft - how is a completion framework different than a search interface? If I am in a note and want to link to an existing note, when would I use helm/ivy vs. company vs. deft?

Hopefully these discussions will lead to documentation that makes onboarding easier for new users.

Sorry about that; will try to address below.

At a high level, a completion framework takes some text as input, returns a list of “completion candidates”, from which you select. So it is a kind of “search-narrow-select” framework really.

Let’s say you want to issue a command in Emacs, doing M-x. You don’t remember the command name, but know it’s related to org-roam.

With a completion framework, you type the M-x to bring up the minibuffer, and type “roam.”

Your completion framework will then give you a list of “completion candidates” from which to select your command, or narrow down further. You do the latter by adding additional text.

So when using ivy-bibtex or helm-bibitex, say you want to insert a citation. You bring up the command, and it will give you a list of all your bib entries. You actually want all entries by author “Doe” that mentions “foo” in the title.

You can then just enter “doe foo” in the minibuffer, and it will narrow down the list for you to select the reference you are looking for.

I would add a screenshot here, but I am running into a bug on my system.

You can, but they provide the same functionality, so not sure why you’d want to.

Ivy and helm are not 100% equivalent; I was meaning ivy-bibtex and helm-bibtex are.

You can google for “helm vs ivy” to get a sense of the general pros and cons of each.

But for purposes of discussing org-roam, they are functionally equivalent.

I made a mistake; I meant org-roam (ORB refers to org-roam-bibtex).

Probably an image is more useful. Here’s completion in the buffer, using company. As in, within the flow of the text you are working on.

company-org-roam

You would not use deft.

You would either:

  1. do M-x and org-roam-find-file or org-roam-insert; org-roam would then use helm or ivy behind-the-scenes if you have it installed and configured.
  2. use company-org-roam if you wanted to link without leaving the buffer (as in 1)

Does the above clarify?

1 Like

ivy can do it with M-o (i.e. Alt+o) when selecting a candidate.

OK, I think I am starting to get it. So, tell me (@bruce or anyone) if the following is correct:

  1. Company completes text typed into the note buffer (i.e. into the note content) but not outside the note buffer. Company completion in the note buffer is optional.

Questions:

  • Does optional mean that the user can enable/disable it overall, or that the user chooses each time whether to invoke it?
  • If enabled, does Company attempt to complete everything typed, just org-roam links, any links, or something else?
  • Does Company try to complete based on filenames, note titles, both, or something else?
  • Can Company be used to complete Bibtex references typed in the note buffer?
  1. Ivy/helm completes text typed outside the note buffer for things like commands, Bibtex references, and notes that are link targets. Ivy and helm provide the same functionality and the user can choose either based on personal preference.

Questions:

  • Do ivy and helm do they interfere with each other in any way? Is there any problem with the user installing both and switching between them if they like?

Ivy and helm are not 100% equivalent; I was meaning ivy-bibtex and helm-bibtex are…But for purposes of discussing org-roam, they are functionally equivalent.

I get that ivy-bibtex and helm-bibtex are equivalent. But it sounds like ivy and helm are also used for completion of bibtex references, note titles, and template selection. So when you say they are functionally equivalent, do you just mean that they are both usable for all of these things? Or that for these functions they are 100% equivalent, as they are for bibtex completion?

You said that you would not use deft to find a note when creating a link. I asked about deft in part because this workflow and this one, which have been praised by many people, both use deft. What is it used for in these or other workflows?

You said that to insert a link to another note, you would find the target note either 1) using Company to find it without leaving the note buffer or 2) using ivy or helm in the minibuffer. So for locating and selecting notes as link targets, company/helm/ivy are interchangeable and the user should choose one based on personal preference?

Does this mean that both ivy and helm can issue a command to call up the same template selection menu, or that both ivy and helm can be individually configured to show the user a template selection menu? In other words, can the user define one template selection menu and use either ivy or helm to call it up, or would they have to set it up twice to use both ivy and helm?

Is that menu a default part of helm, or is it a custom thing that you created? Is it built into ORB?

For now, I’ll just answer this, since it is the bottom line.

Close, but not quite.

Based on your preference, choose ivy or helm (which are interchangeable; company is related but different).

Also setup org-roam-company if you like.