Seario's Blog

Just another WordPress.com weblog

Latex few basic commands…

If you want to write something such as your thesis, a paper, an article, or simply you are the kind of people who likes to do the things in a professional manner, well I’m so glad to give you the welcome to the latex world ;P…

Well starting all Latex document you always write a header, which indicates what kind of document are you going to write, it can be a book, article, paper or report. In latest versions there are few more document-class types. After define your header, you have to define the beginning as well as the end of the document, so your basic code should say…

\documentclass{article}

\begin{document}
   Hello world!
\end{document}

In order to see the result of this code, you have to save this code as a .tex file, after that compile it, there are several ways to do it, it basically depends of the kind of system that you are using. For linux/UNIX users you have to type these commands

latex name_of_the_file.tex (intro)

pdflatex name_of_the_file (no extention is required, intro)

acroreader name_of_the_file.pdf (intro)

The first command will compile and generate a .dvi file, which is a printable version of the code, the second shows you your document, and finally the third allows you to print your document, but if you are a linux user you know that it is possible to change it for a .ps document which means high quality for the printing…

If you are a windows user, well there are several programs such as winedit, that help you to type the commands aforementioned, basically you just push the button that say latex, dvi and pdf, as a secuence and voila, thats all… you have your .pdf document ready to be printed…

Of course if you are interested in write by far complex and high quality documents, you can add some libraries to your document that helps you to submit a high class document. There are quite a few libraries, so if you need or want some in specific you can check in www.ctan.org.

You can specify everything in your code such as font size, paper size, one or two side printed, etc…

\documentclass[11pt,a4paper,oneside]{report}

\begin{document}
\title{How to Structure a LaTeX Document}
\author{Andrew Roberts}
\date{December 2004}
\maketitle
\end{document}

The above commands make your life easier, and there are many more…

\documentclass[12pt]{article}
\usepackage{amsmath}
\title{\LaTeX}
\date{}
\begin{document}
  \maketitle
  \LaTeX{} is a document preparation system for the \TeX{}
  typesetting program. It offers programmable desktop publishing
  features and extensive facilities for automating most aspects of
  typesetting and desktop publishing, including numbering and
  cross-referencing, tables and figures, page layout, bibliographies,
  and much more. \LaTeX{} was originally written in 1984 by Leslie
  Lamport and has become the dominant method for using \TeX; few
  people write in plain \TeX{} anymore. The current version is
  \LaTeXe.

  % This is a comment; it is not shown in the final output.
  % The following shows a little of the typesetting power of LaTeX
  \begin{align}
    E &= mc^2                              \\
    m &= \frac{m_0}{\sqrt{1-\frac{v^2}{c^2}}}
  \end{align}
\end{document}

Copy the above example, compile it and print it… it is just the beginning….

The above example has been copied from wikipedia/latex, as it is under creative commons license we can use it in order to learn and improve our knowledge.

Advertisement

January 11, 2010 - Posted by | Uncategorized

No comments yet.

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 )

Connecting to %s

Follow

Get every new post delivered to your Inbox.