Biostatistics Student Seminar An Introduction To L A T E X

Similar documents
Joy Allen. March 12, 2015

PHYS Exercise: Typeset this by changing the default bullet symbol twice.

Introduction to Beamer

PHYS 87. Check that it works by typesetting the tripple ensted list of the pervious exercise.

LaTeX in a nutshell. Master on Libre Software Miguel Vidal. September 24, GSyC/Libresoft URJC

How to make a presentation with L A TEX?

Introduction. How to use this book. Linear algebra. Mathematica. Mathematica cells

L A TEXtutorial. The very basics for typesetting research papers. Dr. Robin Roche. February 23, 2018

LESSON 1 of 3 (IJMPA)

1. Typeset a = b c = d e = f g = b h = d k = f. m 1 m 2 r 2. e E

What is Beamer?! Introduction to Beamer Beamer is a LaTeX class for creating slides for presentations. Commands for Header and the Title Page

Pronounced Lay Tech Getting Started In LAT E X. Brian David Sittinger

Title of the Book. A. U. Thor XYZ University

PHYS 87. Don t expect to go through all of these today. Will continue next week. 1. Typeset a = b c = d e = f g = b h = d k = f. m 1 m 2 r 2.

Latex Review Beamer: Presentations and Posters Citations & References. L A TEXWorkshop. Mai Ha Vu. University of Delaware.

Adding and Subtracting Terms

Corrections and Minor Revisions of Mathematical Methods in the Physical Sciences, third edition, by Mary L. Boas (deceased)

CZECHOSLOVAK JOURNAL OF PHYSICS. Instructions for authors

MATLAB AND L A TEX EXAMPLES

ADVICE ON MATHEMATICAL WRITING

An example SEG expanded abstract Joe Dellinger, BP and Sergey Fomel, University of Texas at Austin

MA 580; Numerical Analysis I

Math 308 Midterm Answers and Comments July 18, Part A. Short answer questions

Submitted to Econometrica A SAMPLE DOCUMENT 1

Relationships Between Quantities

Introduction to Beamer

LESSON 25: LAGRANGE MULTIPLIERS OCTOBER 30, 2017

Lecture 1 : Basic Statistical Measures

Using Microsoft Excel

MATH.2720 Introduction to Programming with MATLAB Vector and Matrix Algebra

Section-A. Short Questions

Standard Format for Importing Questions

Elementary Statistics for Geographers, 3 rd Edition

Theory of Computation

A (Mostly) Correctly Formatted Sample Lab Report. Brett A. McGuire Lab Partner: Microsoft Windows Section AB2

Required Elements (Multiple Choice) Each question must begin with a question number, followed by either a period. or a parentheses ).

QUADRATIC PROGRAMMING?

Companion. Jeffrey E. Jones

The Title of a Standard LaTeX Report

Module 03 Lecture 14 Inferential Statistics ANOVA and TOI

'XNH8QLYHUVLW\ (GPXQG73UDWW-U6FKRRORI(QJLQHHULQJ. EGR 53L Fall Test I. Rebecca A. Simmons & Michael R. Gustafson II

LAT E X Math Mode. RSI 2007 Staff

Passing-Bablok Regression for Method Comparison

LAT E X Math Mode. RSI 2006 Staff

2D Plotting with Matlab

Algebra. Mathematics Help Sheet. The University of Sydney Business School

Calculus Volume 1 Release Notes 2018

Correction for Ascertainment

2.3 Terminology for Systems of Linear Equations

Required Elements (Multiple Choice) Each question must begin with a question number, followed by either a period "." or a parentheses ")".

New Mexico Tech Hyd 510

Solving Equations by Adding and Subtracting

Green s Functions Computation

Standard Format for Importing Questions

Mathematical Notation

DIMACS Book Series Sample

Experiment 0 ~ Introduction to Statistics and Excel Tutorial. Introduction to Statistics, Error and Measurement

Flip Your Grade Book With Concept-Based Grading CMC 3 South Presentation, Pomona, California, 2016 March 05

A supplementary reader

Lab 2 Worksheet. Problems. Problem 1: Geometry and Linear Equations

CSCI 239 Discrete Structures of Computer Science Lab 6 Vectors and Matrices

The Title of a Sample SW Report 1

UNIVERSITY OF MASSACHUSETTS Department of Biostatistics and Epidemiology BioEpi 540W - Introduction to Biostatistics Fall 2004

Algebra 2 and Algebra 2 Honors Corrections. Blue Cover

Chemical reaction networks and diffusion

LAB 1: MATLAB - Introduction to Programming. Objective:

An Introduction to L A T E X

The Standard Format for Importing

Errata List Numerical Mathematics and Computing, 7th Edition Ward Cheney & David Kincaid Cengage Learning (c) March 2013

Creating Questions in Word Importing Exporting Respondus 4.0. Importing Respondus 4.0 Formatting Questions

Notation, Matrices, and Matrix Mathematics

RESPONDUS: The Standard Format for Importing

Matrix Operations and Equations

Sections 6.1 and 6.2: Systems of Linear Equations

Using the kbordermatrix package

1 Probability Distributions

