Day 6 - WR674 - PDF Output of RMarkdown and Citations

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
and welcome to day 6 of our environmental science class today we're going to continue working with our markdown but instead of generating HTML documents like we did in the last video we're going to generate PDFs and to do that we need to use a program called la tech or latex depending how you pronounce it which is a program that essentially renders PDFs and you can add mathematical equations you can embed code and it's a great way to sort of write reports that you want to send to members of your committee or to people that are you're consulting for on a project and it just does it in a PDF document seven HTML so the way you're going to do that is you're going to install lynktec using this make tech distribution and what it does what Mick tech does is it both installs lytec or law tech and a bunch of the packages that law tech needs to render formulas and things like that in a beautiful way so you're just going to go to this Mick tech org backslash download or just Mick tech org would be find and here you're going to pick the system you have so if you have a Mac or Linux or Windows you're just going to go to download and then you're gonna save the file it won't take super long to download this but this install once you get it downloaded it will take maybe an hour to so then you click this open the thing you just downloaded it's taking a second to open no it's probably gonna open two and then you go ahead and install it and that's going to take a while and make sure to do this before class on Thursday so that we can work with it on my computer that has already installed but once you have it installed you want to make sure you restart our or and our studio and then automatically are in our studio should know that you have a latex distribution and it's ready to knit your documents to a PDF and so what that looks like when you knit to a PDF we'll use the same example from the other day we're going to go to our haiman fire folder again and we'll go ahead and pop this open so this still has the assignment of than the answers time but here's the our markdown document that we did last time and if you remember we just clicked knit and it knitted it into an HTML document so we can go ahead and click on that HTML document and this is what it looks like this is the sort of nice clean version that I showed last time but this is an HTML so this is a website what we're gonna do today is go back into the NDVI trace if I can click on the right thing and what we're gonna change here is this output so it says output HTML document and all we wanted to do is say output PDF document now we save that and then now when we click on it it's gonna automatically know that this should be a PDF and so first it's going to knit this file as a markdown document and then it's going to take that document in law tech is going to turn it into this nice PDF and now we have that in our folder and we can go to that click on it and bring it up and now you have this sort of PDF version of that so this is really nice if you want to share something that sort of has a lot of text in it something it can automatically embed some figures it's a really nice internal report generation so I here I change that by doing output PDF document you can also go ahead and click on this knit button here and you can click on the little caret next to it and here you're given options to knit to HTML and it to PDF you can also even it to word and so that will sort of change the way this outputs so that's sort of a simple simplest PDF but let's say that we wanted to sort of maybe cite something directly in this document so maybe we're writing a paper and we need to use a citation software well to do that we're going to use the same sort of our markdown setup but we're going to use bibtex so let's see if there's been some research on the Hey fire so I just get a good at Google dollar that's a USDA government document so maybe I'll maybe we're writing about let's see if there is an API we don't want USDA documents we have publications maybe we're just gonna compare it to this here in Nevada study that apparently did something with NDVI so you know of course you'd read the paper first but here I'm gonna go ahead and ask to cite it with this little site button that's just right there and when I click on site I'm going to click on Bibb tech and what that's do gonna do is it's gonna automatically format it as a big bib tech and actually go back here I can right-click and do Save Link As and I'm going to save it as a big tech document and that's in my downloads folder so if we go back to our game and fire example when we go to the Haven fire folder which i think is still here there go to downloads we have this document in here called cite duck bib and what psyched up bib holds which we already know if we open it here it just holds this formatted citation so what we need to do with this citation is somehow insert it into our our markdown document so we can add a sentence that says something about maybe we also compare the data to some data in it Sierra Nevada and then we want to cite that because that's the sort of where this citation that we're copying for that not copying but referencing and so here to cite something in our markdown you want to do a square bracket and then you want to do at and then you want to reference the name that's in the bibliography so here would be Brad Bradshaw 2003 fire so we're going to copy that and of course after a while after you've read a bunch of papers you might have some of these names memorized and now this name is sort of cited now this citation is properly in this document but we kind of we also have to do one more final step which is tell our markdown where does this bibliography live so we can go to bibliography and then we just add a colon and we say hey the bibliography for this document is is in this file called cite that bit and I also pulled up another project that I have done to show you what a full citation bibliography might look like and basically this is where you might have hundreds of papers and abstracts and all the full things in a paper so you know this is a really simple citation bibliography with just one but of course usually when you write papers you're gonna have hundreds or maybe the hundreds maybe tens and you know every time you just see these at Seminoles that's how at article Olson or that's how you cite that paper so here you know this is the Bradshaw 2003 fire we've referenced it here and we've told our markdown that that bibliography is living in this document called cite bib and that cite bib is in our master directory that we're in so let's go ahead and try to knit this will just click knit and now it's just doing this conversion from this to kind of document to a PDF and we can open our PDF again and indeed now we have a formatted citation right here so it says Brad shot at all 2003 and then at the bottom we have we need to we have the the formatted citation here so that's how you can sort of add citation to a document in class we'll go over sort of how to do this in a more complex way using either Mendeley or Zotero depending on what citation software you use but we'll go over that in class and I will see that
Info
Channel: Matthew Ross
Views: 1,722
Rating: undefined out of 5
Keywords:
Id: 5WgxUF7B0aY
Channel Id: undefined
Length: 8min 46sec (526 seconds)
Published: Tue Sep 10 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.