Latex Lab Manual - KNS
Latex Lab Manual - KNS
IV SEMESTER | B.E
LAB MANUAL
DEPT. OF CSE, 1
KNSIT
Technical Writing Using Latex – (BCSL456D)
Vision
Aim to become a leader in the field of education, training, and research in the Information
Mission
The Program Educational Objectives define future roles for which we are preparing our
students By studying four years of undergraduate engineering program. The major
objectives for the Department of Information Science at K.N.S Institute of Technology are:
PEO-4: Exhibit high standards of social and professional ethics, entrepreneurship and
leadership Qualities.
DEPT. OF CSE, 2
KNSIT
Technical Writing Using Latex – (BCSL456D)
PSO2: Manage IT services for the organization and individual with its goals.
PSO3: Implement IT services that would perform tasks related to latest trends of
information Technology.
PSO 4: Explain the syntax, flow of the program and sub problems to obtain the
programmatic Solutions.
PSO 5: Inseminate Skills for successful carrier path for higher studies.
DEPT. OF CSE, 3
KNSIT
Technical Writing Using Latex – (BCSL456D)
Sl.NO Experiments
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.
2 Develop a LaTeX script to create a document that displays the sample Abstract/Summary
3 Develop a LaTeX script to create a simple title page of the VTU project Report [Use suitable Logos and text
formatting]
4 Develop a LaTeX script to create the Certificate Page of the Report [Use suitable commands to leave the
blank spaces for user entry]
5 Develop a LaTeX script to create a document that contains the following table with proper labels.
6 Develop a LaTeX script to include the side-by-side graphics/pictures/figures in the document by using the
subgraph concept
DEPT. OF CSE, 4
KNSIT
Technical Writing Using Latex – (BCSL456D)
7 Develop a LaTeX script to create a document that consists of the following two mathematical equations
8 Develop a LaTeX script to demonstrate the presentation of Numbered theorems, definitions, corollaries, and
lemmas in the document
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
10 Develop a LaTeX script to design a simple tree diagram or hierarchical structure in the document with
appropriate labels using the Tikz library
12 Develop a LaTeX script to create a simple report and article by using suitable commands and formats of user
choice.
DEPT. OF CSE, 5
KNSIT
Technical Writing Using Latex – (BCSL456D)
PAGE
S.NO EXPERIMENTS
NO
Develop a LaTeX script to create the Certificate Page of the Report [Use
4. 18
suitable commands to leave the blank spaces for user entry]
Develop a LaTeX script to create a document that contains the following table
5. 23
with proper labels.
Develop a LaTeX script to include the side-by-side graphics/pictures/figures
6. 25
in the document by using the subgraph concept
Develop a LaTeX script to create a document that consists of the following
7. two mathematical equations 27
DEPT. OF CSE, 6
KNSIT
Technical Writing Using Latex – (BCSL456D)
PROGRAM 1
Simple Document
AIM: 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.
LaTex Code:
\documentclass[12pt,a4paper]{article}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage{fancyhdr}
\begin{document}
\pagestyle{fancy}
\title{GNU Project}
\fancyhead[R]{GNU Project}
\fancyfoot[R]{\thepage}
\maketitle
\section{What is GNU?}
GNU is an operating system that is free software—that is, it respects users' freedom. The GNU operating
system consists of GNU packages (programs specifically released by the GNU Project) as well as free
software released by third parties. The development of GNU made it possible to use a computer without
software that would trample your freedom.
DEPT. OF CSE, 7
KNSIT
Technical Writing Using Latex – (BCSL456D)
GNU is a Unix-like operating system. That means it is a collection of many programs: applications,libraries,
developer tools, even games. The development of GNU, started in January 1984, is known as the GNU
Project. Many of the programs in GNU are released under the auspices of the GNU Project; those we call GNU
packages. \\
The name "GNU" is a recursive acronym for "GNU's Not Unix." "GNU" is pronounced g'noo, as one syllable,
like saying "grew" but replacing the r with n. \\
The program in a Unix-like system that allocates machine resources and talks to the hardware is called the
"kernel." GNU is typically used with a kernel called Linux. This combination is the GNU/Linux operating
system. GNU/Linux is used by millions, though many call it "Linux" by mistake.
The free software movement campaigns to win for the users of computing the freedom that comes from free
software. Free software puts its users in control of their own computing. Nonfree software puts its users
under the power of the software's developer. \\
\textbf{Free software means the users have the freedom to run, copy, distribute, study, change and improve
the software.}
Free software is a matter of liberty, not price. To understand the concept, you should think of "free" as in "free
speech," not as in "free beer". More precisely, free software means users of a program have the four essential
freedoms:
\begin{itemize}
\item The freedom to run the program as you wish, for any purpose (freedom 0).
\item The freedom to study how the program works, and change it so it does your computing as you wish
\item The freedom to redistribute copies so you can help others (freedom 2).
\item The freedom to distribute copies of your modified versions to others (freedom 3). By doing this you can
give the whole community a chance to benefit from your changes. Access to the source code is a
precondition for this.
Developments in technology and network use have made these freedoms even more important now than
they were in 1983. Nowadays the free software movement goes far beyond developing the GNU system.
\end{itemize}
\end{document}
OUTPUT :
CLICK HERE
DEPT. OF CSE, 8
KNSIT
Technical Writing Using Latex – (BCSL456D)
DEPT. OF CSE, 9
KNSIT
Technical Writing Using Latex – (BCSL456D)
DEPT. OF CSE, 10
KNSIT
Technical Writing Using Latex – (BCSL456D)
PROGRAM 2
AIM: Develop a LaTeX script to create a document that displays the sample
Abstract/Summary
LaTex Code:
\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[left=3cm,right=3cm,top=2cm,bottom=2cm]{geometry}
%\usepackage{lipsum}
\begin{document}
\thispagestyle{plain}
\begin{center}
\Large
\textbf{Thesis Title}
\vspace{0.4cm}
\large
Thesis Subtitle
\vspace{0.4cm}
\textbf{Author Name}
\vspace{0.9cm}
\textbf{Abstract}
\end{center}
DEPT. OF CSE, 11
KNSIT
Technical Writing Using Latex – (BCSL456D)
%\lipsum[1]
News has become an important medium for everyone to stay aware and updated with the latest happenings
in the world. It is important to note that in recent times with the rise in social media the amount of fake news
has surged to dangerous levels. Fake news causes a lot of economic and social problems. It also gets difficult
to trace back the source of fake news and hold someone accountable in order to curb it down. It is important
to have a mechanism which evicts out fake news and contains only authentic news.
Fake news causes a lot of economic and social problems. It also gets difficult to trace back the source of fake
news and hold someone accountable in order to curb it down. It is important to have a mechanism
whichevicts out fake news and contains only authentic news. With digitization, there has been a drastic
increase in the usage of some of the popular social media sites such as Twitter, Facebook, Yahoo, YouTube as
a medium of spreading news. There is very little check on the spreading of fake news. Accountability, in terms
of how authentic the news is, is very less.
Our project aims to create a platform that runs on a blockchain network. News based media will be shared
across this network. The origin of data and every user interaction will be recorded and get updated in the
decentralized ledger and since it is in the blockchain, it remains immutable and nearly immune to any cyber
threat.
The platform will be highly intuitive and interactive for users to browse through different sections of news.
Users can view articles, blogs, headlines and other news-based content. Users can also push their own
content on the network. The platform also allows the users to manually rate a piece of news based on its
authenticity.
\end{document}
OUTPUT :
CLICK HERE
DEPT. OF CSE, 12
KNSIT
Technical Writing Using Latex – (BCSL456D)
DEPT. OF CSE, 13
KNSIT
Technical Writing Using Latex – (BCSL456D)
PROGRAM 3
AIM : Develop a LaTeX script to create a simple title page of the VTU project Report [Use
suitable Logos and text formatting]
LaTex Code:
\documentclass[12pt, a4paper]{report} % Document class with font size 12pt and paper size A4
\begin{document}
% University Details
\vspace{0.3in}
\includegraphics[scale=0.2]{vtu.jpg}\\
\vspace{0.3in}
ON \\
\vspace{0.2in}
\vspace{0.1in}
{\small Submitted in partial fulfillment of the requirements for the Fourth Semester
degree of
DEPT. OF CSE, 14
KNSIT
Technical Writing Using Latex – (BCSL456D)
University, Belagavi}\\
\vspace{0.1in}
\vspace{0.2in}
% Student Details
Submitted by\\
\vspace{0.08in}
\begin{tabular}{ll}
\end{tabular}
\vspace{0.2in}
% Guide Details
\vspace{0.2in}
% College Details
\includegraphics[scale=0.4]{kns.png}\\
\vspace{0.01in}
\vspace{0.1in}
{\small NAAC accredited Approved by AICTE, New Delhi, Affiliated to VTU, Belagavi,
Opp Tirumenahalli Cross, Bengaluru -560064}\\
DEPT. OF CSE, 15
KNSIT
Technical Writing Using Latex – (BCSL456D)
\vspace{0.1in}
{\small 2023-2024}\\
\end{document}
OUTPUT :
CLICK HERE
DEPT. OF CSE, 16
KNSIT
Technical Writing Using Latex – (BCSL456D)
PROGRAM 4
AIM: Develop a LaTeX script to create the Certificate Page of the Report [Use suitable
commands to leave the blank spaces for user entry]
LaTex Code:
\documentclass[12pt, a4paper]{report}
\usepackage{graphicx}
\usepackage{geometry}
\thispagestyle{empty}
\begin{document}
\begin{titlepage}
\begin{center}
\vspace{0.5in}
\includegraphics[scale=0.1]{vtu-logo.png}\\
\vspace{0.5in}
\textbf{CERTIFICATE}\\
\vspace{0.3in}
\vspace{0.2in}
\underline{\hspace{10cm}}\\
\vspace{0.2in}
\vspace{0.2in}
\vspace{0.2in}
DEPT. OF CSE, 17
KNSIT
Technical Writing Using Latex – (BCSL456D)
\underline{\hspace{10cm}}\\
\vspace{0.2in}
\vspace{0.2in}
\underline{\hspace{10cm}}\\
\vspace{0.2in}
\vspace{0.2in}
towards the partial fulfillment of the requirements for the award of the degree of\\
\vspace{0.2in}
\vspace{0.5in}
\vspace{0.3in}
\vspace{0.1in}
\vspace{0.1in}
\vspace{0.1in}
\vspace{0.1in}
\textbf{[College Name]}\\
\vspace{0.1in}
\textbf{[Location]}\\
\vspace{0.1in}
\end{center}
DEPT. OF CSE, 18
KNSIT
Technical Writing Using Latex – (BCSL456D)
\end{titlepage}
\end{document}
OUTPUT
CLICK HERE
DEPT. OF CSE, 19
KNSIT
Technical Writing Using Latex – (BCSL456D)
PROGRAM 5
AIM: Develop a LaTeX script to create a document that contains the following table with
proper labels.
S.No USN Student Name Marks
Subject1 Subject2 Subject3
1 4XX22XX001 Name 1 89 60 90
2 4XX22XX002 Name 2 78 45 98
3 4XX22XX003 Name 3 67 55 59
LaTex Code :
\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage{multirow}
\begin{document}
\begin{center}
\begin{Large}
\textbf{Table Demo}
\end{Large}
\end{center}
\section*{Marks Table}
\begin{tabular}{|c|c|c|c|c|c|}
\hline
DEPT. OF CSE, 20
KNSIT
Technical Writing Using Latex – (BCSL456D)
\cline{4-6}
\hline
1 C 4XX22XX001 C Name 1 C 88 C 77 C 97 \\
\hline
2 C 4XX22XX002 C Name 2 C 74 C 78 C 66 \\
\hline
3 C 4XX22XX003 C Name 3 C 88 C 82 C 79 \\
\hline
\end{tabular}
\end{document}
OUTPUT
CLICK HERE
DEPT. OF CSE, 21
KNSIT
Technical Writing Using Latex – (BCSL456D)
PROGRAM 6
LaTex Code :
\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{graphicx}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\begin{document}
\section*{Subfigure Demo}
\begin{figure}[h]
\centering
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{graph1.png}
\caption{$y=x$}
\label{fig:y equals x}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
DEPT. OF CSE, 22
KNSIT
Technical Writing Using Latex – (BCSL456D)
\centering
\includegraphics[width=\textwidth]{graph2.png}
\caption{$y=3\sin x$}
\label{fig:three sin x}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{graph3.png}
\caption{$y=5/x$}
\label{fig:five over x}
\end{subfigure}
\label{fig:three graphs}
\end{figure}
\end{document}
OUTPUT
CLICK HERE
DEPT. OF CSE, 23
KNSIT
Technical Writing Using Latex – (BCSL456D)
PROGRAM 7
AIM : Develop a LaTeX script to create a document that consists of the following two
mathematical equations
LaTex Code :
\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,nccmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\begin{document}
\begin{center}
\Large{\textbf{Equations in \LaTeX}}
\end{center}
\section*{Equation 1}
%\begin{eqnarray}
%\end{eqnarray}
DEPT. OF CSE, 24
KNSIT
Technical Writing Using Latex – (BCSL456D)
\begin{fleqn}
\[
\]
\[
\]
\[
\]
\end{fleqn}
\section*{Equation 2}
\begin{fleqn}
\[
\]
\[
\]
\[
= A_{\sigma t} \varphi^{\lambda}_{\sigma}
\]
\end{fleqn}
\end{document}
OUTPUT
CLICK HERE
DEPT. OF CSE, 25
KNSIT
Technical Writing Using Latex – (BCSL456D)
DEPT. OF CSE, 26
KNSIT
Technical Writing Using Latex – (BCSL456D)
PROGRAM 8
LaTex Code :
\documentclass{article}
\usepackage[english]{babel}
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{corollary}{Corollary}[theorem]
\newtheorem{lemma}[theorem]{Lemma}
\theoremstyle{definition}
\newtheorem{definition}{Definition}[section]
\begin{document}
\begin{theorem}
Let \(f\) be a function whose derivative exists in every point, then \(f\) is
a continuous function.
\end{theorem}
\begin{theorem}[Pythagorean theorem]
\label{pythagorean}
This is a theorem about right triangles and can be summarised in the next
equation
\end{theorem}
DEPT. OF CSE, 27
KNSIT
Technical Writing Using Latex – (BCSL456D)
corollary.
\begin{corollary}
There's no right rectangle whose sides measure 3cm, 4cm, and 6cm.
\end{corollary}
\begin{lemma}
Given two line segments whose lengths are \(a\) and \(b\) respectively there is a
\end{lemma}
|x| =
\left\{
\begin{array}{ll}
x C \mbox{if } x \geq 0 \\
-x C \mbox{if } x < 0
\end{array}
\right.
\end{definition}
\end{document}
OUTPUT
CLICK HERE
DEPT. OF CSE, 28
KNSIT
Technical Writing Using Latex – (BCSL456D)
DEPT. OF CSE, 29
KNSIT
Technical Writing Using Latex – (BCSL456D)
PROGRAM G
AIM : 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.
LaTex Code:
For including references we need to first create a ref.bib file in the proper BibTeX format.
which is as shown below. Depending on the kind of reference you have to maintain the
structure as shown in example.
ref.bib
@article{kosachev2012spsecific,
author={Kosachev, Konstantin},
volume={7},
number={3},
pages={1--11},
year={2012},
@article{sergunin2015understanding,
journal={Politics},
volume={35},
number={3-4},
pages={347--363},
year={2015},
DEPT. OF CSE, 30
KNSIT
Technical Writing Using Latex – (BCSL456D)
@article{kiseleva2015russia,
title={Russia's soft power discourse: identity, status and the attraction of power},
author={Kiseleva, Yulia},
journal={Politics},
volume={35},
number={3-4},
pages={316--329},
year={2015},
@book{bohomolov2012ghost,
year={2012},
@article{hill2006moscow,
author={Hill, Fiona},
journal={Current History},
volume={105},
number={693},
pages={341--347},
year={2006},
DEPT. OF CSE, 31
KNSIT
Technical Writing Using Latex – (BCSL456D)
@article{dufrene2002atomic,
journal={Journal of bacteriology},
volume={184},
number={19},
pages={5205--5213},
year={2002},
@article{engel1999atomic,
volume={9},
number={2},
pages={77--80},
year={1999},
publisher={Elsevier}
@article{franz2008atomic,
title={Atomic force microscopy: a versatile tool for studying cell morphology, adhesion and
mechanics},
volume={1},
pages={289--300},
year={2008},
publisher={Springer}
DEPT. OF CSE, 32
KNSIT
Technical Writing Using Latex – (BCSL456D)
@article{marrese2017atomic,
title={Atomic force microscopy: a powerful tool to address scaffold design in tissue engineering},
volume={8},
number={1},
pages={7},
year={2017},
publisher={MDPI}
@article{altman2015noncontact,
title={Noncontact atomic force microscopy: an emerging tool for fundamental catalysis research},
volume={48},
number={9},
pages={2640--2648},
year={2015},
publisher={ACS Publications}
Next we will write the . tex file main.tex which includes paragraphs and wherever citations/references
are needed use the /cite tag with the appropriate reference identifier.
main.tex
\documentclass{article}
\usepackage{cite}
\begin{document}
DEPT. OF CSE, 33
KNSIT
Technical Writing Using Latex – (BCSL456D)
\author{}
\date{}
\maketitle
he 21st century is marked by an increased attention to the appeal and positive image of a country as
instruments of influence in the international arena\cite{bohomolov2012ghost}. There has appeared the
concept of soft power, whose author, U.S\cite{sergunin2015understanding}. political scientist Joseph Nye
described it as “the ability to get what you want through attraction rather than coercion or
payments\cite{hill2006moscow}.” A nation’s image secures attractiveness and trust in a country, playing a
crucial role as the key soft power component\cite{kiseleva2015russia}. Therefore, the efforts of states along
this line relate not so much to the sphere of culture and information as to
geopolitics\cite{kosachev2012spsecific}.
Understanding the functions of microbial cell surfaces requires knowledge of their structural and physical
properties\cite{dufrene2002atomic}. Electron microscopy has long been recognized as a key technique in
microbiology to elucidate cell surface ultra structure\cite{engel1999atomic}. An exciting achievement has
been the development of cryotechniques which allow high-resolution imaging of cell structures in conditions
close to the native state\cite{franz2008atomic}. Yet direct observation in aqueous solution remained
impossible.Because of the small size of microorganisms, the physical properties of their surfaces have been
difficult to study\cite{marrese2017atomic}. Quantitative and qualitative information on physical properties
can be obtained by electron microscopy techniques, X-ray photoelectron spectroscopy, infrared
spectroscopy, contact angle, and electrophoretic mobility measurements\cite{altman2015noncontact}.
\bibliographystyle{plain}
\bibliography{references}
\end{document}
OUTPUT
CLICK HERE
DEPT. OF CSE, 34
KNSIT
Technical Writing Using Latex – (BCSL456D)
DEPT. OF CSE, 35
KNSIT
Technical Writing Using Latex – (BCSL456D)
PROGRAM 10
AIM: Develop a LaTeX script to design a simple tree diagram or hierarchical structure in the
document with appropriate labels using the Tikz library
LaTex Code :
\documentclass{article}
\usepackage{tikz}
\begin{document}
\centering
\begin{tikzpicture}[grow=down, sloped]
% Root node
\node {Root}
% First child
child {
child {
child {
% Second child
child {
DEPT. OF CSE, 36
KNSIT
Technical Writing Using Latex – (BCSL456D)
child {
child {
};
\end{tikzpicture}
\end{document}
OUTPUT
CLICK HERE
DEPT. OF CSE, 37
KNSIT
Technical Writing Using Latex – (BCSL456D)
PROGRAM 11
LaTex Code :
\documentclass{article}
\usepackage{algorithm}
\usepackage{algpseudocode}
\begin{document}
\begin{algorithm}
\caption{Bubble Sort}
\begin{algorithmic}[1]
\Procedure{BubbleSort}{$A, n$}
\EndIf
\EndFor
\EndFor
\EndProcedure
\end{algorithmic}
\end{algorithm}
\end{document}
DEPT. OF CSE, 38
KNSIT
Technical Writing Using Latex – (BCSL456D)
OUTPUT
CLICK HERE
DEPT. OF CSE, 39
KNSIT
Technical Writing Using Latex – (BCSL456D)
PROGRAM 12
AIM : Develop a LaTeX script to create a simple report and article by using suitable
commands and formats of user choice.
LaTex Code:
\documentclass{report}
\title{Simple Report}
\date{}
\begin{document}
\maketitle
\tableofcontents
\chapter{Introduction}
\textbf{Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has
been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type
and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into
electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of
Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like
Aldus PageMaker including versions of Lorem Ipsum.}
\chapter{Methods}
\textbf{Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has
been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type
and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into
electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of
Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like
Aldus PageMaker including versions of Lorem Ipsum.}
\chapter{Conclusion}
\textbf{Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has
been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type
and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into
electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of
Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like
Aldus PageMaker including versions of Lorem Ipsum.}
DEPT. OF CSE, 40
KNSIT
Technical Writing Using Latex – (BCSL456D)
\end{document}
OUTPUT
CLICK HERE
DEPT. OF CSE, 41
KNSIT
Technical Writing Using Latex – (BCSL456D)
DEPT. OF CSE, 42
KNSIT