Latex - LAb Uom Progrm Updated

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 25

Latex Lab Manual

PART –A

1. Write the Latex command to print pmatrix, bmatrix, Bmatrix, vmatrix, Vmatrix

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
A=
\begin{pmatrix}
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9 \\
\end{pmatrix}
\end{equation}

\begin{equation}
A=
\begin{bmatrix}
a & b & c \\
d & e & f \\
g & h & i \\
\end{bmatrix}
\end{equation}

\begin{equation }
C=
\begin{Bmatrix}
a_{11} & a_{12} & a_{13} \\
a_{21} & a_{22} & a_{23} \\
a_{31} & a_{32} & a_{33} \\
\end{Bmatrix}
\end{equation}

\begin{equation}
D=
\begin{vmatrix}
a_{11} & a_{12} & a_{13} \\
a_{21} & a_{22} & a_{23} \\
a_{31} & a_{32} & a_{33} \\
\end{vmatrix}
\end{equation}

\begin{equation}
F=
\begin{Vmatrix}
a_{11} & a_{12} & a_{13} \\
a_{21} & a_{22} & a_{23} \\
a_{31} & a_{32} & a_{33} \\
\end{Vmatrix}
\end{equation}
\end{document}

OUTPUT

Lab Activity 2
Part-A

2. Write code to produce the following equations and refer to the below equations
in your
Latex document.

and

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation*}
Y=\sqrt{\frac{x^2}{z}}t
\end{equation*}

\begin{equation*}
\frac{d}{dx}\int_{0}^{\infty}f(s)ds=dx
\end{equation*}
\end{document}

OUTPUT

Lab Activity
Part-A

3. Write code to generate the following table in Latex

Items Quantity Price(Rs)

Idli 1 25

Dosa 2 40

Coffee 1 20

Vada 2 20

\documentclass[12pt]{article}
\usepackage{epsfig,graphics}
\begin{document}
\begin{table}
\centering
\begin{tabular}{|c|c|c|} \hline
Items & Quality & Price(Rs) \\ \hline
Idli & 1 & 25\\ \hline
Dosa & 2 & 40\\ \hline
Coffee & 1 & 20\\ \hline
Vada & 2 & 20\\ \hline
\end{tabular}
\end{table}
\end{document}

OUTPUT
LATEX Lab Activity
4. Write latex commands to insert an image in PDF and JPEG format into
your document in Latex.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\graphicspath{{./images/}}
\documentclass{article}
\begin{document}
\begin{figure}[htbp]
\includegraphics[width=1.0\textwidth,angle=0] {time-table.pdf}\\
\includegraphics[width=0.5\textwidth,angle=0] {logo.png}
\end{figure}
\end{document}

OUTPUT

LATEX Lab Activity


5. Write the latex code to get the following output

Courses offered
1.B.Sc
∙ PMCS
∙ EMCS
∙ SMCS
2.BCA
3.B.Com
4.B.A
∙ HEP
∙ HPS

\documentclass{report}
\usepackage{enumitem}
\begin{document}
Courses Offered
\begin{enumerate}
\item B.sc
\begin{itemize}
\item PMCs
\item EMCs
\item SMCs
\end{itemize}
\item BCA
\item B.Com
\item B.A
\begin{itemize}
\item HEP
\item HPS
\end{itemize}
\end{enumerate}
\end{document}

OUTPUT
Part-B
1. Write the latex commands to carry out the following operations
∙ Set paper size to A4, margin to 2 inches and orientation to landscape.
∙ Insert a web address in blue color.
∙ Insert a link to local files in Magenta color.

\documentclass{report}

\usepackage[utf8]{inputenc}

\usepackage[english]{babel}

\usepackage{hyperref}

\usepackage[a4paper, landscape, margin=2in]{geometry}

