Google
 

Tuesday, June 5, 2007

World of LaTeX

"LaTeX?? What the heck?" This is what many people say when they hear the word "LaTeX". If you are one among them, then go on and read this post.

Before telling about LaTeX, let me ask you some simple questions.

1. Did you ever use editors like Word, OpenOffice etc for producing your project reports, paper presentations, or journal articles? If so, after typing a few hundred pages, what happened when you inserted an image file in between your paragraphs? My experience in such situations is worst. My friends and I faced this problem when we prepared our undergraduate project reports. All our previous page settings were disturbed when we tried to insert or resize a picture. Once again, we set out to format the entire document.

2. Did you insert some serious Mathematical equations or formulae in your documents? It is a pain in your ass if you do that in normal editors like Word, despite its Equation Editor.

3. How about the quality of your content? I concentrated more on document layout and its appearance. This affected the quality of my content.

One of the solutions to these problems is LaTeX. Simply put, LaTeX is an open source typesetting system. It is especially useful for developing professional and well-structured documents. The main advantage of using LaTeX is that, it allows you to concentrate on your content and forget about the layout; because LaTeX takes care of the actual typesetting (font styles, alignment etc), structuring of your content and page formatting. Though it is a little bit difficult to learn, LaTeX produces high-quality technical and scientific documents easily. Once you learn how to use LaTeX, it makes your life easy.

So much to say about LaTeX. Let us see this in action. Don't expect to learn LaTeX in one day. It needs a lot of patience to master the basics. Go through the links provided at the end of this post to learn more about LaTeX. By the way, don't panic by looking at the code. It is provided to show how easy it is to produce quality reports.

Installation: To install LaTeX under Windows, follow this procedure -- Download and install basic MikTeX. Install a LaTeX editor like TeXnicCenter. Copy and paste the code given below in an empty document inside TeXnicCenter. Save the file as "demo.tex", without quotes.

%--------------------------------------------
% Example of LaTeX
% File: demo.tex
% Author: Trisul Kanipakam
% Date: Tuesday, June 05, 2007.

\documentclass[11pt]{article}
\usepackage{palatino,url}
\usepackage{amsmath}

\begin{document}

\author{Trisul Kanipakam}
\title{\LaTeX\ example}
\date{\today}
\maketitle

\section*{Hello World!}
This is a sample \LaTeX\ document. We can generate an article like this with a default font size of 11pt, using \textit{Palatino} font. Note that, i don't have to format section headings, justification, numbering of sections and pages etc. We can easily generate tables and center them,\\

\begin{center}
\begin{tabular}{cc}
\hline
Sno & Data \\
\hline
1 & 1000 \\
2 & 2000 \\
\hline
\end{tabular}
\end{center}

Listings can be generated as shown below:
\begin{itemize}
\item \emph{$e=m*c^2$},\quad $\sqrt{4}=2$, \quad $\int_0^2 \zeta^{2}(x) \, dx$, \quad $\frac{dy}{dx} \rightarrow 0$, \quad $\alpha \neq 0$, \quad $F(x_{1}, x_{2}, \ldots , x_{n}),$ \quad $(u, \infty)$, \quad $\lim_{x \to \infty} f(x)$.
\item Matrices and Limits
\[
\lim_{x \to a} \frac{f(x) - f(a)}{x - a}, \quad
\begin{pmatrix}
a & b & c & d\\
x & y & z & w
\end{pmatrix}
\]
\end{itemize}

\begin{center}
\textit{Have a nice time learning \LaTeX\ !}
\end{center}

\end{document}

% End of document.
%-----------------------------------

If everything goes well, you should see something like this.

Now Build the current file in TeXnicCenter to produce a nice looking pdf file as shown below.

Thats it. Forget the WYSIWYG editors and enter the world of LaTeX.

Links:

1. Getting to Grips with LaTeX

2. LaTeX isn't for everyone but it could be for you

3. The beauty of LaTeX

4. The not so short introduction to LaTeX

5. Getting started with LaTeX

Hey i ran out of space. Google "latex tutorials" for more links.

1 comment:

sumanthy said...

Hi Trisul,

Its really good one. Thanks, its the best solution for preparing documents involving Mathematical and scientific equations...Thanks once again for ur efforts in letting us know