LaTeX Manul
LaTeX Manul
Prepared by
Dr. Sathyanarayana N
Associate Professor
Department of Information Science & Engineering
1|Page
CONTENTS
3 Develop a LaTeX script to create a simple title page of the VTU project
Report [Use suitable Logos and text formatting] 6
4 Develop a LaTeX script to create the Certificate Page of the Report [Use
suitable commands to leave the blank spaces for user entry] 9
2|Page
9 Develop a LaTeX script to create a document that consists of two
paragraphs with a minimum of 10 citations in it and display the reference in
20
the section
3|Page
Program 1
Develop a LaTeX script to create a simple document that consists of 2 sections
[Section1, Section2], and a paragraph with dummy text in each section. And also
include header [title of document] and footer [institute name, page number] in the
document.
\documentclass{article}
\usepackage{fancyhdr}
\usepackage{lipsum} % For generating dummy text
% Define header and footer
\pagestyle{fancy}
\fancyhf{} % Clear default header and footer
\fancyhead[C]{My Document} % Header center
\fancyfoot[L]{Vemana Institute of Technology} % Footer center
\fancyfoot[R]{\thepage}
\begin{document}
\section{Introduction}
\lipsum[1-2]
\newpage % Page break
\section{Methodology}
\lipsum[3-4]
\end{document}
OUTPUT
4|Page
Program 2
Develop a LaTeX script to create a document that displays the sample Abstract/Summary
\documentclass{article}
\usepackage{lipsum}
\title{Sample Abstract/Summary}
\author{}
\date{}
\begin{document}
\maketitle
\section*{Abstract}
\lipsum[1]
\vspace{0.5cm}
\lipsum[3]
\end{document}
OUTPUT
5|Page
Program 3
Develop a LaTeX script to create a simple title page of the VTU project Report [Use
suitable Logos and text formatting]
6|Page
\vspace{0.2in}
% Student Details
Submitted by\\
\vspace{0.08in}
\begin{tabular}{ll}
\textbf{1ME21CS017} & \textbf{Braham Kumar Sah}\\
\textbf{1ME21AI015} & \textbf{Shoaib Akhtar}\\
\textbf{1ME21CS005} & \textbf{Aman Kumar}\\
\textbf{1ME21CS015} & \textbf{Bikash Kumar Singh}\\
\end{tabular}
\vspace{0.2in}
% Guide Details
\textbf{Under the Guidance of}\\
Dr. Sathyanarayana N\\
Asso. Professor Department of ISE\\
vspace{0.2in}
% College Details
\includegraphics[scale=0.4]{msec.jpg}\\
\vspace{0.01in}
{\small DEPARTMENT OF INFROMATION SCIENCE AND ENGINEERING}\\
\vspace{0.1in}
\textbf{Vemana Institute of Technology}\\
{\small NAAC accredited Approved by AICTE, New Delhi, Affiliated to VTU,
Belagavi, Navarathna
Agrahara, Off International Airport Road, Bengaluru -562110}\\
\vspace{0.1in}
{\small 2023-2024}\\
\end{center} % Ending the center environment
\end{titlepage} % Ending the title page environment
\end{document}
7|Page
OUTPUT
8|Page
Program 4
Develop a LaTeX script to create the Certificate Page of the Report [Use suitable
commands to leave the blank spaces for user entry]
\documentclass[12pt, a4paper]{report}
\usepackage{graphicx}
\usepackage{geometry}
\geometry{a4paper, total={170mm, 257mm}, left=20mm, right=20mm, top=20mm,
bottom=20mm}
\thispagestyle{empty}
\begin{document}
\begin{titlepage}
\begin{center}
\textbf{{\large VISVESVARAYA TECHNOLOGICAL UNIVERSITY}}\\
{\normalsize Jnana Sangama, Belgaum-590018}\\
\vspace{0.5in}
\includegraphics[scale=0.1]{vtu-logo.png}\\
\vspace{0.5in}
\textbf{CERTIFICATE}\\
\vspace{0.3in}
This is to certify that \\
\vspace{0.2in}
\underline{\hspace{10cm}}\\
\vspace{0.2in}
(Name of the student)\\
\vspace{0.2in}
bearing University Seat Number \\
\vspace{0.2in}
\underline{\hspace{10cm}}\\
\vspace{0.2in}
has satisfactorily completed the project work entitled \\
\vspace{0.2in}
\underline{\hspace{10cm}}\\
\vspace{0.2in}
(Title of the project)\\
9|Page
\vspace{0.2in}
towards the partial fulfillment of the requirements for the award of the degree of\\
\vspace{0.2in}
\textbf{BACHELOR OF ENGINEERING\\IN\\INFROMATION SCIENCE AND
ENGINEERING}\\
\vspace{0.5in}
\textbf{Guide} \hspace{3.5in} \textbf{Head of the Department}\\
\vspace{0.3in}
\underline{\hspace{6cm}} \hspace{1.5in} \underline{\hspace{6cm}}\\
\vspace{0.1in}
\textbf{(Guide's Name)} \hspace{2.7in} \textbf{(HOD's Name)}\\
\vspace{0.1in}
\textbf{(Guide's Designation)} \hspace{2in} \textbf{(HOD's Designation)}\\
\vspace{0.1in}
\textbf{(Department of ISE)} \hspace{2.1in} \textbf{(Department of ISE)}\\
\vspace{0.1in}
\textbf{[College Name]}\\
\vspace{0.1in}
\textbf{[Location]}\\
\vspace{0.1in}
\textbf{[Month Year]} % Replace with current month and year
\end{center}
\end{titlepage}
\end{document}
10 | P a g e
OUTPUT
11 | P a g e
Program 5
Develop a LaTeX script to create a document that contains the following table with
proper labels.
\documentclass{article}
\usepackage{array, booktabs, multicol, multirow} % Load necessary packages
\renewcommand{\arraystretch}{1.2} % Adjust vertical spacing in tables
\begin{document}
\centering
\textbf{\Large{Student Details and Marks}} % Title
\vspace{0.1in}
\begin{table}[h]
\centering
\begin{tabular}{|c|c|c|c|c|c|} % Define table with 6 columns, all centered
\hline
\multirow{2}{*}{\textbf{S.No}} & \multirow{2}{*}{\textbf{USN}} &
\multirow{2}{*}{\textbf{Student Name}} & \multicolumn{3}{c|}{\textbf{Marks}}
\\ % Multirow for headers spanning 2 rows, Multicolumn for header "Marks"
spanning 3 columns
\cline{4-6} % Horizontal line from column 4 to 6& & & \textbf{Subject1} &
\textbf{Subject2} & \textbf{Subject3} \\ % Sub-headers for marks
\hline
\multicolumn{1}{|c|}{1} & \multicolumn{1}{c|}{4XX22XX01} &
\multicolumn{1}{c|}{Name 1} & 89 & 60 & 90 \\ % Data rows
\hline
\multicolumn{1}{|c|}{2} & \multicolumn{1}{c|}{4XX22XX02} &
\multicolumn{1}{c|}{Name 2} & 78 & 45 & 98 \\
\hline
12 | P a g e
\multicolumn{1}{|c|}{3} & \multicolumn{1}{c|}{4XX22XX03} &
\multicolumn{1}{c|}{Name 3} & 67 & 55 & 59 \\
\hline
\end{tabular}
\end{table}
\end{document}
OUTPUT
13 | P a g e
Program 6
Develop a LaTeX script to include the side-by-side graphics/pictures/figures in the
document by using the subgraph concept
\documentclass{article}
\begin{document}
\begin{figure}
\centering
\end{subfigure}
\end{subfigure}
\caption{Combined caption for both images} % Overall caption for the figure
\end{figure}
\end{document}
14 | P a g e
OUTPUT
15 | P a g e
Program 7
Develop a LaTeX script to create a document that consists of the following two
mathematical equations
\documentclass{article}
\begin{document}
\date{}
\maketitle
\[\begin{aligned}
\begin{split}
\end{split}
\begin{split}
16 | P a g e
\varphi_{\sigma}^{\lambda} A_{t} &= \sum_{\pi \in C_{t}} \operatorname{sgn}(\pi)
\varphi_{\sigma}^{\lambda} \varphi_{\pi}^{\lambda} \notag \\
\end{split}
\end{aligned}\]
\end{document}
OUTPUT
17 | P a g e
Program 8
Develop a LaTeX script to demonstrate the presentation of Numbered theorems,
definitions, corollaries, and lemmas in the document
\documentclass{article}
\usepackage{amsthm}%The package facilitates the kind of theorem setup typically
needed in American Mathematical Society publications.
% Define theorem-like environments
\newtheorem{theorem}{theorem}[section] % Theorems numbered within sections
\newtheorem{definition}[theorem]{Definition} % Definitions share numbering with
theorems
\newtheorem{corollary}[theorem]{Corollary} % Corollaries share numbering with
theorems
\newtheorem{lemma}[theorem]{Lemma} % Lemmas share numbering with
theorems
\begin{document}
\section{Introduction}
\begin{theorem}
(Pythagorean Theorem) In a right-angled triangle, the square of the length of the
hypotenuse is equal to the sum of the squares of the lengths of the other two sides.
\begin{equation}
a^2 + b^2 = c^2
\end{equation}
\end{theorem}
\begin{definition}
(Prime Number) A prime number is a natural number greater than 1 that is not
divisible by any number other than 1 and itself.
\begin{itemize}
\item Example: 2, 3, 5, and 7 are prime numbers.
\end{itemize}
\end{definition}
\begin{corollary}
\item Proof: Corollary is a statement that follows with little or no proof required
from an already proven statement.
For example, the sum of the interior angles of any triangle is always 180 degrees.
18 | P a g e
\end{corollary}
\begin{lemma}
A true statement that is lesser important and is used in proving another important
statement true.
(Basic Arithmetic Identity) For any real numbers $a$ and $b$, we have:
\begin{equation}
(a + b)^2 = a^2 + 2ab + b^2.
\end{equation}
\end{lemma}
\end{document}
OUTPUT
19 | P a g e
Program 9
Develop a LaTeX script to create a document that consists of two paragraphs with a
minimum of 10 citations in it and display the reference in the section
\documentclass{article}
\usepackage{amsthm}
\usepackage[numbers]{natbib} % Use the 'natbib' package for citation management
\author{}
\begin{document}
\title{Document that Consists of Two Paragraphs with a minimum of 10 Citations in
it and Displaying the References in the Section}
\date{}
\maketitle
% Write two paragraphs with at least 10 citations
\paragraph{Paragraph 1}
The theory of relativity has been explored extensively in various scientific
papers \citep{author1, author2, author3}. Einstein's contributions to physics are
profound and have paved the way for many modern discoveries \citep{author4,
author5}. Researchers continue to investigate the complexities of spacetime and the
universe \citep{author6, author7}. These advancements have led to new methods of
measurement and analysis in cosmology \citep{author8}
\paragraph{Paragraph 2}
\begin{thebibliography}{99}
20 | P a g e
\bibitem{author1} Author One. \textit{Title of Article One}. Journal Name,
vol. 10, no. 1, pp. 1--10, 2022.
\end{thebibliography}
\end{document}
21 | P a g e
OUTPUT
22 | P a g e
Program 10
\documentclass{article}
\usepackage{tikz} %Imports the TikZ package, which is necessary for creating
graphics and diagrams.
\begin{document}
\centering
% Define styles for nodes
\tikzstyle{level 1}=[level distance=2cm, sibling distance=6cm] %Defines the style
for the first level of the tree, setting the vertical distance between levels to 2 cm and
the horizontal distance between sibling nodes to 6 cm.
\tikzstyle{level 2}=[level distance=2cm, sibling distance=3cm]
% Begin TikZ picture
\begin{tikzpicture}[grow=down, sloped] %Begins the TikZ picture environment.
The grow=down option specifies that the tree should grow downwards from the root
node. The sloped option makes the edges (lines) connecting the nodes sloped.
% Root node
\node {Root}
% First child
child {
node {Child 1} % First child node
child {
node {Subchild 1} % Subchild node
}
child {
node {Subchild 2} % Subchild node
}
}
% Second child
child {
node {Child 2} % Second child node
child {
23 | P a g e
node {Subchild 1} % Subchild node
}
child {
node {Subchild 2} % Subchild node
}
};% semicolon in the TikZ tree diagram code is used to properly close the nested
child nodes and the overall \node structure.
\end{tikzpicture}
\end{document}
OUTPUT
24 | P a g e
Program 11
Develop a LaTeX script to present an algorithm in the document using
algorithm/algorithmic/algorithm2e library.
\documentclass{article}
\usepackage{algorithm}
\usepackage{algpseudocode}
\begin{document}
\begin{algorithm}
\caption{Bubble Sort}
\begin{algorithmic}[1]
\Procedure{BubbleSort}{$A, n$}
\For{$i \gets 0$ to $n-2$}
\For{$j \gets 0$ to $n-2-i$}
\If{$A[j] > A[j+1]$}
\State Swap $A[j]$ and $A[j+1]$
\EndIf
\EndFor
\EndFor
\EndProcedure
\end{algorithmic}
\end{algorithm}
\end{document}
OUTPUT
25 | P a g e
Program 12
Develop a LaTeX script to create a simple report and article by using suitable
commands and formats of user choice.
\documentclass{report}
\title{Simple Report}
\author{}
\date{}
\begin{document}
\maketitle
\tableofcontents
\chapter{Introduction}
This is the introduction.
\chapter{Methods}
This is the methods section.
\chapter{Results}
This is the results section.
\chapter{Discussion}
This is the discussion section.
\chapter{Conclusion}
This is the conclusion.
\end{document}
26 | P a g e
OUTPUT
27 | P a g e
28 | P a g e
29 | P a g e