SYMBOL EXPLANATION EXAMPLE

Lecture 44. Better and successive approximations x2, x3,, xn to the root are obtained from

Objectives. Materials

Chapter 2. Review of Mathematics. 2.1 Exponents

DA 2: Linear Approximation

E23: Hotel Management System Wen Yunlu Hu Xing Chen Ke Tang Haoyuan Module: EEE 101

Irrational Thoughts. Aim. Equipment. Irrational Investigation: Teacher Notes

A Guide to Presentations in L A TEX-beamer. Trinity University

PRACTICAL SUGGESTIONS FOR MATHEMATICAL WRITING

Supplementary Material for MTH 299 Online Edition

Mathematics 1104B. Systems of Equations and Inequalities, and Matrices. Study Guide. Text: Mathematics 11. Alexander and Kelly; Addison-Wesley, 1998.

Natural Language Processing Prof. Pawan Goyal Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Math 220 Some Exam 1 Practice Problems Fall 2017

Topic: The Standard Format for Importing

Mathematical Nomenclature

1 Introduction. Multimedia, Vision and Graphics Laboratory

Green s Functions with Reflection

Conceptual Explanations: Simultaneous Equations Distance, rate, and time

A simple san serif article

The Standard Format for Importing Quizzes

Roberto s Notes on Linear Algebra Chapter 11: Vector spaces Section 1. Vector space axioms

Pre-Calculus I. For example, the system. x y 2 z. may be represented by the augmented matrix

Import a Word quiz Doc. To Respondus

hp calculators HP 35s Using Register Arithmetic Variables and Memory Registers Practice Examples: Calculating Using STO Arithmetic

Transcription:

Biostatistics Student Seminar An Introduction To L A T E X Josh Murray Osvaldo Espin-Garcia (edition) Dalla Lana School of Public Health University of Toronto

Introduction There are four stages to creating a document: 1 Text is entered and stored in the computer for corrections, extensions, deletions, etc... 2 The input text is formatted into lines of equal length and pages of a certain size 3 The output text is displayed on the computer screen 4 The final output is sent to a printer T E X, is a powerful computer programming language that focuses on step 2 above. L A T E X, is an extension that allows the user to create publication quality materials with T E Xcommands.

History Computer scientist Donald Knuth was frustrated with the errors that occurred when he sent his journal articles and books to be published. In 1978 wrote the typesetting program T E X so that anyone could create publication quality documents. In 1985 mathematician Leslie Lamport created an extension of T E X, called L A T E X, that focuses on document structure as opposed to the minute detail of T E X.

How do you use L A T E X? There are three steps to creating a publication quality document with L A T E X: 1 Enter text with L A T E X markup into a text editor and save it as a.tex file. (e.g. TeXworks, Tinn-R, TexnicCenter) 2 Send your.tex file to a program that can process L A T E X input. (MikTeX). This will create a file of your choice, PDF, DVI, or Postscript. 3 Open the file you created in a viewer (Adobe).

A Basic Document Every L A T E Xdocument must contain the following three components. \documentclass{article} %preamble \begin{document} %body Hello World! %body \end{document} The preamble. It tells L A T E X what kind of document to process. In the example above I chose article, but I could have chosen something else (e.g book, report, letter, or beamer). This is where you put all of the global commands that will appear in your document. The document s text is placed between the second and third item.

Sections L A T E X is very useful for breaking up your document into sections. Giving your document structure by adding logical sections makes it easier to read. A well structured document usually contains the following components: A title page A table of contents An Abstract Section headings Subsection headings Bibliography

Sections (cont d) A section can be declared in one of two ways: \section{section name} \section*{section name} Once you declare a section it is best to give it a label. This is done by adding the command \label{label name}. Once you have done this, you can reference your section by adding the command \ref{label name}.

Math Mode There are two main modes for processing commands in Latex. 1 Paragraph mode, which is the normal processing mode. 2 Math mode. Latex enters this mode when certain commands are encountered, telling Latex that what follows is a formula. When Latex is in math mode, spaces and blanks are ignored.

Math Mode (cont d) There are two ways to enter math mode. The first is within a paragraph by enclosing your math symbol or formula between two $ s. An example would be: The short hand symbol for summation is the capital Greek letter sigma, $\Sigma$. The short hand symbol for summation is the capital Greek letter sigma, Σ.

Math Mode (cont d) The second method way to enter math math is to place your formula between two $$ s. This will place your formula in a paragraph of its own: $$ f(x)=\frac{1} { \sqrt{2\ pi\sigma^{2} } } e ^{-\frac{(x-\mu) ^{2}}{2\sigma^{2}}} $$ f (x) = 1 (x µ)2 e 2σ 2 2πσ 2

Constants and Variables In Math Mode constants are typeset in Roman and variables are in italics. Spaces are ignored. z = 2a + 3y y = c{f [y, y(x)] + g(x)} M(s) < M(t) < M = m

Exponents and Indices \pi^{2} π 2 x^{5y + 3} x 5y+3 x_i x i a_{12} a 12 x^n_i x n i A_{i,j,k}^{n!2}?? A x 2 i j 2n m.n

