Upgrade to Pro — share decks privately, control downloads, hide ads and more …

LaTeX for Scientific Writing Part-1

sambaiga
August 16, 2017
37

LaTeX for Scientific Writing Part-1

sambaiga

August 16, 2017
Tweet

Transcript

  1. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W LaTex for Scientific Writing: Part -1 Anthony FAUSTINE. PhD machine learning resercher, IDLab, imec Ghent University 2017 sambaiga Latex 2017 1 / 66
  2. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Outline 1 Introduction 2 Latex Command 3 Document Structure 4 Text Formatting 5 Cross-reference 6 Typesetting Mathematics sambaiga Latex 2017 2 / 66
  3. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W What is Latex A very powerful text (markup) processing system designed to produce quality typeset documents. • It is based on the TEX : A typesetting system ⇒ designed and created by Donald Knuth in 1978 • LaTeX is a user-friendly extension of TeX ⇒ a slightly higher-level language built on top of TEX. • TeX and LaTeX ⇒ assembly language and C sambaiga Latex 2017 3 / 66
  4. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W What is Latex A very powerful text (markup) processing system designed to produce quality typeset documents. • It is based on the TEX : A typesetting system ⇒ designed and created by Donald Knuth in 1978 • LaTeX is a user-friendly extension of TeX ⇒ a slightly higher-level language built on top of TEX. • TeX and LaTeX ⇒ assembly language and C sambaiga Latex 2017 3 / 66
  5. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W What is Latex A very powerful text (markup) processing system designed to produce quality typeset documents. • It is based on the TEX : A typesetting system ⇒ designed and created by Donald Knuth in 1978 • LaTeX is a user-friendly extension of TeX ⇒ a slightly higher-level language built on top of TEX. • TeX and LaTeX ⇒ assembly language and C sambaiga Latex 2017 3 / 66
  6. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Why Latex LATEX strength : • Less focus on formatting and more on content. • It makes beautiful documents. • Superior and flexible equation presentation. • It was created by scientists, for scientists ⇒ A large and active community. • Good for collaborative writing. • Fast, stable, extensible, and free (distribution dependent). sambaiga Latex 2017 4 / 66
  7. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Why Latex LATEX strength : • Less focus on formatting and more on content. • It makes beautiful documents. • Superior and flexible equation presentation. • It was created by scientists, for scientists ⇒ A large and active community. • Good for collaborative writing. • Fast, stable, extensible, and free (distribution dependent). sambaiga Latex 2017 4 / 66
  8. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Why Latex LATEX strength : • Less focus on formatting and more on content. • It makes beautiful documents. • Superior and flexible equation presentation. • It was created by scientists, for scientists ⇒ A large and active community. • Good for collaborative writing. • Fast, stable, extensible, and free (distribution dependent). sambaiga Latex 2017 4 / 66
  9. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Why Latex LATEX strength : • Less focus on formatting and more on content. • It makes beautiful documents. • Superior and flexible equation presentation. • It was created by scientists, for scientists ⇒ A large and active community. • Good for collaborative writing. • Fast, stable, extensible, and free (distribution dependent). sambaiga Latex 2017 4 / 66
  10. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Why Latex LATEX strength : • Less focus on formatting and more on content. • It makes beautiful documents. • Superior and flexible equation presentation. • It was created by scientists, for scientists ⇒ A large and active community. • Good for collaborative writing. • Fast, stable, extensible, and free (distribution dependent). sambaiga Latex 2017 4 / 66
  11. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Why Latex LATEX strength : • Less focus on formatting and more on content. • It makes beautiful documents. • Superior and flexible equation presentation. • It was created by scientists, for scientists ⇒ A large and active community. • Good for collaborative writing. • Fast, stable, extensible, and free (distribution dependent). sambaiga Latex 2017 4 / 66
  12. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Why Latex LATEX strength : • Less focus on formatting and more on content. • It makes beautiful documents. • Superior and flexible equation presentation. • It was created by scientists, for scientists ⇒ A large and active community. • Good for collaborative writing. • Fast, stable, extensible, and free (distribution dependent). sambaiga Latex 2017 4 / 66
  13. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W How does it work? • You write your document in plain text with commands that describe its structure and meaning. • The latex program processes your text and commands to produce a beautifully formatted document. sambaiga Latex 2017 5 / 66
  14. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W How does it work? • You write your document in plain text with commands that describe its structure and meaning. • The latex program processes your text and commands to produce a beautifully formatted document. sambaiga Latex 2017 5 / 66
  15. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Installation First you need a TEX Distribution : contains all the software that you need to create a LATEX document. • MiKTeX : A free TeX distribution for Windows systems. • MacTeX : A free TeX distribution for Mac. • TeXLive : A free TeX distribution for for most flavors of Unix and windows. • For more Latex info : https ://www.latex-project.org/ sambaiga Latex 2017 6 / 66
  16. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Installation First you need a TEX Distribution : contains all the software that you need to create a LATEX document. • MiKTeX : A free TeX distribution for Windows systems. • MacTeX : A free TeX distribution for Mac. • TeXLive : A free TeX distribution for for most flavors of Unix and windows. • For more Latex info : https ://www.latex-project.org/ sambaiga Latex 2017 6 / 66
  17. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Installation First you need a TEX Distribution : contains all the software that you need to create a LATEX document. • MiKTeX : A free TeX distribution for Windows systems. • MacTeX : A free TeX distribution for Mac. • TeXLive : A free TeX distribution for for most flavors of Unix and windows. • For more Latex info : https ://www.latex-project.org/ sambaiga Latex 2017 6 / 66
  18. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Installation First you need a TEX Distribution : contains all the software that you need to create a LATEX document. • MiKTeX : A free TeX distribution for Windows systems. • MacTeX : A free TeX distribution for Mac. • TeXLive : A free TeX distribution for for most flavors of Unix and windows. • For more Latex info : https ://www.latex-project.org/ sambaiga Latex 2017 6 / 66
  19. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Installation You also need a text editor : To create a LATEX source file • Texmaker. • TexStudio. • Sublime Text 3. We will use TexStudio with MiKTex • Download TexStudio for your distribution • Install TexStudio when MiKTeX installation is completed. • TexStudio will automatically configure the settings for you. The installation of LaTeX is now complete. sambaiga Latex 2017 7 / 66
  20. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Online versions Popular online versions • Overleaf [https ://www.overleaf.com/]. • Sharelatex [https ://www.sharelatex.com/]. • Papeeria [https ://papeeria.com/]. • Authorea [https ://www.authorea.com/]. sambaiga Latex 2017 8 / 66
  21. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Outline 1 Introduction 2 Latex Command 3 Document Structure 4 Text Formatting 5 Cross-reference 6 Typesetting Mathematics sambaiga Latex 2017 9 / 66
  22. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Commands A LATEX document is mainly defined through commands. Commands are case sensitive, and take one of the following two formats : • They start with a backslash \ and then a name consisting of letters only. • Some commands need an argument, which has to be given between curly braces { }. • Some commands support optional parameters, which are added in square brackets [ ]. sambaiga Latex 2017 11 / 66
  23. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Commands Arguments and Options Many commands require a single argument, and some commands require even multiple arguments. • Some commands can have several options. Example : \section{Introduction} % single argument \usepackage{amsmath, amssymb} % multiple arguments \documentclass[a4paper,11pt]{article} % several options \usepackage[final]{microtype} % single options sambaiga Latex 2017 12 / 66
  24. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Commands Arguments and Options Many commands require a single argument, and some commands require even multiple arguments. • Some commands can have several options. Example : \section{Introduction} % single argument \usepackage{amsmath, amssymb} % multiple arguments \documentclass[a4paper,11pt]{article} % several options \usepackage[final]{microtype} % single options sambaiga Latex 2017 12 / 66
  25. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Commands Environment An environment is be marked by, \begin{environment} ... \end{environment}. • These initiate and exit an environment. • The type of environment is applied to everything between the begin and end commands. Example : \begin{document} content... % document environment \end{document} sambaiga Latex 2017 13 / 66
  26. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Commands Environment An environment is be marked by, \begin{environment} ... \end{environment}. • These initiate and exit an environment. • The type of environment is applied to everything between the begin and end commands. Example : \begin{document} content... % document environment \end{document} sambaiga Latex 2017 13 / 66
  27. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Outline 1 Introduction 2 Latex Command 3 Document Structure 4 Text Formatting 5 Cross-reference 6 Typesetting Mathematics sambaiga Latex 2017 14 / 66
  28. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Document Structure Every LaTeX document has the following form : \documentclass[options]{class name} %Preamble \begin{document} %Body \end{document} sambaiga Latex 2017 15 / 66
  29. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Document Class The command \documentclass[options]{class name} specify type of document you wants to create. • class name : specifies the type of document to be created. • options parameter :customises the behaviour of the document class. Example : \documentclass[11pt,a4paper]{article} sambaiga Latex 2017 16 / 66
  30. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Document Class The command \documentclass[options]{class name} specify type of document you wants to create. • class name : specifies the type of document to be created. • options parameter :customises the behaviour of the document class. Example : \documentclass[11pt,a4paper]{article} sambaiga Latex 2017 16 / 66
  31. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Document Class Lists of the document classes type. Class Description article For articles in scientific journals, presentations, short reports, program documentation, invitations etc. report For longer reports containing several chapters, small books, thesis etc. book For real books. letter For writing letters. beamer For writing presentation exam For writing exams. sambaiga Latex 2017 17 / 66
  32. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Document Class : Options The document classes options. Options Description 10pt, 11pt, 12pt Sets the size of the main font in the document. Default is 10pt. a4paper,letterpaper.. Defines the paper size.The default size is letterpa- per.Besides that, a5paper, b5paper, executivepaper, and le- galpaper can be specified. twocolumn Instructs LaTeX to typeset the document in two columns instead of one. twoside, oneside For writing letters. landscape Changes the layout of the document to print in landscape mode. titlepage, notitlepage Specifies whether a new page should be started after the document title or not. The article class does not start a new page by default, while report and book do. sambaiga Latex 2017 18 / 66
  33. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W The Preamble The preamble is where you define the style of your document and load any packages you need to use. \documentclass[options]{class name} %Preamble \begin{document} • It normally contains commands, variables or other things needed that affect the entire document. • Load needed packages along with any options for those packages. sambaiga Latex 2017 20 / 66
  34. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W The Preamble The preamble is also used to load any other options or information that isn’t necessarily a part of the document’s content such as : • Setting lengths of spaces before/after paragraphs, line height, etc • Specifying author/title/date, etc. (important if you will be making a title page). sambaiga Latex 2017 21 / 66
  35. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W The Preamble Document Tittle There are two steps to give your document a title. • Tell LaTeX what to put in the title, and tell LaTeX to typeset the title. • To specify title use the following commands in preamble : \title{...}, \author{...}, \date{..}. • To display the title, use \maketitle just after \begin{document}. Example : \title{Scintific Writing using LaTeX} \author{M.~Chuwa \and S.~Nyondo} \date{\today} sambaiga Latex 2017 22 / 66
  36. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W The Preamble : Packages Packages extend the basic LATEX commands. • To use packages, include the following command : \usepackage[options]{package} • This command goes into the preamble of the document. Example : %To set margin \usepackage[top=2in,bottom=1in,left=1in,right=1in]{geometry} \usepackage{microtype} %improves the spacing between words a \usepackage{amsmath} %introduces several improvements for ma \usepackage{graphicx} % for inserting image in latex documen sambaiga Latex 2017 23 / 66
  37. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W The Body of the Document After the preamble comes the body. • Starts with \begin {document} and ends with \end {document} • This is where you fill in the actual content of your document. • Contains all text, fgures, tables, etc. sambaiga Latex 2017 25 / 66
  38. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W The Body of the Document You can organize your document using the following commands. • Your PDF output will include these sections as bookmarks. • The above commands have a *-version and using these results in no number and no entry in the table of contents. • Example : \subsection *{Acknowledgement} sambaiga Latex 2017 26 / 66
  39. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Outline 1 Introduction 2 Latex Command 3 Document Structure 4 Text Formatting 5 Cross-reference 6 Typesetting Mathematics sambaiga Latex 2017 28 / 66
  40. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Font Sizes and Colors Commands Output \tiny LaTex \scriptsize LaTex \footnotesize LaTex \small LaTex \normalsize LaTex \large LaTex \Large LaTex \LARGE LaTex \huge LaTex \Huge LaTex sambaiga Latex 2017 29 / 66
  41. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Font Types and Style To change the font itself to different styles Style Commands Output Bold \textbf {LaTex} LaTex Italic \textit {LaTex} LaTex Underline \underline {LaTex} LaTex Typewriter \texttt {LaTex} LaTex Sans-Serif \textsf {LaTex} LaTex Serif (Roman) \textrm {LaTex} LaTex sambaiga Latex 2017 30 / 66
  42. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Font Sizes and Colors To change text color use \usepackage {color} or \usepackage {xcolor} • command : \textcolor {color}{text} • Example : • \textcolor {red}{Hello} world ⇒ Hello world • Hello \textcolor {blue}{world} ⇒ Hello world sambaiga Latex 2017 31 / 66
  43. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Spacing LaTex treats any number of spaces as a single space. • Single new lines are treated as if there is no new line. • Multiple blank lines are treated as a single new line or you may use \newline or \\ command. • You can force horizontal and vertical space using the \hspace {length} and \vspace {length} • You have to give each command a length commands : \hspace {0.1cm}, \hspace {1in} or \hspace {10pt} • To insert page breaks, use \clearpage or \newpage sambaiga Latex 2017 32 / 66
  44. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Lists There are three list environments • itemize ⇒ for a bullet list. • enumerate ⇒ for an ordered list and • description ⇒ for a descriptive list. All lists follow the following format : \begin{list_type} \item The first item \item The second item \item The third etc \end{list_type} sambaiga Latex 2017 33 / 66
  45. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Lists \begin{itemize} \item The first item \item The second item \item The third item \end{itemize} • The first item • The second item • The third item sambaiga Latex 2017 34 / 66
  46. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Lists \begin{enumerate} \item The first item \item The second item \item The third item \end{enumerate} 1 The first item 2 The second item 3 The third item sambaiga Latex 2017 35 / 66
  47. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Lists The description list used to explain notations or terms \begin{description} \item[Itemize] used for a bullet list. \item[Enumerate] used for a ordered list. \item[Description] used for a descriptive list. \end{description} output Itemize used for a bullet list. Enumerate used for a ordered list. Description used for a descriptive list. sambaiga Latex 2017 36 / 66
  48. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Nested Lists \begin{itemize} \item Item one \begin{enumerate} \item Subitem one \item Subitem two \end{enumerate} \item Item two \end{itemize} • Item one 1 Subitem one 2 Subitem two • Item two sambaiga Latex 2017 37 / 66
  49. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Outline 1 Introduction 2 Latex Command 3 Document Structure 4 Text Formatting 5 Cross-reference 6 Typesetting Mathematics sambaiga Latex 2017 39 / 66
  50. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Cross-reference With the commands \label{key} and \ref{key} it is possible to refer to section numbers. • The command \label{key} is used to set an identifier that is later used in the command \ref{key} to set the reference. Example : Create label : \section {Cross-Reference}\label {cross-ref} Reference : It is not difficult to refer to Section~\ref {cross-ref} Output : It is not difficult to refer to Section 5 sambaiga Latex 2017 40 / 66
  51. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Cross-reference With the commands \label{key} and \ref{key} it is possible to refer to section numbers. • The command \label{key} is used to set an identifier that is later used in the command \ref{key} to set the reference. Example : Create label : \section {Cross-Reference}\label {cross-ref} Reference : It is not difficult to refer to Section~\ref {cross-ref} Output : It is not difficult to refer to Section 5 sambaiga Latex 2017 40 / 66
  52. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Outline 1 Introduction 2 Latex Command 3 Document Structure 4 Text Formatting 5 Cross-reference 6 Typesetting Mathematics sambaiga Latex 2017 42 / 66
  53. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Math mode The amsmath package is the backbone of using LaTex for typesetting math. • Include in preamble : \usepackage{amsmath} The math environment" comes in two different forms : Inline mode ⇒ format the math within existing lines of text. Display mode ⇒ sets the math apart and centers it on the page. sambaiga Latex 2017 43 / 66
  54. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Math mode Inline mode Several options exist : • Use : \begin{math} x + y = 2 \end{math} ⇒ x + y = 2 • Use : \(x+y = 2\) ⇒ x + y = 2 • Use : single dollar signs $x + y =2$ ⇒ x + y = 2 sambaiga Latex 2017 44 / 66
  55. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Math mode Inline mode Subscripts and superscripts in math mode are formed using the _ and the ^. Example : an = n2 + 1 ⇒ $a_n = n^2 + 1$ When the subscript or superscript is more than one character, you must wrap it in {...} to group it together. Example : yn+1 = en2−1 + 1 ⇒ $y_{n + 1} = e^{n^2-1} + 1$ sambaiga Latex 2017 45 / 66
  56. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Math mode Inline mode Some common math symbols : Symbol Output \alpha ,\beta ,\lambda ,\gamma ,\theta ,\mu etc α, β, λ, γ, θ, µ, etc \infty ,\exists ,\forall ,\pm ,\leq ,\geq etc. ∞, ∃, ∀, ±, ≤, ≥ etc \int _0^{\infinity },\sum _{i=1}^n,\prod _{n=1}^N ∞ 0 , n i=1 , N n=1 etc \ldots , \cdots ,\vdots ,\colon etc . . . , · · · , . . ., : etc \frac {x}{y}, \sqrt {x},\bar {x},\lim _{x \to \infty } x y , √ x, ¯ x, limx→∞ etc More math symbols and formulas : Latex Symbols sambaiga Latex 2017 46 / 66
  57. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Math mode Common Math Formula ∂y ∂x ⇒ $\frac {\partial y}{\partial x}$ b a f(x) dx ⇒ $ \int _a^b f(x)\,dx $ sambaiga Latex 2017 47 / 66
  58. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Math mode Display mode Several options exist : • \begin{displaymath} x + y = 2 \end{displaymath} ⇒ x + y = 2 • \[x+y = 2\] ⇒ x + y = 2 • $$x + y =2$$ ⇒ x + y = 2 sambaiga Latex 2017 48 / 66
  59. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Math mode Numbered Equation The equation environment : \begin{equation}...\end{equation} creates a displayed formula and automatically generates an equation number. Example : π 0 sin x dx = 2 (1) ⇓ \begin{equation}\int_{0}^{\pi}\sin x \,dx = 2\end{equation} sambaiga Latex 2017 49 / 66
  60. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Math mode Referencing equations The amsmath package provides \eqref{key} for referencing equations. Example : ∞ i=0 ai xi (2) equation (2) is a typical power series. \begin{equation} \label{eq:1} \sum_{i=0}^{\infty} a_i x^i \end{equation} equation~\eqref{eq:1} is a pow sambaiga Latex 2017 50 / 66
  61. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Math mode Multiple Equations The \begin{align}..\end{align} environment is used group together several formulas or, equations with more than one lines. Example : α + β2 = 0 (3) log10 2α = eβ − 1 (4) \begin{align} \alpha + \beta^2 &= 0 \\ \log_{10}2\alpha &=e^{\beta}-1 \end{align} sambaiga Latex 2017 52 / 66
  62. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Math mode Multiple Equations To align several formulas or equations with more than one lines. Example : y = x2 + 2x − 1 = (x + 1)(2x + 1) = (x + 1)2 \begin{align*} y &=x^2 + 2x -1\\ &=(x+1)(2x+1) \\ &=(x+1)^2 \end{align*} sambaiga Latex 2017 53 / 66
  63. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Math mode Matrices and Array A basic matrix may be created using the matrix environment. Plain Matrix α β∗ γ∗ δ \[ \begin{matrix} \alpha& \beta^{*}\\ \gamma^{*}& \delta \end{matrix} \] sambaiga Latex 2017 54 / 66
  64. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Math mode Matrices and Array Bracketed matrix; typically represents the matrix itself α β∗ γ∗ δ \[ \begin{bmatrix} \alpha& \beta^{*} \gamma^{*}& \delta \end{bmatrix} \] sambaiga Latex 2017 55 / 66
  65. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Math mode Matrices Parenthesized matrix α β∗ γ∗ δ \[ \begin{pmatrix} \alpha& \beta^{*}\\ \gamma^{*}& \delta \end{pmatrix} \] sambaiga Latex 2017 56 / 66
  66. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Math mode Matrix Example : let type the following matrix Am,n =      a1,1 a1,2 · · · a1,n a2,1 a2,2 · · · a2,n . . . . . . ... . . . am,1 am,2 · · · am,n      sambaiga Latex 2017 57 / 66
  67. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Math mode Matrix Example : let type the following matrix \[ A_{m,n} = \begin{pmatrix} a_{1,1} & a_{1,2} & \cdots & a_{1,n} \\ a_{2,1} & a_{2,2} & \cdots & a_{2,n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{m,1} & a_{m,2} & \cdots & a_{m,n} \end{pmatrix} \] sambaiga Latex 2017 58 / 66
  68. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Math mode The Case Environment The cases environment allows the writing of piecewise functions. Consider the following : f(x) = x if x = 0 sin x x otherwise \[ f(x) = \begin{cases} x & \text{if } x \neq 0 \\ \frac{\sin x}{x}& \text{otherw \end{cases} \] sambaiga Latex 2017 59 / 66
  69. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Collaborative writing Most of your writing will be collaborative : • Often participants are distributed • there are lots of ways to deal with this ⇒ even when they are local, these techniques help. Collaborative writing of documents requires a strong synchronisation among authors. sambaiga Latex 2017 61 / 66
  70. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Collaborative writing Available modes 1 One person acts as editor, and incorporates changes : others ⇒ communicate proposed changes. - lots of work for editor, but only they end up happy. 2 Token : one person has the token (for all or part) • edit as please when have token pass it when ⇒ finished (e.g. by email) - requires trust. 3 Truly distributed : + all have access, and can edit. + conflicts are merged. + very powerful. - but requires tools. sambaiga Latex 2017 62 / 66
  71. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Collaborative writing models Truly distributed collaboration Require tools that support • Distributed access e.g. Dropbox and Revision control Available options : Dropbox and/ or Box - often have a free limited plan. + save latex and the rest (e.g. accompanying code and data). - not a true versioning control system ⇒ does not allow you to roll the article back to previous versions. sambaiga Latex 2017 63 / 66
  72. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Collaborative writing models Revision control System 1 Online Payfor : e.g Overleaf and Authorea - often have a free limited plan. - focussed on latex, not the rest (e.g. accompanying code and data). 2 free : standard open source tools eg git. - several option available : Mercurial and git + support both latex and accompanying code and data. + offer control and advanced features like branch and merge. - steeper learning curve. sambaiga Latex 2017 64 / 66
  73. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Collaborative writing models Revision control System 1 Online Payfor : e.g Overleaf and Authorea - often have a free limited plan. - focussed on latex, not the rest (e.g. accompanying code and data). 2 free : standard open source tools eg git. - several option available : Mercurial and git + support both latex and accompanying code and data. + offer control and advanced features like branch and merge. - steeper learning curve. sambaiga Latex 2017 64 / 66
  74. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Collaborative writing models Revision control System 1 Online Payfor : e.g Overleaf and Authorea - often have a free limited plan. - focussed on latex, not the rest (e.g. accompanying code and data). 2 free : standard open source tools eg git. - several option available : Mercurial and git + support both latex and accompanying code and data. + offer control and advanced features like branch and merge. - steeper learning curve. sambaiga Latex 2017 64 / 66
  75. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Collaborative writing models Revision control System 1 Online Payfor : e.g Overleaf and Authorea - often have a free limited plan. - focussed on latex, not the rest (e.g. accompanying code and data). 2 free : standard open source tools eg git. - several option available : Mercurial and git + support both latex and accompanying code and data. + offer control and advanced features like branch and merge. - steeper learning curve. sambaiga Latex 2017 64 / 66
  76. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Collaborative writing models Revision control System 1 Online Payfor : e.g Overleaf and Authorea - often have a free limited plan. - focussed on latex, not the rest (e.g. accompanying code and data). 2 free : standard open source tools eg git. - several option available : Mercurial and git + support both latex and accompanying code and data. + offer control and advanced features like branch and merge. - steeper learning curve. sambaiga Latex 2017 64 / 66
  77. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Collaborative writing models Revision control System 1 Online Payfor : e.g Overleaf and Authorea - often have a free limited plan. - focussed on latex, not the rest (e.g. accompanying code and data). 2 free : standard open source tools eg git. - several option available : Mercurial and git + support both latex and accompanying code and data. + offer control and advanced features like branch and merge. - steeper learning curve. sambaiga Latex 2017 64 / 66
  78. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Collaborative writing models Revision control System 1 Online Payfor : e.g Overleaf and Authorea - often have a free limited plan. - focussed on latex, not the rest (e.g. accompanying code and data). 2 free : standard open source tools eg git. - several option available : Mercurial and git + support both latex and accompanying code and data. + offer control and advanced features like branch and merge. - steeper learning curve. sambaiga Latex 2017 64 / 66
  79. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Collaborative writing models Revision control System 1 Online Payfor : e.g Overleaf and Authorea - often have a free limited plan. - focussed on latex, not the rest (e.g. accompanying code and data). 2 free : standard open source tools eg git. - several option available : Mercurial and git + support both latex and accompanying code and data. + offer control and advanced features like branch and merge. - steeper learning curve. sambaiga Latex 2017 64 / 66
  80. Introduction Latex Command Document Structure Text Formatting Cross-reference Typesetting Mathematics

    Collaborative W Revision (or version) control Features : • Allow you to see all revisions of paper ⇒ e.g. revert back to an old version if you don’t like changes. • Trace activity ⇒ volume also what changed, with comments. • Good for code, LaTeX, and (some) data. Cloud git services : Github, BitBucket,Gitlab. sambaiga Latex 2017 65 / 66