0% found this document useful (0 votes)
20 views

HW Typesetting

Typesetting

Uploaded by

Sourav Paul
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

HW Typesetting

Typesetting

Uploaded by

Sourav Paul
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Page 1

CSE 312: Mathematical Typesetting in Word and LaTeX

To start an equation in Word, type [Alt]-[=] or click InsertEquation. To start an equation


midline in Latex, wrap in dollar signs, and to start an equation on a new line, wrap in double dollar
signs ($[equation]$ for inline, and $$[equation]$$ for a new line).

Many of the symbols/commands are identical (but you may also create shortcuts in Latex). In
Word, you will need to press space to see the command converted to the symbol sometimes.

It is recommended to use the equation editor (in word and latex) to do any numerics (even
for numbers and single letters for events). (e.g, 9 vs. 9, let E be an event vs. let 𝐸 be an event).

Symbol Description Word Command (must Latex Command (must Recommended


be inside equation!!!) be in math mode!!!) Latex Shortcut
ℙ Probability \doubleP \mathbb{P} \P (for
Pr Pr \Pr whichever you
𝑃 P P prefer)
𝒫 Power Set \scriptP \mathcal{P}
ℕ Natural #s \doubleN \mathbb{N} \N
ℝ Real #s \doubleR \mathbb{R} \R
𝑛 Combinations (n\atop k)[+space] {n\choose k} or
( )
𝑘 (Choose) \binom{n}{k}
𝑎𝑘 Superscript a^k a^k
𝑎𝑘 Subscript a_k a_k
𝑎⋅𝑏 Multiplication a\cdot b a\cdot b
𝑎×𝑏 a\times b a\times b
𝔼 Expectation \doubleE \mathbb{E} \E
𝑉𝑎𝑟 Variance Var Var \V
𝑎 Fraction a/b [+space] \frac{a}{b} or \f{a}{b}
𝑏 \dfrac{a}{b} (bigger)
𝜇 Greek Letters \mu \mu
𝜎 (mu, sigma, \sigma \sigma
𝜃 theta) \theta \theta
(capitalize for capital greek (capitalize for capital greek
letters. e.g., \Alpha) letters. e.g., \Alpha)
𝑏 Integral \int_a^b[+space]f(x)dx \int_{a}^{b}{f(x)dx}
∫ 𝑓(𝑥)𝑑𝑥
𝑎
𝜕 Partial \partial/\partial\theta[+2 \frac{\partial}{\partial
𝜕𝜃 derivative spaces] \theta}
𝑛 Sum \sum_(i=1)^n[+space]a_i \sum_{i=1}^{n}{a_i}
∑ 𝑎𝑖
𝑖=1
𝑛 Product \prod_(i=1)^n[+space]a_i \prod_{i=1}^{n}{a_i}
∏ 𝑎𝑖
𝑖=1
Page 2

log 𝑏 Logarithm log[+space] b \log{b}


