0% found this document useful (0 votes)
19 views25 pages

Latex Tutorial - Com 1

Uploaded by

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

Latex Tutorial - Com 1

Uploaded by

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

https://latex-tutorial.

com/

1
01 FIRST DOCUMENT

2
1. Basic_layout 01 FIRST DOCUMENT\1. Basic_layout.pdf

\documentclass{article} %\commandname{option}
\begin{document}
Hello World!
\end{document}

3
2.Environment
One environment Two environments
% Valid:
% Valid:

\begin{document}
\begin{document}
\begin{environment1}
\begin{environment2}
\begin{environment}
\end{environment2}
\end{environment}
\end{environment1}
\end{document}
\end{document}
4
3. Adding a title page 01 FIRST DOCUMENT\3. Adding a title page.pdf

\documentclass{article}

\title{My first document} % Preamble


\date{2013-09-01}
\author{John Doe}

\begin{document}
\maketitle
\newpage % Document
Hello World!
\end{document}
5
3a. Adding a title page 01 FIRST DOCUMENT\3a. Adding a title page.pdf

\documentclass{article}

\title{My first document}


\date{2013-09-01}
\author{John Doe}

\begin{document}
\pagenumbering{gobble} % to hide the page number for our first page
\maketitle % used to generate the title page
\newpage
\pagenumbering{arabic}

Hello World!
\end{document} 6
02 SECTIONS

7
1. Example output of sections and subsections 02 SECTIONS\1. Example output of sections and subsections.pdf

\documentclass{article}
\title{Title of my document}
\date{2013-09-01}
\author{John Doe}

\begin{document}

\maketitle
\pagenumbering{gobble}
\newpage
\pagenumbering{arabic}
\section{Section}

Hello World!
\subsection{Subsection}
Structuring a document is easy!
8
\end{document}
2. Hierarchy of sectioning elements 02 SECTIONS\2. Hierarchy of sectioning elements.pdf

\documentclass{article}
\begin{document}
\section{Section}
Hello World!
\subsection{Subsection}
Structuring a document is easy!
\subsubsection{Subsubsection}
More text.
\paragraph{Paragraph}
Some more text.
\subparagraph{Subparagraph}
Even more text.
\section{Another section}
9
\end{document}
03 PACKAGES

10
Using LaTeX packages

% LaTeX offers a lot of functions by default, but in some situations it can


become handy to use packages.

% To import a package in LaTeX, simply add the \usepackage directive to


the preamble of your document:

\documentclass{article}

\usepackage{PACKAGENAME}

\begin{document}
...
\end{document} 11
Purpose of packages - 03 PACKAGES\2. Purpose of packages.pdf

% There are countless packages, all for different purposes.


% To typeset math, LaTeX offers (among others) an environment called equation.
% Everything inside this environment will be printed in math mode.
% LaTeX also takes care of equation numbers for us:

\documentclass{article}

\begin{document}

\begin{equation}
f(x) = x^2
\end{equation}

\end{document}
12
Using / Including a package 03 PACKAGES\3. Using _ Including a package.pdf

\documentclass{article}

\usepackage{amsmath}
% The automatic numbering is a useful feature,
% but sometimes it is necessary to remove them for auxiliary calculations.
% LaTeX doesn’t allow this by default, now we want to include a package.

\begin{document}

\begin{equation*} % * indicates that the equation should not be numbered.


f(x) = x^2
\end{equation*}

\end{document} 13
04 MATH

14
LaTeX math and equations

1.Inline math

2.Equations

3.Fractions

4.Matrices

5.Scaling of Parentheses, Brackets etc.

15
There are two major modes of typesetting math in
LaTeX:

• one is embedding the math directly into your text


by encapsulating your formula in dollar signs and

• the other is using a predefined math environment.

16
1. Using inline math – embed formulas in your text

To make use of the inline math feature, simply write your text
and if you need to typeset a single math symbol or formula,
surround it with dollar signs:
...
This formula $f(x) = x^2$ is an example.
...
17
2. The equation and align environment

The most useful math envorinments are:

the equation environment for typesetting single


equation and

the align environment for multiple equations and


automatic alignment:

18
2. The equation and align environment 04 MATH\2. The equation and align environment.pdf
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation*}
1+2=3
\end{equation*}

\begin{equation*} % The asterisk (e.g. equation*) indicates that the equations need not be numbered .
1=3-2
\end{equation*}

\begin{align*} % The align environment will align the equations at the ampersand &.
1 + 2 &= 3\\
1 &= 3 - 2
\end{align*}

\end{document} 19
3. Fractions and more

LaTeX is capable of displaying any mathematical


notation.

It is possible to typeset integrals, fractions and


more.

Every command has a specific syntax to use.


20
3. Fractions and more 04 MATH\3. Fractions and more.pdf

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{align*}
f(x) &= x^2\\
g(x) &= \frac{1}{x}\\
F(x) &= \int^a_b \frac{1}{3}x^3
\end{align*}

\end{document} 21
4. Matrices

It is possible to display matrices in LaTeX.

There is a special matrix environment for this purpose,

please keep in mind that the matrices only work within


math environments.

22
4. Matrices04 MATH\4. Matrices.pdf
\documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin{align}
\begin{matrix}
1 & 0 \\
0&1
\end{matrix}
\end{align}
\end{document}
23
5. Brackets in math mode – Scaling

To surround the matrix by brackets,

It is necessary to use special statements,

because the plain [ ] symbols do not scale as the


matrix grows.

24
5. Brackets in math mode – Scaling04 MATH\5. Brackets in math mode – Scaling.pdf
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
\left[
\begin{matrix}
1 & 0\\
0&1
\end{matrix}
\right]
\end{align*}
\end{document} 25

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy