0% found this document useful (0 votes)
4K views22 pages

Latex Lab Manual

Latex lab Manual for computer science Engineering students

Uploaded by

abcabab010
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)
4K views22 pages

Latex Lab Manual

Latex lab Manual for computer science Engineering students

Uploaded by

abcabab010
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/ 22

TECHNICAL WRITING USING LATEX

(Effective from the academic year 2023 -2024))


SEMESTER - IV
Course Code BCSL456D CIE Marks 50
Teaching Hours/Week (L: T:P: S) 0:0:2:0 SEE Marks 50
Credits 01 Exam Hours 02
Examination type (SEE) Practical

Course objectives: This course (18CSL48) will enable students to:

➢ To introduce the basic syntax and semantics of the LaTeX scripting language
➢ To understand the presentation of tables and figures in the document
➢ To illustrate the LaTeX syntax to represent the theorems and mathematical
equations
➢ To make use of the libraries (Tikz, algorithm) to design the diagram and
algorithms in the document
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

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

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


algorithm/algorithmic/algorithm2e library

12 Develop a LaTeX script to create a simple report and article by using suitable
commands and formats of user choice.
LATEX
The Latex is a high-quality typesetting system, used for the documentation of scientific and
technical documents. It is widely used in academia for the communication and the publication of
scientific papers popularly in fields such as economics, sociology, mathematics, chemistry,
physics, engineering, etc. It also handles the formatting layout of different structures. The name is
stylized as LATEX.

The Latex is the markup language used for the typesetting of the technical documents. To learn
Latex, you must have a great idea of MS Word and the way or method in which you want to design
your document. It also needs an understanding of mathematics and related commands.

LaTeX is pronounced as 'lah-tech' or 'lay-tech.' which is distributed under the LPPL (Latex
Project Public License). It is based on TEX, a typesetting language designed for science and math.
Both LATEX and TEX contain a variety of font styles, such as serif, typewriter, and a set of
mathematical functions. It is an open-source and powerful document preparation system. It is high-
quality typesetting, which can be used for any publishing. It is often used for scientific publications
and medium to large technical documents. It is not a word processor or any word document, but it
is an efficient way for the publishers and the authors to organize their materials. It gives a unique
appearance to the system. It saves the time for designing as well as the efforts used for the
documents.

The Latex system handles the layout and formatting of the structures using familiar concepts of
the section, table, figure, chapter, etc. It follows the philosophy of separate presentation, i.e.,
separating the writing contents and the visual appearance so that the authors can focus more on the
content rather than its appearance. It is named as the standard for the communication and
publication of the technical or scientific documents.

Features of Latex
o Latex is a markup language and free license software. It includes a set of built-in
commands.
o It is a mode of mathematical and special symbols.
o LaTeX is generally distributed along with plain TEX, i.e., it provides a set of macros for
TEX to interpret. The other macros for TEX are Plain TEX, GNU Texinfo, etc.
o LaTeX is not compatible with the GNU (General Public License). It is available on most
of the operating systems like UNIX, BSD, Linux, Windows, DOS, etc

FILE TYPES
The file sizes of the Latex are generally smaller than the Word document files. The default
extension used is .tex, which we can edit with notepad or Simpletext editor. The Latex file contains
the text as well as the commands for writing the text and equations for the formatting of the
document.

MiKTeX is widely used for the implementation of Latex. For UNIX, you can download the Latex
itself. The OzTeXT is used on the Macintosh (family of PC's manufactured and sold by Apple
Inc.).

When LaTeX processes a file like abc.tex, it creates file abc.dvi, which stands for DeVice
Independent. The '.dvi' is the older format than .pdf, which can be handled by many devices.
Each platform in a computer has its program and files that can view .dvi, but you cannot send it to
the printer. Most of the printers accept PostScript (.ps). In PC, you can open this file on PC
with YAP (Yet Another Priewer) to print it. With the OzTeXT, you can directly print any file. But
for UNIX, you have to first convert the .dvi file into the .ps file. The conversion in UNIX can be
possible by using the programs such as dvips and then can send the file or data to the printer after
the conversion.

LATEX EDITORS
Latex Editors are applications to write the Latex code and allow a user to edit and publish the paper
in Latex. Below are some commonly used Latex Editors:

