Bibliography Management In Emacs With BibTeX

Well, on my way to getting better, I have discovered a piece of software in one of my editors(i.e Emacs), and the software is called BibTeX1 . See, there is little resemblance to the short name with the elaboration of the software it consists of and uses primarily. That means, with bibliography management with tex, you can come up with a more authentic term than my interpretation.

Anyway, while I was managing my bibliographic and note-taking stuff via emacs’ org-mode, that is good enough for the job. But, then why the switch? Because that same stuff can be managed better way with this software.

I have ignored a lot of stuff people write and talk about it. Because those requirements are not required for me. So, I tried to focus on my required thing than what others dish out. Am I missing something by restricting myself to a certain specific thing? Yes, I do. Not yet come the time when I could have to ponder about the other bells and whistles of this specific software.

So, then am I not dishing out half-baked stuff about it?? No, I am not. It fulfills my requirement and that is why I am writing this if somebody wanted to take a cue from it.

Let’s start with the present scenario, then go back to the beginning. Here is what it looks like now :


Okay, a little background, before I opting for to use this software i.e BibTeX, I was happily using another method to keep my books and journals, and notes in separate org files(like everyone else) and pull them up with org-capture-template entries and key binds to insert related info in the specific file.

Likewise, here in this interface, what you are seeing in the picture on top is the main Bibtex interface. It can be used with two precise interfaces inside emacs, those are ivy-BibTeX and helm-BibTeX. I am using helm-BibTeX and it is quite alright for my convenience.

I have got three specific files, which are having a specific name to express the job it is supposed to keep.

bibliography.bib —> is the main bib file where all the BibTeX entries get inducted.

notes.bib –> is the only note-taking file related to the bibliography file.

books.bib —> is for keeping all compiled books entry as pdf

Now, you can see BibTeX needs a dot bib file which should conform to the BibTeX format.

If you scroll down in the main Bibtex interface, you can see those files,


Alright, various things (i.e articles, journals, online, books) have different predefined temples that come with this software. And the default ones are good enough to get along initially. But, once you get comfortable with this,(like we do for every other piece of software we use) then you can churn out your own sadistic requirement with specially designed templates or modify the default one.

Now, how the heck actually does a bib file look likes? Here is a sample


Okay, how do we enter information like the above in the bibliographic file? There is a way to do this in BibTeX and it has a simple key bind, once the bibliographic.bib is open in a buffer, simply type C-c C-b , this will give you a chance to complete the required format for that specific template to choose from. Let me show you, it looks like once you press the key bind


Alright, there are more options if you scroll down that highlighted bar in the minibuffer2 for specific requirements. All you have to do, is select the required type in that list and press enter to fuse the template in that bibliography.bib file, simple.

Suppose, in that drop down I have selected book and pressed enter, the template would look like this in the bibliography file as a BibTeX entry :


Now, you can see, the default templates are pretty extensive, you probably do not need all the fields to fill in. The fields starting with ALT or OPT are really optional, which means you can fill them in if you want or have information. But, what are options without those two words, like the first four options, you are supposed to fill in, that is mandatory. Once, you are done with the entry, you are supposed to press C-c C-c to get it formatted for the BibTeX entry. On the way, it also allocates a key for the specific entry to search for that item later. You can modify that entry while on it or access the default chosen one, because, most of the time it shows sensible keys to attach to the document. Finally, you need to save the file with standard C-x C-s and then look at the echo area at the bottom of the screen and it should show Done, (re) loading the bibliography. If the template is not filled properly, and you try to save the file, then it will complain about that action. So, you need to correct that information and then save it, then only the bibliography gets regenerated.

There are currently 87 different commands to manipulate the BibTeX files and I encourage you to go through them at least once, And most of them have shortcut keys attached to them. If something from that command list is not having key bins you can bind it yourself and it is pretty trivial to do so.

Say, you have inducted an entry which supposes to have a pdf attachment, how do you do that? For that operation, you need to place your highlighted cursor on the main Bibtex interface entry and press TAB to get the action menu like this :


So, you can from the above screenshot that various options are available to use for that entry. Choose whatever is required for that entry. If you look closely at the very first screenshot of this page, specifically on the right side between the year and type there are icons for pdf attachments and a note for that specific entry. These icons can be changed through Bibtex variable tweaks from customized menu options. Those are kind of visual indicators.

I can open any entry by highlighting it and pressing enter. If the entry has a pdf attachment, it will go ahead and opens the pdf in the system-wide pdf viewer, in my case it is zathura3 . This is because most of the time I run emacs in tty mode which means in the terminal session. But if you run emacs(like 90 percent of the people do) in GUI mode then you must have pdf=tool to open the pdf inside emacs, which is cool.

For note-taking related to a specific entry, as you saw on the action page, there is an option to edit the note you select by pressing enter, your designated note files get open and allow you to write the note about that entry. Again the predefined note header and properties can be modified via little lisp coding or tweaking the bibtex variables.

let me show you a note-taking screen, the process, if I want to take a note on a specific entry on the main BibTeX entry, then pressing the TAB while the entry is highlighted will put you on the action page like the last screenshot and you have select edit note and the corresponding note file will get open :


See, my cursor is sitting right on the author, and if we go down a little and start writing about that specific subject. Pretty handy, right? And convenient too.

I use citar4 to manage to cite specific stuff, as I said almost all the actions have shortcut keys available, if not you can bind one by yourself. I have a key bind to open the cite with key bind C-c t o and it shows like this in minibuffer:


Now, if I select any of the entries from the above screenshot minibuffer, it will simply ask me to create a denote file(which is a way to backlink with other notes) or open the attached URL or pdf. See like this :


Extremely convenient to work around with references and notes. There are way more options than I needed, but the people who are delving into academic papers might need all those. All in all, this software is extremely powerful for resource management.

Also, I sometimes take advantage of org-BibTeX which greatly helps in the citation.

Oh, I have made two videos about the process, you might take a peek at those Emacs BibTeX Adds Convenience Part-1 and Emacs BibTeX Adds Convenience Part-2 .

About unixbhaskar
GNU/Linux Consultant

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: