Computer Assigment 4
Computer Assigment 4
Enrollment Number:01-169242-008
Program:BS(DS-1)
Submitted By :Khansa Khan
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.
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.
\textbf{Bold text}
\textit{Italic text}
\underline{Underlined text}
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}
\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}
\begin{enumerate}
\item Item 1
\item Item 2
\item Item 3
\end{enumerate}
$E=mc^2$
\[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}
\begin{abstract}
This is the abstract.
\end{abstract}
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}
\begin{tabular}{|l|l|}
\hline
Column 1 & Column 2 \
\hline
Cell 1 & Cell 2 \
\hline
Cell 3 & Cell 4 \
\hline
\end{tabular}
\use-package{package_name}