LaTeX: Survival Skills

I write this not because I’m an expert but ‘cos of my love towards this ‘LaTeX’ tool and the fact that it is very useful and efficient for students. Once you get used with this tool, creation of professional  project reports, seminar reports, abstracts, presentations etc. becomes a child’s play.

So, lets start.

Basic Requirements:
1) A Linux Distro ( I use openSUSE 11.3 which comes preloaded with LATEX, for those distros that don’t come preloaded with LATEX, you can always download and install it from the Latex website).
2) A basic text editor (like gedit,vim,nano etc.)
3) A small amount of patience

Getting Started

Create a folder “mylatex” (yeah this name can be anything). Now this will be the workplace for your Latex project. Create a text file named ‘first.tex’ (only the .tex extension is important). This is your source file.

Open the first.tex file. Lets create a basic document

Type the following into the file:

\documentclass[12pt,a4paper,oneside]{article} %this instructs instructs latex to create an article with base font size 12pt,on an A4 paper to be printed on single side.
\begin{document}
This is my first \LaTeX{} document.
\end{document}

Now save the file and exit.

Now open a terminal (Application->System->terminal in openSUSE, find it somewhere under the Applications category in other Distros). Suppose you created the ‘mylatex’ folder in your Desktop, then type the following command into your terminal:

cd ~/Desktop/mylatex //this changes directory (cd) to the mylatex directory in the Desktop directory)
latex first.tex //this creates a .dvi version of your document
dvipdf first.tex //this converts the .dvi to the .pdf version

Now lets add some sections and subsections to our document. Open the first.tex file and edit it as follows:(add the following between the \begin{document} and \end{document})

\section{This is my first section}
This is my first section.
\subsection{This is my first subsection}
This is my first subsection.
\section{This is my second section}
This is my second section
\subsection{This is my first subsection in the second section}
This is my first subsection in the second section
\subsubsection{This is my first subsubsection in the first subsection of the second section}
This is my first subsubsection in the first subsection of the second section

All the sections, subsections, subsubsections are numbered automatically (that’ s great right? It even creates a Contents page automatically with correct numbers and page numbers, wow!, now that’c cool!)

For the contents page to appear, add this line to the place where you want your Contents page to appear:

\tableofcontents

Now, your file should look like this:

\documentclass[12pt,a4paper,oneside]{article}
\begin{document}
\tableofcontents
\newpage            %self explained

This is my first \LaTeX{} document.

\section{This is my first section}
This is my first section.
\subsection{This is my first subsection}
This is my first subsection.
\section{This is my second section}
This is my second section
\subsection{This is my first subsection in the second section}
This is my first subsection in the second section
\subsubsection{This is my first subsubsection in the first subsection of the second section}
This is my first subsubsection in the first subsection of the second section
\end{document}

Run

latex first.tex

two or three time and use dvipdf as earlier

Now that I’ve given you a taste Latex, work with it, play with it and explore it. You can always google to get lotcha help on Latex. Next we’ll learn how to import graphics to our article.

Till then, take care and enjoy the power of Freedom. Power 2 u!

Advertisements
Tagged

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: