LaTeX: format basics

Basic structure

tex So, what’s the most basic structural elements for any document you write? Paragraphs, of course. I ussualy use LyX for writing paragraph-based documents (i.e. most of them) and presentations don’t have many, so perhaps this is the structural element I use the least. Oh, wait, there’s no element, just a “nn”. Point for LaTeX (take that, HTML).

You’ll also need to put titles, sections, subtitles and all that stuff to give your document a nice structure. Well, that’s easy too, just use

  • section{name}
  • subsection{name}
  • subsubsection{name}

Easy, right? Check the example at the end of the post. There are some other commands you’ll use in any LaTeX document:

  • Footnotes
    footnote{ Footnote text }

    Just write your text, it’ll be there when you compile the document

  • Vertical skip

    Because, some times, LaTeX default formatting won’t be enough.

  • Align text Center:



    Again, some times you may need it. Not too often, though.

You should now be able to write your first LaTeX document, starting from a template (always start with a template… it’s easier). I’m attaching to this post an example document in LyX, LaTeX and its compiled pdf, in case you’re wondering what does it look like in the end. For the next entry: some “advanced” tips and tricks, now let’s see an example LaTeX document:

title{LaTeX Example}
author{Nicol'as Brailovsky}


This is just a LaTeX kick off, with some basic commands. 

section {Section one}
For example, this is a paragraph.
{ em Lorem ipsum dolor sit amet, consectetur adipiscing elit.}
Donec porta, enim eget tempus tempor, eros sem dapibus diam, vitae lacinia mauris metus id nulla.

You can have subsections too ldots

ldots as many as you want

subsection{Random stuff}
You can even create a shopping list in LaTeX, if you wish
item Beer
item Beer
		item (Another brand of beer)
item Pizza
item Beer

Or even better, use it to do the homework. \
Math is a breeze in LaTeX: $x_n = sqrt{a + b}$ can be typeset inline.

You can download the compiled document from this link. May be it doesn’t look too useful (I’d use LyX instead) but soon we’ll start doing some cool stuff LyX can’t handle. Keep tuned for the next LaTeX article.

Leave a Reply

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

You are commenting using your 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