class: title-irms # First Steps With `\(\LaTeX\)` ## A Brief and Practical Introduction .authors[ **William Poirier**, Postdoctoral Researcher, IRMS ] .date[ Workshop · November `\(\text{11}^{\text{th}}\)`, 2026 ] --- class: toc-irms # Overview of Contents --- class: section-irms name: fivews # Who? What? Why? When? Where? .nav-label[5-Ws] --- # Who is `\(\LaTeX\)` For? --- # Who is `\(\LaTeX\)` For? .pull-left[ .lead[For anyone who writes stuff!] Not just your nerdy friend. ] .pull-right[ <img src="data:image/png;base64,#img/welcome.gif" width="100%" /> ] --- # What is `\(\LaTeX\)`? .pull-left[ - First release in 1984 -> `\(\LaTeX\)` is 42 years old! - Markup language - Handles typesetting and rendering - Not WYSIWYG ] .pull-right[ <img src="data:image/png;base64,#img/latexsimple.png" width="100%" style="display: block; margin: auto;" /> ] --- # What is `\(\LaTeX\)`? .pull-left[ - First release in 1984 -> `\(\LaTeX\)` is 42 years old! - Markup language - Handles typesetting and rendering - Not WYSIWYG ] .pull-right[ <img src="data:image/png;base64,#img/mrl.png" width="100%" style="display: block; margin: auto;" /> ] --- # Why should you learn about `\(\LaTeX\)`? .pull-left[ 1. Open-source! 2. It's forever! 3. It's beautiful! 4. It's customizable! 5. Referencing! 6. Bibliography! 7. Figures! 8. Tables! 9. Math! ] .pull-right[ ] --- # Why should you learn about `\(\LaTeX\)`? .pull-left[ 1. Open-source! 2. It's forever! 3. It's beautiful! 4. It's customizable! 5. Referencing! 6. Bibliography! 7. Figures! 8. Tables! 9. Math! .lead[If not Word, this is what's being used by your co-author.] ] .pull-right[ <img src="data:image/png;base64,#img/standard.gif" width="100%" style="display: block; margin: auto;" /> ] --- # When is `\(\LaTeX\)` useful? <img src="data:image/png;base64,#img/miktex.gif" width="50%" style="display: block; margin: auto;" /> --- # Where do you use `\(\LaTeX\)`? .pull-left[ <img src="data:image/png;base64,#img/overleaf.png" width="70%" /> .footnote[Overleaf is where a lot of the content from this talk comes from: [Learn LaTeX in 30 minutes](https://www.overleaf.com/learn/latex/Learn_LaTeX_in_30_minutes#What_is_LaTeX?)] <img src="data:image/png;base64,#img/RStudio_logo_flat.svg" width="70%" /> <img src="data:image/png;base64,#img/librepaper-logo.svg" width="70%" /> ] .pull-right[ <img src="data:image/png;base64,#img/overleaflayout.png" width="100%" /> ] --- class: section-irms name: overleaf # Getting Started with Overleaf .nav-label[Overleaf] --- # Getting Started with Overleaf .lead[Visit https://williampo1.github.io/lab/] <img src="data:image/png;base64,#img/git_website.png" width="80%" style="display: block; margin: auto;" /> --- # Getting Started with Overleaf .lead[Visit www.overleaf.com] <img src="data:image/png;base64,#img/start_over_1.png" width="80%" style="display: block; margin: auto;" /> --- # Getting Started with Overleaf <img src="data:image/png;base64,#img/start_over_2.png" width="100%" /> --- # Getting Started with Overleaf <img src="data:image/png;base64,#img/start_over_3.png" width="100%" /> --- # Getting Started with Overleaf <img src="data:image/png;base64,#img/start_over_4.png" width="100%" /> --- # Getting Started with Overleaf <img src="data:image/png;base64,#img/start_over_5.png" width="100%" /> --- # Getting Started with Overleaf <img src="data:image/png;base64,#img/start_over_6.png" width="100%" /> --- class: section-irms name: structure # The Structure of a `\(\LaTeX\)` Document .nav-label[Structure] --- # The Structure of a `\(\LaTeX\)` Document .pull-left[ ] .pull-right[ ``` \documentclass[12pt, letterpaper]{article} \usepackage{graphicx} \usepackage{natbib} \bibliographystyle{apalike} \title{A Very Clever Title} \author{Gaby McCoolFace} \date{\today} \begin{document} \maketitle \begin{abstract} Blablabla... \end{abstract} \section{First Section} \subsection{First Subsection} \bibliography{references.bib} \end{document} ``` ] --- # The Structure of a `\(\LaTeX\)` Document: Preamble .pull-left[ ] .pull-right[ ``` *\documentclass[12pt, letterpaper]{article} *\usepackage{graphicx} *\usepackage{natbib} *\bibliographystyle{apalike} *\title{A Very Clever Title} *\author{Gaby McCoolFace} *\date{\today} \begin{document} \maketitle \begin{abstract} Blablabla... \end{abstract} \section{First Section} \subsection{First Subsection} \bibliography{references.bib} \end{document} ``` ] --- # The Structure of a `\(\LaTeX\)` Document: Preamble .pull-left[ - `\documentclass`: \[options\] ] .pull-right[ ``` *>\documentclass[12pt, letterpaper]{article} *\usepackage{graphicx} *\usepackage{natbib} *\bibliographystyle{apalike} *\title{A Very Clever Title} *\author{Gaby McCoolFace} *\date{\today} \begin{document} \maketitle \begin{abstract} Blablabla... \end{abstract} \section{First Section} \subsection{First Subsection} \bibliography{references.bib} \end{document} ``` ] --- # The Structure of a `\(\LaTeX\)` Document: Preamble .pull-left[ - `\documentclass`: \[options\] - Font size: `10pt`, `11pt`, `12pt` ] .pull-right[ ``` *>\documentclass[@@12pt@@, letterpaper]{article} *\usepackage{graphicx} *\usepackage{natbib} *\bibliographystyle{apalike} *\title{A Very Clever Title} *\author{Gaby McCoolFace} *\date{\today} \begin{document} \maketitle \begin{abstract} Blablabla... \end{abstract} \section{First Section} \subsection{First Subsection} \bibliography{references.bib} \end{document} ``` ] --- # The Structure of a `\(\LaTeX\)` Document: Preamble .pull-left[ - `\documentclass`: \[options\] - Font size: `10pt`, `11pt`, `12pt` - Paper size: `letterpaper`, `a4paper` ] .pull-right[ ``` *>\documentclass[12pt, @@letterpaper@@]{article} *\usepackage{graphicx} *\usepackage{natbib} *\bibliographystyle{apalike} *\title{A Very Clever Title} *\author{Gaby McCoolFace} *\date{\today} \begin{document} \maketitle \begin{abstract} Blablabla... \end{abstract} \section{First Section} \subsection{First Subsection} \bibliography{references.bib} \end{document} ``` ] --- # The Structure of a `\(\LaTeX\)` Document: Preamble .pull-left[ - `\documentclass`: \[options\] - Font size: `10pt`, `11pt`, `12pt` - Paper size: `letterpaper`, `a4paper` - Columns: `onecolumn`, `twocolumn` - Orientation: `portrait`, `landscape` ] .pull-right[ ``` *>\documentclass[12pt, letterpaper]{article} *\usepackage{graphicx} *\usepackage{natbib} *\bibliographystyle{apalike} *\title{A Very Clever Title} *\author{Gaby McCoolFace} *\date{\today} \begin{document} \maketitle \begin{abstract} Blablabla... \end{abstract} \section{First Section} \subsection{First Subsection} \bibliography{references.bib} \end{document} ``` ] --- # The Structure of a `\(\LaTeX\)` Document: Preamble .pull-left[ - `\documentclass`: \[options\] - Font size: `10pt`, `11pt`, `12pt` - Paper size: `letterpaper`, `a4paper` - Columns: `onecolumn`, `twocolumn` - Orientation: `portrait`, `landscape` - `\documentclass`: \{class\} - `article`, `book`, `report` ] .pull-right[ ``` *>\documentclass[12pt, letterpaper]{@@article@@} *\usepackage{graphicx} *\usepackage{natbib} *\bibliographystyle{apalike} *\title{A Very Clever Title} *\author{Gaby McCoolFace} *\date{\today} \begin{document} \maketitle \begin{abstract} Blablabla... \end{abstract} \section{First Section} \subsection{First Subsection} \bibliography{references.bib} \end{document} ``` ] --- # The Structure of a `\(\LaTeX\)` Document: Preamble .pull-left[ - `\documentclass`: \[options\] - Font size: `10pt`, `11pt`, `12pt` - Paper size: `letterpaper`, `a4paper` - Columns: `onecolumn`, `twocolumn` - Orientation: `portrait`, `landscape` - `\documentclass`: \{class\} - `article`, `book`, `report` - Packages: `\usepackage` ] .pull-right[ ``` *\documentclass[12pt, letterpaper]{article} *>\usepackage{graphicx} %for figures *>\usepackage{natbib} %for bibliography *\bibliographystyle{apalike} *\title{A Very Clever Title} *\author{Gaby McCoolFace} *\date{\today} \begin{document} \maketitle \begin{abstract} Blablabla... \end{abstract} \section{First Section} \subsection{First Subsection} \bibliography{references.bib} \end{document} ``` ] --- # The Structure of a `\(\LaTeX\)` Document: Preamble .pull-left[ - `\documentclass`: \[options\] - Font size: `10pt`, `11pt`, `12pt` - Paper size: `letterpaper`, `a4paper` - Columns: `onecolumn`, `twocolumn` - Orientation: `portrait`, `landscape` - `\documentclass`: \{class\} - `article`, `book`, `report` - Packages: `\usepackage` - Add infinite features. ] .pull-right[ ``` *\documentclass[12pt, letterpaper]{article} *>\usepackage{graphicx} %for figures *>\usepackage{natbib} %for bibliography *@@\bibliographystyle{apalike}@@ *\title{A Very Clever Title} *\author{Gaby McCoolFace} *\date{\today} \begin{document} \maketitle \begin{abstract} Blablabla... \end{abstract} \section{First Section} \subsection{First Subsection} *@@\bibliography{references.bib}@@ \end{document} ``` ] --- # The Structure of a `\(\LaTeX\)` Document: Preamble .pull-left[ - `\documentclass`: \[options\] - Font size: `10pt`, `11pt`, `12pt` - Paper size: `letterpaper`, `a4paper` - Columns: `onecolumn`, `twocolumn` - Orientation: `portrait`, `landscape` - `\documentclass`: \{class\} - `article`, `book`, `report` - Packages: `\usepackage` - Add infinite features. - Document metadata: - `\title`, `\author`, `\date` ] .pull-right[ ``` *\documentclass[12pt, letterpaper]{article} *\usepackage{graphicx} %for figures *\usepackage{natbib} %for bibliography *\bibliographystyle{apalike} *>\title{A Very Clever Title} *>\author{Gaby McCoolFace} *>\date{\today} \begin{document} \maketitle \begin{abstract} Blablabla... \end{abstract} \section{First Section} \subsection{First Subsection} \bibliography{references.bib} \end{document} ``` ] --- # The Structure of a `\(\LaTeX\)` Document: Preamble .pull-left[ - `\documentclass`: \[options\] - Font size: `10pt`, `11pt`, `12pt` - Paper size: `letterpaper`, `a4paper` - Columns: `onecolumn`, `twocolumn` - Orientation: `portrait`, `landscape` - `\documentclass`: \{class\} - `article`, `book`, `report` - Packages: `\usepackage` - Add infinite features. - Document metadata: - `\title`, `\author`, `\date` - `\today`: updates on each compilation ] .pull-right[ ``` *\documentclass[12pt, letterpaper]{article} *\usepackage{graphicx} %for figures *\usepackage{natbib} %for bibliography *\bibliographystyle{apalike} *>\title{A Very Clever Title} *>\author{Gaby McCoolFace} *>\date{@@\today@@} \begin{document} \maketitle \begin{abstract} Blablabla... \end{abstract} \section{First Section} \subsection{First Subsection} \bibliography{references.bib} \end{document} ``` ] --- # The Structure of a `\(\LaTeX\)` Document: Body .pull-left[ ] .pull-right[ ``` \documentclass[12pt, letterpaper]{article} \usepackage{graphicx} %for figures \usepackage{natbib} %for bibliography \bibliographystyle{apalike} \title{A Very Clever Title} \author{Gaby McCoolFace} \date{\today} *\begin{document} *\maketitle *\begin{abstract} *Blablabla... *\end{abstract} *\section{First Section} *\subsection{First Subsection} *\bibliography{references.bib} *\end{document} ``` ] --- # The Structure of a `\(\LaTeX\)` Document: Body .pull-left[ ] .pull-right[ ``` \documentclass[12pt, letterpaper]{article} \usepackage{graphicx} %for figures \usepackage{natbib} %for bibliography \bibliographystyle{apalike} \title{A Very Clever Title} \author{Gaby McCoolFace} \date{\today} *@@\begin{document}@@ *\maketitle *\begin{abstract} *Blablabla... *\end{abstract} *\section{First Section} *\subsection{First Subsection} *\bibliography{references.bib} *@@\end{document}@@ ``` ] --- # The Structure of a `\(\LaTeX\)` Document: Body .pull-left[ - `\begin{...}`, `\end{...}`: core structure of `\(\LaTeX\)` ] .pull-right[ ``` \documentclass[12pt, letterpaper]{article} \usepackage{graphicx} %for figures \usepackage{natbib} %for bibliography \bibliographystyle{apalike} \title{A Very Clever Title} \author{Gaby McCoolFace} \date{\today} *@@\begin{document}@@ *\maketitle *\begin{abstract} *Blablabla... *\end{abstract} *\section{First Section} *\subsection{First Subsection} *\bibliography{references.bib} *@@\end{document}@@ ``` ] --- # The Structure of a `\(\LaTeX\)` Document: Body .pull-left[ - `\begin{...}`, `\end{...}`: core structure of `\(\LaTeX\)` ] .pull-right[ ``` \documentclass[12pt, letterpaper]{article} \usepackage{graphicx} %for figures \usepackage{natbib} %for bibliography \bibliographystyle{apalike} \title{A Very Clever Title} \author{Gaby McCoolFace} \date{\today} *@@\begin{document}@@ *\maketitle *@@\begin{abstract}@@ *Blablabla... *@@\end{abstract}@@ *\section{First Section} *\subsection{First Subsection} *\bibliography{references.bib} *@@\end{document}@@ ``` ] --- # The Structure of a `\(\LaTeX\)` Document: Body .pull-left[ - `\begin{...}`, `\end{...}`: core structure of `\(\LaTeX\)` - `\maketitle` points to `\title{}` ] .pull-right[ ``` \documentclass[12pt, letterpaper]{article} \usepackage{graphicx} %for figures \usepackage{natbib} %for bibliography \bibliographystyle{apalike} *\title{A Very Clever Title} \author{Gaby McCoolFace} \date{\today} *\begin{document} *@@\maketitle@@ *\begin{abstract} *Blablabla... *\end{abstract} *\section{First Section} *\subsection{First Subsection} *\bibliography{references.bib} *\end{document} ``` ] --- # The Structure of a `\(\LaTeX\)` Document: Body .pull-left[ - `\begin{...}`, `\end{...}`: core structure of `\(\LaTeX\)` - `\maketitle` points to `\title{}` - Sectioning hierarchy: - `\part` - `\chapter`: only in `book` and `report` class - `\section` - `\subsection` - `\subsubsection` - `\paragraph` - `\subparagraph` ] .pull-right[ ``` \documentclass[12pt, letterpaper]{@@article@@} \usepackage{graphicx} %for figures \usepackage{natbib} %for bibliography \bibliographystyle{apalike} *\title{A Very Clever Title} \author{Gaby McCoolFace} \date{\today} *\begin{document} *\maketitle *\begin{abstract} *Blablabla... *\end{abstract} *>\section{First Section} *>\subsection{First Subsection} *\bibliography{references.bib} *\end{document} ``` ] --- class: inverse # The Structure of a `\(\LaTeX\)` Document: Exercise .pull-left[ - In `working.tex` - Add: - `fontenc` and `inputenc` packages - Allows accented characters in input and output - Change: - Title - Author ] .pull-right[ ``` \documentclass[12pt, letterpaper]{article} \usepackage{graphicx} %for figures \usepackage{natbib} %for bibliography \bibliographystyle{apalike} *\usepackage[T1]{fontenc} *\usepackage[utf8]{inputenc} *\title{@@A Very Clever Title@@} *\author{@@Gaby McCoolFace@@} \date{\today} \begin{document} ... \end{document} ``` ] --- class: section-irms name: commands # Basic Commands .nav-label[Commands] --- # Basic Commands: Special Characters .pull-left[ ] .pull-right[ ``` ... \newcommand{\scc}[1]{\textbf{Super~Cool~Cat}~#1} ... \section{Introduction} % Find a citation for this Dr.~Dolittle says that $80\%$ of people who don't like cats are not cool. As cat's \#1 fan, I donate \$1 every $2^{nd}$ Monday of each month to the \scc{Foundation}. ... ``` <img src="data:image/png;base64,#img/special1.png" width="100%" /> ] --- # Basic Commands: Special Characters .pull-left[ - `@@#@@`: define macros/placeholders (you won't need it) ] .pull-right[ ``` ... \newcommand{\scc}[1]{\textbf{Super~Cool~Cat}~@@#1@@} ... \section{Introduction} % Find a citation for this Dr.~Dolittle says that $80\%$ of people who don't like cats are not cool. As cat's \#1 fan, I donate \$1 every $2^{nd}$ Monday of each month to the \scc{@@Foundation@@}. ... ``` <img src="data:image/png;base64,#img/special2.png" width="100%" /> ] --- # Basic Commands: Special Characters .pull-left[ - `#`: define macros/placeholders (you won't need it) - `@@$@@`: math mode ] .pull-right[ ``` ... \newcommand{\scc}[1]{\textbf{Super~Cool~Cat}~#1} ... \section{Introduction} % Find a citation for this Dr.~Dolittle says that @@$@@80\%@@$@@ of people who don't like cats are not cool. As cat's \#1 fan, I donate \$1 every @@$@@2^{nd}@@$@@ Monday of each month to the \scc{Foundation}. ... ``` <img src="data:image/png;base64,#img/special3.png" width="100%" /> ] --- # Basic Commands: Special Characters .pull-left[ - `#`: define macros/placeholders (you won't need it) - `$`: math mode - `@@%@@`: comment ] .pull-right[ ``` ... \newcommand{\scc}[1]{\textbf{Super~Cool~Cat}~#1} ... \section{Introduction} @@%@@ Find a citation for this Dr.~Dolittle says that $80\%$ of people who don't like cats are not cool. As cat's \#1 fan, I donate \$1 every $2^{nd}$ Monday of each month to the \scc{Foundation}. ... ``` <img src="data:image/png;base64,#img/special4.png" width="100%" /> ] --- # Basic Commands: Special Characters .pull-left[ - `#`: define macros/placeholders (you won't need it) - `$`: math mode - `%`: comment - `@@_@@`: subscripts - `@@^@@`: superscripts ] .pull-right[ ``` ... \newcommand{\scc}[1]{\textbf{Super~Cool~Cat}~#1} ... \section{Introduction} % Find a citation for this Dr.~Dolittle says that $80\%$ of people who don't like cats are not cool. As cat's \#1 fan, I donate \$1 every $2@@^@@{nd}$ Monday of each month to the \scc{Foundation}. ... ``` <img src="data:image/png;base64,#img/special5.png" width="100%" /> ] --- # Basic Commands: Special Characters .pull-left[ - `#`: define macros/placeholders (you won't need it) - `$`: math mode - `%`: comment - `_`: subscripts - `^`: superscripts - `@@{}@@`: open and close a command argument ] .pull-right[ ``` ... \newcommand@@{\scc}@@[1]@@{@@\textbf@@{@@Super~Cool~Cat@@}@@~#1@@}@@ ... \section@@{@@Introduction@@}@@ % Find a citation for this Dr.~Dolittle says that $80\%$ of people who don't like cats are not cool. As cat's \#1 fan, I donate \$1 every $2^@@{@@nd@@}@@$ Monday of each month to the \scc@@{@@Foundation@@}@@. ... ``` <img src="data:image/png;base64,#img/special6.png" width="100%" /> ] --- # Basic Commands: Special Characters .pull-left[ - `#`: define macros/placeholders (you won't need it) - `$`: math mode - `%`: comment - `_`: subscripts - `^`: superscripts - `{}`: open and close a command argument - `@@~@@`: non-breaking space (**espace insécable**) ] .pull-right[ ``` ... \newcommand{\scc}[1]{\textbf{Super@@~@@Cool@@~@@Cat}@@~@@#1} ... \section{Introduction} % Find a citation for this Dr.@@~@@Dolittle says that $80\%$ of people who don't like cats are not cool. As cat's \#1 fan, I donate \$1 every $2^{nd}$ Monday of each month to the \scc{Foundation}. ... ``` <img src="data:image/png;base64,#img/special7.png" width="100%" /> ] --- # Basic Commands: Special Characters .pull-left[ - `#`: define macros/placeholders (you won't need it) - `$`: math mode - `%`: comment - `_`: subscripts - `^`: superscripts - `{}`: open and close a command argument - `~`: non-breaking space (**espace insécable**) - `&`: separate columns in tables ] .pull-right[ ``` ... \newcommand{\scc}[1]{\textbf{Super~Cool~Cat}~#1} ... \section{Introduction} % Find a citation for this Dr.~Dolittle says that $80\%$ of people who don't like cats are not cool. As cat's \#1 fan, I donate \$1 every $2^{nd}$ Monday of each month to the \scc{Foundation}. ... ``` <img src="data:image/png;base64,#img/special8.png" width="100%" /> ] --- # Basic Commands: Special Characters .pull-left[ - `#`: define macros/placeholders (you won't need it) - `$`: math mode - `%`: comment - `_`: subscripts - `^`: superscripts - `{}`: open and close a command argument - `~`: non-breaking space (**espace insécable**) - `&`: separate columns in tables - `@@\@@`: escape character ] .pull-right[ ``` ... @@\@@newcommand{@@\@@scc}[1]{@@\@@textbf{Super~Cool~Cat}~#1} ... @@\@@section{Introduction} % Find a citation for this Dr.~Dolittle says that $80@@\@@%$ of people who don't like cats are not cool. As cat's @@\@@#1 fan, I donate @@\@@$1 every $2^{nd}$ Monday of each month to the @@\@@scc{Foundation}. ... ``` <img src="data:image/png;base64,#img/special9.png" width="100%" /> ] --- # Basic Commands: Functions .pull-left[ ] .pull-right[ ``` ... \section{Introduction}\label{bananasplit} ... \section{Theory} \citet{adcock2001measurement} would call this \textbf{bad measurement}\footnote{And they would be \textit{right}.}, because \texttt{catCoolness} is \underline{not} observable. The argument in Section~\ref{bananasplit} stretches the concept well past breaking \citep{sartori1970concept}. ... ``` <img src="data:image/png;base64,#img/func1.png" width="100%" /> <img src="data:image/png;base64,#img/funcfoot1.png" width="100%" /> ] --- # Basic Commands: Functions .pull-left[ - Text formatting: - **Bold**: `\textbf` ] .pull-right[ ``` ... \section{Introduction}\label{bananasplit} ... \section{Theory} \citet{adcock2001measurement} would call this @@\textbf{bad measurement}@@\footnote{And they would be \textit{right}.}, because \texttt{catCoolness} is \underline{not} observable. The argument in Section~\ref{bananasplit} stretches the concept well past breaking \citep{sartori1970concept}. ... ``` <img src="data:image/png;base64,#img/func2.png" width="100%" /> <img src="data:image/png;base64,#img/funcfoot1.png" width="100%" /> ] --- # Basic Commands: Functions .pull-left[ - Text formatting: - **Bold**: `\textbf` - *Italic*: `\textit` ] .pull-right[ ``` ... \section{Introduction}\label{bananasplit} ... \section{Theory} \citet{adcock2001measurement} would call this \textbf{bad measurement}\footnote{And they would be @@\textit{right}@@.}, because \texttt{catCoolness} is \underline{not} observable. The argument in Section~\ref{bananasplit} stretches the concept well past breaking \citep{sartori1970concept}. ... ``` <img src="data:image/png;base64,#img/func1.png" width="100%" /> <img src="data:image/png;base64,#img/funcfoot2.png" width="100%" /> ] --- # Basic Commands: Functions .pull-left[ - Text formatting: - **Bold**: `\textbf` - *Italic*: `\textit` - .underline[Underline]: `\underline` ] .pull-right[ ``` ... \section{Introduction}\label{bananasplit} ... \section{Theory} \citet{adcock2001measurement} would call this \textbf{bad measurement}\footnote{And they would be \textit{right}.}, because \texttt{catCoolness} is @@\underline{not}@@ observable. The argument in Section~\ref{bananasplit} stretches the concept well past breaking \citep{sartori1970concept}. ... ``` <img src="data:image/png;base64,#img/func3.png" width="100%" /> <img src="data:image/png;base64,#img/funcfoot1.png" width="100%" /> ] --- # Basic Commands: Functions .pull-left[ - Text formatting: - **Bold**: `\textbf` - *Italic*: `\textit` - .underline[Underline]:`\underline` - .tt[Typewriter]:`\texttt` ] .pull-right[ ``` ... \section{Introduction}\label{bananasplit} ... \section{Theory} \citet{adcock2001measurement} would call this \textbf{bad measurement}\footnote{And they would be \textit{right}.}, because @@\texttt{catCoolness}@@ is \underline{not} observable. The argument in Section~\ref{bananasplit} stretches the concept well past breaking \citep{sartori1970concept}. ... ``` <img src="data:image/png;base64,#img/func4.png" width="100%" /> <img src="data:image/png;base64,#img/funcfoot1.png" width="100%" /> ] --- # Basic Commands: Functions .pull-left[ - Text formatting: - **Bold**: `\textbf` - *Italic*: `\textit` - .underline[Underline]:`\underline` - .tt[Typewriter]:`\texttt` - Sectioning: `\section`, `\subsection`, etc. ] .pull-right[ ``` ... @@\section{Introduction}@@\label{bananasplit} ... @@\section{Theory}@@ \citet{adcock2001measurement} would call this \textbf{bad measurement}\footnote{And they would be \textit{right}.}, because \texttt{catCoolness} is \underline{not} observable. The argument in Section~\ref{bananasplit} stretches the concept well past breaking \citep{sartori1970concept}. ... ``` <img src="data:image/png;base64,#img/func5.png" width="100%" /> <img src="data:image/png;base64,#img/funcfoot1.png" width="100%" /> ] --- # Basic Commands: Functions .pull-left[ - Text formatting: - **Bold**: `\textbf` - *Italic*: `\textit` - .underline[Underline]:`\underline` - .tt[Typewriter]:`\texttt` - Sectioning: `\section`, `\subsection`, etc. - Footnotes: `\footnote`, `\endnote` ] .pull-right[ ``` ... \section{Introduction}\label{bananasplit} ... \section{Theory} \citet{adcock2001measurement} would call this \textbf{bad measurement}@@\footnote{And they@@ @@would be \textit{right}.}@@, because \texttt{catCoolness} is \underline{not} observable. The argument in Section~\ref{bananasplit} stretches the concept well past breaking \citep{sartori1970concept}. ... ``` <img src="data:image/png;base64,#img/func6.png" width="100%" /> <img src="data:image/png;base64,#img/funcfoot3.png" width="100%" /> ] --- # Basic Commands: Functions .pull-left[ - Text formatting: - **Bold**: `\textbf` - *Italic*: `\textit` - .underline[Underline]:`\underline` - .tt[Typewriter]:`\texttt` - Sectioning: `\section`, `\subsection`, etc. - Footnotes: `\footnote`, `\endnote` - Referencing: `\label`, `\ref` ] .pull-right[ ``` ... \section{Introduction}@@\label{bananasplit}@@ ... \section{Theory} \citet{adcock2001measurement} would call this \textbf{bad measurement}\footnote{And they would be \textit{right}.}, because \texttt{catCoolness} is \underline{not} observable. The argument in Section~@@\ref{bananasplit}@@ stretches the concept well past breaking \citep{sartori1970concept}. ... ``` <img src="data:image/png;base64,#img/func7.png" width="100%" /> <img src="data:image/png;base64,#img/funcfoot1.png" width="100%" /> ] --- # Basic Commands: Functions .pull-left[ - Text formatting: - **Bold**: `\textbf` - *Italic*: `\textit` - .underline[Underline]:`\underline` - .tt[Typewriter]:`\texttt` - Sectioning: `\section`, `\subsection`, etc. - Footnotes: `\footnote`, `\endnote` - Referencing: `\label`, `\ref` - Citations: `\citep`, `\citet`, etc. - Specific to `natbib` ] .pull-right[ ``` ... \section{Introduction}\label{bananasplit} ... \section{Theory} \citet{adcock2001measurement} would call this \textbf{bad measurement}\footnote{And they would be \textit{right}.}, because \texttt{catCoolness} is \underline{not} observable. The argument in Section~\ref{bananasplit} stretches the concept well past breaking @@\citep{sartori1970concept}@@. ... ``` <img src="data:image/png;base64,#img/func8.png" width="100%" /> <img src="data:image/png;base64,#img/funcfoot1.png" width="100%" /> ] --- # Basic Commands: Functions .pull-left[ - Text formatting: - **Bold**: `\textbf` - *Italic*: `\textit` - .underline[Underline]:`\underline` - .tt[Typewriter]:`\texttt` - Sectioning: `\section`, `\subsection`, etc. - Footnotes: `\footnote`, `\endnote` - Referencing: `\label`, `\ref` - Citations: `\citep`, `\citet`, etc. - Specific to `natbib` ] .pull-right[ ``` ... \section{Introduction}\label{bananasplit} ... \section{Theory} @@\citet{adcock2001measurement}@@ would call this \textbf{bad measurement}\footnote{And they would be \textit{right}.}, because \texttt{catCoolness} is \underline{not} observable. The argument in Section~\ref{bananasplit} stretches the concept well past breaking \citep{sartori1970concept}. ... ``` <img src="data:image/png;base64,#img/func9.png" width="100%" /> <img src="data:image/png;base64,#img/funcfoot1.png" width="100%" /> ] --- # Basic Commands: Environments .pull-left[ <img src="data:image/png;base64,#img/env_fl.png" width="100%" /> ] .pull-right[ ``` ... \section{Data \& Methods} \begin{center} We conduct a survey among $2{,}000$ Canadian adults regarding their attitudes towards cats. Specifically, we collect information on attitudes towards: \end{center} \begin{enumerate} \item Dogs \item Birds \item Reptiles \end{enumerate} We test the following hypotheses: \begin{itemize} \item H1: Cat lovers are more likely to not like dogs. \item H2: Cat lovers are more likely to own a cat. \end{itemize} ``` ] --- # Basic Commands: Environments ?? .pull-left[ <img src="data:image/png;base64,#img/env_fl.png" width="100%" /> ] .pull-right[ ``` ... \section{Data @@\&@@ Methods} \begin{center} We conduct a survey among $2{,}000$ Canadian adults regarding their attitudes towards cats. Specifically, we collect information on attitudes towards: \end{center} \begin{enumerate} \item Dogs \item Birds \item Reptiles \end{enumerate} We test the following hypotheses: \begin{itemize} \item H1: Cat lovers are more likely to not like dogs. \item H2: Cat lovers are more likely to own a cat. \end{itemize} ``` ] --- # Basic Commands: Environments .pull-left[ <img src="data:image/png;base64,#img/env_ctr.png" width="100%" /> - Text alignment: `center` ] .pull-right[ ``` ... \section{Data \& Methods} @@\begin{center}@@ We conduct a survey among $2{,}000$ Canadian adults regarding their attitudes towards cats. Specifically, we collect information on attitudes towards: @@\end{center}@@ \begin{enumerate} \item Dogs \item Birds \item Reptiles \end{enumerate} We test the following hypotheses: \begin{itemize} \item H1: Cat lovers are more likely to not like dogs. \item H2: Cat lovers are more likely to own a cat. \end{itemize} ``` ] --- # Basic Commands: Environments .pull-left[ <img src="data:image/png;base64,#img/env_fr.png" width="100%" /> - Text alignment: `center`, `flushright` ] .pull-right[ ``` ... \section{Data \& Methods} @@\begin{flushright}@@ We conduct a survey among $2{,}000$ Canadian adults regarding their attitudes towards cats. Specifically, we collect information on attitudes towards: @@\end{flushright}@@ \begin{enumerate} \item Dogs \item Birds \item Reptiles \end{enumerate} We test the following hypotheses: \begin{itemize} \item H1: Cat lovers are more likely to not like dogs. \item H2: Cat lovers are more likely to own a cat. \end{itemize} ``` ] --- # Basic Commands: Environments .pull-left[ <img src="data:image/png;base64,#img/env_fl_high.png" width="100%" /> - Text alignment: `center`, `flushright`, `flushleft` ] .pull-right[ ``` ... \section{Data \& Methods} @@\begin{flushleft}@@ We conduct a survey among $2{,}000$ Canadian adults regarding their attitudes towards cats. Specifically, we collect information on attitudes towards: @@\end{flushleft}@@ \begin{enumerate} \item Dogs \item Birds \item Reptiles \end{enumerate} We test the following hypotheses: \begin{itemize} \item H1: Cat lovers are more likely to not like dogs. \item H2: Cat lovers are more likely to own a cat. \end{itemize} ``` ] --- # Basic Commands: Environments .pull-left[ <img src="data:image/png;base64,#img/env_enum.png" width="100%" /> - Text alignment: `center`, `flushright`, `flushleft` - List: `enumerate` ] .pull-right[ ``` ... \section{Data \& Methods} \begin{flushleft} We conduct a survey among $2{,}000$ Canadian adults regarding their attitudes towards cats. Specifically, we collect information on attitudes towards: \end{flushleft} @@\begin{enumerate}@@ \item Dogs \item Birds \item Reptiles @@\end{enumerate}@@ We test the following hypotheses: \begin{itemize} \item H1: Cat lovers are more likely to not like dogs. \item H2: Cat lovers are more likely to own a cat. \end{itemize} ``` ] --- # Basic Commands: Environments .pull-left[ <img src="data:image/png;base64,#img/env_item.png" width="100%" /> - Text alignment: `center`, `flushright`, `flushleft` - List: `enumerate`, `itemize` ] .pull-right[ ``` ... \section{Data \& Methods} \begin{flushleft} We conduct a survey among $2{,}000$ Canadian adults regarding their attitudes towards cats. Specifically, we collect information on attitudes towards: \end{flushleft} \begin{enumerate} \item Dogs \item Birds \item Reptiles \end{enumerate} We test the following hypotheses: @@\begin{itemize}@@ \item H1: Cat lovers are more likely to not like dogs. \item H2: Cat lovers are more likely to own a cat. @@\end{itemize}@@ ``` ] --- # Basic Commands: Environments .pull-left[ <img src="data:image/png;base64,#img/env_descrip.png" width="100%" /> - Text alignment: `center`, `flushright`, `flushleft` - List: `enumerate`, `itemize`, `description` ] .pull-right[ ``` ... \section{Data \& Methods} \begin{flushleft} We conduct a survey among $2{,}000$ Canadian adults regarding their attitudes towards cats. Specifically, we collect information on attitudes towards: \end{flushleft} \begin{enumerate} \item Dogs \item Birds \item Reptiles \end{enumerate} We test the following hypotheses: @@\begin{description}@@ \item H1: Cat lovers are more likely to not like dogs. \item H2: Cat lovers are more likely to own a cat. @@\end{description}@@ ``` ] --- class: inverse # Basic Commands: Exercise .pull-left[ - In `working.tex` - Replace the highlighted text with 3 sections - Name them: Introduction, Theory, Methods - Write something in **bold** in the introduction. - Write 3 hypotheses in the theory section under some sort of list. ] .pull-right[ ``` \documentclass[12pt, letterpaper]{article} \usepackage{graphicx} %for figures \usepackage{natbib} %for bibliography \bibliographystyle{apalike} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \title{A Very Clever Title} \author{Gaby McCoolFace} \date{\today} \begin{document} *\section{First Section} *\subsection{First Subsection} \end{document} ``` ] --- class: section-irms name: objects # Special Objects: ## Figures, Tables & Equations .nav-label[Objects] --- # Special Objects: Figures .pull-left[ ``` ... \section{Results} \begin{figure}[h] \centering \includegraphics[width=\textwidth]{fig/cat_health.pdf} \caption{\textbf{Cats Improve Health Outcomes Among Cat Lovers.} But too many cats has a negative effect on health outcomes. Smoothed curve fitted with \texttt{LOESS}. Data from Canada, $n=2{,}000$.} \label{fig:cats} \end{figure} ``` ] .pull-right[ <img src="data:image/png;base64,#img/cat_fig_ltx.png" width="100%" /> ] --- # Special Objects: Figures .pull-left[ ``` ... \section{Results} @@\begin{figure}[h]@@ \centering \includegraphics[width=\textwidth]{fig/cat_health.pdf} \caption{\textbf{Cats Improve Health Outcomes Among Cat Lovers.} But too many cats has a negative effect on health outcomes. Smoothed curve fitted with \texttt{LOESS}. Data from Canada, $n=2{,}000$.} \label{fig:cats} @@\end{figure}@@ ``` - Initialize figure environment: - `h`: a suggestion - `H`: force placement (`\usepackage{float}`) ] .pull-right[ <img src="data:image/png;base64,#img/cat_fig_ltx.png" width="100%" /> ] --- # Special Objects: Figures .pull-left[ ``` ... \section{Results} \begin{figure}[h] \centering *\includegraphics[width=\textwidth]{fig/cat_health.pdf} \caption{\textbf{Cats Improve Health Outcomes Among Cat Lovers.} But too many cats has a negative effect on health outcomes. Smoothed curve fitted with \texttt{LOESS}. Data from Canada, $n=2{,}000$.} \label{fig:cats} \end{figure} ``` - Initialize figure environment: - `h`: a suggestion - `H`: force placement (`\usepackage{float}`) - Import figure ] .pull-right[ <img src="data:image/png;base64,#img/cat_fig_ltx.png" width="100%" /> ] --- # Special Objects: Figures .pull-left[ ``` ... \section{Results} \begin{figure}[h] \centering *@@\includegraphics@@[width=\textwidth]{fig/cat_health.pdf} \caption{\textbf{Cats Improve Health Outcomes Among Cat Lovers.} But too many cats has a negative effect on health outcomes. Smoothed curve fitted with \texttt{LOESS}. Data from Canada, $n=2{,}000$.} \label{fig:cats} \end{figure} ``` - Initialize figure environment: - `h`: a suggestion - `H`: force placement (`\usepackage{float}`) - Import figure ] .pull-right[ <img src="data:image/png;base64,#img/cat_fig_ltx.png" width="100%" /> ] --- # Special Objects: Figures .pull-left[ ``` ... \section{Results} \begin{figure}[h] \centering *\includegraphics[@@width=\textwidth@@]{fig/cat_health.pdf} \caption{\textbf{Cats Improve Health Outcomes Among Cat Lovers.} But too many cats has a negative effect on health outcomes. Smoothed curve fitted with \texttt{LOESS}. Data from Canada, $n=2{,}000$.} \label{fig:cats} \end{figure} ``` - Initialize figure environment: - `h`: a suggestion - `H`: force placement (`\usepackage{float}`) - Import figure ] .pull-right[ <img src="data:image/png;base64,#img/cat_fig_ltx.png" width="100%" /> ] --- # Special Objects: Figures .pull-left[ ``` ... \section{Results} \begin{figure}[h] @@\centering@@ *\includegraphics[width=@@0.5@@\textwidth]{fig/cat_health.pdf} \caption{\textbf{Cats Improve Health Outcomes Among Cat Lovers.} But too many cats has a negative effect on health outcomes. Smoothed curve fitted with \texttt{LOESS}. Data from Canada, $n=2{,}000$.} \label{fig:cats} \end{figure} ``` - Initialize figure environment: - `h`: a suggestion - `H`: force placement (`\usepackage{float}`) - Import figure ] .pull-right[ <img src="data:image/png;base64,#img/cat_fig_ltx_half.png" width="100%" /> ] --- # Special Objects: Figures .pull-left[ ``` ... \section{Results} \begin{figure}[h] \centering \includegraphics[width=\textwidth]{@@fig/cat_health.pdf@@} \caption{\textbf{Cats Improve Health Outcomes Among Cat Lovers.} But too many cats has a negative effect on health outcomes. Smoothed curve fitted with \texttt{LOESS}. Data from Canada, $n=2{,}000$.} \label{fig:cats} \end{figure} ``` - Initialize figure environment: - `h`: a suggestion - `H`: force placement (`\usepackage{float}`) - Import figure ] .pull-right[ <img src="data:image/png;base64,#img/cat_fig_ltx.png" width="100%" /> ] --- # Special Objects: Figures .pull-left[ ``` ... \section{Results} \begin{figure}[h] \centering \includegraphics[width=\textwidth]{fig/cat_health.pdf} *\caption{\textbf{Cats Improve Health Outcomes Among *Cat Lovers.} But too many cats has a negative *effect on health outcomes. Smoothed curve fitted *with \texttt{LOESS}. Data from Canada, $n=2{,}000$.} \label{fig:cats} \end{figure} ``` - Initialize figure environment: - `h`: a suggestion - `H`: force placement (`\usepackage{float}`) - Import figure - Add a note ] .pull-right[ <img src="data:image/png;base64,#img/cat_fig_ltx2.png" width="100%" /> ] --- # Special Objects: Figures .pull-left[ ``` ... \section{Results} \begin{figure}[h] \centering \includegraphics[width=\textwidth]{fig/cat_health.pdf} \caption{\textbf{Cats Improve Health Outcomes Among Cat Lovers.} But too many cats has a negative effect on health outcomes. Smoothed curve fitted with \texttt{LOESS}. Data from Canada, $n=2{,}000$.} @@\label{fig:cats}@@ \end{figure} ``` - Initialize figure environment: - `h`: a suggestion - `H`: force placement (`\usepackage{float}`) - Import figure - Add a note - Identify for future reference ] .pull-right[ <img src="data:image/png;base64,#img/cat_fig_ltx.png" width="100%" /> ] --- # Special Objects: Tables .pull-left[ ] .pull-right[ ``` \begin{center} \begin{tabular}{crr} Type & Number & Percent \\ \hline Cat & 1870 & 93.5\% \\ Dog & 100 & 5.0\% \\ Bird & 30 & 1.5\% \\ \hline Total & 2000 & 100\% \end{tabular} \end{center} ``` <img src="data:image/png;base64,#img/tbl.png" width="100%" /> ] --- # Special Objects: Tables .pull-left[ - Centering ] .pull-right[ ``` @@\begin{center}@@ \begin{tabular}{crr} Type & Number & Percent \\ \hline Cat & 1870 & 93.5\% \\ Dog & 100 & 5.0\% \\ Bird & 30 & 1.5\% \\ \hline Total & 2000 & 100\% \end{tabular} @@\end{center}@@ ``` <img src="data:image/png;base64,#img/tbl.png" width="100%" /> ] --- # Special Objects: Tables .pull-left[ - Centering - `tabular` environment: - `c`: center - `l`: left - `r`: right ] .pull-right[ ``` \begin{center} *\begin{tabular}{@@crr@@} Type & Number & Percent \\ \hline Cat & 1870 & 93.5\% \\ Dog & 100 & 5.0\% \\ Bird & 30 & 1.5\% \\ \hline Total & 2000 & 100\% *\end{tabular} \end{center} ``` <img src="data:image/png;base64,#img/tbl.png" width="100%" /> ] --- # Special Objects: Tables .pull-left[ - Centering - `tabular` environment: - `c`: center - `l`: left - `r`: right - Horizontal lines ] .pull-right[ ``` \begin{center} \begin{tabular}{crr} Type & Number & Percent \\ @@\hline@@ Cat & 1870 & 93.5\% \\ Dog & 100 & 5.0\% \\ Bird & 30 & 1.5\% \\ @@\hline@@ Total & 2000 & 100\% \end{tabular} \end{center} ``` <img src="data:image/png;base64,#img/tbl.png" width="100%" /> ] --- # Special Objects: Tables .pull-left[ - Centering - `tabular` environment: - `c`: center - `l`: left - `r`: right - Horizontal lines - Vertical lines ] .pull-right[ ``` \begin{center} \begin{tabular}{@@c|r|r@@} Type & Number & Percent \\ \hline Cat & 1870 & 93.5\% \\ Dog & 100 & 5.0\% \\ Bird & 30 & 1.5\% \\ \hline Total & 2000 & 100\% \end{tabular} \end{center} ``` <img src="data:image/png;base64,#img/tbl_vertical.png" width="100%" /> ] --- # Special Objects: Tables .pull-left[ - Centering - `tabular` environment: - `c`: center - `l`: left - `r`: right - Horizontal lines - Vertical lines - Columns ] .pull-right[ ``` \begin{center} \begin{tabular}{crr} Type @@&@@ Number @@&@@ Percent \\ \hline Cat @@&@@ 1870 @@&@@ 93.5\% \\ Dog @@&@@ 100 @@&@@ 5.0\% \\ Bird @@&@@ 30 @@&@@ 1.5\% \\ \hline Total @@&@@ 2000 @@&@@ 100\% \end{tabular} \end{center} ``` <img src="data:image/png;base64,#img/tbl.png" width="100%" /> ] --- # Special Objects: Tables .pull-left[ - Centering - `tabular` environment: - `c`: center - `l`: left - `r`: right - Horizontal lines - Vertical lines - Columns - Caption ] .pull-right[ ``` \begin{table} \caption{Respondents Owning Pets} \label{tbl:pets} \centering *\begin{tabular}{crr} * Type & Number & Percent \\ *\hline * Cat & 1870 & 93.5\% \\ * Dog & 100 & 5.0\% \\ * Bird & 30 & 1.5\% \\ *\hline *Total & 2000 & 100\% *\end{tabular} \end{table} ``` <img src="data:image/png;base64,#img/tbl_caption.png" width="100%" /> ] --- # Special Objects: Tables .pull-left[ In R: ``` r library(stargazer) model1 <- lm(Y ~ X + I(X^2), data = dat) model2 <- lm(Y ~ (X + I(X^2)) * Z, data = dat) tbl <- stargazer(model1,model2) writeLines(tbl,"tbl/table.tex") ``` ] .pull-right[ ``` \begin{table}[!htbp] \centering \caption{} \label{} \begin{tabular}{@{\extracolsep{5pt}}lcc} \\[-1.8ex]\hline \hline \\[-1.8ex] & \multicolumn{2}{c}{\textit{Dependent variable:}} \\ \cline{2-3} \\[-1.8ex] & \multicolumn{2}{c}{Y} \\ \\[-1.8ex] & (1) & (2)\\ \hline \\[-1.8ex] X & 0.588$^{***}$ & 0.124$^{***}$ \\ & (0.026) & (0.026) \\ & & \\ ... \hline \\[-1.8ex] Observations & 2,000 & 2,000 \\ R$^{2}$ & 0.231 & 0.641 \\ ... \textit{Note:} & \multicolumn{2}{r}{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01} \\ \end{tabular} \end{table} ``` ] --- # Special Objects: Tables .pull-left[ In R: ``` r library(stargazer) model1 <- lm(Y ~ X + I(X^2), data = dat) model2 <- lm(Y ~ (X + I(X^2)) * Z, data = dat) tbl <- stargazer(model1,model2) writeLines(tbl,"tbl/table.tex") ``` .lead[Don't write those manually!] ] .pull-right[ <img src="data:image/png;base64,#img/tbl_cats.png" width="100%" /> ] --- # Special Objects: Equations <img src="data:image/png;base64,#img/eq.png" width="100%" /> ``` \begin{equation}\label{eq:mod2} Y_i = \beta_0+\beta_1X_i+\beta_2X_i^2+\beta_3Z_i+\beta_4X_i\times Z_i+\beta_5X_i^2\times Z_i+\varepsilon \end{equation} ``` --- # Special Objects: Equations <img src="data:image/png;base64,#img/eq.png" width="100%" /> ``` @@\begin{equation}@@\label{eq:mod2} Y_i = \beta_0+\beta_1X_i+\beta_2X_i^2+\beta_3Z_i+\beta_4X_i\times Z_i+\beta_5X_i^2\times Z_i+\varepsilon @@\end{equation}@@ ``` --- # Special Objects: Equations <img src="data:image/png;base64,#img/eq.png" width="100%" /> ``` \begin{equation}@@\label{eq:mod2}@@ Y_i = \beta_0+\beta_1X_i+\beta_2X_i^2+\beta_3Z_i+\beta_4X_i\times Z_i+\beta_5X_i^2\times Z_i+\varepsilon \end{equation} ``` --- # Special Objects: Equations <img src="data:image/png;base64,#img/eq.png" width="100%" /> ``` \begin{equation}@@\label{eq:mod2}@@ Y_i = \beta_0+\beta_1X_i+\beta_2X_i^2+\beta_3Z_i+\beta_4X_i\times Z_i+\beta_5X_i^2\times Z_i+\varepsilon \end{equation} ``` `\usepackage{amsmath}` for additional math environments. --- # Special Objects: Math More Generally .pull-left[ - Inline math: `$...$` ] --- # Special Objects: Math More Generally .pull-left[ - Inline math: `$...$` - Display math: `$$`...`$$` - A language in itself ] --- # Special Objects: Math More Generally .pull-left[ - Inline math: `$...$` - Display math: `$$`...`$$` - A language in itself - Truly **the standard** ] --- # Special Objects: Math More Generally .pull-left[ - Inline math: `$...$` - Display math: `$$`...`$$` - A language in itself - Truly **the standard** Example of display math: ``` $$f(x)=\frac{1}{\sigma\sqrt{2\pi}} e^{-\frac{(x-\mu)^2}{2\sigma^2}}$$ ``` `$$f(x)=\frac{1}{\sigma\sqrt{2\pi}}\,e^{-\frac{(x-\mu)^2}{2\sigma^2}}$$` ] .pull-right[ Other Examples | Code | Result | |:---|:---| | `$\alpha, \beta, \gamma, \delta$` | `\(\alpha, \beta, \gamma, \delta\)` | | `$\bar x=\frac{\sum_{i=1}^n x_i}{n}$` | `\(\bar x=\frac{\sum_{i=1}^n x_i}{n}\)` | | `$\hat y_i = \alpha + \beta x_i + \varepsilon_i$` | `\(\hat y_i = \alpha + \beta x_i + \varepsilon_i\)` | | `$H_0:\ \mu_1 = \mu_2$` | `\(H_0:\ \mu_1 = \mu_2\)` | | `$\begin{bmatrix} a & b \\ c & d \end{bmatrix}$` | `\(\begin{bmatrix} a & b \\ c & d \end{bmatrix}\)` | | `$\int_{-\infty}^{\infty} f(x)\,dx = 1$` | `\(\int_{-\infty}^{\infty} f(x)\,dx = 1\)` | | `$\mathcal{L}=\prod_{i=1}^{n} f(x_i \mid \theta)$` | `\(\mathcal{L}=\prod_{i=1}^{n} f(x_i \mid \theta)\)` | | `$X \sim \mathcal{N}(\mu, \sigma^2)$` | `\(X \sim \mathcal{N}(\mu, \sigma^2)\)` | ] --- class: inverse # Special Objects: Exercise .pull-left[ - In `working.tex` - Add `cat_dist.pdf` as a figure in the methods section - Add a caption. ] .pull-right[ ``` \documentclass[12pt, letterpaper]{article} \usepackage{graphicx} %for figures \usepackage{natbib} %for bibliography \bibliographystyle{apalike} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \title{A Very Clever Title} \author{Gaby McCoolFace} \date{\today} \begin{document} \section{Introduction} \section{Theory} *\section{Method} \end{document} ``` ] --- class: section-irms name: bibliography # References and Bibliography .nav-label[Bibliography] --- # References ?? .pull-left[ - `ref{}` - `label{}` ] --- # References .pull-left[ - `ref{}` - `label{}` - *We construct a typology which we present in Table `\ref{tbl:typo}`.* ] --- # References .pull-left[ - `ref{}` - `label{}` - *We construct a typology which we present in Table `\ref{tbl:typo}`.* - This works for almost everything. - Tables - Figures - Equations - Sections - Supplementary material ] .pull-right[ <img src="data:image/png;base64,#img/magic.gif" width="70%" style="display: block; margin: auto;" /> ] --- # Bibliography Three things to handle: 1. How to cite? 2. How to produce the bibliography? 3. How to create a `.bib` file? .lead[It only works like this when using `\usepackage{natbib}`.] --- # Bibliography .panelset[ .panel[.panel-name[Cite] - `\citep{mccool2026}`: (McCoolface, 2026) - `\citep[p.~26]{mccool2026}`: (McCoolface, 2026, p. 26) - `\citet{mccool2026}`: McCoolface (2026) - `\citeyear{mccool2026}`: 2026 - `\citeauthor{mccool2026}`: McCoolface - `\citep{mccool2026,nofunson2024}`: (McCoolface, 2026; Nofunson, 2024) ] .panel[.panel-name[Produce] 1. In preamble: `\bibliographystyle{apalike}` 2. Before `\end{document}`: `\bibliography{references}` .lead[Note that `references` points to `references.bib`, a separate file!] ] .panel[.panel-name[.bib File] .pull-left[ - Entry type: `@article` - Entry key: `adcock2001measurement` - Document's information - Zotero can produce those files for you. - Export Library `\(\rightarrow\)` format `BibTeX` - Google Scholar has a `BibTeX` button. ] .pull-right[ ``` @article{adcock2001measurement, title={Measurement validity: A shared standard ...}, author={Adcock, Robert and Collier, David}, journal={American political science review}, volume={95}, number={3}, pages={529--546}, year={2001}, publisher={Cambridge University Press} } ``` ] ] ] --- # Bibliography .pull-left[ .lead[Compile and:] <img src="data:image/png;base64,#img/bib.png" width="100%" /> ] .pull-right[ ] --- # Bibliography .pull-left[ .lead[Need Chicago instead of APA?] <img src="data:image/png;base64,#img/bib_chicago.png" width="100%" /> Just change `\bibliographystyle{chicago}`. ] .pull-right[ ] --- # Bibliography .pull-left[ .lead[Need Chicago instead of APA?] <img src="data:image/png;base64,#img/bib_chicago.png" width="100%" /> Just change `\bibliographystyle{chicago}`. ] .pull-right[ <img src="data:image/png;base64,#img/magic.gif" width="70%" style="display: block; margin: auto;" /> ] --- class: inverse # References and Bibliography .pull-left[ - In `working.tex` - Go to Google Scholar - Find *The hidden American immigration consensus: A conjoint analysis of attitudes toward immigrants* - Hainmueller and Hopkins - 2015 - Update the .bib file - Cite it somewhere in the document - Compile and make sure it got added to the bibliography ] .pull-right[ ``` \documentclass[12pt, letterpaper]{article} \usepackage{graphicx} %for figures \usepackage{natbib} %for bibliography \bibliographystyle{apalike} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \title{A Very Clever Title} \author{Gaby McCoolFace} \date{\today} \begin{document} \section{Introduction} \section{Theory} \section{Method} \bibliography{references.bib} \end{document} ``` ] --- # Concluding Remarks - Don't learn syntax! - Ask google/AI when you face a bug. - This is a start. --- class: band-irms, vmiddle # Please reach out if you have any questions! - Extra resources: - [Learn LaTeX in 30 minutes](https://www.overleaf.com/learn/latex/Learn_LaTeX_in_30_minutes#What_is_LaTeX?) - [Learn LaTeX in five steps](https://cortex.corca.ai/docs/en/tutorial) - Google - Your AI agent of choice