\hypersetup{

colorlinks=true,

linkcolor=blue,

filecolor=magenta,

urlcolor=cyan,

pdfpagemode=landscape,

\begin{document}

Web Address in blue color:\\

\href{http://www.google.co.in}{Google}\\

OR\\

url: \url{http://www.google.co.in} \\

Local Link

open the next file \href{run:./new.txt}{File.txt}\\

\end{document}
2. Using beamer class create a simple presentation of 3 slides with the following
features ∙ Highlight important text
∙ Use Madrid theme
∙ Two column slide

\documentclass{beamer}

\usepackage[utf8]{inputenc}

\usetheme{Madrid}

%\usecolortheme{beaver}

%\usefonttheme{structuresmallcapsserif}

\AtBeginSection[]

\begin{frame}

\frametitle{Table of Contents}

\tableofcontents[currentsection]

\end{frame}

\begin{document}

\begin{frame}

\frametitle{Introduction to Latex}

LaTeX is a software for \alert {typesetting documents}. In other words, it's a document
preparation system. LaTeX is not a word processor, but is used as a \alert{ document markup
language}.

\begin{block}{Why LaTeX?}

→ Open Source and Freeware\\

→ Available for Windows, Linux, Macintosh, Browsers, etc.\\


→ Low Sized documents with High Quality Outputs\\

\end{block}

\end{frame}

\begin{frame}

\frametitle{Two-column slide}

\begin{columns}

\column{0.5\textwidth}

LaTeX.

LaTeX is a document preparing system for high-quality typesetting. It is used


for Articles, Research Papers, Scientific and Technical Documents, Presentations, Law-Texts,
Scorecards, Bills, Letters, Books, Reports and almost any form of publishing.

\column{0.5\textwidth}

Installing LaTeX.

This distribution is available for Windows, Linux, Mac OS X, and other Unix-
like operating systems. TeX Live is well maintained and it is being actively developed.

\end{columns}

\end{frame}

\end{document}
3. Using latex commands create a model question paper for 20 marks with two
sections.

\documentclass[a4paper,11pt]{exam}

\usepackage{ragged2e}

\usepackage{amsmath}

\begin{document}

\centering

\LARGE

\bf{St JOSEPH’S COLLEGE FOR WOMEN }\\

\large

V semester BCA \\

C1 Examination \\

(Semester Scheme: CBCS) \\

Computer Applications \\

INTRODUCTION TO LATEX\\

\vspace{30px}

\bf{PART A} \\

\vspace{15px}

\raggedright

\normalsize

Answer any 5 question. Each question carries 2 marks. (5x2=10)

\begin{questions}

\question Define latex.

\question Write any 2 uses of latex.

\question Write the syntax to create latex document.


\question 4. Mention different types of math modes in latex.

\question Write any 2 tabular environments in latex.

\question Define package and give an example

\end{questions}

\centering

\vspace{30px}

\bf{PART B} \\

\vspace{15px}

\raggedright

\normalsize

Answer any 2 question. Each question carries 5 marks. (2x5=10)

\begin{questions}

\question Explain latex compilation with neat block diagram.

\question Explain how the math functions are used in latex

\question Explain tables in latex with an example

\end{questions}

\end{document}
4. Using latex commands create a simple resume of yours.

\documentclass[paper=a4,fontsize=11pt]{scrartcl} % KOMA-article class

\usepackage[english]{babel}

\usepackage[utf8x]{inputenc}

\usepackage[protrusion=true,expansion=true]{microtype}

\usepackage{amsmath,amsfonts,amsthm} % Math packages

\usepackage{graphicx} % Enable pdflatex

\usepackage[svgnames]{xcolor} % Colors by their 'svgnames'

\usepackage{geometry}

\textheight=700px % Saving trees ;-)

\usepackage{url}

\frenchspacing % Better looking spacings after periods

\pagestyle{empty} % No pagenumbers/headers/footers

%%% Custom sectioning (sectsty package)

%%% ------------------------------------------------------------

\usepackage{sectsty}

\sectionfont{% % Change font of \section command

\usefont{OT1}{phv}{b}{n}% % bch-b-n: CharterBT-Bold font

\sectionrule{0pt}{0pt}{-5pt}{3pt}}

%%% Macros

%%% ------------------------------------------------------------
\newlength{\spacebox}

\settowidth{\spacebox}{8888888888} % Box to align text

\newcommand{\sepspace}{\vspace*{1em}} % Vertical space macro

\newcommand{\MyName}[1]{ % Name

\Huge \usefont{OT1}{phv}{b}{n} \hfill #1

\par \normalsize \normalfont}

\newcommand{\MySlogan}[1]{ % Slogan (optional)

\large \usefont{OT1}{phv}{m}{n}\hfill \textit{#1}

\par \normalsize \normalfont}

\newcommand{\NewPart}[1]{\section*{\uppercase{#1}}}

\newcommand{\PersonalEntry}[2]{

\noindent\hangindent=2em\hangafter=0 % Indentation

\parbox{\spacebox}{ % Box to align text

\textit{#1}} % Entry name (birth, address, etc.)

\hspace{1.5em} #2 \par} % Entry value

\newcommand{\SkillsEntry}[2]{ % Same as \PersonalEntry

\noindent\hangindent=2em\hangafter=0 % Indentation

\parbox{\spacebox}{ % Box to align text

\textit{#1}} % Entry name (birth, address, etc.)

\hspace{1.5em} #2 \par} % Entry value

\newcommand{\EducationEntry}[4]{

\noindent \textbf{#1} \hfill % Study


\colorbox{Black}{%

\parbox{6em}{%

\hfill\color{White}#2}} \par % Duration

\noindent \textit{#3} \par % School

\noindent\hangindent=2em\hangafter=0 \small #4 % Description

\normalsize \par}

\newcommand{\WorkEntry}[4]{ % Same as \EducationEntry

\noindent \textbf{#1} \hfill % Jobname

\colorbox{Black}{\color{White}#2} \par % Duration

\noindent \textit{#3} \par % Company

\noindent\hangindent=2em\hangafter=0 \small #4 % Description

\normalsize \par}

%%% Begin Document

%%% ------------------------------------------------------------

\begin{document}

\MyName{Your Name}

\MySlogan{Curriculum Vitae}

\sepspace

%%% Personal details

%%% ------------------------------------------------------------

\NewPart{Personal details}{}
\PersonalEntry{Birth}{January 1, 1980}

\PersonalEntry{Address}{111 First St, New York}

\PersonalEntry{Phone}{(123) 000-0000}

\PersonalEntry{Mail}{\url{[email protected]}}

%%% Education

%%% ------------------------------------------------------------

\NewPart{Education}{}

\EducationEntry{MSc. Name of Education}{2010-2012}{Name of

University}{Descriptive text goes here. In order to maintain a stylish look, try to fill this
description with a few lines of text. Do the same for the other entries in the education section.}

\sepspace

\EducationEntry{BSc. Name of Education}{2007-2010}{Name of University}{Descriptive text


goes here. In order to maintain a stylish look, try to fill this description with a few lines of text.
Do the same for the other entries in the education section.}

%%% Work experience

%%% ------------------------------------------------------------

\NewPart{Work experience}{}

\EducationEntry{Job name}{2011-present}{Company Name inc., Full-time}{Job description


goes here. To maintain a stylish look, try to fill this description with a few lines of text. Do the
same for the other entries in this section.}

\sepspace

\EducationEntry{Job name}{2010-2011}{Company Name inc., Part-time}{Job description goes


here. To maintain a stylish look, try to fill this description with a few lines of text. Do the same
for the other entries in this section.}
%%% Skills

%%% ------------------------------------------------------------

\NewPart{Skills}{}

\SkillsEntry{Languages}{Dutch (mother tongue)}

\SkillsEntry{}{English (fluent)}

\SkillsEntry{}{German (fluent)}

\SkillsEntry{Software}{\textsc{Matlab}, \LaTeX, \textsc{Ansys}, \textsc{Comsol}}

%%% References

%%% ------------------------------------------------------------

\NewPart{References}{}

Available upon request

\end{document}

Resume

\documentclass[10pt]{article}

\usepackage{array, xcolor, lipsum, bibentry}

\usepackage[margin=3cm]{geometry}

\title{\bfseries\Huge Tom T. Texblog}

\author{[email protected]}

\date{}

\definecolor{lightgray}{gray}{0.8}
\newcolumntype{L}{>{\raggedleft}p{0.14\textwidth}}

\newcolumntype{R}{p{0.8\textwidth}}

\newcommand\VRule{\color{lightgray}\vrule width 0.5pt}

\begin{filecontents}{publication.bib}

@article{lamport1986latex,

title={LaTEX: User's Guide \& Reference Manual},

author={Lamport, L.},

year={1986},

publisher={Addison-Wesley}

@book{knuth2006art,

title={The art of computer programming: Generating all trees: history of combinatorial


generation},

author={Knuth, D.E.},

volume={4},

year={2006},

publisher={addison-Wesley}

\end{filecontents}

\begin{document}

\maketitle

\vspace{1em}

\begin{minipage}[ht]{0.48\textwidth}

Main Road 25\\

City 12345\\

State of Sabotage

\end{minipage}
\begin{minipage}[ht]{0.48\textwidth}

Nonlandian\\

January 3rd, 2020\\

+12 34 56 789

\end{minipage}

\vspace{20pt}

\section*{Objective}

Find a job.

\section*{Professional Experience}

\begin{tabular}{L!{\VRule}R}

2011--today&{\bf Work at company XY.}\\

&\lipsum[66]\\

\end{tabular}

\section*{Education}

\begin{tabular}{L!{\VRule}R}

2005--2007&{\bf MSc in Computer Science, Great University, Country.}\\[5pt]

2001--2005&BSc in Life Science, Great University, Country.\\

\end{tabular}

\section*{Languages}

\begin{tabular}{L!{\VRule}R}

Klingon&Mother tongue\\

{\bf English}&{\bf Fluent}\\

French&Fluent (DELF 2010)\\

Japanese&Fair\\
\end{tabular}

\bibliographystyle{plain}

\nobibliography{publication}

\section*{Publications}

\begin{tabular}{L!{\VRule}R}

2006&\bibentry{knuth2006art}\\[5pt]

1986&\bibentry{lamport1986latex}\\

\end{tabular}

{\vspace{20pt}\newline\newline

\vspace{20pt}

\scriptsize\hfill Created by http://texblog.org}

\end{document}

You might also like