RMarkdown, LaTeX and Lyx

Slides:



Advertisements
Similar presentations
By Saeid Abolfazli Faculty of Computer Science and IT, University Malaya, Malaysia. Website:
Advertisements

EndNote. What is EndNote:  EndNote is referencing software that enables you to create a database of references from your readings. Your database of references.
COE201 – Computer Proficiency Mr. Hamze Msheik
Lesson 16 Enhancing Documents
Microsoft Word Objectives: Word processing using Microsoft Word
Introduction to LaTeX CPS470 Software Engineering Fall 1998.
McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved. Office Word 2003 Lab 3 Creating Reports and Tables.
Chapter 10 Formatting a Document.
CS 173 Fall Introduction to LaTeX David and Lucas CS 173 Fall 2009 Written with significant references to Oetiker et al. “The Not So Short Introduction.
Chapter 12: Network Programming Desktop Publishing Translator models Latex Documentation Preparation Postscript programming language WYSIWIG Editors.
How to Open Microsoft Word Click Start Click All Programs Click Microsoft Office Click Microsoft Word 2013.
LaTeX Tutorial. What is LaTeX? TeX is a typesetting system designed in 1978 to automate the production of high quality print using any type of computer.
CpSc 462/662: Database Management Systems (DBMS) (TEXNH Approach) HTML Basics James Wang.
Lecture 3 LaTeX and LyX. LaTeX TeX Computer program by Donald Knuth for typesetting text and formulas (1977) LaTeX Predefined professional layout You.
For AMS 200, 2009 Dept. of Applied Math & Statistics School of Engineering University of California Santa Cruz, CA A Very Short Introduction to LaTeX.
Research Tools: LaTex A high quality document preparation system by Karthikeyan Umapathy.
Introduction to LaTeX PRISM Brownbag Series June 9 th, 2009 Byungwon Woo.
HTML HyperText Markup Language Constantly evolving - extra facilities being added regularly Java applets and JavaScript used to increase functionality.
LaTeX Tutorial Fiona Shearer May 11th, 2004 Disclaimer added
LaTeX A Short Intro to Marco D. Santambrogio Politecnico di Milano Sala DEIB 2 Sept 2015 Ver. 2/9/15.
Committed to Shaping the Next Generation of IT Experts. Exploring Microsoft Office Word 2007 Chapter 4: Share, Compare and Document Robert Grauer, Keith.
Committed to Shaping the Next Generation of IT Experts. Exploring Microsoft Office Word 2007 Chapter 4: Share, Compare and Document Robert Grauer, Keith.
CC510 - LaTeX 1 Lecturer - 김한규 (Hangyu Kim) 1CC510 – 2011.
IS1811 Multimedia Development for Internet Applications Lecture 4: Introduction to HTML Rob Gleasure
June LaTeX " A typesetting package for formatting and creating documents. Created by L. Lamport based on TeX designed by D. Knuth. " Alphanumeric.
1 LaTeX For Dummies Mulugeta Gebregziabher Division of Biostatistics and Epidemiology MUSC April 4, 2011.
BRIEF A BRIEF Introduction to L A T E X For Physics Graduate Students Prof. L. S. Pinsky Physics Department University of Houston.
Academic Writing Using LaTeX
McGraw-Hill Career Education© 2008 by the McGraw-Hill Companies, Inc. All Rights Reserved. Office Word 2007 Lab 3 Creating Reports and Tables.
SIGNewGrad: Intro to LaTeX
EndNote. What is EndNote? EndNote is referencing software that enables you to create a database of references from your readings.
L. Anne Spencer (c) 2001 Basic Web Design Document, text, & layout formatting tags & attributes.
Lecture 3- Microsoft Word COE 201- Computer Proficiency.
Cumulative Review of Microsoft Word Mrs. Masishin.
What is HTML? HTML is a language for describing web pages. HTML stands for Hyper Text Markup Language HTML is not a programming language, it is a markup.
R 賴威昇 Introduction 2. Why using LaTeX ? 3. LaTeX usage: ◦ Backbone ◦ Equation ◦ Figure ◦ Table ◦ BibTex 4. Compile 5. Conclusion.
Using Microsoft Office Word Assignment Layout. Target Create a Cover Page (Front Page) Create a Table of Contents Page Create a Table of Figures Page.
Sébastien Le Roux. not What I am not going to talk about The explanations are in my HowTo ! Check my web IPCMS Basic tutorial to programming.
Formatting a Research Paper Lesson 10 © 2014, John Wiley & Sons, Inc.Microsoft Official Academic Course, Microsoft Word Microsoft Word 2013.
Department of Mathematics, Jazan University, Jazan.
LaTex -Computer scientist named Donald Knuth developed the program called Tex, in 1978.(mainly focused on formulae) -Later a mathematician and computer.
LaTeX Tutorial. What is LaTeX? TeX is a typesetting system designed in 1978 to automate the production of high quality print using any type of computer.
LATEX By GerardoVela 3/27/2015.
Formatting a Research Paper
Microsoft Word Objectives: Word processing using Microsoft Word
APA Formatting & How to Avoid Plagiarism
Sébastien Le Roux.
Lesson 16 Enhancing Documents
Lesson 16 Enhancing Documents
Computer Fundamentals
Lesson 2 Tables and Charts
Creating Accessible PDFs from Word Docs
ENDNOTE Presented to: Presented By: Tariq Najmi Amir Subhani
Brief Intro to Knitr Package
Introduction to LaTeX David and Lucas CS 173 Fall 2009
LaTeX Tutorial.
Introduction to LaTeX By Dan Burke.
Nathaniel MacHardy Fall 2014
Benchmark Series Microsoft Word 2016 Level 2
EndNote by: fatimah alotaibi.
Formatting a Research Paper
Embedding Graphics in Web Pages
Benchmark Series Microsoft Word 2016 Level 2
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
Microsoft PowerPoint 2007 – Unit 2
A Very Short Introduction to LaTeX
A high quality document preparation system
Making Math Look Pretty – or How to Use LaTeX
Welcome To Microsoft Word 2016
Presentation transcript:

