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

LATEX notes

LaTeX is a markup language and document preparation system widely used for typesetting scientific and mathematical documents, offering superior typesetting quality and extensive customization options. The document outlines the basic structure of LaTeX, including formatting, sections, lists, tables, figures, and mathematical notations. It also provides examples of various commands and environments used in LaTeX for text formatting, page layout, and mathematical expressions.

Uploaded by

ankurpatil085
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)
7 views

LATEX notes

LaTeX is a markup language and document preparation system widely used for typesetting scientific and mathematical documents, offering superior typesetting quality and extensive customization options. The document outlines the basic structure of LaTeX, including formatting, sections, lists, tables, figures, and mathematical notations. It also provides examples of various commands and environments used in LaTeX for text formatting, page layout, and mathematical expressions.

Uploaded by

ankurpatil085
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/ 11

Topics:

What is Latex?
Advantages of latex.
Basic structure of Latex.
Formatting in latex.
Section, List and Referencing in Latex.
Tables and figures in Latex.
Mathematical Notations.

What is LaTeX?
LaTeX is a markup language and document preparation system used for
typesetting documents.
LaTeX is a typesetting system which is commonly used for producing scientific
and mathematical documents, including academic papers, theses, reports, and
presentations. It provides a high-quality output, particularly for complex
documents with mathematical equations, tables, and graphics.

Advantages of LaTeX:
Superior typesetting quality, especially for mathematical equations and
technical content.
Consistent formatting across different platforms and printers.
Separation of content and formatting, allowing users to focus on writing without
worrying about layout.
Extensive customization options for document styles and templates.
LaTeX Editors:

TeXstudio
TeXworks
Overleaf
TeXShop
LaTeXila
Texmaker
Miktex

Introduction to Latex document structure :-


● Documentclass: Defines the overall layout (e.g., article, report, book).
● Title, author, date: Information about the document.
● Abstract: Summarizes the content
Example:

\documentclass{article}

\title{Introduction to LaTeX}

\author{Your Name}

\date{\today}

\begin{document}

\maketitle

\begin{abstract}

This is a brief introduction to LaTeX document structure.

\end{abstract}

\end{document}
● Commenting:In LaTeX, we can add comments using the % symbol. Anything next to
the % sign treated as a comment and will not be printed in the output. Comments are
useful for adding explanations to your code or temporarily excluding certain lines
without deleting them.

Text Formatting:-
● Font styles: In LaTeX, you can apply various font styles to text using commands.
Here are some common font styles.
\textbf{Text}: Renders the text in bold.
\textit{Text}: Renders the text in italics.
\underline{Text}: Underlines the text.
\texttt{Text}: Renders the text in a monospaced (typewriter) font.
\textsf{Text}: Renders the text in a sans-serif font.

● Font Sizes: In LaTeX, you can set the font size using various commands. Here are the
basic commands for changing font sizes.

\tiny : The smallest size.


\scriptsize: Slightly larger than \tiny.
\footnotesize: Smaller than the normal size.
\small: Smaller than the normal size.
\normalsize: Normal size text
\large: Larger than the normal size.
\Large: Even larger than \large.
\LARGE: Larger than \Large.
\huge: Huge size.
\Huge: Largest size.

Example:
\documentclass{article}
\begin{document}
{\tiny Tiny text.}
{\scriptsize Scriptsize text.}
{\footnotesize Footnotesize text.}
{\small Small text.}
{\large Large text.}
{\Large Larger text.}
{\LARGE Even larger text.}
{\huge Huge text.}
{\Huge Largest text.}
\end{document}
Output:

Tiny text. Scriptsize text. Footnotesize text. Small text. Large text.
Larger text. Even larger text.
Huge text. Largest
text.

● Text Color: In Latex we change the color of text using the ‘\textcolor’ command from
the ‘xcolor’ package.
● Background color: Using the command ‘\colorbox’ form the ‘xcolor’ package.

Example:

\documentclass{article}
\usepackage{xcolor}
\begin{document}
\textcolor{red}{Red text}

\colorbox{yellow}{Text with yellow background color}


\end{document}
Output:

Red text
Text with yellow background color

Text Alignment:
● Center alignment: To text horizontally on the page, we use the ‘\centering’ command
or ‘center’ environment.
● Right alignment: To right-align text, we use the ‘flushright’ environment.

● Left alignment: To left-align text, we use the ‘flushleft’ environment.

Spaces:
● Vertical space: ‘\vspace{length}’ adds vertical space.
● Horizontal space: ‘\hspace{length}’ adds horizonatal space.
● Negative space: Use negative values for \vspace and \hspace.
Length can be specified in varies unites e.g. pt, cm, in.

Paragraph:
● For new paragraph leave a blank line or use command \newparagraph.
● For new line use command \\ or \newline.
● \noindent suppresses paragraph indentation.
● \smallskip ,\medskip, \bigskip adds small, medium or large vertical space between
paragraph.

Page Layout and Margin:


● The geometry package in LaTeX is use for customizing the page layout, including
paper size, margins, and other parameters.
● For page layout there are some paper size a4paper, letterpaper, legalpaper, and
executivepaper and we can also customize paper size using ‘paperwidth= ‘ and
‘paperheight= ‘ in geometry package.
● For margin we use margin command in geometry package and also customize margin
on top, left, right, and bottom.
Example:

\usepackage[a4paper,margin=1in]{geometry}