o Texmaker: It is the most popular editor and has the settings of spell checking and layout
settings through the 'Quick Start' window. It is an open-source, multi-platform Latex editor
with a built-in PDF Viewer. To get started, its configuration window allows the user to
set the settings accordingly. The warnings and errors are also displayed with the
corresponding line number, which makes the task easy for users.
o TeXnicCentre: It is primarily used for the Windows Operating System. It is free and open-
source software and uses MikTex. It is used to navigate Latex documents and has a
powerful GUI editor. To create complex formulas and the documentation part of the
scientists, it has pre-defined Latex snippets, which makes this task easy.
o LyX: It has some modern and unique features. It is available for systems like Windows,
Linux, and macOS. With the use of its advanced scripts, you can also create a structured
novel or script. The unique feature of LyX is its automatic index creation, which is only
available in LyX. You can even drag-drop equations and can edit them using its advanced
mathematical tools.
o Texstudio: It is based on the Texmaker and further adds support and features to it. These
features include frequency count analysis, Document Word count, and more. It is quite
popular among academia. It has more than 1000 Mathematical formulas and other key
features like code folding, syntax highlighting, auto-corrections, structure viewing, and
spell-checking.
o TeXworks: It also supports many features like auto-completion, Unicode support, and
auto-correction. It is considered as one of the best editors because of its robust built-in Pdf
viewer, interaction with external editors, and insertion of graphics. It also has a built-in
PDF Viewer like other editors discussed above, but also possess an auto-synchronization
feature.

The online Latex editors are:

➢ Papeeria: The features of an online Latex editor can be achieved by using its web-based
UI and a massive library of templates. These templates include journals, articles,
scientific magazines, etc. It also allows collaboration on the Latex document. It can be
directly accessed from your web browser.
➢ Authorea: It has a collaboration and template feature. It also supports many file formats
like Latex, HTML, etc. It is considered as the best web-based editor which possesses
features like insertion of images, tables, auto-creation, ready-to-use templates, document
revision history, etc.
➢ Overleaf: It covers hundreds of templates ranging from lab reports to formal letters. The
feature which brings transparency to the editing work is its real-time collaboration. It has
features, which make your documentation easier. As you enter the text, the Overleaf offers
the real-time preview feature, which makes authors and editors familiar with the tool.

Some of the editors used for the Linux are:


✓ Gummi: It is considered as the basic editor used by the starters as it does not contain many
excellent options and tools. It is based on the GTK+ toolkit. It lets you highlight the syntax,
supports exporting the documents to PDF format, and helps with fundamental error
checking functionalities.
✓ TeXpen: It is also a simple tool, as the above mentioned. It has the feature of auto-
completion. It is considered as the most accessible tool of Latex. It also helps to improve
the impressions and correct the grammar mistakes in the document.
✓ Kile: It is more just than an editor. Kile is available for Linux, as well as for Windows. It
is an IDE tool like Eclipse, which provides complete access to work on projects and
documents. It also has the feature of insert citations, organization of documents, auto-
completion of commands, etc.

LATEX SYMBOLS
The Latex symbols are widely used in different subjects over hundreds of categories. For every
symbol, which is used either in mathematics or other subjects, a corresponding command is used.
This topic will give you a detail idea and explanation of the symbols, and in which way, all the
symbols can be used.

With the use of standard text, you can use any symbol. This method not only saves the efforts or
time but also gives the convenience to focus more on the content without wasting much time on
finding the symbols and then proceeding with the content.

Below is the list of the commands divided into the particular categories. The essential commands
used all over are:

❖ \ it is called backslash, used as the starting command. The line following it gets printed.
❖ {} it is called curly brackets, which is used to group and separate commands from its
surroundings and must appear in pairs.
❖ \\ terminates a line.
❖ \\* it also terminates the line, but disallows the page break.
❖ [] it is used to write the optional parameters that can be passed to a command to change its
behavior.
❖ % the Latex ignores the rest of the line or commands after %.
Experiment No 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.

Notes on the commands used


