Lecture 5
Lecture 5
Kaushik Roy
1 Introduction to LATEX
2 Text formatting
8 Drawing Figures
Kaushik Roy (WBSU) LaTeX May 29, 2024 2 / 17
Symbols
\beginmath
math equation
\endmath
$ math equation $
\ensuremath{math equation}
\documentclass{article}
\begin{document}
Sample symbol $ α $ is as a equation in text
\end{document}
\documentclass{article}
\begin{document}
Sample symbol $ α $ is as a equation in text
\end{document}
Output
Sample symbol α is as a equation in text
Output
a0 = 1 (2)
an+1 = 2 × an (3)
Output
Note that the equations are numbered. If you don’t want this feature,
use the eqnarray* environment instead
Kaushik Roy (WBSU) LaTeX May 29, 2024 8 / 17
Algorithm
\documentclass{article}
\usepackage{algpseudocode}
\begin{algorithmic}
Output
\State $ i \gets 10$ i ← 10
\If{$i \geq 5$} if i ≥ 5 then
i ←i −1
\State $ i \gets i-1$
else
\Else \If{$i \lq 3$} if i ≤ 3 then
i ←i +2
\State $ i \gets i+2$ end if
\Endif end if
\Endif
\end{algorithmic}
1: i ← 10
2: if i ≥ 5 then
3: i ←i −1
4: else ▷ This is a comment
5: if i ≤ 3 then
6: i ←i +2
7: end if
8: end if
1 Introduction to LATEX
2 Text formatting
8 Drawing Figures
1 Introduction to LATEX
2 Text formatting
8 Drawing Figures
1 Introduction to LATEX
2 Text formatting
8 Drawing Figures
1 Introduction to LATEX
2 Text formatting
8 Drawing Figures