RMarkdown, LaTeX and Lyx Lecture 3 Course leader: Oleg Sysoev 732A60

LaTeX TeX Computer program by Donald Knuth for typesetting text and formulas (1977) LaTeX Predefined professional layout You need to write code to create documents ( for ex. scientific papers) Code is compiled to PDF or PS or other files LyX Graphical interface that allows using mouse instead of writing codes (compare: Word) Produces LaTeX code that you can see and compile 732A60

LaTeX vs MS Word LaTeX is more often used for writing scientific reports and papers Once publisher provides it’s style file, it can be embedded into your TeX file easily (in Word, you need to adjust the style manually may take hours or days) Formulas can be enumerated and updated automatically (not so easy in Word) There is a flexible citation and referencing function Word provides a simple click-forward way 732A60

Installing LaTeX and LyX Windows OS Install MikTeX https://miktex.org/ Install an editor, TeXnicCenter (if you do not plan to use LyX): http://www.texniccenter.org/ Install LyX if you like graphical interface: http://www.lyx.org/ 732A60

LyX 732A60

RMarkdown and knitr A way to include R code into your reports and let the code be run at the time the document is compiled Reproducible Research Multiple outputs: PDF, HTML, DOCX,.. Slide Presentations, Interactive documents and even Websites can be generated 732A60

Using Rmarkdown Install MikTeX https://miktex.org/, choose ”Complete installation” (not basic) Install rmarkdown Install knitr package in R FileNew FileR Markdown Writing papers: install rticles 732A60

Creating new file FileNew RMarkdown Select ”From Template” to use a journal template 732A60

Getting help HelpCheet sheetsR markdown… https://bookdown.org/yihui/bookdown/ http://rmarkdown.rstudio.com/index.html Check ”Get started ” and ”Articles” 732A60

Structure of the RMD file YAML header R code chunks Formatted text Knit buttion Insert button 732A60

YAML header title subtitle author date output_type beamer_presentation github_document html_document ioslides_presentation md_document odt_document pdf_document rtf_document slidy_presentation word_document … 732A60

