Docsity

Introduction to Latex, Cheat Sheet of Statistics

Toggle sidebar
bg1
Biol/Stat 2244
Property of J. Peter (Western University)
Basics of LaTeX
Purpose of this file
Statistics uses a lot of mathematical notation to represent parameters, estimators, models, etc. Having a
formatting language that can be used across many different file formats to generate the notation is
ideal. LaTeX is such a formatting; this file introduces you to the basic method of using LaTeX.
Basic structure
No matter what type of file format you are going use LaTeX, you have to tell that file that you’re
‘starting’ the LaTeX. This is because LaTeX uses common symbols, like $ or \ or ^ to ‘code’ for
particular mathematical symbols. So, the file needs to “know” when the LaTeX coding for those symbols
beings and ends.
There are two methods to indicate the beginning and ending of LaTeX in a document, with sub-variants
for each. The sub-variants determine whether your LaTeX is to be placed ‘in-line’ (i.e. integrated exactly
where it lies in your document) or centred (i.e. on a new line, in the centre of that line).
Method 1
• In-line:
o start the LaTeX section with \(
o end the LaTeX section with \)
• Centred:
o Start the LaTeX section with \[
o End the LaTeX section with \]
Method 2
• In-line:
o Start the LaTeX section with $
o End the LaTeX section with $
• Centred:
o Start the LaTeX section with $$
o End the LaTeX section with $$
It’s really up to you which ‘method’ you use. In case you’re wondering:
• R Markdown files will recognize both.
• OWL Brightspace recognizes what I’m referring to as Method 1.
• Gradescope only recognizes the use of $$ to start and end (providing no option for in-line vs.
centred; it’s all inline).
pf3

Partial preview of the text

Download Introduction to Latex and more Cheat Sheet Statistics in PDF only on Docsity!

Basics of LaTeX

Purpose of this file

Statistics uses a lot of mathematical notation to represent parameters, estimators, models, etc. Having a formatting language that can be used across many different file formats to generate the notation is ideal. LaTeX is such a formatting; this file introduces you to the basic method of using LaTeX.

Basic structure

No matter what type of file format you are going use LaTeX, you have to tell that file that you’re ‘starting’ the LaTeX. This is because LaTeX uses common symbols, like $ or \ or ^ to ‘code’ for particular mathematical symbols. So, the file needs to “know” when the LaTeX coding for those symbols beings and ends. There are two methods to indicate the beginning and ending of LaTeX in a document, with sub-variants for each. The sub-variants determine whether your LaTeX is to be placed ‘in-line’ (i.e. integrated exactly where it lies in your document) or centred (i.e. on a new line, in the centre of that line). Method 1

  • In-line: o start the LaTeX section with ( o end the LaTeX section with )
  • Centred: o Start the LaTeX section with [ o End the LaTeX section with ] Method 2
  • In-line: o Start the LaTeX section with $ o End the LaTeX section with $
  • Centred: o Start the LaTeX section with $$ o End the LaTeX section with $$ It’s really up to you which ‘method’ you use. In case you’re wondering:
  • R Markdown files will recognize both.
  • OWL Brightspace recognizes what I’m referring to as Method 1.
  • Gradescope only recognizes the use of $$ to start and end (providing no option for in-line vs. centred; it’s all inline).

Common symbols in LaTeX

If you know a symbol or notation, there’s a LaTeX code for it (well, almost). They are a quick Google search away. Generally speaking, a LaTeX code for a symbol will start with a backslash, i.e. \ followed by the ‘name’ of the symbol. For example, if you want the Greek letter, μ, then the symbol is \mu Here’s a quick table of some common “letters” you might encounter in 2244: Symbol LaTeX code μ \mu σ \sigma β \beta α \alpha ϑ \theta χ \chi ρ \rho ε \epsilon And some mark-ups of letters you might find useful: Mark-up LaTeX code Example and result Superscript ^{} X^{ 2 } becomes X^2 Subscript {} (an underscore) X{i=1} becomes Xi= Bar on top of letter \bar{} \bar{x} becomes 𝑥̅ Hat on top of letter \hat{} \hat{x} becomes 𝑥̂ Tilde on top of letter \tilde \tilde{x} because 𝑥̃ Some mathematical symbols that are handy: Symbol LaTeX Code ≤ \leq ≠ \ne ≥ \geq ± \pm

  • (typically used for multiplication) \cdot