owned this note
owned this note
Published
Linked with GitHub
---
tags: ResBaz2021
---
# Intro to LaTeX
### Wednesday, May 19th, 2021 1\:00-3\:00
[Back to Resbaz HackMD Directory](https://hackmd.io/@ResBaz21/directory)
It's fun to code things for computers to read, so why not code things for humans to read, too?
With the LaTeX typesetting system, you can code professional quality equations, tables, figures, verse, novellas, and much more.
LaTeX offers many of the advantages of programming other steps of the research process: automation, customization, and replicability. Even better, using LaTeX means you can do the hard work (writing the thing) in your favorite plain text editor.
This workshop will emphasize the skills you need to get started producing a basic manuscript for an academic article or essay.
## Getting Started
### Install LaTeX, or sign up for an online editor
Three modes for running LaTeX will work for this tutorial:
1. Run it online on ~~https://latexbase.com,~~ https://papeeria.com/ or https://www.overleaf.com/. These sites require you to create an account. ~~The free version of latexbase.com does not require an account and is suitable for this tutorial.~~ (Correction: latexbase.com does *not* have the capabilities needed for this tutorial.)
This is a good option if you're dropping in on this tutorial at the last minute, or you don't have time to download and install the full program.
2. Install it on your machine and run it on a LaTeX GUI. Installation should be straightforward, but let the instructor know if you have problems.
If you think you might need a TeX distribution at some point, but you don't want to mess around with integrating it into a plain text editor, go for this option.
- Mac users: http://www.tug.org/mactex/ This distribution is relatively large because it includes an array of supporting packages and other stuff.
- Linux users: you probably already have it on your system. You can install it directly here: https://www.tug.org/texlive/quickinstall.html
- PC users: https://miktex.org/download This distribution is light because it installs packages "on the fly." When you have the option, your instructor recommends you elect to install all available packages.
5. Install it on your machine and run it from within Emacs or Atom.
This is the best option if you're looking to integrate LaTeX editing into your other coding workflows. This is your instructor's preferred mode, but it can be more complicated to get started.
- Install the appropriate distribution as described in step 2.
- Install the LaTeX package for [Atom](https://atom.io/packages/latex) or make sure you have AucTeX installed in [Emacs](http://statweb.stanford.edu/~naras/lunches/f96/talk4/talk.html).
### Run a quick test document
Once you have chosen your mode of running LaTeX, try to do the following (skip to step 2 if you're using an online distribution):
1. Depending on your distribution, open your LaTeX GUI, Emacs, or Atom:
- MacTeX (Mac) users: open the "TeXShop" GUI
- MikTeX (PC) users: open the "miktex-texworks" GUI
- Linux users: You can use either of the GUIs above, or use Atom or Emacs.
- Plain text zealots: Run Emacs or Atom and save a blank document called "test.tex" to an empty folder.
2. Copy and paste the code below:
```
\documentclass{article}
\usepackage[margin = 2in]{geometry}
\begin{document}
\pagenumbering{gobble}
\centering
\vspace*{\fill}
Hello world%?
\[
P_{ij} = \sum^{g}_{k = 1}A_{ki}A_{kj}
\]
\vspace*{\fill}
\end{document}
```
Hit either "Typeset" (TeXShop), the green play button (TeXworks), or wait for the page to refresh (online distribution). If you're using a plain text editor, you'll need to save the document, then compile (C-c C-c in Emacs, or ctrl-alt-b in Atom).
After a moment or two, a pdf page will appear. You should see "Hello world" and an equation centered (vertically and horizontally) on an otherwise blank page, without the question mark or page numbering. You may notice that a number of "auxiliary" files are produced along with the pdf. This is expected.
While the document compiles, TeXworks users may be asked if they want to install the "geometry" package. They should answer in the affirmative.
If you have problems, feel free to contact the instructor: peterore@email.arizona.edu
---
## Introductions
- Peter Ore (instructor)
- UA Sociology grad student
- peterore@email.arizona.edu
- @peter__ore on Twitter
- I taught myself LaTeX over the last five years or so because I was sick of the alternatives, especially when formatting complex documents
- Feel free to introduce yourself here. It would be especially useful if you briefly state the following:
- affiliations
- experience with LaTeX
- what you're looking for in this tutorial
- Rene Dario Herrera (they/them),
- University of Arizona Cancer Center,
- some experience using LaTeX adjacent technologies like R Markdown and Pandoc
- how can I add my bibliography to my document?
## Questions and Answers
In this section, you can post your questions and feel free to answer if you have it. Questions will be answered during or after the workshop.
1. Ask your question.
- Here is an answer
---
:::info
**Session Feedback :mega:**
Use the link below to provide your feedback on the session:
[**Session Feedback Form**](https://forms.gle/TrnJpr9qRBEKdnVVA)
:::