0% found this document useful (0 votes)
21 views4 pages

LaTeX Document Example and Guide

This document serves as an example of a LaTeX document, illustrating its structure and features such as paragraphs, math formatting, theorems, and lists. It emphasizes the importance of using LaTeX's capabilities to avoid manual formatting and provides shortcuts for common tasks. Additionally, it includes references to external resources for further learning about LaTeX.

Uploaded by

dangtranhoan655
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)
21 views4 pages

LaTeX Document Example and Guide

This document serves as an example of a LaTeX document, illustrating its structure and features such as paragraphs, math formatting, theorems, and lists. It emphasizes the importance of using LaTeX's capabilities to avoid manual formatting and provides shortcuts for common tasks. Additionally, it includes references to external resources for further learning about LaTeX.

Uploaded by

dangtranhoan655
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

An Example LaTeX Document

Evan Chen

March 16, 2025

This is an example of a LATEX document, complete with theorems


and headers and the like.

Contents
1 Paragraphs 2

2 Math 2
2.1 Using alignment . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

3 Shortcuts 3

4 Theorems and Proofs 3

5 Referencing 4

6 Numbered and Bulleted Lists 4

7 More Sources 4

1
An Example LaTeX Document 2

Golden Rule: Do not do anything manually if you can avoid it.

I have seen people manually add section numbers, manually bold theorems,
manually create numbered lists, manually add spacing between every single para-
graph. . . Do not do this. If you do not know how to do something, Google it!
The site [Link] will frequently provide answers. Often, LATEX can do it, and
can do it better than you can.
The philosophy here is that what you see is what you mean. The source code
shows you the logical structure of the document. Then the compiler converts
that to a PDF.

1 Paragraphs
In LATEX, paragraphs are caused when two line breaks are used. Single line breaks
are ignored. Hence this entire block is one paragraph. This is useful because it
means you can break text at convenient points, which makes your source code
much more readable than if you had lines spanning hundreds of characters.
Now this is a new paragraph. If you want to start a new line without a new
paragraph, use two backslashes like this:
Now the next words will be on a new line. As a general rule, use this as
infrequently as possible.
You can bold or italicize text. Try to not do so repeatedly for mechanical
tasks by, e.g. using theorem environments (see Section 4).

2 Math
1
Inline math is created with dollar signs, like eiπ = −1 or 2 · 2 = 1.
Display math is created as follows:
n n
!2
X X
3
k = k .
k=1 k=1

This puts the math on a new line. Remember to properly add punctuation to
the end of your sentences – display math is considered part of the sentence too!
Note that the use of \left( causes the parentheses to be the correct size.
Without them, get something ugly like
n
X Xn
k3 = ( k)2 .
k=1 k=1
An Example LaTeX Document 3

2.1 Using alignment


Try this:
4
Y
(i − xk ) (i + xk ) = P (i) · P (−i)
k=1
= (1 − b + d + i(c − a)) (1 − b + d − i(c − a))
= (a − c)2 + (b − d − 1)2 .

3 Shortcuts
In the beginning of the document we wrote

\newcommand{\half}{\frac{1}{2}}
\newcommand{\cbrt}[1]{\sqrt[3]{#1}}

Now we can use these shortcuts.


1 1 √
3
+ = 1 and 8 = 2.
2 2

4 Theorems and Proofs


Let us use the theorem environments we had in the beginning.

Definition. Let R denote the set of real numbers.

Notice how this makes the source code much more readable.

Theorem 1 (Vasc’s Inequality). For any a, b, c we have the inequality


2
a2 + b2 + c2 ≥ 3 a3 b + b3 c + c3 a .


For the proof of Theorem 1, we need the following lemma.

Lemma 2. We have (x + y + z)2 ≥ 3(xy + yz + zx) for any x, y, z ∈ R.

Proof. This can be rewritten as


1
(x − y)2 + (y − z)2 + (z − x)2 ≥ 0

2
which is obvious.

Proof of Theorem 1. In the lemma, put x = a2 − ab + bc, y = b2 − bc + ca,


z = c2 − ca + ab.

Remark 1. In Theorem 1, equality holds if a : b : c = cos2 2π


7 : cos
2 4π
7 : cos2 6π
7 .
This unusual equality case makes the theorem difficult to prove.
An Example LaTeX Document 4

5 Referencing
The above examples are the simplest cases. You can get much fancier: check
out the Wikibooks.

6 Numbered and Bulleted Lists


Here is a numbered list.

1. The environment name is “enumerate”.

2. You can nest enumerates.


a) Subitem
b) Another subitem

2 12 . You can also customize any particular label.

3. But the labels continue onwards afterwards.

You can also create a bulleted list.

ˆ The syntax is the same as “enumerate”.

ˆ However, we use “itemize” instead.

7 More Sources
This is just a modest example of some common usages. For more sources,

1. The excellent Wikibooks, [Link] pro-


vide a much more thorough, comprehensive treatise on using LATEX.

2. Detexify, [Link] can be useful


for locating a particular symbol.

3. And finally, Google. Seriously. If you want to know how to do something,


a quick Google search suffices 90% of the time.

You might also like