Basics of L TEX: Roxanne Daphne O. Lapaan
Basics of L TEX: Roxanne Daphne O. Lapaan
Commands
Basics of LATEX
Lapaan, R. D.
February 2014
Basics of LATEX
Installing LATEX
Commands
Installing LATEX
Lapaan, R. D.
February 2014
Basics of LATEX
Installing LATEX
Commands
Configuring TeXnicCenter
Lapaan, R. D.
February 2014
Basics of LATEX
Installing LATEX
Commands
Start up Commands
\documentclass[options]{style}
Style include article, report, and book
Options include fontsizes (i.e. 9pt, 10pt, etc.) and paper sizes
(i.e. legalpaper, letterpaper, a4paper).
\begin{document}, \end{document}
Type what you want to see in your output between these two
commands.
Lapaan, R. D.
February 2014
Basics of LATEX
Installing LATEX
Commands
Parts
Preamble
This is what is between
\documentclass
and
\begin{document}
This is where we import packages and include other
modifications to the document.
Document Environment
This is what is between
\begin{document}
and
\end{document}
Lapaan, R. D.
February 2014
Basics of LATEX
Installing LATEX
Commands
Example
\documentclass[9pt]{article}
\begin{document}
Hello World!
\end{document}
Lapaan, R. D.
February 2014
Basics of LATEX
Installing LATEX
Commands
Basic Commands
\textbf{}
Hello World!
\textit{}
Hello World!
\textsc{}
Hello World!
\noindent
\\
- new line.
\\ plus a space between lines
- new paragraph.
Lapaan, R. D.
February 2014
Basics of LATEX
Installing LATEX
Commands
Alignment Environments
\begin{center}, \end{center}
This text is centered.
\begin{flushleft}, \end{flushleft}
To the left, to the left.
\begin{flushright}, \end{flushright}
To the right, to the right.
Lapaan, R. D.
February 2014
Basics of LATEX
Installing LATEX
Commands
Itemize Environment
This environment
creates a bulleted
list
that can be nested
and nested
Lapaan, R. D.
February 2014
Basics of LATEX
Installing LATEX
Commands
Itemize Environment
\begin{itemize}
\item This environment
\item creates a bulleted
\item list
\begin{itemize}
\item that can be nested
\begin{itemize}
\item and nested
\end{itemize}
\end{itemize}
\end{itemize}
Lapaan, R. D.
February 2014
Basics of LATEX
Installing LATEX
Commands
Enumerate Environment
This environment
creates a numbered
list
Lapaan, R. D.
and nested
February 2014
Basics of LATEX
Installing LATEX
Commands
Enumerate Environment
\begin{enumerate}
\item This environment
\item creates a numbered
\item list
\begin{enumerate}
\item that can be nested
\begin{enumerate}
\item and nested
\end{enumerate}
\end{enumerate}
\end{enumerate}
Lapaan, R. D.
February 2014
Basics of LATEX
Installing LATEX
Commands
Lapaan, R. D.
February 2014
Basics of LATEX
Installing LATEX
Commands
Typesetting Math
A mathematical expression is enclosed by a dollar sign (for an
inline expression) or a double dollar sign (for a display styled
expression). e.g.
the expression $x+4$
will produce
the expression x + 4
while
the expression $$x+4$$
will produce
the expression
x +4
Lapaan, R. D.
February 2014
Basics of LATEX
Installing LATEX
Commands
Typesetting Math
^{}
- superscript
_{}
- subscript
\leq
- less than or equal to
\geq
- greater than or equal to
Lapaan, R. D.
February 2014
Basics of LATEX
Installing LATEX
Commands
Typesetting Math
\sqrt{}
- square root
\sqrt[n]{}
- nth root
\frac{numerator}{denominator}
- for fractions
\displaystyle
- for a display styled inline expression
Lapaan, R. D.
February 2014
Basics of LATEX
Installing LATEX
Commands
Example
Typeset:
Solve for x in
x2
1
+ 2x + 5 =
4
16
Solve for x in
1 q
3
Lapaan, R. D.
February 2014
x+
1
x1
Basics of LATEX
Installing LATEX
Commands
Example
\begin{itemize}
\item Solve for $x$ in
$\displaystyle \frac{x^{2}}{4}+2x +5=\frac{1}{16}$
\item Solve for $x$ in
$$ 1-\frac{1}{\sqrt[3]{x+\frac{1}{\sqrt{x-1}}}} $$
\end{itemize}
Lapaan, R. D.
February 2014
Basics of LATEX
Installing LATEX
Commands
Trigonometric Functions
Indeed every letter inside a mathematical expression is considered a
variable in LATEX and is italicized in the output. Hence we have
these commands for Logarithms and Trigonometric Functions:
\cos
\sin
\tan
\sec
\csc
\cot
\log
\ln
Lapaan, R. D.
February 2014
Basics of LATEX
Installing LATEX
Commands
Greek Alphabet
\theta
-
\Theta
-
i.e. The commands for Greek letters are the spelled out letters
itself and if we want a capital Greek letter, we just capitalize the
first letter in the command.
Lapaan, R. D.
February 2014
Basics of LATEX
Installing LATEX
Commands
Example
Typeset:
tan + cot =
Lapaan, R. D.
February 2014
sin
cos
+
cos
sin
Basics of LATEX
Installing LATEX
Commands
Example
Lapaan, R. D.
February 2014
Basics of LATEX
Installing LATEX
Commands
\int_{lowerlimit}^{upperlimit}
Z
upperlimit
lowerlimit
\frac{dx}{dt}
dx
dt
\frac{\partial x}{\partial t}
x
t
Lapaan, R. D.
February 2014
Basics of LATEX
Installing LATEX
Commands
\sum_{n=1}^{k}
k
X
n=1
\prod_{n=1}^{k}
k
Y
n=1
Lapaan, R. D.
February 2014
Basics of LATEX
Installing LATEX
Commands
Why resize?
Unresized:
(
Resized:
Lapaan, R. D.
x +1
)
x2 + 1
x +1
x2 + 1
February 2014
Basics of LATEX
Installing LATEX
Commands
How to resize?
\left( <insert expression here> \right)
\left\{ <insert expression here> \right\}
\left[ <insert expression here> \right]
So basically, you just use
\left, \right
Lapaan, R. D.
February 2014
Basics of LATEX
Installing LATEX
Commands
Aligning Expressions
2
2
x 1
Lapaan, R. D.
February 2014
Basics of LATEX
Installing LATEX
Commands
Aligning Expressions
Use the align or align* environment which is available in the
amsmath package.
Whats the difference? align puts an equation number in every line
while align* does not.
How to use align:
Import the amsmath package. That is, in the preamble, type
\usepackage{amsmath}
Precede the symbol/expression you want to align with the
others in an ampersand (&)
End the current expression line with a double backslash (\\)
Lapaan, R. D.
February 2014
Basics of LATEX
Installing LATEX
Commands
Aligning Expressions
Lapaan, R. D.
February 2014
Basics of LATEX
Installing LATEX
Commands
Thank You! : )
Lapaan, R. D.
February 2014
Basics of LATEX