0% found this document useful (0 votes)
6 views29 pages

LaTeX Manul

This document is a lab manual for Technical Writing using LaTeX, prepared by Dr. Sathyanarayana N. It includes a series of experiments with LaTeX scripts for creating various document elements such as sections, abstracts, title pages, certificates, tables, graphics, mathematical equations, and theorem presentations. Each experiment is detailed with specific requirements and example code.

Uploaded by

Selze M
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)
6 views29 pages

LaTeX Manul

This document is a lab manual for Technical Writing using LaTeX, prepared by Dr. Sathyanarayana N. It includes a series of experiments with LaTeX scripts for creating various document elements such as sections, abstracts, title pages, certificates, tables, graphics, mathematical equations, and theorem presentations. Each experiment is detailed with specific requirements and example code.

Uploaded by

Selze M
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/ 29

Approved by AICTE, New Delhi,

Affiliated to VTU, Belagavi & Recognized by Government of Karnataka

LAB MANUAL FOR


TECHNICAL WRITING USING LaTeX
(BCSL456D)

Prepared by

Dr. Sathyanarayana N
Associate Professor
Department of Information Science & Engineering

1|Page
CONTENTS

Experiments Particulars Page


Numbers

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 4
name, page number] in the document.

2 Develop a LaTeX script to create a document that displays the sample


Abstract/Summary 5

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

5 Develop a LaTeX script to create a document that contains the following


table with proper labels.
12

6 Develop a LaTeX script to include the side-by-side


graphics/pictures/figures in the document by using the subgraph concept 14

7 Develop a LaTeX script to create a document that consists of the following


two mathematical equations
16

8 Develop a LaTeX script to demonstrate the presentation of Numbered


theorems, definitions, corollaries, and lemmas in the document 18

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

10 Develop a LaTeX script to design a simple tree diagram or hierarchical


structure in the document with appropriate labels using the Tikz library 23

11 Develop a LaTeX script to present an algorithm in the document using


algorithm/algorithmic/algorithm2e library. 25

12 Develop a LaTeX script to create a simple report and article by using


suitable commands and formats of user choice. 26

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]

\documentclass[12pt, a4paper]{report} % Document class with font size 12pt and


paper size A4
\usepackage{graphicx} % Package to include images
\usepackage{geometry} % Package to customize page layout
\geometry{a4paper, total={170mm, 257mm}, left=20mm, right=20mm, top=30mm,
bottom=30mm} % Customizing page margins
\thispagestyle{empty} % Suppressing page numbers for the title page
\begin{document}
\begin{titlepage} % Starting the title page environment
\begin{center} % Centering content
% University Details
\textbf{{\large VISVESVARAYA TECHNOLOGICAL UNIVERSITY}}\\
{\normalsize Jnana Sangama, Belgaum-590018}\\
\vspace{0.3in}
\includegraphics[scale=0.2]{vtu-logo.png}\\
\vspace{0.3in}
% Title and Project Details
\textbf{A PROJECT REPORT} \\
ON \\
\vspace{0.2in}
\textbf{{\large "Create Report Format Using LaTeX"}}\\
\vspace{0.1in}
{\small Submitted in partial fulfillment of the requirements for the Fifth Semester
degree of
Bachelor of Engineering in Computer Science Engineering of Visvesvaraya
Technological
University, Belagavi}\\
\vspace{0.1in}
\textbf{BACHELOR OF ENGINEERING\\IN\\INFROMATION SCIENCE AND
ENGINEERING}\\

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}

\usepackage{graphicx} % Required for including images

\usepackage{subcaption} % Required for subfigures

\begin{document}

\begin{figure}

\centering

\begin{subfigure}{0.46\linewidth} % Subfigure environment for the first image

\includegraphics[width=\linewidth]{image1.jpg} % Include image1.jpg

\caption{Caption for image 1} % Caption for the first image

\label{fig:subfig1} % Label for referencing the first image

\end{subfigure}

