In this page, we will highlight or illustrate a quick and easy way to get started using latex to create some very simple documents. Once you have understood some basic elements of Latex and have succeeded in creating the basic files, then you can refer to the various links included in this page.
This file is a very bare-bones document that is necessary and sufficient to get started. The documentclass tag is needed to specify what type of document we are trying to create. The documentclass tag is part of the preamble (everything before the \begin{document} tag is called the preamble). The actual text will be contained within the \begin{document} and \end{document} tags.
\documentclass{article}
\begin{document}
Hello world!
\end{document}
Save the text (actually, text with some interspersed code) into a file and name it as sample1.tex. In order to obtain the pdf output all we have to do is open a terminal and run pdflatex on the file as
$pdflatex sample1.tex
Of course, you must have pdflatex installed in order to obtain the required output. Click here to see it.
In this file we create unordered lists, itemized lists using latex. Lists are very useful in Latex and frequently used in creating presentations, reports and thesis.
\documentclass{article}
\begin{document}
In case you did not really understand the power of latex, then, realize that
we can type in arbitrary text into the tex(t) file and store it on disk. Later,
from the tex file we generate the pdf document and thus latex subsumes
many of the functionalities of the word processor.
Ah! You say that latex can never be a suitable replacement for any wordprocessor
as any decent word processor has for a start unordered lists. Well in latex, we
have to
\begin{itemize}
\item First realize that it can be done
\item Be ready to learn
\item Be willing to type in a little more.
\end{itemize}
Do you think that the above are points are disadvantageous? Hold on let me
enumerate some really good advantages for latex:
\begin{enumerate}
\item The typing can be eliminate by using a GUI frontend
\item Learning is easy too
\item It is faster and has lesser overhead compared to a wordprocessor
\item It is open and free
\item There are many more advantages
\end{enumerate}
\end{document}
The output for the above file can be viewed here.
Finally, we end this whirlwind introduction by introducing some of the ways of marking math content in tex files. LateX has no parallel for typesetting math content as it was originally invented by the mathematician and computer scientist Donald Knuth. Here, we illustrate one of the myriad ways of typesetting some of the frequently used (by me at least) commands which is by enclosing the special commands within the $ signs. Please note the addition of the \usepackage command in the preamble and the dollar signs interspersed within the document tags.
\documentclass{article}
\usepackage{amssymb}
\begin{document}
\section{Symbols}
\begin{itemize}
\item Fractional quantities can be expressed easily , for example
$\frac{1}{2}$, $\frac{721}{95}$
\item In general the fractions are of the form $\frac{x}{y}$ or
$\frac{x*y*z}{y*z} = x$
\item The square root of a variable : $\sqrt{x}$,$\sqrt{var1}$
\item The nth square root : $\sqrt[n]{var1}$,$\sqrt[5]{var1}$
\item The natural numbers, the real numbers, rationals ... :
$\mathbb{N}, \mathbb{R}, \mathbb{Q}$
\item For all, There exists and belongs to: $\forall x \in \mathbb{N}$,
$\exists y \in \mathbb{N}$ such that y=x+1.
\end{itemize}
\section{Sub- and Super-Scripts}
\begin{itemize}
\item If we want subscripts ,we enter them thus : S$_{n}$, G$_{|X|}$ ...
\item For superscripts : x$^{n}$ + y$^{n}$ = z$^{n}$
\end{itemize}
\end{document}
To view the output click here
The series of links that I had promised are listed below. The main page for referring anything related to TeX is the homepage of the LateX project.
A convenient cheat sheet for quick reference.
The following links are very useful for entering a varied types of symbols. However, if you really need to enter a lot of symbols, looking up the symbols manually is not a very good idea. If you find yourself in this position, as I did and suffered, I strongly suggest that you install kile and use the GUI to look up symbols rather that searching for the names in the pdf.