10.3 Understand the basics of Markdown - Video Tutorials & Practice Problems
Video duration:
2m
Play a video:
<v Voiceover>Well LaTeX</v> is incredibly powerful and allows you to do just about anything you would want. It's still incredibly complex and takes a lot of effort to do and learn properly. LaTeX is so complete that even this entire book was written entirely in LaTeX inside of RStudio but it is very complicated for something simple like a slide show or a quick little document or a blog post. Luckily that's where Markdown comes in and RStudio has full support for Markdown as does Knitr. So to get started we will do a new file by Ctrl Shift N and the very first line we will make a simple title a simple site and we'll put that with a bunch of equal signs underneath it to denote a title. So we'll save this and we'll call it "markdown.Rmd" That's R markdown. You click save. RStudio asks, "Are you sure want to change it to an Rmd?" You say "yes." Now everything in Markdown is meant to be simple. This is a header, Header one actually. This is a Header two. If you want to make something italics, you do an underscore then say "this will be italics" <v Voiceover>You want something bolded</v> you say double underscore "this will be bold" and see how RStudio even helps us with color coding? To make a list you simply put an asterisk and the items. (typing) <v Voiceover>Let's see</v> how we've done so far. We have the title Header one, Header two, italics, bold and we have a list. Let's say we want to make a link now. We do "my website" in square brackets. Then we say "http://www.jaredlander.com" <v Voiceover>and close</v> off the parenthesis. We run this and if we don't want to click Knit HTML, we hit Ctrl Shift H <v Voiceover>and there's</v> a link to the website. If you were to click on it in a browser, it would go to the website. <v Voiceover>Placing an</v> image takes a bit more work but is done by an exclamation mark, <v Voiceover>Alt text for the image,</v> and then the path to the image which for us might be "figure/diamond-plot.png" <v Voiceover>Then close</v> off the parenthesis. That would get you an image. Those are just some quick examples of Markdown. For more information, you can click the little drop down box next to the question mark and learn about using R Markdown or learn about the Markdown quick reference. That gives you a bunch of little quick things you need to know about Markdown all inside RStudio.