Quick Start Guide
Quick Start Guide
Kenneth M Monks
Chapter 1
Created in the late 1970s and early 1980s by Donald Knuth and Leslie Lamport, LATEX has become
the standard typesetting language used in STEM fields as well as some subdisciplines of psychology,
philosophy, political science, and especially linguistics. Overleaf is a cloud-based compiler and shared
editing system (similar in many ways to Google Docs) for LATEX. Here is a short introduction to the
LATEX commands, Overleaf functionalities, and writing style principles that you’ll need most frequently
throughout this course.
\begin{document}
\end{document}
1.2. MATH MODE, DISPLAY MATH MODE, AND THE ALIGN ENVIRONMENT
For convenience, in the rest of this document we will not show the preamble and the document envi-
ronment commands, but rather just the code that would go into the body.
Question! K French fries in ketchup are of course another instance of a tomatoed potato. Can you,
however, think of an instance of a potatoed tomato? Show the LATEX code that would answer this
question.
1.2 Math mode, display math mode, and the align environment
Here we discuss three of the most commonly used capabilities of LATEX. Math mode is used for displaying
small mathematical expressions in a paragraph, display math mode is used to display larger mathematical
expressions that need to be centered on their own line, and the align environment is used to display a
sequence of larger mathematical expressions that are connected to each other.
In the early 1600s, Ren\’e Descartes In the early 1600s, René Descartes
introduced the convention of introduced the convention of
using the letters x,y, and z using the letters x,y, and z
as variable names. as variable names.
In this instance, LATEX is formatting our variables as if they are just letters appearing in words and not
mathematics expressions. (Also notice the backslash-apostraphe creates the accent mark on the next
character!) Instead, we should write it as follows.
In the early 1600s, Ren\’e Descartes In the early 1600s, René Descartes
introduced the convention of introduced the convention of
using the letters $x,y,$ and $z$ using the letters x, y, and z
as variable names. as variable names.
Question! K Why would it be wrong to format the sentence above using the code written below?
In the early 1600s, Ren\’e Descartes introduced the convention of using the
letters $x,y, and z$ as variable names?
Question! K One of the most common expressions in mathematics is of course the beloved summation,
which in LATEX is called \sum. If you use the code
If you have a sequence of equations or expressions which you would like to display as connected to
one another in a sequence down the page, an align environment is likely the right choice. In such an
enviroment, the ampersand marks the alignment character, and a double backslash represents a line
break. For example, here is another way we could typeset the factorization of the quartic above.
What it generates
x4 − 4x3 + 6x2 − 4x + 1
= x2 x2 − 2x + 1 − 2x x2 − 2x + 1 + 1 x2 − 2x + 1
= x2 − 2x + 1 x2 − 2x + 1
2
= x2 − 2x + 1
2
2
= (x − 1)
4
= (x − 1) .
Notice above the parenthesis all have the words left and right attached to them; we will discuss this
further in the following section!
Question! K Notice the commands that began and ended the align environment each had an asterisk.
What happens if the asterisks are removed?
n n!
\binom{n}{k}=\frac{n!}{k!(n-k)!} k = k!(n−k)!
Because LATEX uses the vertical bar as a special character for other purposes within its language,
absolute values are a bit stranger to typeset correctly. They involve in fact not using the | key at all, but
rather the words lvert and rvert.
CHAPTER 1. A BRIEF INTRODUCTION TO LATEX AND OVERLEAF
Likewise, set brackets are used in LATEX to denote an input to a function and as a grouping symbol.
Thus, to properly format curly braces, it is best to use the words lbrace and rbrace and not type the
curly brace itself at all.
Question! K We mention above that curly braces are often used as a grouping symbol. The following
example shows more specifically what is meant by that. Try out the following three ways of raising x to
the tenth power:
• $x^10$
• $x^(10)$
• $x^{10}$
n(n+1)
Bad: 1+2+3+...+n=\frac{n(n+1)}{2} 1 + 2 + 3 + ... + n = 2
n(n+1)
Slightly Better: 1+2+3+ \ldots +n=\frac{n(n+1)}{2} 1 + 2 + 3 + ... + n = 2
n(n+1)
Bliss: 1+2+3+ \cdots +n=\frac{n(n+1)}{2} 1 + 2 + 3 + ··· + n = 2
Question! K Why would the following code below be evil and smell bad? How should it be fixed?
$a_1,a_2,a_3,\cdots,a_n$
\end{cases}
Question! K What would go wrong in the output above if we did not include those two text commands?
\begin{itemize}
\item {\bf Sines and Cosines:} $\cos^2(\theta)+\sin^2(\theta)=1$
\item {\bf Tangents and Secants:} $1+\tan^2(\theta)=\sec^2(\theta)$
\item {\bf Cotangents and Cosecants:} $\cot^2(\theta)+1=\csc^2(\theta)$
\end{itemize}
CHAPTER 1. A BRIEF INTRODUCTION TO LATEX AND OVERLEAF
What it generates
The itemize environment will be how we format our discussions in the Comments sections below each
problem. If you are replying to someone above, you create a sublist; if you are posting a new comment
then you create a new item.
Question! K How does the above environment change if you use enumerate instead of itemize?
\usepackage{graphicx}
in your preamble (before your document environment starts). Once you have this package, you’ll be able
to include graphics using the steps detailed below.
1. Create the graphic: Start by creating the graphic in your favorite external graphing utility. For
our course, particularly useful ones include the following:
• Desmos: Great for plotting graphs of functions, their derivatives, and parametric curves.
Super easy interface and low learning curve.
https://www.desmos.com/
• Geogebra: Very user-friendly 2D and 3D plotter. Also has a fantastic ruler-and-compass
construction application.
https://www.geogebra.org/
• Darryl Nester’s Slope Fields and Phase Planes: To easily visualize vector fields and see
solutions to differential equations, you can’t beat this.
https://www.bluffton.edu/homepages/facstaff/nesterd/java/slopefields.html
2. Export and Save: From that utility, save the graphic locally on your computer. Here we demo
Desmos because demo is a substring of desmos. First, click the Share button in the upper right.
1.5. INCLUDING GRAPHICS
Then, use the Download PNG button to create a local copy on your computer. Rename it as
you like. Here we call it cosh.png since it is a hyperbolic cosine graph.
3. Upload to Overleaf: Overleaf has three panes, the file-tree, the code editor, and the preview
window, from left to right. In the leftmost pane, click the Upload button near the top to
produce the window shown below.
4. Use the includegraphics command: Wherever you would like the image to appear in your
document, use the command
CHAPTER 1. A BRIEF INTRODUCTION TO LATEX AND OVERLEAF
\includegraphics[scale=number]{filename}
where the name of your file is between the curly braces, and scale is equal to whatever factor you
would like to resize your image by. It is often desirable to put your image in a center environment
just to get it centered on the page. For example, the code
How to best investigate further LATEX functionality depends a lot on what you are looking for. If you are
looking for. . .
• . . . a single special character. Try the Detexify website or mobile app. It will allow you to
draw a character on the touchscreen or with a mouse, and it will take its best guess at what the code
is for what you drew. This is not good at telling you how to build more complicated expressions,
but for a single character it is great. See my not-so-great drawing on the left, with its guesses as to
what I mean on the right!
1.6. HOW TO GO FURTHER
http://detexify.kirelabs.org/
• . . . a more complicated expression. Say there is some bigger operation you are trying to
perform, like building fancy tables, captioning images, building an autonumbered index, etc. Your
best bet here is to type a phrase describing what you want to do into StackExchange. Chances
are, whatever question you’re asking has already been asked by someone else on StackExchange,
and someone has answered it.
https://tex.stackexchange.com/
• . . . more general information. The LATEX wikibook is very well-written and usually quite easy
to find what you are looking for. It provides great documentation for the language.
https://en.wikibooks.org/wiki/LaTeX
• . . . a LATEX Sandbox! There is a browser-based application called LATEXNotes with fast render-
ing and an easily searchable database of LATEX commands. It is useful for quickly composing a
component of a larger document which could then be copy-pasted into our Overleaf homework
assignments.
https://latexnotes.surge.sh
Be aware that any of the code or suggestions you find in the above sources may require loading some
extra packages for it to work properly (much like how we loaded graphicx above). Pay attention to what
packages are in the preamble of sample code you find.
Question! K Use one of the above suggested resources to find the LATEX code for a smiley face. What
is the code and how did you find it?
each and every time. We could define a function called abs by typing
\newcommand{\abs}[1]{\left\lvert #1 \right\rvert}
CHAPTER 1. A BRIEF INTRODUCTION TO LATEX AND OVERLEAF
into our preamble. The first argument in squiggles specifies the name of our new command, abs, the
second argument in square brackets specifies the number of arguments we desire, just 1, and the third
expression in squiggles specifies what we want our function to be a shortcut for. The “#1” represents
where we want argument number 1 to go in our code. Armed with our new fancy command, we could
write the following little program.
\documentclass{article}
\usepackage{amsmath}
\newcommand{\abs}[1]{\left\lvert #1 \right\rvert} √
x2 = |x|
\begin{document}
$$\sqrt{x^2}=\abs{x}$$
\end{document}
This of course is not worth it if you were only going to use this command once, but in a longer writeup
it is a great way to customize your LATEX document. It is one of the beautiful aspects of using LATEX.
You can teach it new commands to make it the most efficient tool possible for your own purposes.
Chapter 2
Incorporating mathematics into college-level writing presents new challenges and has its own set of agreed
upon conventions, much like APA or MLA apply to many disciplines. Here we list a set of commonly
followed conventions in addition to the typesetting guidelines listed above.
Bad: $cos$, $sin$, $arctan$, $ln$, $det$ cos, sin, arctan, ln, det
Good: $\cos$, $\sin$, $\arctan$, $\ln$, $\det$ cos, sin, arctan, ln, det
Though this is how you might write such a calculation in your scratchwork on a test or on the
chalkboard, this would not be an acceptable way to typeset mathematics. In the writeup above, each
mathematics expression is just floating above the other, and none of them live in sentences. Here is one
way (of many possible) you could rewrite it to get it up to modern standards of mathematics writing.
ln |y| = 2t + C1 .
At this point, all the calculus is complete and we need only to algebraically solve for y. Solving for y
and then cleaning up our constant of integration with the substitution C = ±eC1 results in the following
solution:
y = ±e2t+C1 = ±eC1 e2t = Ce2t .
Notice in particular how our sentences end with periods even if they happen to end in a mathematics
expression.
• Mignon Fogarty, Grammar Girl. Her short articles and podcasts provide great practical advice.
– Commas! https://www.quickanddirtytips.com/education/grammar/where-do-i-use-commas
– Colons! https://www.quickanddirtytips.com/education/grammar/colons
– Apostraphes! https://www.quickanddirtytips.com/education/grammar/apostrophes
• Purdue OWL. The Online Writing Lab from Purdue University has become a widely used and re-
spected source on writing. It has videos and notes providing information and exercises on everything
from the mechanics of proper grammar to how to keep your audience in mind while writing.
https://owl.purdue.edu/owl/general_writing/index.html
Question K Any time you use a colon, what word does Mignon Fogarty suggest it should be inter-
changeable for? That is, a colon is grammatically correct (at least in Chicago style) if and only if it could
be replaced by the word .
We wish to show that tan2 (θ) + 1 = sec2 (θ). We start with this identity and then manipulate both
sides until we get something true.
This is how identity “proofs” are often taught in trig; in that context it is fine to work this way as
you are basically just trying to get used to applying the identities and doing algebra with trig functions.
But as far as an argument goes, the logical flow is awful. What you’re really saying is that the first
equality is equivalent to the second which is equivalent to the third, and since the third is true, then so
is the second, and so is the first. It’s not wrong, but it’s really convoluted. Also it’s considered bad form
because it really looks like your starting point of the whole proof is the very thing that you’re trying to
prove.
How to fix this? Just start with the left-hand side of that identity you’re trying to prove, and then
continually manipulate it until you reach the right hand side. It’s not much work to take a U-shaped
proof and turn it into one of these, and it is considered much better style. This is called a transitive
chain and is the right way to rewrite a U-shaped proof (not to mention fix the bad case of floating blob
disease happening above). In a transitive chain, we use an align environment to say the first expression
equals the second which equals the third and so on down to the bottom; at the end we conclude the first
equals the last since equality is a transitive relation.
We wish to show that tan2 (θ) + 1 = sec2 (θ). We start with the left-hand side and manipulate it using
the Pythagorean identity for sines and cosines until we obtain the right-hand side as follows:
Exponentiation a^b ab
a
Fractions \frac{a}{b} b
n
Binomial coefficients \binom{n}{m} m
Subscripts a_n an
Question! KWhat symbol does the Colorado Department of Transportation use for multiplication?
Chapter 4
Why?
Why am I structuring the course this way? Why I am requiring use of this system? Wouldn’t good
old pencil and paper be easier and better? Well, the answer is at first maybe yes, but in the long run,
definitely no. Although there will likely be a slow or frustrating period in the beginning, once you get
over that hump it will help you fly for the rest of your STEM career. Here are my objectives with regards
to structuring the course around this homework system:
• Better feedback from me. I want all of you to have more feedback and better quality feedback
from me on your homeworks. Pen and paper is just so slow for me to write anything substantial,
especially when there are similar mistakes on 15 different assignments, and inevitably the one on
the bottom of the pile is getting shorter and sloppier feedback than the ones on the top of the pile.
• Better feedback from each other. Here at BCC, we’re not at CU where everyone is a 19-year
old full-time student living in the Engineering dorm, and you can always just go knock on the door
of the twelve people down the hall who have the same homework assignment to ask a question. So,
I wanted to create this shared space where you do have access to your peers (of all different ages
and work schedules and living situations) 24/7 and can collaborate, rather than feeling isolated
when working on homework.
• Research-backed benefits of active learning. There are volumes of research supporting active
learning as a more effective learning modality than listening to lecture alone. Studies show that
comprehension and retention from listening to lecture alone is fairly low compared to when it is
coupled with higher-level processes like writing, formulating questions based on reading, and sharing
ideas with collaborators. One problem is that in higher-level courses, we sometimes don’t have time
to do much more than state our definitions and work out one big example in class, so with this
online system we can still have good thorough demonstrations of the mathematics in class, with
the added benefits of active learning in the homework.
• Forum for sharing resources. There are a million and seven free mathematics resources out
there, but it’s a minefield riddled with lots of misleading and poor quality time-suckers in the higher
levels of undergraduate mathematics. I have already shared a few resources in each assignment that
I have found very helpful; if you find any that you like, you can share them there as well!
• Practice incorporating feedback in your technical writing. This style of working much more
accurately simulates what will happen down the road. I can’t think of even a single time in my
career where I just wrote an important technical document and then didn’t have to thoughtfully
incorporate some feedback from my department chair, a dean, a fellow faculty member, an adjunct,
a student, a grant-reviewer, my advisor, a journal referee, a journal editor, etc. This doesn’t
mean that you always make every change that is suggested to you, but you should incorporate it
thoughtfully. Maybe you disagree with the change that someone suggested, but you see why it
caught their eye and it still brings to light some third alternative regarding how you can improve
your document. It is an incredibly important skill that takes time and practice to develop.
• Practice reading technical documents critically and giving others constructive feed-
back. The assumption in most undergraduate courses is that every document you read is perfect
and correct. The fancy expensive textbook is from some giant publishing company with an army
of content experts and editors proofreading it. However, this Candyland fantasy quickly vanishes
as you enter a more specialized niche in whatever field you work in. Often there aren’t that many
people worldwide working on it and a lot of the ideas are too new to even know what the gold-plated
final form of them should be. In roles as a colleague, supervisor, or researcher, you will frequently
have to read technical writing and provide the author with feedback on the writing or make your
own judgement as to what seems correct or incorrect (and contact the author or others in your field
with these questions). Like anything worthwhile, this will take time and effort to develop this skill.
• Having you leave the course knowing LATEX. This is an extremely good tool to carry forward
with you for the following reasons:
– Secret handshake in the STEM workplace. In technical fields these days, there is a bit
of an unspoken culture that if you go in with a document not prepared in LATEX, the first
impression is automatically a negative one, and if it is in LATEX, it’s automatically positive.
Preparing technical docs these days in Microsoft Word would be kind of the same as if a
professional wedding photographer did all their editing in Instagram instead of Photoshop.
Yes of course Instagram is way easier to use and Photoshop has a steep learning curve, but
if you are going to do real work in any field, you need to have more control over your own
projects and not have a super hand-holdy program doing all sorts of auto- this and auto- that
for you.
– Common requirement in upper level coursework at universities. Lots of professors at
CU, CSU, etc require assignments or lab reports to be done in LATEX. For example, I know the
main Circuits professor at CU Boulder does. (And as you might expect, they will not provide
scaffolding like I am doing here but rather just say “do this”.) This way as you’re dealing with
all the other challenges of transfer, you at least don’t have to also be trying to use LATEX for
the first time ever.
– Common requirement in journals. As you try to do research in a STEM field and publish
in paper or electronic journals, you will find that most do not even accept submissions in any
format other than .tex files.
– Perfect introduction to coding. If you don’t have programming experience, it is the perfect
introductory language because the language is very simple compared to say C or Java. But,
it at least gets you used to some of the basic syntax of how compiled languages look and how
to use them. Historically, LATEX was one of the early languages that served as the basis for
HTML, so it’s a great launching point for learning other languages (and realistically every
STEM professional needs to know at least a bit of coding these days).
Hopefully it is clear that I built this to not only serve as a more effective (and fun!) system for
learning the content of this course, but also to set you up for success in broader ways for further STEM
adventures!
Question! K Visit the url given below:
https://www.frontiersin.org/journals/psychology/sections/quantitative-psychology-and-measurement#
submission-checklist
What website is this? What purpose does it serve, and for what entity? What two submission formats
do they mention in name are acceptable for their journal? Which one do you think they actually prefer
and why?
Question! K Find another journal of a STEM field you are interested in. What formats do they accept
for submissions?