0% found this document useful (0 votes)
1 views

Computer Assigment 4

Uploaded by

khhaannssaakhan
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)
1 views

Computer Assigment 4

Uploaded by

khhaannssaakhan
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/ 6

ASSIGMENT :04

Topic: “La TeX”

Enrollment Number:01-169242-008

Program:BS(DS-1)
Submitted By :Khansa Khan

Submitted To:Abdul Raheem Aleen

Submission Date:28thDecember,2024
1. What is La TeX?

La TeX is a document preparation system and markup language that is widely used
for typesetting scientific and mathematical documents. It provides a simple and
efficient way to create professional-looking documents with complex layouts,
equations, and graphics.

2. Why learn La TeX?

La TeX offers several advantages over traditional word processing software,


including:

Professional-quality documents: La TeX produces documents with precise


formatting and layout control.
Mathematical typesetting: La-TeX has extensive support for mathematical equations
and symbols.
Re-usability: La TeX documents are plain text files, making them easy to modify and
reuse.
Collaboration: La TeX documents can be easily shared and collaborated on.

3. Writing your first piece of La-TeX

To start writing in La TeX, you'll need to create a new document and add some basic
structure. Here's an example:

\document class{article}
\begin{document}
Hello, world!
\end{document}

This code creates a simple article document with the text "Hello, world!".
4. The preamble of a document
The preamble is the section of a La TeX document that comes before the
\begin{document} command. It's used to specify document-wide settings, such as
the document class, font size, and page layout.

5. Including title, author, and date information


To include title, author, and date information in your La TeX document, you can use
the following commands:

\title{Your Document Title}


\author{Your Name}
\date{\today}

These commands should be placed in the preamble.


6. Adding comments
To add comments to your La TeX document, you can use the % symbol. Any text that
follows the % symbol on a line will be ignored by the LaTeX compiler.

7. Bold, italics, and underlining


To add bold, italic, or underlined text to your LaTeX document, you can use the
following commands:

\textbf{Bold text}
\textit{Italic text}
\underline{Underlined text}

These commands can be used anywhere in your document.

8. Adding images
To add an image to your La-TeX document, you can use the \include graphics
command:
\include graphics[width=0.5\text-width]{image-file}

Replace image-file with the name of your image file.

9. Captions, labels, and references


To add captions, labels, and references to your La-TeX document, you can use the
following commands:

\caption{Image caption}
\label{fig:image}
\ref{fig:image}

These commands can be used to add captions and labels to figures, tables, and other
elements.
10. Creating lists in La TeX
10.1 Unordered lists
To create an unordered list in La TeX, you can use the itemize environment:

\begin{itemize}
\item Item 1
\item Item 2
\item Item 3
\end{itemize}

10.2 Ordered lists


To create an ordered list in LaTeX, you can use the enumerate environment:

\begin{enumerate}
\item Item 1
\item Item 2
\item Item 3
\end{enumerate}

11. Adding math to LaTeX


11.1 Inline math mode
To add math to your LaTeX document in inline mode, you can use the $ symbol:

$E=mc^2$

11.2 Display math mode


To add math to your LaTeX document in display mode, you can use the \[ and \]
symbols:

\[E=mc^2\]
11.3 More complete examples
Here's an example of a more complex math equation:

\begin{equation}
\label{eq:example}
\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}
\end{equation}

12. Basic document structure


12.1 Abstracts
To add an abstract to your LaTeX document, you can use the abstract environment:

\begin{abstract}
This is the abstract.
\end{abstract}

12.2 Paragraphs and new lines


To add a new paragraph to your La-TeX document, you can use the \par command or
leave a blank line:

This is the first paragraph.

This is the second paragraph.

To add a new line without starting a new paragraph, you can use the \\ command:

This
12.3 Chapters and sections
To create chapters and sections in La-TeX, you can use the following commands:

\chapter{Chapter Title}
\section{Section Title}
\subsection{Subsection Title}
\sub-subsection{Sub-subsection Title}

13. Creating tables


13.1 Creating a basic table in La-TeX
To create a basic table in La-TeX, you can use the tabular environment:

\begin{tabular}{|l|l|}
\hline
Column 1 & Column 2 \
\hline
Cell 1 & Cell 2 \
\hline
Cell 3 & Cell 4 \
\hline
\end{tabular}

13.2 Adding borders


To add borders to a table in La-TeX, you can use the | symbol to separate columns
and the \hline command to create horizontal lines.

13.3 Captions, labels, and references


To add captions, labels, and references to a table in LaTeX, you can use the following
commands:
\caption{Table Caption}
\label{tab:table}
\ref{tab:table}

14. Adding a Table of Contents


To add a Table of Contents (TOC) to your La-TeX document, you can use the
\tableofcontents command.

15. Downloading your finished document


Once you've completed your La-TeX document, you can download it as a PDF file.

16. Finding and using La-TeX packages


La-TeX packages are collections of commands and styles that can be used to
customize your document.

16.1 Loading packages


To load a La TeX package, you can use the \use-package command:

\use-package{package_name}

16.2 Finding information about packages: CTAN


The Comprehensive TeX Archive Network (CTAN) is a repository of LaTeX packages
and documentation.
16.3 Packages available on Overleaf: Introducing TeX Live
Overleaf is an online La-TeX editor that provides access to a wide range of La-TeX
packages and templates. TeX Live is a comprehensive TeX distribution that includes a
wide range of La-TeX packages and fonts.

You might also like