TeX is a typesetting language originally started by Donald Knuth.
'Typesetting' means going from structured text to an aesthetic version.
In TeX, you get control over the underlying structure, unlike word processors like Word that
invisibly manage that structure for you through a purely visual interface (and almost
invariably make a mess of it that leads to the unpreductable uncleverness of WYSIWYG text editing).
In TeX/LaTeX, much of the layouting and styling has sensible defaults but is quite controllable,
making it easier to get consistently and controllable behaviour (seemingly particularly on larger documents).
TeX is nice for people who want control over their text, partly because it does not try to help
you in ways you can't control. Still, simplicity has its limits - when TeX works, it works well and
understandably, but when it causes trouble, it often does so thoroughly, or at least complains
verbosely.
When you deviate from its way of doing things more than a little, or have a wish that isn't easily served,
you' may be in for an hour of headache.
There are other upsides and downsides. TeX's formula typesetting is one of its widely recognized strengths. At the time it was the only decent option, but even now, modern alternatives like MathML or even MathType seem to often be considered less conventient by its likely users. If you've not done TeX before, try either of those to create:
In TeX that's f(t) = h(t) \otimes g(t) \equiv \int h(\nu) g(t-\nu) d\nu. Seems fairly succinct for what it does, right?
Weaknesses mostly lie with things TeX wasn't made for. For example, tables are relatively basic in theory, but making them prettier is a mess of different almost-solutions, meaning this becomes workable only once you've dug into package details.
LaTeX started as a set of document preparation macros (written around TeX),
a set of high-level constructs for common documents and common tasks for creating them.
Think of things like page headers and footers, table of contents generation,
an two column style, and many smaller details.
LaTeX is such a useful and ubiquitous expansion that you don't see TeX without LaTeX.
(It is possible to write plain TeX and have it processed, but this is rarely useful).
See this if you wish further introduction.
LaTeX has basic setups for writing articles, reports and books.
Quite possibly it is also favoured because it is harder to mess up styling in larger documents, as opposed to eg. Microsoft Word, which tends to grow into a larger juggernaut in proportion to the document length - if you've worked on a large collaborative document, you probably have stories about this.
In recent years, the pdfTeX compiler has gained popularity, as it will allow you to compile TeX files
straight to PDFs (without dvi and ps as intermediates), using pdflatex instead of
latex, which also allows you to use PDF-specific features.
(It's also possible to generate PDF via multiple conversions, via the DVI and PS outputs,
but this can be more convoluted and fault-prone -- though on the other hand, pdflatex sometimes makes
slightly different layouting decisions, and packages may work a little differently under the pdftex
driver (which can be good or bad), so if generation of a PDF that looks identical to a PS is important to
you (and you don't need pdflatex-specific features), you may want to generate a PS document and use ps2pdf
rather than use pdflatex -- or use pdflatex and convert the PDF to PS (which has its own limitations).
All of this depends largely on how many format-specific things you want to use/avoid).
There are many packages on top of TeX or LaTeX that will let you do anything from using odd symbols, generating diagrams like trees and proofs, writing sheet music, to CAD drawing and details like making sure all acronyms are spelled out at least or exactly once, or just easing use of features that are already present.
The newer and currently common version of the LaTeX language is ,
often written as LaTeX2e. I tend to assume you're using this version. Usually it doesn't matter,
but there are some older commands I'm specifically not mentioning.
Note that this and the older LaTeX209 are mostly language and behaviour specifications,
and not specific directly packages/implementations.
Free TeX implementations include the common 'teTeX' and also 'TeX Live' for unices, and 'MikTeX' for Windows (which in combination with e.g. WinEdt works quite well, installing packages as you need them, something the *nix variants don't do). See the 'related software' list later for more.
See the wikipedia entries for TeX and LaTeX for more historical detail; The TeX Users Group (TUG) for some (recent) developments and some documentation.
At the very least, you create a .tex file, which is your document and contains your text (and processing instructions).
If your goal is PDF, this is best generated immediately (without the DVI intermediate) by invoking pdflatex yourfile.tex (it uses an alternative TeX processor named pdfTeX).
(Aside from being fewer commands, this is also the best way to use some PDF-specific features,
and it makes embedding images easier (PostScript only directly does vector images, PDF can also embed raster images)
The classical method was to run latex yourfile.tex, which generates yourfile.dvi. DVI is a self-contained format for typesetting (not unlike PostScript and PDF in concept.), but as DVI cannot store images, it was usually used as an intermediate step towards generating PostScript documents (or PDF, but doing so directly with pdflatex has more features and less awkwardness).
A LaTeX run produces various files, many of which are produced because LaTeX itself is single-pass and so cannot look forward; many of the files is simply compiled information about the document that can be used in later runs on the same document, and when you compile documents referencing others (e.g. book chapters) Consider e.g. refereces to figures, chapters, sections, and, separately, citations). Because of this, it produces data for specific functionality (.aux for references, .toc for chapter headings, etc.) that it will use in later runs.
This is the reason that you will often need to run LaTeX twice to have references work at all, and also to update them. In some fairly pathological cases you may need to run it more often. You can ignore these extra files, and you can delete them after generating the document.
If you're on a unix-type system, I suggest you take a look at rubber. Its purpose is to recompile a document as often as seems necessary (including calls to BibTeX), which means you don't have to worry about all this. It's not foolproof, but generally much more covenient.
A .log file is also created, which is a copy of the text that flies by when you run latex (plus a few more details you probably didn't care about).
Also note that once the document (often the DVI file, the PostScript from it, or the PDF document) has been made, you won't really need to keep anything but the original data (.tex, possible .bib). The log, aux, or toc files re are mostly clutter once you're done, and can be deleted if you wish.
Apart from xdvi and printing in unices, the DVI format is not too useful. As mentioned, a common
conversion is from DVI to PostScript with the dvips program (part of at least teTeX, and
it requires ghostscript to be installed). You can even go from DVI via PS to PDF, or from DVI to PDF.
However, these indirect steps can only introduce problems, and won't use most PDF-specific features.
More importantly, there is a font
rendering problem (dvips usually uses raster fonts - usually at high resolution, but
raster fonts all the same. You won't really see it after printing, but it causes an odd sort of
liney fuzziness on screen probably in programs that do quick and dirty interpolation).
For PDF, I suggest you use pdflatex or analogous to avoid the font problemlet. You'll have
to convert any .ps/.eps figures to pdf, but this isn't hard. See the graphics
section for details.
As you may have noticed, a (La)TeX document is plain text, where a few symbols have special meaning, depending a little on context, but usually sensibly so. An example piece of LaTeX - and don't worry if you can't really read it yet - with most special characters crammed into it:
I am text. Yes. %comment: a semi-complex table with math in it: \begin{tabular}{|l|r|} \hline $a_1~~~b$ & $\sqrt[3]{a_1^2}$ \\ \end{tabular}TeX is generally information-compact, so sometimes hard to read. Look for an editor that knows how to color its syntax, so that it'd look something like:
I am text. Yes. %comment: a semi-complex table with math in it: \begin{tabular}{|l|r|} \hline $a_i~~~b$ & $\sqrt[3]{a_i^2}$ \\ \end{tabular}
Incidentally, that table looks like when it is typeset.