Lecture 3 LaTeX and LyX. LaTeX TeX Computer program by Donald Knuth for typesetting text and...

Click here to load reader

  • date post

    25-Dec-2015
  • Category

    Documents

  • view

    214
  • download

    0

Embed Size (px)

Transcript of Lecture 3 LaTeX and LyX. LaTeX TeX Computer program by Donald Knuth for typesetting text and...

  • Slide 1
  • Lecture 3 LaTeX and LyX
  • Slide 2
  • 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 Introduction to academic studies
  • Slide 3
  • LaTeX vs MS Word LaTeX is more often used for writing scientific reports and papers Once publisher provides its 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 (one new formula is inserted not a big deal, compare with Word) There is a citation and referencing function (in Word, manually) Word provides a better grammar control tool than LaTeX Introduction to academic studies
  • Slide 4
  • Installing LaTeX and LyX Windows OS Install MikTeX http://www.miktex.org/http://www.miktex.org/ Install an editor, TeXnicCenter (if you do not plan to use LyX): http://www.texniccenter.org/http://www.texniccenter.org/ Install LyX if you like graphical interface: http://www.lyx.org/ http://www.lyx.org/ Introduction to academic studies
  • Slide 5
  • Document structure Try to do yourself! Introduction to academic studies \documentclass{} \usepackage{} \begin{document} Write your text here \end{document}
  • Slide 6
  • Text, characters and comments New line is ignored Make a blank line to begin a new line Several spaces treated as a single one # $ % ^ & _ { } ~ \ can not be used in text directly use \# \$ \% LaTeX commands are case sensitive LaTeX commands start with backslash \command[optional param]{parameter} Comments start with % Introduction to academic studies
  • Slide 7
  • Document classes \documentclass[options]{class} class article proc (Proceedings) report (small book, thesis) book slides options 10pt, 11pt, 12pt (size of main font) a4paper, a5paper, onecolumn, twocolumn twoside, oneside landscape Introduction to academic studies
  • Slide 8
  • Language support Swedish Introduction to academic studies \usepackage[swedish]{babel} \usepackage[T1]{fontenc} \usepackage[latin1]{inputenc}
  • Slide 9
  • Titles, chapters and sections Define the frontpage: 1. \title{} 2. \author{} 3. \date{} 4. \maketitle 5. \section Introduction to academic studies \documentclass[12pt]{paper} %Some more commands here, skipped \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}
  • Slide 10
  • Alignment \begin{x} \end{x} x = flushleft flushright or center Introduction to academic studies \section{Introduction}\label{intro} \begin{center} Monotonic regression is a nonparametric method... \end{center}
  • Slide 11
  • Quotation Use quote environment Introduction to academic studies As it is specified in \cite{strand}: \begin{quote} Unfortunately, there are no efficient MR algorithms when... \end{quote}
  • Slide 12
  • Referencing Use \label{} and \ref{} Proper in many situations: formulas, tables, graphs, chapters Introduction to academic studies \section{Introduction}\label{intro} As it is specified in section \ref{intro}...
  • Slide 14
  • Formulas Formula in the text $...$ Formula at the new line: \begin{equation}\end{equation} Formula at the new line without number: \[ \] Introduction to academic studies \begin{equation} Y_i=\phi(X_i, \theta)+ \epsilon_i \label{addit} \end{equation}
  • Slide 15
  • 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 Introduction to academic studies
  • Slide 16
  • Arrays, matrices Use array environment: Use c,l or r for alignment Separate elements with & End line with \\ Introduction to academic studies \[ \mathbf{X} = \left( \begin{array}{ccc} x_1 & x_2 & \ldots \\ x_3 & x_4 & \ldots \\ \vdots & \vdots & \ddots \end{array} \right) \]
  • Slide 17
  • Arrays, matrices Introduction to academic studies \begin{equation} Y=\left\{ \begin{array}{rl} e^x,& if \: x>0,\\ \sqrt{x^2+1},& otherwise \end{array} \right. \end{equation}
  • Slide 18
  • Creating tabbing Define position by \= Move to the position by \> Introduction to academic studies \begin{tabbing} 1. \ \=Compute the fitted response values $\hat{Y}_1, \ldots, \hat{Y}_n$ \\ \> and block partition $B_1, \ldots, B_K$ by applying SBR\\ 2. \>For \= each $j=1, \ldots, B$ and $i=1, \ldots, n$\\ \>\>Find $k$ such that $i \in B_k$. \\ \>\>Compute $l$ by sampling from $B_k$\\ \>\>Set $Y^*_{ij}=Y_{l}$\\ \end{tabbing}
  • Slide 19
  • Creating tables Use \begin{tabular}[pos]{table_spec} \end{tabular} Use c,l orr for alignment. For a fixed width, use p{width}. For drawing of vertical lines, use | Separate elements with & End line with \\ Draw lines with \hline Introduction to academic studies
  • Slide 20
  • Creating tables Introduction to academic studies \begin{tabular}{|l|ccc|} \hline $\frac{Bootstrap\ method}{CI\ approach}$ & $Parametric$ &$\stackrel{Non-parametric,}{mid-point}$ & $\stackrel{Non- parametric,}{worst-case}$\\ \hline Percentile& Method 1 & Method 3 & Method 5 \\ BCa& Method 2 & Method 4 & Method 6\\ \hline \end{tabular}
  • Slide 22
  • Creating tables \usepackage{multirow} \multirow{''num_rows''}{''width''}{''contents''}. Introduction to academic studies \begin{tabular}{ |l|l|l| } \hline \multicolumn{3}{ |c| }{Registered breakpoints} \\ \hline 1981 & January & 13.7 \\ \hline \multirow{2}{*}{1982} & February & 12.6 \\ & March & 13.9 \\ \hline \end{tabular}
  • Slide 23
  • Floating tables Sometimes tables and graphs are large to be placed directly after a specific text automatic placement Placement: h= here t=top b=bottom p=at the special page Introduction to academic studies \begin{table}[placement or nothing] \begin{tabular}{...}... \end{tabular} \caption{} \label{} \end{table}
  • Slide 24
  • Floating tables Introduction to academic studies \begin{table}[b] \begin{tabular}{ |l|l|l| } \end{tabular} \caption{Registered breakpoints in the time series of oil consumption, mtones.} \label{oil} \end{table}