• \fancyhead{}: clears the settings for the headers
• \fancyfoot{}: clears the settings for the footers
• \fancyhead[RO,LE]{\textbf{ First Program using LaTex }: uses the header locations RO
(RightOdd) and LE (LeftEven) to place the content \textbf{ First Program using LaTex }
• \fancyfoot[LE,RO]{\thepage}: uses the footer locations LE (LeftEven) and RO (RightOdd)
to place the page number output by \thepage
• \fancyfoot[LO,CE]{ Dept of ISE,MyCEM }: uses the footer locations LO (LeftOdd) and
CE (CentreEven) to place the content Dept of ISE MyCEM
• \fancyfoot[CO,RE]{ Dept of CSE MyCEM }: uses the footer locations CO (CentreOdd)
and RE (RightEven) to place the content Dept of CSE MyCEM

Program:
\documentclass{article}
% Packages
\usepackage{fancyhdr} % For header and footer
\usepackage{lipsum} % For dummy text
% Header and footer settings
\pagestyle{fancy}
\fancyhf{}
\rfoot{\thepage}
\lhead{\textit{First Program using LaTex}}
\lfoot{\textit{ Dept of CSE/ISE,MyCEM }}
% Document
\begin{document}
\section{Section 1}
\lipsum[1] % Dummy text
\section{Section 2}
\lipsum[2] % Dummy text
\end{document}

Sample Output
Experiment No 2
Develop a LaTeX script to create a document that displays the sample Abstract/Summary

Notes on the commands used


• \usepackage{lipsum}:lipsum is a package that inserts dummy text into a document
• \title: Title of the Documents
• \author: Author Name of the Documents
• \vspace: Vertical Space of the paragraphs

Program
\documentclass{article}
\usepackage{lipsum}

\title{Sample Abstract/Summary}
\author{Your Name}
\date{}

\begin{document}
\maketitle
\section*{Abstract}
\lipsum[1]
\vspace{0.5cm}
\lipsum[3]
\end{document}
Sample Output
Experiment No 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{xcolor}
\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{\textcolor{magenta}{\large \textit{VISVESVARAYA TECHNOLOGICAL
UNIVERSITY}}}\\
{\normalsize Jnana Sangama, Belgaum-590018}\\
\vspace{0.2in}
\includegraphics[scale=0.3]{vtu.jpg}\\
\vspace{0.3in}
% Title and Project Details
\textbf{\textcolor{red}{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\\COMPUTER SCIENCE AND ENGINEERING}\\
\vspace{0.2in}
% Student Details
\textbf{{Submitted by}}\\
\vspace{0.08in}

\begin{tabular}{ll}
\textbf{1MO22CS017} & \textbf{STUDENT -1}\\
\textbf{1MO22CS015} & \textbf{STUDENT -2}\\
\textbf{1MO22CS005} & \textbf{STUDENT -3}\\
\textbf{1MO22CS015} & \textbf{STUDENT -4}\\
\end{tabular}

\vspace{0.2in}
% Guide Details
\textbf{\textcolor{blue}{Under The Guidance of}}\\
Prof.HarshaKumar H S/Prof Santhosh B R\\
Asst. Professor Department of CSE/ISE\\

\vspace{0.2in}
% College Details
\includegraphics[scale=0.4]{Mycem.png}\\
\vspace{0.01in}

{\small DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING}\\


\vspace{0.1in}
\textbf{MYSORE COLLEGE OF ENGINEERING AND MANAGEMENT}\\
{\small1072, T Narsipura Road, Near Big Banyan Tree, Chikkahalli, Mysuru,
Karnataka 570028}\\
\vspace{0.1in}
{\small 2024-2025}\\
\end{center} % Ending the center environment
\end{titlepage} % Ending the title page environment
\end{document}
Sample Output
Experiment No 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.3in}
\includegraphics[scale=0.1]{vtu-logo.png}\\
\vspace{0.3in}
\textbf{\large CERTIFICATE}\\
\vspace{0.3in}
This is to certify that \\
\vspace{0.2in}
{\textbf{\underline{ABHI K}}}\\
\vspace{0.2in}
bearing University Seat Number \\
\vspace{0.2in}
{\textbf{\underline{4MO22CS001}}}\\
\vspace{0.2in}
has satisfactorily completed the project work entitled\\
\vspace{0.2in}
{\textbf{\underline{RESUME BUILDER WEB APPLICATION}}}\\
\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\\COMPUTER
SCIENCE AND ENGINEERING}\\
\vspace{0.5in}
\hspace{1.7cm}\textbf{Guide} \hspace{2.8in} \textbf{Head of the
Department}\\
\vspace{0.2in}
\underline{\hspace{6cm}} \hspace{1.5in} \underline{\hspace{6cm}}\\
\vspace{0.1in}
\hspace{0.6cm}\textbf{(SANTHOSH B R)} \hspace{2in}
\textbf{(HARSHA KUMAR H S)}\\
\vspace{0.1in}
\textbf{(Assistant Professor)} \hspace{2.2in} \textbf{(Assistant
Professor)}\\
\vspace{0.1in}
\textbf{(Department of CSE)} \hspace{2.1in} \textbf{(Department of
CSE)}\\
\vspace{0.3in}
\textbf{[Mysore College Of Engineering and Management]}\\
\vspace{0.1in}
\textbf{[Mysore]}\\
\vspace{0.1in}
\textbf{[AUGUST 2023-24]} % Replace with current month and year
\end{center}
\end{titlepage}
\end{document}
Sample Output:
Experiment No 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.8} % 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{ADA} & \textbf{Microcontroller} &
\textbf{DBMS} \\ % Sub-headers for marks
\hline
\multicolumn{1}{|c|}{1} &
\multicolumn{1}{c|}{4MO22CS001} & \multicolumn{1}{c|}{ABHISHEK K S } & 89 & 60
& 90 \\ % Data rows
\hline
\multicolumn{1}{|c|}{2} &
\multicolumn{1}{c|}{4MO22CS002} & \multicolumn{1}{c|}{ADITHYA SHETTY H D} & 78
& 45 & 98 \\
\hline
\multicolumn{1}{|c|}{3} &
\multicolumn{1}{c|}{4MO22CS003} & \multicolumn{1}{c|}{AMRUTHA VARSHINI H N} &
67 & 55 & 59 \\
\hline
\end{tabular}
\end{table}

