1st Latex
1st Latex
LaTeX”
Subject code: BCSL456D
Department of Information Science & Engineering
GSSSIETW, Mysore
May 3, 2025 1
Syllabus
May 3, 2025 2
May 3, 2025 3
Purpose of this Latex software
May 3, 2025 4
Agenda
Introduction to LaTex
Document Structure
Document classes
Packages
Environments
May 3, 2025 5
To produce an output like this
PDF file
May 3, 2025 6
LaTex Program
Sample.tex
Input
Latex Software
Output
PDF file
May 3, 2025 7
LaTex Program
Sample.tex
\documentclass[12pt,a4paper]{article}
\usepackage{times}
\title{Introduction to Latex}
\author{Dr. Umadevi V}
\date{\today}
\begin{document} PDF file
\maketitle
My first LaTex document. Latex is a document
preparation system for the Text
typesetting………
\end{document}
May 3, 2025 8
Latex Software
Offline Mode
Backend tool, MiKTex which processes Latex files.
Frontend tool, TeXmaker for creating and editing
Latex documents.
Online Mode
https://www.overleaf.com/
May 3, 2025 9
Latex : Offline Mode – MikTex and TeXnicCenter
May 3, 2025 10
Latex : Online - www.overleaf.com
May 3, 2025 11
Installation
First Install MikTex
Downloading MikTex
https://miktex.org/download
Those who are having difficulty in installing go for online mode Overleaf.
Login into Overleaf using your Google account.
May 3, 2025 12
Next we will see
What is Latex ?
Why we want to Learn Latex ?
May 3, 2025 13
What is LaTex ?
LATEX is a text processing system.
Base engine is ‘TEX’ (Donald Knuth, 1978)
developed for typesetting.
LATEX focuses on document structure than
details.
Has collection of defined commands to create
names and numbers for title, section, figures
etc.
LaTeX is based on the idea that it is better to
leave document design to document designers,
and to let authors get on with writing
documents.
May 3, 2025 14
Why we want to learn LaTeX ?
May 3, 2025 15
Agenda
Introduction to LaTex
Document Structure
Document classes
Packages
Environments
May 3, 2025 16
Document Structure
LATEX document is a plain text file with
required commands and environments.
The extension of the file is .tex
All commands start with a ‘\’ Eg., \title, \
caption, \label, etc.
May 3, 2025 17
Document Structure
LATEX document is a plain text file with
required commands and environments.
The extension of the file is .tex
All commands start with a ‘\’ Eg., \title, \
caption, \label, etc.
A LATEX document starts with a declaration of
the document type by \documentclass{}
May 3, 2025 18
Document Structure
LATEX document is a plain text file with
required commands and environments.
The extension of the file is .tex
All commands start with a ‘\’. Eg., \title, \
caption, \label, etc.
A LATEX document starts with a declaration of
the document type by \documentclass{}
The matter to type set are typed between \
begin{document} and
\end{document}
May 3, 2025 19
Agenda
Introduction to LaTex
Document Structure
Document class
Packages
Environments
May 3, 2025 20
Syntax of \documentclass
\documentclass[…]{…}
Optional Arguments
Required Arguments
May 3, 2025 21
Syntax of \documentclass
\documentclass[…]{…}
Optional Arguments
Required Arguments
May 3, 2025 22
Syntax of \documentclass
\documentclass[…]{…}
Optional Arguments
Required Arguments
May 3, 2025 23
Options for article documentclass
May 3, 2025 24
LaTex: Simple Example
\documentclass{article}
Input \begin{document}
Sample.tex My first LaTex document.
\end{document}
Output
PDF file
May 3, 2025 25
LaTex Example
Sample.tex
Input
TeXnicCenter
Output
PDF file
May 3, 2025 26
Source code of your first LaTeX document
Sample.tex
\documentclass{article}
\begin{document}
My first LaTex document.
\end{document}
\documentclass{article}
Input \begin{document}
Sample.tex My first LaTex document.
\end{document}
TeXnicCenter Tool
May 3, 2025 Latex for Research Documentation, BMSCE 28
Practice
Steps to Create and Compile your first
latex document
Press Start -> All Programs ->
TexnicCenter
To build
Press the keys Ctrl-F7
May 3, 2025 32
Next we will Learn
What is the Latex command to insert
•Author name
•Date
•Title
into the document.
May 3, 2025 33
Answer
May 3, 2025 34
LaTex Program: Practice
Sample.tex
\documentclass[12pt,a4paper]{article}
\usepackage{times}
\title{Introduction to Latex}
\author{Dr. Umadevi V}
\date{\today}
\begin{document} PDF file
\maketitle
My first LaTex document. Latex is a document
preparation system for the Text
typesetting………
\end{document} PDF file
May 3, 2025 35
Question
Among the following identify which one is the correct order
of commands
a. \maketitle \begin{document} \end{document}
b. \begin{document} \maketitle \end{document}
c. \begin{document} \end{document} \maketitle
May 3, 2025 36
Answer
Among the following identify which one is the correct order
of commands
a. \maketitle \begin{document} \end{document}
b. \begin{document} \maketitle \end{document}
c. \begin{document} \end{document} \maketitle
May 3, 2025 37
Question: Identify missing line of code
Sample.tex
May 3, 2025 38
Question: Identify missing line of code
May 3, 2025 39
Question: Identify error in this code
Sample.tex
May 3, 2025 40
Question: Identify error in this code
Correct Code
May 3, 2025 41
Agenda
Introduction to LaTex
Document Structure
Document classes
Packages
Environments
May 3, 2025 42
Packages
LaTeX "packages" serve the same function
as libraries for programming languages.
A package contains a set of commands that
are not built into the core of LaTeX, but
useful for special purposes.
There exist hundreds of packages.
To load a package, add a \
usepackage{package name} instruction in
the area between the \documentclass
and \begin{document}
May 3, 2025 43
List of few Packages
May 3, 2025 44
Using Packages
Example:
\documentclass[12pt,a4paper]
{article}
\usepackage{times}
\begin{document}
My first LaTex document.
\end{document}
May 3, 2025 45
Next we will learn
May 3, 2025 46
To produce an output like this
May 3, 2025 47
Sectioning
Ex: 1. Introduction
• Use
\section{section name}\label{section-label}
\section{Introduction}\label{intro}
May 3, 2025 48
Cross Referring a Section - Example
Latex Code
\section{Introduction}
Complex equations are described in
section \ref{CE}.
\section{Text Formatting}
\subsection{Fontsize}
\subsection{Text Justification}
\section{Mathematical Equations}
\subsection{Simple Equations}
\subsection{Complex Equations}\label{CE}
May 3, 2025 49
Cross Referring a Section - Example
Latex Code Output
\section{Introduction}
Complex equations are described in
section \ref{CE}.
\section{Text Formatting}
\subsection{Fontsize}
\subsection{Text Justification}
\section{Mathematical Equations}
\subsection{Simple Equations}
\subsection{Complex Equations}\label{CE}
May 3, 2025 50
Next we will Practice
May 3, 2025 51
Header and Footer
Package for Header and Footer
\usepackage{fancyhdr}
\fancypagestyle{}
i.empty: Both header and footer are cleared
ii.Plain: Header is clear, but the footer contains the page number in the center.
iii.Headings: Footer is blank, header displays information according to document class
(e.g., section name) and page number top right.
iv.myheadings: Page number is top right, and it is possible to control the rest of the
header.
May 3, 2025 52
Program1
\documentclass{article}
\usepackage{authoraftertitle}
\usepackage{fancyhdr}
\fancypagestyle{plain}{
\fancyhead{} %Clear Exisiting Header/footer enteries
\fancyhead[C]{Artificial Intelligence}
\fancyfoot{}
\fancyfoot[C]{GSSS, Mysuru}
\fancyfoot[R]{\thepage} %To insert page number
}
\title{Large language Models}
\begin{document}
\maketitle
\section{Introduction to LLMs}
Large language models (LLMs) are a category of foundation models trained \
section{How large language models work}
LLMs operate by leveraging deep learning techniques and vast amounts of textual
data.
\end{document}
May 3, 2025 53
To Do
Modify Program1 to add the following sections and subsections
1 Introduction to LLMs
May 3, 2025 54
To produce an output like this
May 3, 2025 55
Text Formatting
Use \textit{text} to produce italicized text
Use \textbf{text} to produce bold-faced text
Changing the Fontsize locally
\begin{small} text \end{small}
\begin{tiny} text \end{tiny}
\begin{large} text \end{large}
\begin{Large} text \end{Large}
\begin{huge} text \end{huge}
\begin{Huge} text \end{Huge}
Text Justification
\begin{center} text \end{center}
\begin{flushleft} text \end{flushleft}
\begin{flushright} text \end{flushright}
May 3, 2025 56
Program
May 3, 2025 57
Fixed-length spaces
To insert a fixed-length space, use:
\hspace{length}
\vspace{length}
May 3, 2025 58
Next we will Practice
2. Develop a LaTeX script to create a document that displays
the sample Abstract/Summary
May 3, 2025 59
Program2
\documentclass{article}
\usepackage{ragged2e}
\title{\textbf{Abstract}}
\date{}
\begin{document}
\maketitle
\thispagestyle{empty}
\justify{LLMs are redefining an increasing…………..}
\vspace{4mm}
\justify{LLMs also excel in………...}
\vspace{4mm}
\justify{Moreover, they contribute to accessibility by assisting individuals with
disabilities, including text-to-speech applications and generating content in accessible
formats. From healthcare to finance, LLMs are transforming industries by streamlining
processes, improving customer experiences and enabling more efficient and data-
driven decision making.}
\end{document}
May 3, 2025 60
LATEX Commands forspacing, line breaking and
page breaking
Command Effect
\newpage starts a new page at that point
\pagebreak starts a new page after the current line
\newline ends a line without justifying it.
\linebreak ends a line and justifies it, i.e., stretches the
spacing between words so the line extends to
the right margin.
\hspace produces a horizontal space of given size
\vspace produces vertical space of given size
\smallskip creates a little extra vertical space between
paragraphs.
\medskip creates medium extra vertical space between
paragraphs
\bigskip creates large extra vertical space between
paragraphs
May 3, 2025 61
Next we will Practice
3. Develop a LaTeX script to create a simple title page of the
VTU project Report [Use suitable Logos and text formatting]
May 3, 2025 62
Agenda
Introduction to LaTex
Document Structure
Document classes and
packages
Environments
May 3, 2025 63
Environments
May 3, 2025 64
Next We Will Learn
May 3, 2025 65
Figures
\usepackage{graphicx}
To include a figure in your document:
\begin{figure}[position] \centering
\includegrapics[size]{figure file name}
\caption{figure caption}\label{figure-label}
\end{figure}
May 3, 2025 66
Figures
\usepackage{graphicx}
To include a figure in your document:
\begin{figure}[position] \centering
\includegrapics[size]{figure file name}
\caption{figure caption}\label{figure-label}
\end{figure}
Eg. \begin{figure}[h]\centering
\includegraphics[width=3in]
{graph1.png}
\caption{My First Figure}\
label{fig:graph1}
\end{figure} Output
May 3, 2025 68
Prorgram3
\documentclass[a4paper, 12pt]{report}
\usepackage{graphicx}
\usepackage{xcolor}
\begin{document}
\include{FrontPage-VTU}
\end{document}
May 3, 2025 69
FrontPage-VTU.tex
\thispagestyle{empty}
\begin{center}
\textbf{\large Building Conversational AI Enabled Chatbots}
\end{center}
\vspace{18mm}
\begin{center}
\begin{small}
A Project Report\\ Submitted for the Award of the Degree\\ of\\ Bachelor of
Engineering\\ in\\ Computer Science and Engineering\\ by\\ \vspace{.5cm} \
textbf{Aditya P}\\ IV SEM\\ \vspace{.3cm} Under the guidance of\\ \vspace{.5cm} \
textbf{Dr.Manjunath Kumar B H}\\ Professor, HoD\\ SJC INSTITUTE OF TECHNOLOGY\\
Visvesvaraya Technological University, Belgavi.\\
\end{small} \vspace{10mm}
\centerline{\includegraphics[scale=.6]{vtu_logo}}
\vspace{20mm} Department of Computer Science and Engineering\\
SJC INSTITUTE OF TECHNOLOGY\\
Visvesvaraya Technological University, Belgavi.\\
April 2024\\
\end{center}
May 3, 2025 70
Thanks for Listening
May 3, 2025 71