Skip to content
Mageswaran edited this page Mar 27, 2015 · 7 revisions

Aja team was searching for a way to document its research work somewhere some way for free, with less effort to maintain and distribute. That is when we have come across OpenNN which uses LaTex for its documentation.
Yes your guess is correct Ctrl + c and Ctrl + v, we are done!

For those who are interested to create your own technical documentation in an easy way without any hassles, we guess this is the best way.

The common question that would have raised in you head by now, why will I need to know a new language? when there are N tools out there that does the job in few clicks. We will answer your doubt, with our documents!

We will cover here some of the basics that needs to be known to start off.
Assumptions: You are using Ubuntu and followed our setup

Good place to start is wiki, wiki2 and LaTeX official guide links.

Basic Rules

Basic LaTeX is just text with typesetting commands. Typesetting commands are usually preceded by \, and any arguments are usually placed inside curly braces {}.
LaTeX wraps text in adjacent lines as if they were part of the same paragraph. To start a new paragraph, insert an extra “return”:

LaTeX source:
This is one paragraph.

This is another.

To get a newline without starting a new paragraph, use \\. To get a comment, use the percent sign % at the beginning of a line. The rest of that particular line will be commented out.

Starting a new document

The most basic (empty) document has only three parts:
\documentclass{article}
\begin{document}
\end{document}

Compiling

latex <your_file_name.tex>

Once it successfully compiles, you will get a file named your_file_name.dvi. Typically we convert this either into a Postscript or PDF file, which may be done by the programs dvips your_file_name.dvi and dvipdf your_file_name.dvi. Sometimes dvips requires an extra option: -o output-file-name specifying the output file.

Organization

One important thing to do is to organize our document well.

Sectioning

There are two sectioning commands that will be useful for us:
\section{Name of section} and
\subsection{Name of subsection}.
Use these to separate different problems or subproblems in the assignment.

Tables

You can put stuff into tables by using the tabular environment.

LaTeX source:
\begin{tabular}{r|cl}
1st column & 2nd column & 3rd column\\
\hline
a & b & c
\end{tabular}

Note that the command is called tabular and not table.
Important points:

  • The “{r|cl}” after the tabular \begin{tabular} indicate the alignment of the three columns: right, center, and left. This is mandatory as it specifies the layout of the table. For more columns, type more alignment commands, e.g. for a table with 5 columns all aligned to the right, you would use rrrrr.
  • The vertical bar | between the r and c indicates that a vertical line should be drawn between those columns.’
  • The & separates the columns in the body of the table.
  • A \ signifies the end of each line of the table.
  • The command \hline means that a horizontal line should be inserted.

Lists

You can put stuff into ordered and unordered lists by using the enumerate and itemize commands, respectively.

LaTeX Source:

Unordered list:
\begin{itemize} \item This is one item.
\item This is another.
\end{itemize}
Ordered list:
\begin{enumerate}
\item This is the first item.
\item This is the second.
\end{enumerate}

Labels and references

It is useful to refer to the section number at times. This may be done by using the \label{labelname} command. Place this right after you start a section. Then, you may refer to the section number by using \ref{labelname}. This will also be useful to refer to math equations. Note that LaTeX creates and uses a bunch of auxiliary files. Thus you will have to invoke it twice to compile a file that has labels and references, or if those labels and references have changed since the last compilation.

Math

The one and the only reason why we have chosen to use LATEX is because it is so powerful in typesetting mathematical expressions. It wins hands down versus word processors like Word to be specific MicroSoft Word.

Math Mode

Math expressions are separate from text in LaTeX. To enter a math environment in the middle of text, use the dollar sign $, for example $F = ma$ produces F = ma. Everything between the two $ signs will be considered math formula.
To type a math expression that is on its own line and centered, use $$

LaTeX source:
The following is an important equation: $$E = mc^2$$

To give an equation a number and have it referable, use the equation environment and use a \labelcommand
LaTeX source:
\documentclass[12pt]{article}
\title{\LaTeX Test Source}
\date{}
\begin{document}
The following is an important equation:
\begin{equation}
\label{emc}
E = mc^2
\end{equation}
Please memorize Equation \ref{emc}.\\

We bet it could be no more easier way to write below equation \\
$$\Pr\left[\sum_{i=1}^k X_i > c \right] \leq 2^{-\Omega(c^2 k)}$$
\end{document}

The best link we could find for an on-line LaTeX compiler is Google Docs Tool

Following are the tutorial links what Aja team refers to make its documentation.

Reference Links

Templates we will use