Text, characters and comments New line is ignored make a blank line to begin a new line Several ”space”s treated as a single one Some symbols can not be used in text directly  use \* \# \$ \% … Comments can be put between <!-- and --> 732A60

Headers and fonts Headers: Italic: *italic*, bold: **bold** #Main header ##Second level header …. Italic: *italic*, bold: **bold** 732A60

Code chunks Write your code between ```{r} and ``` 732A60

Code chunks Important options: echo=FALSE: code is not shown in the report eval=TRUE: code is executed include=FALSE: code is executed but not the code nor results are in the report error=FALSE message=FALSE warning=FALSE 732A60

Code chunks 732A60

Code chunks Same code chunk with echo=TRUE 732A60

Code chunks: figures Important options fig.cap fig.width fig.height fig.align: ’center’, ’left’,’right’ fig.show=’hold’ 732A60

Code chunks: figures 732A60

Referencing figures Works when save to PDF 732A60

Tables Use kable in package knitr: 732A60

Referencing tables Works when save to PDF 732A60

Lists Numbered and not numbered Use four spaces to indicate a new level: 732A60

Quotations Quote by starting line with > 732A60

Formulas Formula in the text $...$ Formula at the new line \[ … \] No support for enumerated formulas… $Y_i=\phi(X_i, \theta)+ \epsilon_i$ 732A60

Formulas: building blocks Subscript: $X_i$ $A_{low}$ Superscript: $x^2$ $Y^{t^2}$ Greek letters: \lambda \Phi \phi… Comparison: > < = \geq \leq Square root: \sqrt{x^3} Ratio $\frac{x}{y^2+1}$ Product $A \cdot B$ $\hat{Y}$, $\vec{X}$ Brackets $\left( X^2+1 \right )$ Series of sums, product: \sum and \prod $Y_i= \sum_{j=1}^{n_i} Y_{ij}/n_i$ Integral \int 732A60

Tables in pandoc 732A60

Images and links Web links [text](url) Insert image ![caption] (path_to_image) 732A60

References to sections Mark by a label {#label} Use the label in text 732A60

References Create a bib-file describing your references in BibTeX https://en.wikipedia.org/wiki/BibTeX Change YAML header to specify: ”bibliography: your_file.bib” Optionally ”cls: your_citation_style” Use [@reference] or @reference to cite https://github.com/citation-style-language/styles 732A60

References See ”ci.bib” for example 732A60

Pandoc vs LaTeX Pandoc has a more simple syntax than LaTeX Pandoc supports doc and HTML output, LaTeX not Writing scientific papers in Pandoc can be difficult Limited flexibility of Pandoc vs LaTeX You may write LaTeX code in Pandoc when compile to PDF! RMarkdown and LyX can use knitr Cross-referencing is not always possible in Pandoc 732A60

LaTeX example \documentclass[12pt]{paper} \begin{document} \title{Bootstrap confidence intervals for large-scale multivariate monotonic regression problems} \author{Oleg Sysoev, Anders Grimvall, Oleg Burdakov } \maketitle \begin{abstract} Monotonic regression (MR) computes a response that is increasing or decreasing with respect to each of explanatory variables... \end{abstract} \textbf{Keywords: }Confidence intervals, monotonic regression, bootstrap, percentile... \section{Introduction}\label{intro} ... \end{document} 732A60

LaTeX example 732A60

LaTeX: enumerated equations and figures To enumerate equations, To enumerate figures, use \includefigure and \label To refer, use \ref{your_label} \begin{equation} …\label{your_label} \end{equation} 732A60

LaTeX: enumerated equations and figures

LaTeX: enumerated equations and figures

Assignment Write the first lab report in any of your courses in Rmarkdown Submit the Rmd and PDF files via LISAM until 1st of October 732A60

Home reading http://rmarkdown.rstudio.com/index.html https://en.wikipedia.org/wiki/BibTeX https://bookdown.org/yihui/bookdown/ http://ctan.tug.org/tex-archive/info/lshort/english/lshort.pdf http://www.latex-project.org/ http://www.lyx.org/ 732A60