\end{document}
Sample Output:
Experiment No 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.48\linewidth} % Subfigure environment for
the first image
\includegraphics[width=\linewidth]{NATURE1.jpg} %
Include image1.jpg
\caption{Nature1} % 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.48\linewidth} % Subfigure environment for
the second image
\includegraphics[width=\linewidth]{NATURE2.jpg} %
Include image2.png
\caption{Nature2} % Caption for the second image
\label{fig:subfig2} % Label for referencing the second
image
\end{subfigure}
\caption{Nature} % Overall caption for the figure
\label{fig:subfigures} % Label for referencing the entire
figure
\end{figure}

\end{document}
Sample Output:
Experiment 7

Develop a LaTeX script to create a document that consists of the following two
mathematical equations.

\documentclass{article}
\usepackage{amsmath} % Required for mathematical environments and commands

\begin{document}

\section*{Equations Set 1} % Section header for the first set of equations

\begin{align} % Begin the align environment for multiple equations


x &= -b \pm \sqrt{\sqrt[4]{b^2 - 4ac}} \notag \\ % First equation with \notag
to suppress numbering
x &= \frac{-b \pm \sqrt{22 - 4 \cdot 1 \cdot (-8)}}{2 \cdot 1} = \frac{-b \pm
\sqrt{\sqrt{4 + 32}}}{2} = \frac{-b \pm \sqrt{2}}{2} \notag % Second equation
with \notag to suppress numbering
\end{align} % End the align environment

\section*{Equations Set 2} % Section header for the second set of equations

\begin{align} % Begin the align environment for multiple equations


\varphi_{\sigma}^{\lambda} \cdot A_{t} &= \sum_{\pi \in C_{t}} \text{sgn}(\pi)
\cdot \varphi_{\sigma}^{\lambda} \cdot \varphi_{\pi}^{\lambda} \notag \\ %
First equation with \notag to suppress numbering
&= \sum_{\tau \in C_{\sigma}^{t}} \text{sgn}(\sigma^{-1} \tau \sigma)
\varphi_{\sigma}^{\lambda} \varphi_{\sigma^{-1} \tau \sigma}^{\lambda} \notag
\\ % Second equation with \notag to suppress numbering
&= A_{\sigma}^{t} \varphi_{\sigma}^{\lambda} \notag % Third equation with
\notag to suppress numbering
\end{align} % End the align environment

\end{document}
Sample Output:

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