 So, if you've ever used any kind of serious document formatting service like LaTeX, or Groff, or Pandoc, or something else like that, you probably know that they all have ways of automatically formatting references for you, which is very convenient. Here, for example, is my master's thesis. None of this bibliography I wrote, it's all automatically compiled as well as all of the citations in text. So that's a very nice capability, but of course, in order to do that, you have to have a properly formatted bibliography file, which sometimes can feel like just as much effort. I'll go ahead and open up mine, but it basically looks something like this. You list out all your references. Once you have them in there, you never have to worry about them. You can just automatically call them and it just works. But it might be, I know when I initially started keeping a bibliography file, it seemed sort of daunting to put all the references I have into this file and how to organize it the right way. So, I want to talk about some of the ways where you can basically do this automatically. You don't have to worry about it. I know a lot of people use Zotero or these other kind of applications, but I want to talk about how to do it in the command line without having really to do that much at all. So, I'll go ahead and say, originally when I first started keeping a LaTeX bibliography file, I basically just had Vim shortcuts so that I could edit it quickly. So I had a shortcut to, you know, I want to put in an article so it automatically formats all the stuff that I need for an article and I can just type that in relatively easily. And that actually, for when I first started this out, I think that's pretty much what I did and it was pretty easy to, you know, have everything in place. But especially when I moved on to more scientific articles that had like 80 authors and like extremely long titles, it was just sort of a pain to do that or if you have to include the abstract or something like that. Now, a while ago I found a video, I think I pulled it up over here, I found this video by Connor McDaniel, which is, you may have seen it, it's pretty cool. It talks about some other stuff that I'm not going to touch on. He talks about Vim Pandoc and stuff like that. But one little interesting thing that he had is he had little functions that can access this website, crossref.org, because crossref.org, in case you don't know, basically every academic article has some kind of digital DOI, what is it, digital object identifier or something like that, doesn't matter what it stands for. But you know, each article will pretty much have a DOI and this site actually allows you to look them up. It has an API where you can look them up and get the metadata for free. So let me show you how that works. Now, you can check his video out for how he does it. He uses some bash functions, but I had to make it a little simpler just so I do yet less effort. So I have this little script called git bib, and it is on my GitHub, so you can check it out. So basically what this does is, well actually I'll show you what he does manually, and I just sort of have the script do it for me by default. Now, I keep all my articles in my, oops, in my sci folder, which I got a whole lot of them in here, I guess. In fact, I have, let's see, oops, I meant to do this, oh, over 400 of them. So I got a good bit. So if I, one of the things that Connor did in this video is that if you have poplar installed, which is like basically PDF tools, you have things like PDF info. So I can run PDF info on one of these files here. So I'll say PDF info on Woodley 15 or something like that. And it actually, let me just, so you can see this, and it actually will output all of this information, and part of that is actually the DOI. So I can grep out, so what I do, this is just what I do in the script. First off, it runs PDF info on whatever file you give it, and it tries to grep out the DOI. So it'll just grep only the DOI, and so it gets that. And this is from that Connor's video. Basically you can just plug the DOI into this URL, and it's going to search for that on the website, okay, on this website. So I'll just show you how that looks. So if I set this to DOI, and then I'm going to, I guess, copy this over, run that, and it actually outputs the DOI to the terminal. So it just CURLs that, and that's all you need to do. So there are two ways I have to get the DOI. So it tries PDF to info, but not every single file has that. I mean that's only if the person who made your PDF put the metadata on there. Now on a lot of scholarly sources, scholarly repositories, they will do that. But occasionally there are some where you don't have that, but you are lucky enough to be able to PDF to text the entire text. And then you can just grep out any of the metadata. Actually let me just show you what that looks like, I'm going to get rid of this. So you can do something like this, so let's say PDF to text. And then I'll say another one of these Woodley ones. And if I do that, actually you have to manually say dash for standard output. But it'll output all of that, and you can grep out only the DOI. And so yeah, so that outputs that as well. So what my script does, it basically tries to get the DOI from PDF info, if it can't do that it tries to get it from PDF to text, if it can't get it from either it exits. But either way it's going to plug that into this command here, and it's going to search crossraft.org, so it's going to give you whatever your reference is. Additionally if you can't do either of those, like if it's just failing and returning nothing because there just is no DOI, if you happen to have it, you know, pasted from some, copied from somewhere else, you can just give it to this script manually as the first argument and it'll work. So hypothetically if I don't have, so if I just run git bibb, the script on Woodley 2010, it'll give me that, or if I run it on 2015, it'll give me that. Let's see if there's some other ones. So it pretty much works, but on this one there doesn't happen to be a way of doing it either, but if I just had the DOI I can manually give it in right here, whatever it is, you know. So anyway, aside from that, actually using this script was pretty convenient when I was moving from doing everything manually, or if I wanted to redo old citations. Now I should say, I didn't say it explicitly, but since I'm just outputting it to the standard output, it's assumed that I'm going to actually send this standard output to my bibliography file. And my bibliography file I just have as an environmental variable, just capital bibb, and that's just for convenience. So it'll just output that and if I want to add it to my bibliography, I just say that. And that's all I have to do. Additionally I could, you know, again I'm in my article folder, I have a bunch of PDFs here. If you just want to use this script for your own purposes and get all of the citations you already have articles for, you can just, you know, just run a little bash loop or something. So for x and all the PDFs, do git bib of x and then done. So it'll actually run through all the PDFs in attempt to get, so it's now just printing out all of the bibliographical information for all of my articles. Now if I wanted to, I could just output all of this to my bibb file or something. But it's a little more complicated because obviously you may see there are a couple errors, but I just ran a loop like this once and changed the errors that happened to pop up and I don't have to deal with it again. But whenever I download a new article, I'll usually run git bib on it and then, you know, output that to the bibliography file. Now additionally, actually let me open up my profile file because I'm on home. Because I actually, as I said, I set bibb to my bibliography, my law tech bibliography. But additionally, since I use grof a lot nowadays, I do have refer set as well. Now refer is just what, I mean you can check the refer manual, it's just grof's equivalent of bib law tech or whatever, but the refer variable is just going to be whatever you use for your default database, which is going to be this file otherwise. So if I open up my refer file, it really is the same kind of thing as the bib file, it's just in a different format. But the thing about it is while you can get, so crossref.org, you can get law tech or bib law tech formatted stuff, but you can't get grof formatted stuff, it's just a little too old school, but I did make a little script. So let's say, let's see, where am I? So I'm going to run bibb again on one of those articles I ran it on again. So it'll output that, but I actually have a little script that is, what is it, bibb to refer? And if I run that, it'll actually reformat it in refer. And if you want to see what that is, that is literally just a said script. So it literally just replaces whatever pattern matching is in your law tech formulas into your refer format or whatever. Now of course, this isn't really complete. I don't really use this that often. I think it's on my GitHub, but if it isn't, honestly, it's just a little said script where you replace the title in law tech's format with grof's format. And that's literally all you have to do. Of course, there are a couple little bugs and stuff. I mean, a couple of things that don't convert, but I don't really use this that often. But I just say so because, you know, people have asked me how I get grof references and this is how. So I'm trying to think of what else. Aside from that, I encourage you to check out this original video. Obviously, it touches on a little different stuff. He talks about like Vim Pandalk and some other stuff like that. But I will say in real life, when I'm, let's say, I'm just going to open up an article or something here. Let's see. What is it? Yeah. So if I open up a document, I will say additionally, I don't have any autocomplete stuff for my references or stuff like that. But I do have a Vim binding so that it automatically opens up my bib file. So if I just press leader B, it'll open up my bib file and I can manually see, okay, which one do I need? Which one don't I? Or if I need to make some kind of changes, I can do them here. But anyway, that's pretty much about it. So again, the goal behind it is just like minimizing the amount of work that I have to do when I'm getting references or articles. So the bib file is on my GitHub, you can get that. And basically, I just process every article I download with that, put it in my references and then I really don't have to worry about it until when I have to cite it. And it's not that difficult. So anyway, that's about it. If you have any questions, feel free to ask and we'll see you guys next time.