\hfill % Add horizontal space between subfigures

\begin{subfigure}{0.44\linewidth} % Subfigure environment for the second image

\includegraphics[width=\linewidth]{image2.png} % Include image2.png

\caption{Caption for image 2} % Caption for the second image

\label{fig:subfig2} % Label for referencing the second image

\end{subfigure}

\caption{Combined caption for both images} % Overall caption for the figure

\label{fig:subfigures} % Label for referencing the entire 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}

\usepackage{amsmath} % This package is required for the 'aligned' environment

\begin{document}

\title{Following Two Mathematical Equations}

\date{}

\maketitle

% Use the 'align' environment to align equations properly

\[\begin{aligned}

% Left side: equations about 'x'

\begin{split}

x &= \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} \\

&= \frac{-2 \pm \sqrt{2^2 - 4 \cdot 1 \cdot (-8)}}{2 \cdot 1} \\

&= \frac{-2 \pm \sqrt{4 + 32}}{2}

\end{split}

\quad \quad \quad &

% Right side: equations about 'phi_{\sigma}^{\lambda} A_t'

\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 \\

&= \sum_{\tau \in C_{\sigma t}} \operatorname{sgn}(\pi^{-1} \tau \sigma)


\varphi_{\sigma}^{\lambda} \varphi_{\pi^{-1} \tau \sigma}^{\lambda} \notag \\

&= A_{\sigma t} \varphi_{\sigma}^{\lambda}

\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}

Recent studies have focused on the impact of climate change on various


ecosystems \citep{author9, author10}. Scientists are examining how rising
temperatures and changing weather patterns affect biodiversity and human health
\citep{author11, author12}. Furthermore, interdisciplinary research has brought about
innovative solutions for sustainable development \citep{author13}. Collaboration
among experts from different fields is essential to address the challenges of global
warming \citep{author14}.

% Add a references section

\newpage % Optional: Start the references on a new page

\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.

\bibitem{author2} Author Two. \textit{Title of Book Two}. Publisher Name,


2021.

\bibitem{author3} Author Three. \textit{Title of Conference Paper Three}.


In: Proceedings of Conference, pp. 100--110, 2020.

\bibitem{author4} Author Four. \textit{Title of Article Four}. Journal Name,


vol. 9, no. 2, pp. 15--25, 2019.

\bibitem{author5} Author Five. \textit{Title of Book Five}. Publisher Name,


2018.

\bibitem{author6} Author Six. \textit{Title of Conference Paper Six}. In:


Proceedings of Conference, pp. 200--210, 2017.

\bibitem{author7} Author Seven. \textit{Title of Article Seven}. Journal


Name, vol. 8, no. 3, pp. 30--40, 2016.

\bibitem{author8} Author Eight. \textit{Title of Book Eight}. Publisher


Name, 2015.

\bibitem{author9} Author Nine. \textit{Title of Conference Paper Nine}. In:


Proceedings of Conference, pp. 300--310, 2014.

\bibitem{author10} Author Ten. \textit{Title of Article Ten}. Journal Name,


vol. 7, no. 4, pp. 50--60, 2013.

\bibitem{author11} Author Eleven. \textit{Title of Article Eleven}. Journal


Name, vol. 6, no. 5, pp. 70--80, 2012.

\bibitem{author12} Author Twelve. \textit{Title of Article Twelve}. Journal


Name, vol. 5, no. 6, pp. 90--100, 2011.

\bibitem{author13} Author Thirteen. \textit{Title of Book Thirteen}.


Publisher Name, 2010.

\bibitem{author14} Author Fourteen. \textit{Title of Conference Paper


Fourteen}. In: Proceedings of Conference, pp. 400--410, 2009.

\end{thebibliography}

\end{document}

21 | P a g e
OUTPUT

22 | P a g e
Program 10

Develop a LaTeX script to design a simple tree diagram or hierarchical structure in


the document with appropriate labels using the Tikz library

\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

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