LaTeX

LaTeX, created by L. B. Lamport, is one of a number of "dialects" of TeX, which are based on the version of TeX created by D. E. Knuth known as Plain TeX. It is well suited to the production of long articles and books, since it has facilities for the automatic numbering of chapters, sections, theorems, equations and cross-referencing.

See here -> http://en.wikibooks.org/wiki/LaTeX/

Typical input file

\documentclass[a4paper, 12pt]{article}
\begin{document}
Blah
\end{document}

\documentclass ends with the names of one of the available styles (a.k.a. document style), which in this case is "article". Other available styles are report, book and letter. Between the \documentclass and document style, are options. Options are enclosed in [] and separated by commas. Available options include

11pt Specifies a size of type known as eleven-point and is 10% larger than the ten-point type
12pt Same as above but is 20% larger than the ten-point type
twocolumn Produces a two-column output
a4paper Ensures that the page is appropriately positioned on A4 sized paper

By default, a document is in ten-point type size and paper size is the American paper size.

The text of the document lies between \begin{document} and \end{document}. LaTeX will automatically indent all paragraphs with the exception of the first paragraph of a new section.

Pages are automatically numbered at the bottom of the page, unless you specify otherwise using the \pagestyle command. This command comes after the \documentclass and before the \begin{document} and the syntax is \pagestyle{option}, where option can be

plain The page number is at the foot of the page and is the default page style for article and report document styles
empty No page number
heading The page number is put at the top

So the input file

\documentclass[a4paper]{article}
\pagestyle{empty}
\begin{document}
blah
\end{document}

produces a document without page numbers with ten-point type sized font positioned on A4 sized paper.

Whitespace

LaTeX treats carriage returns, tab characters, a sequence of blank spaces as blank space.

Dashes

Hyphens are obtained by -, en-dashes by -- and em-dashes by ---. Normally en-dashes are used to specify a range of numbers. em-dashes are used for punctuating.

The commands \section, \subsection and \subsubsection produces section headings and are numbered automatically. The title of the section should be surrounded by curly braces

Automatic numbering can be suppressed using the asterisk

Control sequences

\textit{word} italics
\emph{word} emphasis
\textbf{word} boldface
\textsl{word} slanted
\textsc{word} small caps
\textbf{\textdl{word}} boldface and slanted

Font size

Ranked from smallest to largest:

\tiny
\scriptsize
\footnotesize
\small
\normalsize
\large
\Large
\LARGE
\huge
\HUGE

Special characters

The special characters { and } are used for grouping. Everything within the braces are treated as a single unit. The special character $is used to set the boundary of mathematical expressions. 1.$ % & _ { } need to be escaped. \ ^ and ~ are produced by \char92, \char94 and \char126 respectively.

Greek letters

\alpha
\beta
\gamma
\delta

and epsilon, zeta, eta, theta, iota, kappa, lambda, mu, nu, xi, o, pi, rho, sigma, tau, upsilon, phi, chi, psi and omega. For upper case Greek letters, capitalise the first character; for example

\Delta

Lists

For numbered lists

\begin{enumerate}
\item
Item 1
\item
Item 2
\end{enumerate}

Bullet points

\begin{itemize}
\item
Item 1
\item
Item 2
\end{itemize}

Descriptions

\begin{description}
\item[word]
Description
\item[word 2]
Description 2
\end{description}

Quotations

\being{quotation}
blah blah blah
\end{quotation}

Tables

Left justified tables

\begin{tabular}{lll}
[1,1]&[1,2]&[1,3]\\
[2,1]&[2,2]&[2,3]\\
[3,1]&[3,2]&[3,3]
\end{tabular}

Right justified with vertical and horizontal lines

\begin{tabular}{|r|r|r|}
\hline
One&Two&Three\\
\hline
[1,1]&[1,2]&[1,3]\\
[2,1]&[2,2]&[2,3]\\
[3,1]&[3,2]&[3,3]\\
\hline
\end{tabular}

Mac

Head over to http://tug.org/mactex/ and download MacTeX.pkg from the closest mirror http://tug.org/mactex/mirrorpage.html. Then add this to your $PATH /usr/texbin Windows MiKTeX: http://miktex.org/download I used MiKTeX for a while and eventually I just found that it was much easier to find help for TeX Live in Ubuntu. So IMHO, if you're using a Windows machine, install VirtualBox and Ubuntu and use TeX Live instead of MiKTeX. Ubuntu sudo apt-get install texlive-latex-base sudo apt-get install texlive-latex-recommended latex test dvips test gv test.ps ps2pdf test.ps Installing packages First search to see if the package is available as a Ubuntu package: #use apt-file to search for packages sudo apt-get install apt-file sudo apt-file update apt-file -x search '/textcomp.sty$'
#texlive-latex-base: /usr/share/texmf-texlive/tex/latex/base/textcomp.sty

Search for amsmath

apt-file -x search '/amsmath.sty\$'
#texlive-latex-base: /usr/share/texmf-texlive/tex/latex/amsmath/amsmath.sty

For glossaries.sty

sudo apt-get install texlive-latex-extra

Installing fancytabs.sty

wget http://mirrors.ctan.org/macros/latex/contrib/fancytabs.zip
unzip fancytabs.zip
#where to put the sty file?
kpsewhich -var-value=TEXMFHOME
#/home/davetang/texmf
mkdir -p ~/texmf/tex/latex/commonstuff
cp fancytabs/fancytabs.sty ~/texmf/tex/latex/commonstuff
kpsewhich fancytabs.sty
#/home/davetang/texmf/tex/latex/commonstuff/fancytabs.sty

Installing chemfig

wget http://mirrors.ctan.org/macros/generic/chemfig.zip
unzip chemfig.zip
cp chemfig/chemfig.sty ~/texmf/tex/latex/commonstuff/
kpsewhich chemfig.sty
#/home/davetang/texmf/tex/latex/commonstuff/chemfig.sty

BibTeX

BiBTeX style examples: http://www.cs.stir.ac.uk/~kjt/software/latex/showbst.html

Errors

! LaTeX Error: Cannot determine size of graphic in

\includegraphics[width=0.8\textwidth,natwidth=1000,natheight=1000]{tiger.pdf}

It seems the dimensions that were actually added don't matter.