 I think a lot of people are filing in while people are still joining. If you want to either code along with me today or I also have some exercises that you can do when we get to an exercise section of the workshop, then we have a training environment set up. So the joining details should be also attached to this event. But I'll quickly show you how to join the training environment if you want to. So. I've sent out in the chat and I'll send it again, just for anyone who's just joined the link to the welcome page. So if you go to that link, it will look a bit like this. Potentially, if you were attending Astrid's workshop yesterday, you might have already seen this, because I think she will also have used the same training environment. But basically to log into the training environment, if you want to do exercises or code along with me, then on the welcome page, put in your own email. So don't put mine in. Put your own, otherwise I'll get kicked out when you log in. And for the password. If you could put cherry dash blackberry, and I'll send that out in the zoom chat as well, so you can copy that. For anyone who's just joined, I'm just showing you how to log into the training environment. You don't have to log into the training environment. But if you want to participate in the exercises and play around with some of the things I'll be showing you, then I highly recommend doing that. If you've got an up to date version of our studio locally as well, you're free to follow along locally. But we have all the materials and dependencies on the training environment already installed, so it's a bit easier. So go to the welcome page, put in your own email. Put in the password, which is cherry blackberry. Cherry dash blackberry. Press submit. That should generate a username and a password for you. Copy. I can manage to copy the whole thing. Copy the password, click the link that says training environment. That should take you to a page that looks a bit like this. Here, put in your username, so your generated username, which for me is going to be U001, but for you, it might be something different. U001, and then I'm putting in my generated password in there. And clicking sign in. You might not have a session here, so I'll click that one so it looks the same. So once you're on this page, if you could do a new session, RStudioPro, start session, then it might take some time. Let's see. All right. And then you should see something like this. Just a sort of normal looking RStudio session. You should have a folder called exercises as well as a PDF version of the slides for this course. You won't have the lemur JPEG, but you have another lemur picture in your exercises folder. So don't don't feel too sad about not having this one. All right, I'll do a super quick run through of that again. So on the welcome page, put in your email, put in the sort of master password, which is cherry dash blackberry, press submit, copy your username and password. Click the sort of blue bit here, the blue link that says training environment that will take you to another login page there. Copy and paste your generated username and password. And once you're in new session, RStudioPro, start session, and you should end up with something like this. Don't stress if you haven't managed to log in. You can still follow along with the course. It will only be at the exercises that you'll be asked to go to this training environment. But you don't have to to do the exercises either. I won't check if you've done them or not. So if you want to, you can just sit back and watch. And you can also play around with Korto locally if you have a new enough version of RStudio. All right, I'll jump into the content. If you have any problems getting into the training environment, getting into the training environment, you can just put a question in the chat. So before we actually start talking about Korto, I'll just do some quick introductions. So an introduction to me, first of all. So my name is Mandy. I originally learned R using it in a sort of psychological capacity. So I have a background in psychology. Then I actually moved into teaching R and data analysis at a coding bootcamp. And now I currently work as a data scientist at Jumping Rivers. And if you attended Astrid's workshop yesterday, or I think Russ is also doing a talk, you'll meet some other colleagues from Jumping Rivers as well. So I mostly do R and Shiny development. As a consultancy, we're sort of industry agnostic. So our clients actually operate in a bunch of different fields. I'm not specialized in one area in particular. At Jumping Rivers, I also do a bit of teaching. So we do a lot of courses. We do Python and Stan courses, but we also do R courses. And those are the ones that I tend to teach at. So I teach both sort of the first introductory what is R course, but also some more advanced ones on sort of best practices in R and text mining, things like that. So what does Jumping Rivers do as a company? Well, we do R and Shiny development, which is what I do. We also do these training courses. More broadly, we do machine learning. We build dashboards. We develop R packages, APIs, setup data pipelines, do code review. We have a whole section as well, just dedicated to infrastructure. That's not what I do, but we do a little bit of everything data related. So let's jump into the actual content. Before we start actually creating a quarto document, we'll talk a bit about what quarto is for anyone who has maybe never heard of it or just heard the word quarto and not been sure what it actually means. So quarto is a, I guess, like a publishing document editor system where you can write documents. And in those documents, you can have both text and code, which is sort of the benefit of quarto over something like maybe Microsoft Word, because in Word, if you want to include any R code or outputs from R code, you would just have to copy paste them. You couldn't actually run the R code within your Word document or Google Docs document and outputs. You couldn't sort of directly generate inside of your document. You'd have to, if you're creating your figures in R, you'd create the figures in R, save them somewhere, and then insert that image into your Word doc or your Google doc or something like that. And so quarto, very much like R Markdown, if anyone has used R Markdown, is sort of removing that middle step of having to save your outputs and then import them in your document editor. Instead, in the exact same place where you're actually writing the text for your report or your journal article or whatever you're writing, you can also develop your code, run the code and get the outputs from that code in the exact same place. So, quarto actually works for multiple languages, which is sort of one of the reasons why it has evolved from R Markdown is that it's more focused on being sort of multi-language, a multi-language tool so that both Python programmers, Julia programmers, R programmers and even JavaScript could all use this tool without having to kind of rely on R, which is where sort of R Markdown was more based. quarto also supports multiple output formats. So if you've been using something like R Markdown, you might have also used other packages to extend your R Markdown document. So maybe something like blog down to make websites or book down to make books. quarto tries to kind of contain all of that in one thing, like batteries included system. So before we jump into what quarto can do and look at more specifics, we can have a look at the gallery, which is probably a good place to get inspired. And if you need that little pusher motivation to actually start using quarto to see what is even possible with quarto. So another nice thing about quarto as well is that it has sort of the one central website, which contains almost anything and everything, quarto related. So at quarto.org there is a gallery tab. And this is just a sort of showcase of what is possible. So before we talk more, let's have a look at what is even possible. So you can generate PDF documents with quarto. Here's an example, got a nice figure of a seal there, very cute. There's also presentations and we'll look at generating presentations today as well. But just to give you an example, here's a presentation made with Reveal.js, which is something we're going to look at today as well. So we have these nice little animations, being able to add moving parts as well, because it's HTML based slides and so on. Final thing I also wanted to look at was the website section. So you can also generate websites for quarto. And there was one when I was scrolling through this earlier, that I didn't even believe was actually made with quarto. Because to me it just looked like, I guess, a lot of times things generated in R will not look like they will look a certain way, like when you know, when you have a default shiny app, it will look like a shiny app. It won't necessarily look like a production dashboard, maybe. But this website, I think, looks very, very cool and neat and is generated in quarto. I actually had to double check in the source for the website that it actually was. But yeah, I recommend checking out the gallery on the quarto website to get some inspiration for what is possible. So quarto is also created by the formerly known as RStudio, now known as Posit Team. And as I've been saying, if you've been using R Markdown, it's sort of the next generation of R Markdown. So if you've already been using R Markdown a lot, quarto should hopefully be quite straightforward. And a lot of the time the way that you do things will either be identical or very similar to the way that you do them in R Markdown. And a question that a lot of you might be wondering about, that I also was wondering about when quarto was released, which is about a year ago now for anyone who's wondering how recent quarto is and is whether it's worth, if you're using R Markdown, is it worth switching to quarto? It probably depends. You might want to switch at some point. So it might be that new projects you might want to start playing around with quarto with, especially now that it's been around for about a year. Things are becoming a bit more stable. And there's a lot of nice features. But I think the general consensus is that R Markdown isn't going to stop being maintained. It's more like any new features are going to be mostly in quarto. But you can still keep using your R Markdown documents from before. I guess another main difference between quarto and R Markdown is just the final extension. So it's not a huge change from RMD and you just have to go to QMD. And sometimes you might be able to take an RMD document, basically just resave it as a QMD and it still works. So that's kind of how similar they are. And so switching over should also not be too painful because of this similarity. But new features are going to come in quarto. So you might benefit from switching at least any new projects that you're starting. So you can use quarto in our studio, which is what we're going to be doing. But you can actually use it directly from the command line as well. And if you want to do that, you can download it from the get started menu on the quarto website. And so there's the download files for a bunch of different operating systems. And yeah, as I said, it's we're going to be using it in our studio, but you can use it for a lot of different tools. So for example, if you like to write code in VS code, then you can use quarto directly there as well. I've only ever tried it out properly from our studio. But if you use VS code, Jupyter or another text editor, because it's a command line tool, you can basically use it with any text editor that you like. So with our studio as well, since that might be what most of you use, if you have a quite updated version of our studio, you might already have quarto installed without knowing it. I think the easiest way to check is when you're in our studio, if you have the quarto document option when creating a new file, then you already can start creating quarto locally. So I've sort of already touched upon this, but if you're an avid user of our markdown, you might have actually been worried when they announce quarto because, oh no, everything I've ever written is going to have to be updated. But as I said, our markdown is actually still going to be maintained. There's going to be bug fixes and it should still be working. As far as I know, there's no plans to deprecate our markdown, so you should still be able to use it moving forward. All of your old our mark documents would still work in the near future, at least. And so to some of the benefits I was talking about already, quarto has sort of been developed to be multi-lingual. So especially if you have a team with maybe our programmers and Python programmers, switching to quarto probably makes it a bit easier for Python programmers because you're not depending on R anymore to be able to just generate reports or articles or whatever you might have been doing in our markdown. quarto is also a bit more user friendly. So from what I've read, when quarto was released, it was sort of branded as everything we've learned from the 10 years of our markdown. We've sort of tried to implement in quarto. So the documentation is actually great. And it's one of the things that I really like about it, because with our markdown, a lot of the time when I was looking for help, it was in a lot of different places. I would maybe Google something about our markdown and it would be an excerpt from a book, or maybe it would be the markdown cheat sheet or someone's blog on a topic. Instead with quarto, the nice thing is that it's all very centralised on the quarto website. It's super easy to find help. And basically everything you'd ever want is on as this website in the same place. And the content is super nicely structured. So there's both like tutorials to get started, but also a kind of reference page. So I'm creating an HTML document, basically telling me everything that I can do in this HTML document. quarto also has better control of the output layouts. There's also an R package. And yeah, as I've said a few times already, I guess one of the main benefits of quarto is that this is now where new cool features are going to be added. So even though our markdown is still going to work, the sort of cutting edge features might not be implemented in our markdown. All right, that was enough introducing quarto. I think we will go straight into actually creating our first ever quarto document. So if you are following along with me, I'm going to be switching to the training environment every now and then to demonstrate things. So the first thing that we're going to look at is actually creating the document. It's quite straightforward. We're just going to need to go to the file tab, select quarto document. Then the same thing as with an R markdown document. We're going to set the title and the author for that document. We're going to create it and then I'm going to also render it. So I'm going to switch over to the training environment. File, new file. quarto document, first quarto document. And I'm going to put Mandy as the author. I'm going to start off with creating a HTML file. So I'm going to keep HTML ticked. We also have some options for what engine to use. I'm going to keep NITAR. And then for the editor, I'm going to keep that ticked as well. And I'll show you what the visual editor is if you haven't used it before. So similar to if you create an R markdown document, we have some boilerplate text and code when we generate this. There is an option, I think, when you generate the document. You can click create empty document instead. So if you haven't seen that button before, that's how you can create a document without all of this boilerplate. But right now, this is quite good. It will give us a bit of content for our first document. So what I'm going to do is I'm going to save it. My first quarto document. And then I'm going to render it as well. So there is a. Should be a render button here with a blue arrow. We can just click that when I hover over that as well. You can see what the keyboard shortcut is control shift K. So if you don't like using a mouse, then you can use the keyboard shortcut instead. Right, I've clicked that. There are some things happening down here. And now we have our first quarto document. I'm going to open that in a new window. So there's a button here show a new window, which will basically pop out that document into a separate tab in my browser, a bit zoomed in on training environment, which is why it's so zoomed in here. So here's our first document pretty straightforward to create it. So just to quickly go through that again, file, new file, quarto document, choose whatever output format you want. We're going to look mostly at HTML today, but you can also do PDF and Word documents, whichever one suits your use case the best. And then create, then we save it and then we can render it. And we have it both rendered here in the browser and also in our little viewer pane here. I think there's some options for where you want that to be, if you want it in the viewer pane or if you want it in the window. So now that I've changed that, it should open a new tab. So if you want to join the training environment, I've got the details further up in the chat. And the password is Cherry Blackberry. And I think there was a good link to where the instructions are above. So I'll share that as well. So the instructions for how to log into the training environment are on the event page. So I won't run through that now, but hopefully those instructions should help you get in there. And when we get to our first exercise, if anyone's stuck, I can try to help. All right. So as you might have seen at the top here of our document, we've got this YAML header. Once again, if you have been using our mark found you are probably quite familiar with the YAML header. But in case anyone has never seen this before, I will talk through what it is. So the YAML header is basically a way where a place in your document where you can set options in terms of how you want that document to be rendered, what you want the output to look like, what output format you want, for example. So currently we're outputting to HTML, but we could in the YAML header set what format we want. So, for example, we could change it to PDF. So we're not going to go through all the available options in the YAML header. But I want to also share on the Cortot website if we go to reference and then HTML documents for HTML options. On this page, it's basically almost all the options that you can have for HTML documents. And I just wanted to show you how many options that is that you can set in the YAML header. So there's quite a lot of different things that you can set. Things like put notes. What's the language of your document? But more fun, maybe things like themes as well. To give your Cortot document a nice theme in terms of fonts and colors and layout and things like that. So there's a lot of different options you can set in the YAML. If you've never seen YAML before, it's basically like a key value pair way of providing options. So basically you'll have a key, so a type of option. So for example, format and then the value will be whatever you want to set that option to be. So format, I want to be HTML. So format colon HTML. We could change it to PDF instead. And so I'll show you that. I think as well, if we start typing in the YAML, quite nicely, our studio will try to autocomplete for you. So I've started typing form, you can autocomplete to format. I don't... Oh, yeah, it looks like it will as well. Actually, you're able to autocomplete all the values that you can set here. So you can see there's a lot of different ones. We're just going to go ahead and change it to PDF. But if you felt overwhelmed looking at all the different HTML options that you can set, the nice thing is that in our studio, at least, it will autocomplete both the keys and the potential values. So I've set it to be PDF. Now I'll render. We have things happening down here. And here we go, same document as a PDF. So I've just had to change one thing, set format to PDF instead of HTML. And now we have a PDF document. And we can download this with this button here, download. I'm going to set that to HTML. And then let's jump back to the slides. So in terms of what you can add, these are some of the things that you can add. We're going to look at most of these things today, if not all of them. So you can add just plain text. You can add links. You can add images. You can format those images, adding captions or text, changing the size of it, the layout of the image on the page and so on. You can add code. And we're going to look a lot at the different options that we have when we include a code chunk in our document. Do we want that code chunk to be visible? Do we want to actually show the option set for that code chunk? Do we even want that code chunk to run? Things like that. You can also, then with the code that you're adding into your document, you can easily generate tables and plots in your document directly. So that's what I was kind of talking about at the start. One of the main benefits of generating reports in something like Corto is that you can write your code in the same place that you write the rest of your report or article. And so if something changes about your data or about your code, you don't have to open a separate R session, change the code, run it, make sure that you save that to a new PNG or JPEG or whatever, import that into your document and hope that you've got the most recent version. Instead, if your data changes and you've written your report in Corto, all you need to do is actually re-render that report. And it will just, if you're generating the plots directly, it will read in the newest data and regenerate the plot or the table. You can also include things like equations. And we're going to also look at references, both in terms of cross-referencing sections in a document, as well as references, like bibliography of references that you've used. So if you're in the visual editor and the way to make sure you're on the visual editor is that this bit is sort of clicked here. We can switch between source and visual by just clicking that. And the difference is that the source is basically the markdown or whatever code you're using to generate components in your document, whereas the visual editor is more like a classic document editor like Word or Google Doc. And so when you're in the visual editor, you actually have a lot of the nice straightforward options. You don't have to remember, how do I make text bold? How do I use italics? What's the markdown way of adding an image? We can just click the relevant button and it will do it for us. And I think I was a bit hesitant at first being a programmer to sort of go back to something like Word where I'm just clicking the buttons. In general, it's so much faster and easier and you don't have to try to memorize a lot of things. So I've sort of been won over by the visual editor. It makes things a lot easier. A super cool feature of the visual editor that I didn't know was if you have like a table in a Word or Google Docs document in the visual editor, you can actually just highlight that table and paste it in into your Corto document. So that kind of thing makes it super easy. If you've previously got kind of like a tedious manual process in Google Docs or Word, a lot of the time you can actually just copy that over into Corto and it just works. And you can then incorporate any code bits or whatever you want to add to your document. So yeah, we have a lot of straightforward, nice options here for including bits. We're going to look more in detail at how to include them and compare to what is actually happening in the source code. So for example, here we have the level two header rendered. So we can see that's a bolded and sort of bigger font heading. If we look at the source code, that's just a hash and hash to create a level two header. The other thing I wanted to highlight as well is that there's a nice option to render on save. So if you are developing your document, it might be a bit annoying to every time you want to see your change, have to click the render button. So basically I can add some more text and then I'm going to save it or hit just control S. And our document will just re-render directly. And then if you have it previewed in the viewer pane, it will sort of be even more convenient I think for developing. We'll have saved it and it just re-renders. So that is the visual editor. Let's now look at how to add a link to our document. So I think what we'll do is we've got sort of two more bits and then an exercise. So I think we'll do the next two bits, the exercise, and then we'll also take a bit of a break after the exercise because I know it gets tiring to listen to someone to zoom for ages. So let's have a look at how to include a link in your document. So I'll just get some new lines here. I'm going to not render on save because that is going to irritate me. Let's do the easiest way of including a link is to in the visual editor, insert link. And then you just have to fill it in here. So if we wanted to link to the Corto website, we can just add that link there. I'll render. And now it's a nicely formatted link already. Super simple as well if we want to add link text. So I'll put the same link. But this time we'll have some text that says Corto documentation. And now I'll save and render. And here we now have that nice link text as well. So a nicely formatted link to change the preview settings. It would be this cog here. And then there's preview in window or preview in viewer pane. That should be there. It might be more zoomed out because I'm quite zoomed in. So where you, yeah, it might be next to render button. There preview in window preview in viewer pane. If you're using the training environment, I would think it would be there because we should be on the same version of our studio. So potentially if you're on an older version of our studio locally, maybe the button is somewhere else. All right. Make sure everyone is muted because I just heard some background noise. If you do have a question, feel free to put it in the chat. So that was adding a link. We're also going to look at adding a picture. And so once again, I've sort of been won over by the visual editor. You might feel like, oh, but what's the code behind it? If you want to know, you can look at the source. So here's basically how our links were generated. I think the easiest way to add an image is just insert figure slash image. And then we're going to find a picture. So I've got this lemur JPEG. You don't actually have that. But if you want to add an image, if you're coddling along with me, you can upload images to the training environment as well and include them in your document. So I'm going to add a caption. My caption is going to be the image from Duke lemur center. And the alt text is going to be brown colored lemur looking directly at camera. And so I'm going to add that. That has now added our image with a caption. We can look at the source as well. So rather than having to remember the syntax for writing this, we just use the nice button to insert our picture. But here you can basically see the different components. So the image caption has ended up here. And the alt text has ended up here. Save and then render. And then here we have our image with our caption. And then the alt text is used. If someone uses something like a screen reader. If you haven't heard about alt text, basically just a way to make images more accessible by also describing them in writing. All right. And that's how simple it is to just add some links, images. We can also add just some plain texts. I realize I didn't actually show that, but to add text, all you need to do is just type the text that you want. So below are some links to the Cortot websites or something like that. Same if you prefer writing in source, you can do that. We can add a heading here, something like adding images to your Cortot report. And then you can switch between source and visual. Whatever you prefer. All right. And so it's time for our first exercise, which is where I hand over to you to actually practice what I've been talking about. If you finish way before the time is up, we'll have this little timer, but if you finish way before time is up, either feel free to just play around with Cortot yourself. It should be quite intuitive. I'll send out a link to the website as well. You can find interesting things that you can do with your document or feel free to take a little break from your screen as well if you want to with the remaining time. But we will go for a break after the 15 minutes are up as well. So don't stress if you are busy with the task for the full 15 minutes. All right. So I'll start the timer. The tasks are on the screen. If you have any questions about them, just let me know. It refers to task one, TXT, any files that you need for the exercises you can find in the exercises folder in the training environment. So that should have all your task related files. And there's also solutions if you're stuck. If you finish early as well, another thing you can do is to put any questions in the chat and I'll have a go at answering them after we're done with the exercise. All right. That is 15 minutes up. I hope everyone got on OK with the exercise. I'm just having a look through the questions in the chat. So how do you get back to the options that you first selected to make the quarter document? So if I understand correctly, just how do you change them or how do you get to that point? So to see the options, it would be again just when you create a quarter document. So new file, quarter document, you have the options available here. So some of the options are title, author, what output format and whether to use the visual markdown editor. And those things you can also change in your YAML once you've actually created your document. So either when you're creating them, but even if you've created your document a certain way, it doesn't mean you're stuck with those options. So as I showed, we can change the format, for example, to be PDF. We can change our title or the author. We can even change if by default it's going to use the visual editor or not on our document. So one question. And there was a question about whether I've added a label to the image. So I've added a caption and there's also some alt text, which we can see here in the source. And so I added those when I did insert figure slash image, and then I can just include my image there and then I can add a caption and alt text. And also if I want the image to link to something, so when you click the image, it actually takes you to a website or something like that. And then there's more advanced options as well for editing your images, but I'm not going to look at that. Then there was a question, which in brief was basically how good can you control the layout in Korto. Is it possible to basically have very precise control over where images and texts are making sure the size of the document is always the same and that's always on one page. And I would say that those things is possible to have quite precise control over your layout. You can change document sizes, margins, font sizes, where images are located on like a grid where text is located. But I would say if you get to like a very custom layout, either you can sort of create your own template for Korto. So that might benefit, but then to create your own template, you have to learn about Lua as well, which is kind of how Korto generates documents. Or you might be better off not using Korto if you want super precise, easy way to control very specific layouts, because if you're going to have to change precise details about layouts every time, it probably does feel like a bit of a hassle in Korto having to in the YAML or in a CSS file to precisely define output options and trying to using sort of code or just text describe where things are located on the page. So I guess the short answer is it's probably possible in Korto. It's probably not painless, especially if you're new to Korto. So I'm not familiar with Adobe InDesign, which is what this person is asking if you can get positions similar to something like Adobe InDesign. I've not used that before, but I would imagine that that is probably easier to have very precise control of your layout. And I think, okay. And the final question just before we go for a break, when changing your YAML, you had a list of options appear that could be selected. How did that list appear to you? Yeah, I didn't really say that. Did I? So basically, once I have a YAML option like format, I can hit the tab key. So in general, tab in our studio will autocomplete for you. So if I hit tab, that will give us, give me the different output formats. So just the tab key on your keyboard should autocomplete. I don't know if that works just here as well. I don't know. I think for the sort of actual YAML key names, you'd have to start typing something and then hit tab to autocomplete. So I type letter t and then I can see the things that start with the t. I'm not sure I understand what the question is here. I mean like a table of contents at the top or something like that. I think we'll take the break that we were going to do and any, I can maybe have a look at this screen share thing in the break and then we'll continue and do other questions sort of a bit later. But the thing I mentioned was Lua. I can send you a link as well in a bit about creating your own quarter templates. All right, but I think we'll go for a break. Let's say about 10 minutes. So back at 20 past and yes, exactly Brad. If the question was about a table of contents, then it would be to see. So back at 20 past, whatever time it is for you and we'll continue then I might stick around and answer some questions for five minutes and then I'll have to take a five minute break for myself as well. So Constantine, did you get your question answered or do you want to share your screen? Hello, let me share my code and discuss it. Yeah, I think you're able to do that maybe. I don't know. Okay, I can see but I can't hear you currently if you are using my screen. Yeah, I can see your screen and now I can hear you as well. So this is my document and I'm working on so my problem is how to display the kind of chapter on the top of my my pages. For example, I made my ignite the renders. My problem is, when is it do with, let me make the output in ptl. Okay, this is the document. I don't have the type of content but my my problem is how to display for example, introduction or concept. This is French concept. If I'm going there introduction, for example, is the is the one on the page. But when I go down, for example, I do not have. Yeah, yeah. So you want like a header on each page. Yeah, so I think there is a header option in Corto. So just, I know there's a footer one. So I think there is a header too. Let's see where that is not coming up now. All right, I'll give that a Google. I think there would be an option to include a header on every page. If not in Corto, then you might be able to also introduce custom latex. I don't know if you've written anything latex. Yeah, so I would think there would be a header YAML key. But yeah, I'll have a look into that more thoroughly in the next exercise and I'll give you a message if I'll put it in the chat if I can find exactly what the best way to do that. But I'm not sure off the top of my head. Okay. Yep, no worries. Right, I can maybe, oh, there we go. Great. All right, I'll go for a break now as well. And then we'll start at 20 past. All right. So let me share my screen again. Okay, okay. I think we'll pick up from the slides and then any more questions that I've had had time to answer in the chat. I can maybe do after the next set of exercises. So our next section is going to be all about code chunks and there will be some more lemurs as well in this section. So one of the benefits, as I've said a few times now to using Corto is the fact that you can run your code in the same time where you're containing the sort of storing the contents of your document. So, for example, I can include some code to read in some data in my document. So I'm just going to copy this code and then go back to my document. And we're going to insert some code. So once again, there's a few different ways of inserting code. Either you can do it in the source editor. You can directly type a code chunk like that. Or in the visual editor, you can do insert code chunk, and we're going to write our code but just to show you the different code chunk options that you have. So Python, bash, SQL, D3, and so on. So our code chunk, I can paste that code into it for reading in the CSV. And I can just render my document. And you can see I now have a code chunk. I'll open this in a new window to make it a bit easier to see. So I've got the code chunk there. It's nicely syntax highlighted. And it's actually run that code. We can't see that, but it has actually loaded Redar and it has read in the CSV. There's also, by default, this nice little copy to clipboard button here to copy any code from a document. So the same thing goes for my slides as well, which these slides are actually created in Corto if you haven't guessed it yet. So as you maybe saw, there's also that nice copy to clipboard button there, which is how I was able to copy my code and paste it in here. So let's look at some chunk options. Basically controlling how this code is displayed and run. If you've used our markdown before, the chunk options are very similar. The only thing to know is that whereas in our markdown, you might have written something like this here. So it's called echo equals false in Corto. It's still called echo, but it's not written in the top here with the R in the curly braces. Instead, we're going to write it as a comment in the code chunk. So we're not using the equal sign and false is no longer capitalized because it's not our code anymore. So we're not writing it in like a R way. Okay, so the new way to write in Corto is the comment and then a pipe and you'll see that has sort of special syntax highlighting. And here we can actually hit tab to see the options. We're going to do echo and we're going to set echo to be false. And what that does, we're going to see when it's rendered. Now we've hidden that code so we can't see it anymore. We can also add a label here. So normally in R, you might add a label like R load data R and then set the option that's the R markdown way. Here we're going to say label load data R. Now we can change the echo to be, for example, fenced. And what that does is it basically will, oops, I've accidentally called these the same, haven't I? Let's just remove that one. Now with echo fenced, I can see both the actual code but also it has the actual sort of chunk, R code chunk syntax around it. And we can see the chunk options that we've used. So if you're, for example, writing Corto educational documents like Corto documents on how to write Corto, you might want to include what you've actually written to produce what you've got here. So it makes sense for these slides that I've created for this right to sometimes show what the actual chunk options have set R. So that is echo fenced. That's what that does. We can also collapse code. So basically give the user the option to show the code or not. So the code is there by default sort of collapse. So it's not taking up space in your document. But if the user is interested, they can look at maybe how a figure was created or something like that. And so the option there is to set code fold is true. And we're going to add some code to load in some packages. So we're going to add another chunk. How I tend to add chunks is control alt I as a keyboard shortcut to insert a chunk. I think that's even faster than doing the insert code chunk R. And you can even see here as well that that's the keyboard shortcut. So I'm going to paste my code in there. Loading some libraries. We've sent the message option to be false. All that does is when you load in those packages, usually it gives you some warning about conflicts between function names. So we're preventing those conflict messages to show up in our document. But what we were actually demonstrating was the code fold. So let's add that as well. So comment pipe and then code dash fold is true. And I'm going to render that again. Now we have in our document. This little code dropdown, which if I click that, it will show you the code. If I click it again, it will hide it. And the code again is sort of nicely highlighted. And there's that copy button there as well. So code fold set to true gives you that code dropdown option. So what if you want to include some tables in your quarter document? Well, depending on what output format you're using PDF or HTML, it might differ which packages are compatible with each output format. You can basically use a lot of the cool R packages that give you a lot of options to format your tables. So something like DT or formatable are great for HTML tables where you maybe want to allow the user to sort through the table and click on certain entries, filter the table, etc. And around highlighting different roles depending on on values and so on. Here just in the slides we've got an example or a NITAR cable table. So the way that we've set the options here. We are showing that on the next slide. So all we're doing is just piping that to NITAR cable. And the outputted table is just shown on the slides. And you can do something very similar in a document as well. Same with plots. I won't code through all the plot code here, but just to give you an example of including a plot in your quarter document or your corto presentation. In this case, here we've got a lot of different chunk option set. So for example, we have the output location set to slide, which just means that the plot is going on a new slide. Code overflow is wrap. So basically any code that doesn't fit on the line will wrap around. You can also set figure captions and figure alt text in your chunk options. So there is fig dash cap and fig dash alt. And then you can also control the size of that plot as it's outputted. In this case, I wanted it to take up all of the slides. I've set the out width to be quite large, under 50%. And then we just have some ggplot code that is run in your document and then you have the output directly in your document. So that was including tables and lots. Another thing that you can do is to include inline code. So if you want to run some code to basically get the value of something directly in a line of text. So maybe if you're writing a journal article, you want to say something like the sample for this study was. And then you have some R code, which checks the number of rows in your table. And then that line of your report is reproducible and flexible in terms of if your data actually changes, you get more data. That line of text will actually update. So inline code is a great way of saving yourself having to go in and edit maybe mean standard deviations sample sizes after they've updated if you write them with inline code. They will just regenerate when you re render your report. So we can see just writing that same example. We're going to say something like and row of we Mars. And if I render that, we can see we just have that number directly in our code. So I find it a bit easier to edit inline code in source editor so I might say something like we have the same thing here. The number of observations in our data set is and then full stop render, and then we can add some more text here. And so on to basically include results from code in our directly in our text in our report. So you could also have a chunk with some code, especially if you have a bit more complicated code than just the number of rows. And then just call the name of that object in your inline our code. We've misspelled that it's not numerous observations is number. And yeah, the same thing here is not changed. But let's say we had a complicated bit of code and we want to hide it. We just add our chunk option, echo false render. It's a complicated bit of code and then we just pull out that result and add it to our text. So that is inline code. All right. Once again, we're at another exercise. This time it will be about adding code to your document. So this will be task two. I think there is some code in our script that we want you to copy over into your document and then use some code chunk options. Feel free if you finished these tasks early to Google and find more code chunk options that you can use. Then adding a plot and adding a figure caption, as well as then adding also some code to calculate the average weight of lemurs in the data set. So I'm going to start the timer on that same as before in the training environment. If anyone has joined recently and needs help accessing the training environment just put something in the chat. And I'll send out the instructions again. All right. And once I might answer some of the questions in the chat while you're doing the exercises and any questions that I haven't answered, I can maybe answer after we're done. All right. Good luck with the exercises. All right. That is times up for the exercise. Hopefully everyone found that. Okay. So what we'll do. Again, is just a quick break before we start with the next section. So let's do maybe just five minutes. This time, come back at top of the hour. Whatever time zone you're in. I guess if you're looking at my screen since I'm sharing it, I think you can see the time at the top. It would be at 18. And then we'll crack on with the next section. I've tried to respond to all the questions in the zoom chat. I've tried to also respond in a way that everyone can see them, but potentially I have just direct messaged some people. So let me know if you can't see the answer. All right. Welcome back. Let's jump into the next section, which is going to be about including questions, cross references and references as well. So kind of like a bibliography in your corto document. So if there's any more questions in the chat, I'll probably leave them all to the end because we just have an hour left now. So to make sure we have time to cover all the content in the workshop, I'll respond to any questions at the end. So equations. If you're writing any kind of, I guess, statistical or journal article that includes statistics, you might want to include some mathematical notation in your report. So I'll show you how to do that. So the easiest way is to once again use the visual editor. And we're going to do all we can add a heading here equations. And we're going to insert latex math. And to add sort of like a equation or formula sort of center of the page. You might want to do something like display math. Now we'll add these two dollar signs and then you'll write latex math notation in between here. So to recreate the one that we had in the slides we're going to do that curly braces e subscript I is equal to capital Y subscript I minus Y subscript I. Oops, did I accidentally do a minus instead of an equal sign there. There we go. That looks more correct. So don't worry if you don't know the math notation. You probably don't need to use it if you don't know about it. If not, you can easily Google sort of latex math notation to find out how to write equations or formula like this. So if I render that we can then see. We have a lot of documents open at the bottom of our document we now have this equation in the middle of the page nicely formatted. There was another option as well when we were doing the insert. So that is in line math. So once again insert latex math in line math. So what you could do with that which is just the dollar signs you could say something like the value of X is 53 or something like that. Save that and render. And you'll see now we have a very snazzy formatted X. So that's basically if you want to include any math notation in line similar to the R inline code. The way to do that either insert latex math in line math or it's just writing the dollar signs around something like that. So that is including equations. Now what about referencing. So if you're writing a journal article or something like that, you probably want to have a references section. And rather than having to generate that somewhere else and maybe copy it into your document at the end, you can actually manage that within core toe quite easily. So if you have a .bib file, you can add entries to it. And then all you need to do is reference it in your YAML. And then to actually cite that you can also use special notation to basically give you a link to that entry in your references section. So we'll look at doing that as well. So I'll copy our reference and I'll show you some different ways as well of finding references within core toe. What we're going to do is we're going to create a new file is going to be references.bib. We're going to add that in there. And then important step here is to in your YAML, you need to say be bleography is that file that we've just created references.bib. Okay, so now core toe sort of has access to the information within that file. So now what we can do is we can reference it within our text. So I guess the easiest way is actually insert citation and then we can find in our bibliography our current entries in our bibliography. And so we have this one here that I've just added. I don't need to remember the name of it. I can just find it. So I'll show you that again, so I did that a bit quickly. So we'll add some text first. Lemurs are very cool. And then insert citation. Add this insert. And then I'll revender that and we'll see what that looks like. Let's open that in a new tab. So here we have our sort of statement as well as the in text reference nicely when you highlight that it even shows you the further details about that reference. And you can also click it to get taken down to the references section. So you'll be able to see that a bit better if I move this to the top of our document. Alright, so now I have my reference here. I click that it takes me down to that reference in the references section that is added at the bottom. So super convenient. And even nicer is when we add when we use the insert citation, you could actually look for references within Cortot as well. So if you have the DOI, you can use that to search. You can also search I think just by words in for example PubMed. So if I wanted lemur related papers, I could search for lemur. And then I can just choose one of them. And it will add to the bibliography because Cortot has access to that. And I can also insert it at the same time. So now I have both the inline reference to that new paper that I've just searched in PubMed. And then also it's added it to the references section. So pretty handy to have. Especially if you're writing something like a journal article or something academic but also useful if you're doing something non academic where you're including references. All right. So that is referencing. We're also going to look at cross referencing. So basically adding links to either certain sections of your document. So in this section, or please refer to this section for this information and you should be able to sort of click on that. And it will take you to whichever section is relevant. Or for example figure cross referencing saying something like in figure two. And those the sort of nice thing about those figure references is that the numbering on them will automatically update so that if you move around some figures you don't have to be like okay now figure 14 is figure 13 and figure 13 is figure 14. Or even more complicated situations. It will sort of regenerate the numbering of your figures and your figure references as it re renders the document. I'll get to the questions at the end. So let's have a look at how to cross reference a section. So what we first have to do is basically add a section. Label that we can reference. And then we will reference it with the app and then label for that section. And Corto will render that as a kind of numeric reference to that section. So if we go to our source editor to make it a bit clearer here I'll add the name of it. So we're going to add the hash at the start as well. And we're going to call this equations. And then I'll add some text here at the bottom that say C at SEC equations to learn how to add equations to your Corto document. And we'll re-render that. And so now it has numbered that section based on the headings. So this is our first section. This is our second section. This is our third section and our fourth section. So C section four to learn how to add equations to your Corto document. We can click on that and it will take us to that section. So there's actually a lot of different prefixes that you can use. So the one that we just saw was the section prefix, which means when we cross-reference that it will say section four. There's a lot of other prefixes as well to refer to different types of outputs that you can then reference to. So for example, figure cross-referencing is what someone asked about in the chat earlier. So to do that, it would just be instead of the SEC dash equation or elephant as in this case, it would be big dash elephant. And then that will add the figure numbering. And then when you cross-reference it, it will number it the same way as the sections where it's sort of figure one, figure two, and so on, depending on which figure is. So I guess we could do that with our lemur image, which is over here. So we're going to add a reference to it and then not elephant. We're going to say lemur and then we can say something like C at big lemur or an image of a lemur or something like that. And that will take us to that picture and now it's also numbered it figure one. Let's get back to the slides. And yeah, here's an example in our slides as well for labeling plots because with plots you're not including them in the same way as you do images where you have this bit of code that you can add the fig lemur section to. So how you can do when you're generating gg plots, for example, in the code chunk that generates it, you can add a label and we can say big dash lemurs. And then it works the same thing at fig dash lemurs to reference that and it does the cross-referencing numbering automatically. All right, we've got another task. So this time it's to practice the equations and references. And it is task three. So once again, if you're doing the tasks, then you'll have the relevant files in the exercises folder. So you can find that in the training environment home exercises task three. This time we already have a document for you and we just want you to edit that document. So this time you want to open task three QMD and add some bits to it. All right. 15 minutes again, I'll start the timer and then we'll continue where we left off. All right, that is the end of the exercise time. Let's just continue since we have less than half an hour left. So our final section is going to be looking at some other output formats. We're not going to have time to look at everything. So at the start of this workshop, I showed you that you can create PDF reports, websites and more. We're only going to look at presentations. But as I said, there's plenty of resources on the quarter website for any kind of output that you might want to create. So I definitely recommend checking that out if there's some output that you want to know how to create. And I'm not covering today. So in terms of creating a presentation with Korto, as we created the document, there's actually a whole other option. When you do file, new file, we did Korto document. You can instead do Korto presentation. And there's three main options for when you create that there's revealed JS. And that's actually what these slides I'm presenting right now we're made with. So that's like a JavaScript framework that gives you a lot of nice animated interactive components in your slides. So for example, we were able to, in the code chunks in our presentation, we were able to just copy those. And we'll see a few different other cool things that you can do with revealed JS. You're also able to export your presentations as PDF slides, which is why in the training environment and on the event page, you do have these slides available as a PDF as well. There's also PowerPoint and Beamer. We're not going to cover those today, but PowerPoint, probably everyone is familiar with, and you can play around with Beamer if you want to after the workshop finishes. So presentations isn't like a whole new area where everything is different. In general, a lot of the things that we did in documents will be done in the exact same way if you're doing a presentation. So inserting code, code chunk options, inserting images, cross referencing, and so on. That all works the same in presentations. So all that that you've learned is useful if you need to create a presentation as well. We're going to look at some more features that are especially cool when you're using them with presentations. And in particular, we're going to look at reveal JS presentations. So let's create a presentation. Similarly to before, it's going to be file, new file, and instead of Corto document is going to be Corto presentation. Here again, we can add a title. So we'll call it my first Corto presentation. Mandy as author. Here you can choose the different output formats very similarly to when you're creating a document. We're going to go with reveal JS. Going to keep the engine as knitter and editor will keep as the visual editor looks very similar to before. If we look at the source as well, it basically looks the same as a document, right? The only thing different is the format is reveal JS instead of HTML as before. So we're going to save that my first Corto presentation and render. And now we have a nice presentation, which looks a bit similar to the one that I'm using for this workshop as well. I'm using the keys to go through. We've got this nice little progress bar here. And we also have some options. For example, you can click through the different slides and you can also, for example, get speaker notes and things like that. So what we can note here is that these headings here, we're not necessarily saying create a new slide. Instead, the headings are by themselves just creating a new slide. So when we've got the Corto heading, everything that's underneath here is going on that slide. Then we have bullets and code. So we're going to look at a cool feature called code highlighting, which I'll show you what that does. So I've included that because my slides are reveal JS is basically, you know, I can show you anything that we can create in reveal JS slides. So here, see when I'm going to the next. So I'm clicking the right arrow, and it's highlighting different parts of the code. And I've also set the option here as echo fenced. If you remember from before, which means that we can see what I've included in the YAML here to be able to get this code highlighting. So this can be super useful if you're doing any kind of presentation where you want to talk through some code. Maybe it's educational, maybe it's sharing something with your team, something that you've learned sort of knowledge sharing type session. I think this code highlighting is so satisfying and also nice for directing the audience's attention to a certain part of the code. And so what we've done here is up here, we've got the actual YAML which controls this. And so we have this little special syntax for specifying what we want highlighted. So we've got three comma six to basically highlight line three. Oops. Let me get back there. Highlight line three and six at the same time. Then the pipe here to indicate another sort of transition. So we're first highlighting three and six, then we're highlighting line four and then another transition to line five. And then the final comma here just highlights everything. So I don't necessarily need to copy that into my document because it's all kind of visible here. If we wanted to include a logo and a footer. So once again, I can just show you what it looks like in the slides that I'm presenting with. So if you wanted to include a logo, you would nest that underneath revealed JS as the output format and then set logo to be whatever image you want as your logo. In this case, we've got the jumping rivers logo. You could add your own company logo as an image file together with your presentation. And then just reference the file path to that. And it will show up on every slide as a logo down down there. Same with the footer. So this is all in the YAML at the top of the presentation. So if we go back here, it would basically go in here like so. We don't need that line anymore. As well as so to add a logo and a footer. You have examples of them here. The final feature we're going to look at in terms of revealed JS slides is incremental lists. So incremental lists is a list where each item of the list shows up as you continue to the next slide. So you can nicely animate and talk about each point as it comes up on your slide. There's kind of two different ways that you can create incremental lists either in the options in the YAML. So that would be up here. We can set incremental to be true. If you want all lists in your presentation to be incremental. If you want most lists to behave normally, but you just want a certain list to appear incrementally. So for example, that's what I have right because most of my bullet points just show up. Whereas on this slide, they're showing up incrementally. You can wrap it in this incremental div or section. And then whatever list you have inside there will show up as incremental. So this is exactly the code that I have to generate this slide. So two different ways of doing incremental lists. Either incremental true to do that globally or wrapping a list in this incremental div to format the whole thing as incremental. All right, so that was code highlighting, including logos and footers, as well as adding incremental lists. Let's jump straight into the task because we're nearing the end of the session. So we'll do this task for 10 minutes and then we'll do five minutes for questions and sort of wrap up. I'll show you how to download things from the training environment in the last five minutes. All right. I'll start the timer for task four. Anyone who's just joined the tasks are in exercises and you should have the relevant files there. So you'll need some code from task four to do this one. All right, I'll start the timer and then we'll do some questions and wrap up in the last five minutes. Also, I should have said if you can't remember how to do something, then you do have the PDF slides in the training environment as well. So you can open those and then find the slide that contains the information that you need. All right, it's the end of the exercise time and the end of the content of this workshop before you go. At the end, I just have some links to some extra resources. We've already looked at the Korto website a lot. I would recommend this list on GitHub as well, which is basically a collection of Korto resources blogs and different cool extensions that you can use to make Korto even better. There's also a workshop from Thomas Mock on getting started with Korto. So if you want some more introductory materials, I think that's a great tutorial to follow. And finally, if you're interested in any more jumping rivers training courses, if you want to come and listen to me or someone else explain more are related or Python concepts to you. We do have a link to that as well. If there's any topics that you're interested in, I would recommend either signing up to a course or requesting more information to say that you're interested. All right, that is it for the content. I will say as well before you go, if you want to download any files from the training environment, just tick the files that you want to download and then go to this cog here in your files window and then export and download. And that will download a zip file of the documents that you've chosen. So pick whatever files you want and then cog export download. And that will download a zip file. I think the training environment will be up for at least until tomorrow. So if you want to keep playing around with Corto, but you don't want to bother installing it locally, you have maybe about a day to keep playing around with it in this training environment. So feel free to do that if you want to. If not, thanks everyone for attending. I hope you learned something and feel free to find me and ask me questions if there's anything that didn't get answered in this course. I am, as far as I know, the only person with my name, which you can find I think my full name on the events page so you can find me on LinkedIn and Twitter through that if you want to connect or ask me any more questions. Yeah, I think that's it for me. I don't think there's anything else practically. Yeah, thanks everyone for attending.