Math Bootcamp 2017 August 14th, 2017
Math Bootcamp 2017 August 14th, 2017
• It is fast
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}
• Install Editor
— Text Studio
http://www.texstudio.org/
— WinEdt
http://www.winedt.com/
— Emacs, vi, etc.
How to Setup LaTeX for Mac
http://pages.uoregon.edu/koch/t
exshop/
• Install Editor
— Text Studio
http://www.texstudio.org/
— WinEdt
http://www.winedt.com/
— Emacs, vi, etc.
How to Setup LaTeX. Don’t want to install anything
• Use overleaf
www.overleaf.com
Get Started with some basics
Get Started
\documentclass[12pt]{article}
\begin{document}
Hello world. This is my \emph{first} document prepared in \LaTeX.
\end{document}
\documentclass
{article}
{report}
\documentclass[12pt]{article} {beamer}
{book}
{letter}
• article: suitable for short document, journal articles
• report: good for longer document, such as thesis.
• beamer: similar to power point format.
Font
Font Size
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}
Sections
…
\begin{abstract}
...
\end{abstract}
\section{introduction}
\section{Methodolgy}
\subsection{Data and Variables}
\subsection{Statistical Model}
Standard Environments
\begin{env_name}
stuff Environment name (env_name) can be
\end{enc_name} 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}
Standard Environments
\begin{equation}
E=mc^2
\end{equation}
\begin{tabular}{l|c|r}
1 & 2 & 3 \\
4 & 5 & 6 \\
4 & 5 & 6 \\
\end{tabular}
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
https://en.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Captions
https://www.sharelatex.com/learn/Inserting_Images
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}
….
• \begin{equation} …. \end{equation}
Math Mode: some examples
x = \frac{-b \pm \sqrt{b^2-4ac} } {2a}
\int_0^\infty
\frac{\partial u}{\partial x}
• # $ % ^ & _ {} ~ \
• \# \$ \% \^{} \& \_ \{ \} \~{}
https://en.wikibooks.org/wiki/LaTeX/Tables
https://www.sharelatex.com/learn/Tables
Bibliography and Citation
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.
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}
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}
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 = "891--921", year = "1905",
DOI = "http://dx.doi.org/10.1002/andp.19053221004" }
@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 = "http://www-cs-faculty.stanford.edu/\~{}uno/abcde.html" }
Another Advantages
The bibTex file can be downloaded directly from Temple library Website!!!
Other Usage of Latex
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.
LaTex for Presentation
• Good for math intensive presentation.
• Not flexible
LaTex for CV