Fractions Fractions can be displayed as x/y x/y \frac{x}{y} x y Both, \frac{x/y - z/y}{u/v -s/t}?? a x y + b x+y 1+ a b a+b

Roots Roots can be displayed as \sqrt{8} 8 \sqrt[3]{8}=2 3 8 = 2 \sqrt{x^2 + y^2 +2xy} x 2 + y 2 + 2xy \sqrt[3]{-q + \sqrt{q^2 +p^3}}?? SE( ˆ ) = 1 n 11 + 1 n 12 + 1 n 21 + 1 n 22

Sums and Integrals Summation and integration formulas are made with the commands \sum and \int: n i=1 b a n a x x=1 2 n b a i f i (x)g i (x) dx4 i=1 a More complex equations can be made by following the simple rules. \int\frac{\sqrt{(ax+b)^3}}{x} produces: (ax + b) 3 x

Arrays Arrays are used to create matrices, determinants, systems of equations and so on. An array begins with the command \begin{array}{justification} and ends with \end{array}. The justification consists of entering l for left, c for center, or r for right. You need to include a justification rule for every column that you include. The entries in each array are separated by an & and each line ends with \\.

Examples of arrays $$ \ l e f t ( \ begin { array } { r c l } 1 & 0 & 0 \ \ 0 & 1 & 0 \ \ 0& 0 & 1 \ \ \ end { array } \ r i g h t ) $$ 1 0 0 0 1 0 0 0 1 $$ \ l e f t ( \ begin { array } { c } \ l e f t \ begin { array } { c c } x _{11} & x _{12} \ \ x _{21} & x _{22} \ end { array } \ r i g h t \ \ x \ \ y \ end { array } \ r i g h t ) $$ x 11 x 12 x 21 x 22 x y

What code produces the following? F(x, y) = 0 and F xx F xy F x F yx F yy F y F x F y 0 = 0

Multiple Line Equations Equation deployed over several lines of code. They have the same form as an array. \begin{eqnarray} (x+y)(x-y) & = & x^2 - xy - y^2 \\ & = & x^2 - y^2 \\ (x+y)^2 & = & x^2 + 2xy + y^2 \end{eqnarray} x n u 1 + + x n+t 1 u t = x n u 1 + (ax n + c)u 2 + ( ) + a t 1 x n + c(a t 2 + + 1) = (u 1 + au 2 + + a t 1 u t )x n + h(u 1,..., u t ) u t

Tables Tables are created in Latex using the tabular environment. The basic syntax for a table in Latex is: \begin{tabular}{justification} r1c1 & r1c2 &... \\... \\ rnc1 & rnc2 &... \end{tabular} The justification is either l for left, c for center, or r for right. Each column entry is separated by an & and each row ends with \.

Example of a table The following code: \ begin { t a b l e } \ begin { t a b u l a r } { c c c c } \ hline \ hline B i r t h & \ multicolumn { 2 } { c } { Smoking Status } & \ \ \ cline {2 3} Weight & No & Yes & T o t a l \ \ \ hline Normal & $n_{11}$ & $n_{12}$ & $n _ { 1. } $ \ \ \ hline Low & $n_{21}$ & $n_{22}$ & $n _ { 2. } $ \ \ \ hline \ hline T o t a l & $n _ {. 1 } $ & $n _ {. 2 } $ & $n _ {.. } $ \ \ \ hline \ hline \ end { t a b u l a r } \ caption { $ 2 \ times2$ contingency t a b l e } \ end { t a b l e }

Example of a table (cont d) Produces the table: Birth Smoking Status Weight No Yes Total Normal n 11 n 12 n 1. Low n 21 n 22 n 2. Total n.1 n.2 n.. Table: 2 2 contingency table

Table: Summary of Categorical variables Distribution of Gender Gender n (%) Females 296 (58.04%) Males 214 (41.96%) Distribution of Age Spread n (%) Age grp 1 1 (0.21%) Age grp 2 92 (19.53%) Age grp 3 159 (33.76%) Age grp 4 219 (46.50%)

Special Characters List of Special Characters: $ = \$ & = \& % = \% # = \# _ =\_ { = \{ } = \}

Lists There are three types of lists available in L A T E X. \begin{itemize} list text \end{itemize} \begin{enumerate} list text \end{enumerate} \begin{description} list text \end{ description} To add a new bullet/number/description you call the command \item.

Example itemize The individual entries are indicated with a black dot, a so-called bullet, as the label The text in the entries may be of any length. The label appears at the beginning of the first line of text. Successive entries are separated from one another by additional vertical spaces.

Example of enumerate 1 The labels consists of sequential numbers 2 the numbering starts at 1 with every call to the enumerate environment

Sample description purpose This environment is appropriate when a number of words or expressions are to be defined example A keyword is used as the label and the entry contains a clarification or explanation other uses It may also be used as an author list in a bibliography

Online resources 1 http://en.wikibooks.org/wiki/latex 2 http://latex.wikia.com/wiki/main_page 3 http://www.ctan.org/tex-archive/info/ lshort/english/ 4 http://tex.stackexchange.com/