\usepackage[legalpaper, top=1cm, right=1.5cm, left=2.5cm, bottom=1cm]{geometry}

\usepackage[paperwidth=15cm,paperheight=25cm, margin=2.5cm]{geometry}

Hyperlink:
● In Latex we can create hyperlinks using the \href command from the hyperref
package. The hyperref package provides extensive support for hyperlinks, including
links to URLs, email addresses, and internal document links. Here’s a simple
example:

\documentclass{article}
\usepackage{hyperref}
\begin{document}
Click \href{https://www.example.com}{link}
\end{document}

Enumerates:
● To create enumerated lists in LaTeX, you can use the enumerate environment. Here’s
a simple example:

\documentclass{article}
\begin{document}
\begin{enumerate}
\item First item
\item Second item
\item Third item
\end{enumerate}
\end{document}
Header and Footer:
● To create custom headers and footers in LaTeX, we use the fancyhdr package. Here’s
a simple example:

\documentclass{article}
\usepackage{fancyhdr}

\pagestyle{fancy}

\fancyhead[r]{page no \thepage}
\fancyhead[L]{page no \thepage}
\fancyfoot[c]{this is footer}
\begin{document}

% Your document content goes here

\end{document}

Figures and Pictures :


• Graphics package is use to add figures and pictures in latex document
• Upload image on latex editor then
• Using Command \includegraphics[width=5cm]{image.png }
• For in line figure use wrapfigure package
Example :

\begin{wrapfigure}{l}{0.25\textwidth}
\includegraphics[width=0.9\linewidth]{image.png}
\caption{Caption1}
\label{fig:wrapfig}
\end{wrapfigure}
Table in LaTeX
• Tabular environment:
Eg.

\begin{tabular}{|c|c|c|}
\hline
cell1 & cell2 &cell3 \\
\hline
cell4 & cell5 & cell6 \\
\hline
cell4 & cell5 & cell6 \\
\hline
\end {tabular}

‘|c|c|c|’ for three centered columns with vertical lines.


‘&’ is used to separate the entries with in a row.
‘\\’ is used to start new row.
‘\hline’ is used to draw horizontal lines in the table.

• Table environment:
Eg.

\begin{table}
\centering
\caption{caption}
\begin{tabular}{|c|c|c|}
\hline
cell1 & cell2 &cell3 \\
\hline
cell4 & cell5 & cell6 \\
\hline
cell4 & cell5 & cell6 \\
\hline
\end {tabular}

‘\centering’ gives center alignment to table and caption


‘\caption{caption}’ gives caption to table.
Math mode:
• To enter inline equations, wrap your expression with $.....$
• For displayed equation use $$....$$, \[……\], or the equation environment.
Symbols and operations:
• Greek letters: \alpha,\beta,\omega,\theta,\delta,etc
• Mathematical symbols: +, -, *, /, =, \neq, \leq, \geq, \times, \div,
Subscripts and Superscripts:
• Subscript: use ‘_’ for subscript eg. a_1 gives a1.
• Superscript: use ‘^’ for superscript eg. x^2 gives x2.
Fractions:
• Fraction: \frac{numerator}{denominator}
1
Eg. \frac{1}{3} gives 3

Roots:
• Square root: \sqrt{}
eg. \sqrt{x} gives √𝑥
• nth root: \sqrt[n]{}
𝑛
eg. \sqrt[n]{x} gives √𝑥
Integrals and derivatives:
• Integral: \int_{lower}^{upper} expression \dx.
• Derivative: \frac{d}{dx}.
Equation alignment:
• Use the ‘align’ environment for aligned equations. Insert ‘&’ before ‘=’ for align ‘=’ in
vertical line.
Summation and Product:
• Summation: \sum_{lower}^{upper}
• eg. \sum_{i=1}^{m} gives ∑𝑚 𝑖=1 ⬚
• Product: \prod_{lower}^{upper}
eg. \prod_{j=1}^{\infty} gives ∏∞𝑗=1 ⬚

Limit:
• Limit: \lim_{}
Eg. \lim_{x \to 0} gives lim ⬚
𝑥→0
Matrices:
To create matrices in LaTeX, you can use pmatrix, bmatrix, vmatrix, and Bmatrix
environments for different types of brackets.
• pmatrix environment for parentheses bracket.
• bmatrix environment for square brackets.
• vmatrix environment for vertical bars.
• Bmatrix environment for curly braces.

Example:

\begin{equation}
B = \begin{bmatrix}
b_{11} & b_{12} \\
b_{21} & b_{22}
\end{bmatrix}
\end{equation}

Mathematical symbols in LaTeX:

Commands Output: Commands Output:


\times × \in ∈
\div ÷ \notin ∉
\infty ∞ \cap ∩
\neq ≠ \cup ∪
\leg ≤ \subset ⊂
\geq ≥ \superset ⊃
\forall ∀ \equiv ≡
\exists ∃ \approx ≈
\degree ᵒ \angle ∠
\partial 𝜕 \parallel ∥
\sim ~ \perp ⊥
\hat{a} 𝑎̂ \vec{a} 𝑎⃗
\land ∧ \lor ∨

Greek letters in LaTeX:

Commands Output: Commands Output:


\alpha α \lambda λ
\beta β \mu μ
\gamma γ \pi π
\delta δ \theta θ
\Delta Δ \sigma σ
\epsilon ε \omega ω
\eta η \Omega Ω

You might also like