One advantage I have found with PDFs over EPUB files is that when you create a PDF it looks the way you intended to, almost a snapshot of a printed page. While EPUB has some advantages over PDFs (including much smaller file sizes), a PDF to me is still preferable for technical documentation where there are screen shots, figures and charts.
When generating a PDF with R Markdown there are a few options you can define to determine how your pages look, including the document size (letter, legal, A4, etc), page orientation, and even the set different margins for each side of the page.
All of these options are specified within the YAML metadata header portion of your R Markdown document, and make use of many LaTex functions. By default, R Markdown uses the pdflatex engine, but if you plan to use fonts from your system, or need support for Unicode, you should use one of the alternatives: xelatex or lualatex. (more…)