Yihui Xie | pagedown Creating beautiful PDFs with R Markdown and CSS | RStudio (2019)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
you [Music] good morning everyone so if you have ever used a mock down before you can probably recognize me so since about 2014 I have created and co-authored a series of practice related to our mock down like the our mock down itself and then 2016 book ton 2017 block down so I'm responsible for a lot of things down except except the current government shutdown so so today I'm going to introduce a new member in the our marked an ecosystem named page down so this is joint work with an excellent collaborator actually I should say the the best collaborator I have ever met in my life named Roman Lucio oh it's a French name story I don't I don't really I can't really pronounce that name precisely alright so just before I get started just a word of caution this package is still very young so I would treat it as experimental so don't set your expectation too high Oh so after this talk you may feel that oh this is great so we can finally throw away lay tech and the word and unfortunately the answer is not yet there are still many rough energies well why why do I work choose to work on this page dumb package so basically this page down just allows you to skip word or latex but it basically creates page documents from your web pages like HTML pages I personally I have strong belief in HTML like persevere sometimes as you say in in HTML in the web I trust so basically the reasons are like so first of all hTML is very access accessible because you only need a web browser right every pretty much everyone has a browser so the output from page tongue is an HTML page so pretty much everyone can have access to that without installing any special software and it's also very easy to embed interactive in rich media on web pages and it's also much easier to parse HTML pages than PDF documents for example if you have a table on your HTML page is technically it's very easy to parse the data in the table so the bottom line is that I think HTML and CSS will eventually catch up with latex in typesetting but it will be difficult for later cords to catch up in other aspects of HTML such as the interactivity so the installation is pretty simple you can so although I have released an initial version of page down to cran I still recommend strongly recommend you to test this package from github so you just install that from github and note that this package Britain requires a higher version of panic and dark version 2 which is bundled currently bundled in the preview version of our studio and because the output is HTML and I would recommend you to use Google Chrome or chromium to view or print the HTML pages generated from this package so that the usage is pretty simple so if you are an our studio user you can just create a new are markdown document with the page down output format through the menu file new file are marked on from template and you can find a quite a few page down templates in that list so for those who do not use our studio I'm not sure if you are aware of the name of this conference that's totally fine you don't have to use our studio you can use any editor you like so the all the example or the template documents are in the source code of this package so you can find them in the installation directory of your package or on it hub to preview the HTML output from page down I recommend like for complicated reasons as Henry would say that the most reliable to preview a page down document is through the weird our studio area named infinite moon reader or equivalent equivalently you can call a function to preview it and to generate a PDF from your HTML document you can just open that HTML document in your web browser in chrome and printed it to PDF there there's also a function named Chrome print in this package but at the moment it doesn't really work perfectly well so it will be improved in the future and next I'm going to show you some of the output existing output formats and examples in this package so the first one I would like to show you is paged HTML documents so this is based on another JavaScript library named page 30 GS this is basically a library to implement the w3c spec named paged media properties for CSS basically it allows you to typeset your HTML pages through CSS but the problem is that no web browsers really support that w3c spec so Paige don't yes did that job so it implemented that spec so that you can view a page document in your web browser the output the name of the output format is page down colon colon HTML underscore paged so we just specify that as your output format and you like click the neat button or use the infinite moon reader and you will see page HTML document in your browser this is just a screenshot created from from the PDF generated in Chrome so that that is what paged HTML document looks like so if you open the link here page down are behind on Io you can hopefully you can see that in your web in your web browser that you've got a paged HTML document so in this document you can have things like the title page of your book a table of content several chapters math equations if your eyes are really good he can probably see the running header on the fourth page so you can have headers page numbers footers all kinds of elements that you could see as you would see in a PDF document so besides creating page documents you can also create other applications like a business card so on the left hand side that that is just the full our markdown sauce so you can see there's title author output format business card and then the body of your card so the output would be something like the picture on the right hand side so this is basically an unsolicited business card I made for mr. shiny also known as the president of our studio you can also create a resume from page down the output format is page down colon colon shanell underscore resumes so in the knockdown source basically it looks like this so you have an you can specify a sidebar in the side part so you can then it can have several subsections you can have bulleted lists and in the main area you can have an arbitrary number of blocks so like listing your education working experience so basically each block is level 2 header and then inside each block you can list the details about your resume so that is what on the resume produced from page down looks like so if you click that link you can also see a web page that looks almost identical so by the way this is actually a real resume although this is just an example in the page down package this is real so if you are looking for a PhD student with strong computing skills and knowledge in bio bio informatics you may consider this person so and you can also create posters HTML posters from page down so currently I have included two poster formats when it's called poster relax the other is called poster Jacobs so I will show you what they look like so this is a poster relax well actually this CSS style is borrowed from another package named relaxed it's not an R package for the nodejs package I I only port it their CSS into page down so yeah hopefully you can see the our lovely car woman in the middle smiling at you so that is what a relaxed the poster looks like and then we've got a poster Jacobs I yeah I basically I found this style on a late hack website so that I think this is probably very famous in the late community to create posters so basically I saw that appearance and I wrote all the CSS from scratch in one evening after my little kids went to bed it took me about two or three hours to read CSS the total number of lines of CSS is only about like a little over a hundred so the CSS is really simple and in case you are curious the technical behind the CSS it's called the CSS grid so which allows you to arrange elements on your posters on agreed you can also write letters with page down if you want so there is a format named HTML underscore letter so I as an example I wrote a letter of recommendation for a meeting Anka who is really cool hacker I believe in our community so the armitron source also looks simple is from me a way to the hiring manager in the school of ninja hackers University the address is for for not found Road in the undefined city in an in a state so and then yes the letter would look like this so you can open that in your web browser and see the real letter so actually since this is this is just HTML the as I said there are many advantages of using its HTML so for example my slides are actually HTML so I can embed whole letter in my slice through an iframe so you can see the letter live here the one thing that I'm proud of this is that this is probably the first letter in history that contains a gift so this shows this shows that this gif shows Emmys talent and last give actually is my description of Emmy issues such as just like such a cool hacker alright so well actually despite of all these kinds of advances in technology I feel a little sad that I mean we receive so many letters and emails every day and we are no longer excited like 10 years ago right 10 years ago you would be excited to receive an email and now you will be excited to receive a real letter so besides letters and you can also write books with Paige town there's a format named poktan underscore CRC which is a format for the publisher Chapman ha crc so just to give you a quick overview so this is what the book would like actually this is a real book that the book done book reproduced with CSS in HTML last I want to talk a journal format so before that I want to mention the the talk from Catherine Mullen at use our 2014 conference where she mentioned the history and future of the Journal of statistical software Genesis so that's the GSS was originally founded by Maya Angelou so in Katherine slice she actually presented the original email of Angelou where you can find his original proposal so that was in 1995 1995 that was quite early it was only a few years after I learned how to put on my own pants and stopped wetting my bed at night so in the proposal and he mentioned four points he would like to create a journal that is electronic electronic and freely available and then done in in HTML and interactive and peer-reviewed I want to highlight two points in that proposal so the journal should be done in HTML and I would say that this is quite possible now because of page 2 and page 2 GS and then the papers should continue interactive content and that is also possible now because we have interactive things like HTML widgets and shiny apps so in fact we have my excellent collaborator Roman has actually recreated the style of Genesis through HTML and instrument CSS so I would like you to guess which one is HTML CSS and which one they slay attack it's hard to tell right it's just amazing as as you say so last I want to digress a little bit in this technical talk to talk about something totally non-technical because I feel it is very important so last year I read this book by Sigmund Freud and they actually said heavily influenced to me civilization and its discontent because I could relate this to many things in my real life like PDF and it's this content world and is discontent typesetting and is discontent journal publication and it is discounted there are just so many things I was I'm not happy with so basically the main the main thing that we talk about in this book was the friction between civilization in the individual and the friction is between is from the instinct individuals instinctive freedom and the civilizations demand for conformity and repression of instinct so basically civilization is built up upon control beauty hygiene and order if you look at this worse you may also you may often think of your journal editor control beauty hydrogen and order and in the last paragraph of that book Freud said so if you if you survey the aims of culture in Denver and it that the means that it employs you it come to the conclusion that the whole effort is not worth it and even individual will be unable to tolerate the outcome of the civilization so I'd like to repeat maybe the whole effort of typesetting is just not worth it it's just not worth the trouble last year the the quote that influenced me most was this we become what we behold we shape our tools and our tools shake hands sometimes I just feel really confused so when you confused you can take a look at or you can hear what little kids say and observe what they do so last Saturday I told my my other son that I would come to this conference and give a talk and because every day when I floss or brush brush his teeth he would watch her video so last last Saturday I had him watch my last year's us video conference talk and after he finished so that was about block down after he finished his only comment was I want to watch bleep in case you don't know bleep this is flippy and his garbage truck so so yeah I thought my last year's talk was awesome but of course not as important as play P so just think about some journal type setting guidelines like sometimes you are required to use codes and pre-formatted keyboards variable environment option command file package crammed package pro long URL is it's so many later commands are they really important I really don't know and I doubt so so sometimes you just as an adults we just forget what our original play P was so why do we write journal papers why do you write the right books to share knowledge right why do you read letters which we will show our care for our friends or family members right so we'll mark down in CSS save us maybe because Martha is very limited but on the other hand I believe it's very good to have constraints so who is causing the trouble actually it is it humans or technology will CSS save us probably not so sometimes in terms of working I mean in the biggest tragedy is probably not that people are lazy and they don't work that the real tragedy is that people working extremely hard on three vehicles so just trivial things might help in typesetting details alright I hope pagedown can save you some effort in interpreting because I think HTML CSS are just fantastic alright thank you okay we have time for a question hands please who has a question for you a we have one right here if we can get a microphone up front please do we want to take bets on the pass right we're going for the safe pass right please say your name and ask your question please I'm Andrew one thing that I struggle with well there we go it's really difficult to get our CFO to read anything unless it is in the body of an email so my question for a page down is with the CSS that's in it I know when you open it in Chrome you can download external files but an email client you can't so could I render that into an email rendered yeah yeah render the HTML and then you send an email with the HTML file as the body yes yes there are pecked is actually the next speaker which he has written are what's the name of that package no I mean the the the package to send emails this class okay yeah it's just asking [Laughter] okay we do have time for one more quick question we've got a hand over here please raise your hand high you don't got it all right Damon question please one of the reasons for all optics popular popular today's equation mathematical typesetting worries page down our markdown on that for type site setting math and equations yeah there's their support from mathjax [Music]
Info
Channel: RStudio
Views: 12,284
Rating: undefined out of 5
Keywords: Yihui Xie, pagedown, rstudio, data science, machine learning, python, stats, tidyverse, data visualization, data viz, ggplot, technology, coding, connect, server pro, shiny, rmarkdown, package manager, CRAN, interoperability, serious data science, dplyr, forcats, ggplot2, tibble, readr, stringr, tidyr, purrr, github, data wrangling, tidy data, odbc, rayshader, plumber, blogdown, gt, lazy evaluation, tidymodels, statistics, debugging, programming education, rstats, open source, OSS
Id: GCmnvXXrpRk
Channel Id: undefined
Length: 20min 59sec (1259 seconds)
Published: Wed Jul 31 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.