Download presentation
Presentation is loading. Please wait.
1
Introduction Math bootcamp 2017
August 14th, 2017
2
What is LaTex A scripting language used for writing documents.
Donald Knuth in 1978 develop a typesetting program Tex. LaTex is an extension of Tex. Like a programming language, and produces files (PDF, html, ps) Differences with Microsoft word: Microsoft Word: ‘What You See Is What You Get’ (WYSIWYG) LaTex: You cannot see the final document while you are typing (WYSIWYM)
3
Advantages It looks pretty It is fast
Consistent in term of formatting. Good for long documents, such as dissertation and books. y = \frac{{n!}}{{k!\left( {n - k} \right)!}}p^k q^{n - k} = \left( {\begin{array}{*{20}c} n \\ k \\\end{array}} \right)p^k q^{n - k}
4
Advantages (Cont.) Stability and interchangeability (Office 97, Office 2000, ….) Most journals have their LaTeX styles file (just download and use them). Good bibliography management. Connection with statistical software (R and SAS) It is free!
5
Disadvantages Learning curve. Take a little bit longer to obtain working knowledge. Flexibility. Hard to customize. Trade-off: hard to learn, but powerful.
6
How to Setup LaTeX for Windows
Download and install MikTeX Install Acrobat Reader Install Editor Text Studio WinEdt Emacs, vi, etc. LaTeX package
7
How to Setup LaTeX for Mac
Download and install MacTex Or TexShop exshop/ Install Acrobat Reader Install Editor Text Studio WinEdt Emacs, vi, etc. LaTeX package LaTeX package
8
How to Setup LaTeX. Don’t want to install anything
Use overleaf
9
Get Started with some basics
10
Get Started \documentclass[12pt]{article} \begin{document}
Hello world. This is my \emph{first} document prepared in \LaTeX. \end{document}
11
\documentclass \documentclass[12pt]{article}
{report} {beamer} {book} {letter} \documentclass[12pt]{article} article: suitable for short document, journal articles report: good for longer document, such as thesis. beamer: similar to power point format.
12
Font
13
Font Size
14
Titles \documentclass[12pt]{article} \begin{document}
\title{Introduction to \LaTeX} \author{Zeda Li and William W.S. Wei} \maketitle Hello world. This is my \emph{first} document prepared in \LaTeX. \end{document}
15
Sections … \begin{abstract} ... \end{abstract} \section{introduction}
\section{Methodolgy} \subsection{Data and Variables} \subsection{Statistical Model}
16
Standard Environments
\begin{env_name} stuff \end{enc_name} Environment name (env_name) can be document, itemize, enumerate, tabular, etc. \begin{itemize} \item The first item \item The second item \end{itemize} \begin{enumerate} \item The first item \item The second item \end{enumerate}
17
Standard Environments
\begin{equation} E=mc^2 \end{equation} \begin{tabular}{l|c|r} 1 & 2 & 3 \\ 4 & 5 & 6 \\ \end{tabular}
18
Figures \begin{figure} \centering \includegraphics {name of the figure file} \caption{Put the caption here} \end{figure} You can insert figures in pdf, jpg, png, eps, and other formats into your document. In general, figures have to be in the same folder as .tex file. Multiple figures can be inserted using \subfigure
19
Labels and cross-reference
\begin{figure} \centering \includegraphics {name of the figure file} \caption{Put the caption here} \label{a short name that you can easily remember} \end{figure} \section{Introduction} \label{sec:intro} \section{Methodology} \label{sec:meth} …. In Section \ref{sec:intro}, we see the Figure \ref{fig:s11},
20
Math Mode
21
Math Mode Use \( … \) or $...$ for in-line math formulas
Use \[ … \] or $$...$$ for math formulas with separate line Spaces inside \( … \) and \[ … \] are ignored. If needed, use “\ ” or “~” to add space Use \mbox{…} or \text{…} for words inside math formulas \begin{equation} …. \end{equation}
22
Math Mode: some examples
x = \frac{-b \pm \sqrt{b^2-4ac} } {2a} \int_0^\infty \frac{\partial u}{\partial x} \gamma, \pi, \theta, \lambda, \sigma \Gamma, \Pi, \Theta, \Lambda, \Sigma
23
Exercise Produces following equations:
24
Special Characters # $ % ^ & _ { } ~ \ \# \$ \% \^{} \& \_ \{ \} \~{}
# $ % ^ & _ { } ~ \ \# \$ \% \^{} \& \_ \{ \} \~{} Try \cdots, \vdots
25
User-defined Commands
\newcommand\bs{\boldsymbol} \newcommand{\cov}{\text{Cov}} \newcommand{\cor}{\text{Corr}} \def\mb#1{\setbox0=\hbox{$#1$} \kern-.025em\copy0\kern-\wd0 \kern.05em\copy0\kern-\wd0 \kern-.025em\raise.0em\box0} \def\X{{\bf X}} \def\Z{{\bf Z}} \newcommand{\beq}{\begin{equation}} \newcommand{\eeq}{\end{equation}}
26
Packages Many packages can be used to fill user’s advanced needs.
It is hard to include all of them here. Use google!
27
Tables
30
\begin{tabular}{|l|l|}
Apples & Green \\ Strawberries & Red \\ Oranges & Orange \\ \end{tabular}
31
\begin{tabular}{l*{6}{c}r}
Team & P & W & D & L & F & A & Pts \\ \hline Manchester United & 6 & 4 & 0 & 2 & 10 & 5 & 12 \\ Celtic & 6 & 3 & 0 & 3 & 8 & 9 & 9 \\ Benfica & 6 & 2 & 1 & 3 & 7 & 8 & 7 \\ FC Copenhagen & 6 & 2 & 1 & 3 & 5 & 8 & 7 \\ \end{tabular}
32
... \usepackage{multirow} \begin{tabular}{ |l|l|l| } \hline \multicolumn{3}{ |c| }{PhD Office} \\ Senior Associate Dean & Milton F Stauffer Professor & Paul Pavlou \\ \multirow{2}{*}{Student Services} & Associate Director & Lisa Fitch \\ & Coordinator & Felix Flores \\ \multirow{12}{*}{Concentration Advisors} & Accounting & Jagannathan Krishnan \\ & Decision Neuroscience & Angelika Dimoka \\ & Finance & Connie X. Mao\\ & Human Resource & Crystal Harold \\ & Interdisciplinary Studies & Angelika Dimoka \\ & International Business & J. Jay Choi\\ & Marketing & Susan Mudambi \\ & MIS & Sunil Wattal \\ & RMI & Hua Chen\\ & Statistics & Cheng Yong Tang\\ & Strategic & Susan Feinberg\\ & Tourism \& Sports & Daniel Funk\\ \end{tabular}
33
Exercise Produces following tables:
34
Bibliography and Citation
35
Simple Bibliography If you know you have between 10 and 99 publications, you can start with \begin{thebibliography}[99]. Use any two digit number in the argument, since all numerals are the same width.
36
Bibliography Management
BibTeX is a widely used bibliography management tool in LATEX. The bibliography entries are kept in a separate file and then imported into the main document. Once the external bibliography file is imported, the command \cite, \citet, \citep,… Very useful to build your own bibliography library. Make sure include package \usepackage{natbib}
37
Main Tex Ths document is an example of BibTeX using in bibliography management. Three items are cited: \textit{The \LaTeX\ Companion} book \cite{latexcompanion}, the Einstein journal paper \cite{einstein}, and the Donald Knuth's website \cite{knuthwebsite}. The \LaTeX\ related items are \cite{latexcompanion,knuthwebsite}. \medskip \bibliographystyle{unsrt} \bibliography{sample}
38
BibTex @article{einstein, author = "Albert Einstein",
title = "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German}) [{On} the electrodynamics of moving bodies]", journal = "Annalen der Physik", volume = "322", number = "10", pages = " ", year = "1905", DOI = " } @book{latexcompanion, author = "Michel Goossens and Frank Mittelbach and Alexander Samarin", title = "The \LaTeX\ Companion", year = "1993", publisher = "Addison-Wesley", address = "Reading, Massachusetts" } @misc{knuthwebsite, author = "Donald Knuth", title = "Knuth: Computers and Typesetting", url = " }
39
Another Advantages The bibTex file can be downloaded directly from Temple library Website!!!
40
Other Usage of Latex
41
Connect LaTex with other software
Connect with R. Provide flexible and fast report writing and editing. Need two packages, kinitr and sweave. If you are all interested in learning R, we can do a section latter.
42
LaTex for Presentation
Good for math intensive presentation. Not flexible LaTex for CV
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.