ln 𝑏 ln[+space] b \ln{b}
𝑥̅ Average x\bar[+space] \bar{x}
𝑥̂ Estimate x\hat[+space] \hat{x}
√𝑥 Square Root \sqrt(x)[+space] \sqrt{x}
𝑛 Union of many \bigcup_(i=1)^n[+space]E_i \bigcup_{i=1}^{n}{E_i}
⋃ 𝐸𝑖
𝑖=1
𝑛 Intersection of \bigcap_(i=1)^n[+space]E_i \bigcap_{i=1}^{n}{E_i}
⋂ 𝐸𝑖 many
𝑖=1
∩ Intersection \cap \cap
∪ Union \cup \cup
→ Arrow -> or \to \to
⇒ Implication \Rightarrow \Rightarrow or \implies
⇐ Converse \Leftarrow \Leftarrow or \impliedby
⇔ If and only if \Leftrightarrow \iff or \Leftrightarrow
~ Distributed as ~ \sim
<, >, = Comparator <,>,= >,<,=
≥ >= \ge
≤ <= \le
≠ \ne \ne
≈ \approx \approx
lim 𝑎𝑛 ⁡ Limits lim[+space] \lim_{n\to\infty}{a_n}
𝑛→∞
_(n\to\infty)[+space] a_n
𝑎 𝑏 Vector/Matrix Insert->equation->Matrix \begin{bmatrix}
[ ]
𝑐 𝑑 a & b \\
c&d
\end{bmatrix}
Note: go to the next
column with &. Go to
a new line with \\.
𝑓(𝑥) Piecewise Insert->equation->bracket f(x) =
−𝑥, 𝑥<0 Function (scroll all the way down) \begin{cases}
={
𝑥, 𝑥≥0 -x & x < 0 \\
x & x \ge 0
\end{cases}
Again, go to the next
“column” with &. Go
to a new line with \\.
∞ Infinity \infty \infty
∈, ∉ Inclusion \in, \notin \in, \notin
⊂, ⊆ Subset \subset,\subseteq \subset,\subseteq
⊃, ⊇ Superset \superset,\superseteq \superset,\superseteq
∅ Empty set \emptyset \emptyset
\ Set difference \setminus \setminus
Page 3

Important: To box your answer in Latex (not Word), use \fbox{$[answer in equation]$}. There
isn’t a way to do it easily/naturally in Word, but you could create a one-cell table (not required) or
simply highlight in yellow (easier).

See Adam Blank’s tutorial for a more comprehensive list!


http://www.countablethoughts.com/documents/HowToLaTeX.pdf
Most of the commands should be the same for Word and Latex, as you can see above.

Use the following LaTeX shortcuts (you can paste at the top of your Latex source; they’re
already there in the template). Of course you can create your own too!

\newcommand{\N}{\mathbb N}
\newcommand{\E}{\mathbb E}
\newcommand{\V}{Var}
\newcommand{\P}{\mathbb P}
\newcommand{\f}{\frac}

Word vs Latex

Josh’s Opinion:

Personally, I use a lot of scratch paper when figuring out how to solve a problem. Since my draft
paper is often riddled with eraser marks and failed attempts (haha), I then transcribe it to LaTeX,
on the sharelatex.com platform. Word also works, but I’m less efficient with it since I don’t know
the shortcuts well. We’re totally fine with Word, LaTeX, or legible handwriting, but LaTeX is
worth learning since it’s standard for CS research. If you’re typing your homework, please reserve
enough time (it takes longer than you think)! Also, if using LaTeX, make sure to compile
frequently, since it’s easy to make a typo and end up with annoying compilation errors.

Alex’s Opinion:

Word and Latex generally have the same appearance in terms of equations, but Latex probably
looks a little better to you. I personally like using Word only because the formatting is easier and
most importantly, there is live compilation. If I am typing my homework while doing it (rather
than handwriting it then typing it), it is very hard for me to keep my train of thought in Latex since
I have to compile it each time I want to see what I just wrote. Believe me, it is almost impossible to
read the Latex source directly and be able to process it quickly. Word has the advantage that you
immediately see what you type, and so I can do homework directly from Word with no issues and
compiling. Latex errors are generally also harder to debug and more annoying, while Word won’t
give any errors. So it’s up to you – use Word if you want to type homework simultaneously while
doing the homework, Latex if you want to handwrite first and then typeset, or handwrite and scan
your homework if you aren’t comfortable with typesetting. If you know how to use one, you
basically know the other! I personally reserve using Latex for bigger and more formal
projects/papers, as it takes more time with the compilation.
Page 4

Extra Notes:

1. If you want to have plain text (not italicized) inside equation mode, as below:

𝑎2 = 𝑏⁡[by⁡definition]

Word: a^2=b [“by definition” [+space to remove the quotes and apply formating] ]
Latex: a^2=b [\text{by definition}]

2. In Word, if you start an equation on a new line, it automatically centers. If you want it to left-
align, simply type anything outside of equation mode after (easiest way is a space).

You might also like