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.
\begin{verbatim} In the verbatim environment, text appears with almost no treatment. There's also no need for manual TeX newlines (\\) \end{verbatim}
..produces:
To get the the above characters to show in your text, add a backslash: \$ \{ \% \} \_ \# produces .
There are three exceptions, things that have other meanings: \\ is a literal newline, \^ gives a caret diacritic (e.g. t\^ete),
\~ is a tilde diacritic (e.g. Ni\~no).
For backslash, $\backslash$ (dollars for math mode) is often the easy solution.
For the diacritics, you can give an empty argument (\~{}, \^{}) to place them above nothing - though visually that's often not what you want (.
).
Inline verbatim is one solution if use of a monospace font is fine, for example \verb|^| and \verb|~|,
and \verb|\|.
To get tildes in URLs, use the url package, because this handles most everything for you: a tilde is treated as a tilde and not a TeX space, it copies as a tilde and not a space, and URLs are clickable (where supported).
To get a tilde in non-URL text - and optionally centralized (as it is often shown in monospaced text elsewhere), i.e. more of a swung dash:
If you don't mind a macro, you can create a specific tilde look, tweaking position and style. For example:
You can shift up \sim with something like {\raise.17ex\hbox{$\scriptstyle\sim$}}. (scriptstyle makes it shorter and thinner, the raise roughly centers it. This was taken from the url package, but with less raising.)
You can also shift down the diacritic tilde. It looks subtler in \mathtt, which you may prefer for regular text. In \texttt it looks thicker, which is probably nicer for monospace use.
For example, you could define:
\newcommand\thintilde{{\lower.92ex\hbox{\mathtt{\char`\~}}}}
\newcommand\thicktilde{{\lower.74ex\hbox{\texttt{\char`\~}}}}
This makes a\thintilde b\thicktilde c look like .
For comparison:
When you want a literal caret: \^{} is a high diacritic, so you're probably looking for a caret in verbatim style, e.g. . (You could lower it a bit if you're picky, e.g. )
A very minimal document looks like:
\documentclass{article} \begin{document} Text \end{document}
Documents and tutorials that use documentstyle instead of documentclass are old; that's a LaTeX209 file instead of LaTeX2e. Most LaTeX packages provide transparent backwards compatibility, but that doesn't always work flawlessly. Some differences are in available commands, including some common things. For example, 209 has \textbf{text}, 2e has the shorter {\bf text}
A slightly more practical document looks like:
\documentclass[a4paper]{article} %package imports and document options go here \usepackage{url} %I occasionally use URLs in footnotes, this helps. %useful if you use \maketitle, or want it to end up in the document file's metadata \title{I am Sam} \author{Dr. Seuss} \date{1960} %%%% the actual document %%%% \begin{document} \maketitle I do not like green eggs and ham. \end{document}
...which can easily compile into the simple eggs.pdf here.
The commands before the \begin{document} are the preamble, in which document-wide things settings, package imports, and things like command (re-)definitions go.
Documents have a type, a classes, which controls the basic style of document preparation like whether to show a header with chapter type or not, and which provides you with commands like \section. The basic document classes are:
Exactly which of the commands like \part, \chapter, \section, \subsection, \subsubsection, \paragraph, \subparagraph and \appenix are available depends on the document class used in a particular document.
There are various other document classes that are commonly installed (can depend on how old, minimal, or default your setup is):
Each document type recognizes a set of arguments. Exactly which options each document class supports depends on both sense (for example, slides doesn't support most of the page options) and on whether the document class was recently updated to support certain options. Common options that most support include:
For example, if you want to make an A5-size booklet with tiny print, you might use:
\documentclass[9pt,twoside,a5paper]{extbook}
Simple header/footer control comes from \pagestyle. You can disable both with \pagestyle{empty}. You can also use \pagestyle{headings}, which uses predefined header styles, and what goes there depends mainly on the document style. The default is \pagestyle{plain}. A few documentclasses provide more options.
There is a fourth page style, myheadings, but usually it pays to use the
fancyhdr package instead, as it is more customisable.
TODO: experiment, write up.
To change the space around the headers, you probably want to change (\addtolength) \headheight (or \headsep), but it may well be easier to use the geometry package instead. (see layouting below)
Most packages you'll need are installed by default, depending somewhat on how old the installation is. Sometimes you'll want specific functionality that's not installed on basic setups, such as perhaps typesetting russian. You may have to both find and install these packages.
You can find most any halfway accepted package on CTAN, specifically its package search. This will give a basic description, its source, and often a link to its documentation.
If you are the sysadmin and got the question or idea that you want a TeX package, see if the OS' package manager has what you want. Failing that, do a manual install by copying the package into one of the directories mentioned by kpsepath tex. You need to run texhash after you do so to inform a TeX index.
If you're not the sysadmin, a quick workaround is to download the package from CTAN and unpack the contents into ~/texmf/tex/ (or some other directory reported by kpsepath tex). Create that directory if it didn't exist. A texhash is usually unnecessary, but see the paragraph below about this when in doubt.
I believe you can even just plunk the files in the same directory you're compiling the tex from.
The package path that kpsepath tex reports has two syntax additions over a regular path.
When an entry starts with !!, that path is indexed, and you have to use texhash after any
changes. The absence of !! means the path is checked each run, which is often the case for anything
under your $HOME directory.
The other addition is that when the path ends with two slashes (or three, practically), it means
'search recursively', which is useful when you unpacked things into directories of their own.
See also 'Installing TeX/LaTeX packages inside your account'.
I still need to check whether this is MikTeX or WinEdt cooperating with it, but when you use halfway common packages you don't have installed yet, it will do so for you automatically.
However, some FTP repositories may not react (and possibly not be up to date), so if it seems to hang and then fail, you want to switch repositories; use the MikTeX package manager. While you're there, try to use it to install, as it seems more likely to report the error message.
Much can be done by describing what sort of text it is and what, generally, must be done with it; TeX's default handling of many things are commendable, and making things like lists Every now and then, you want accurate control. Some of it just is, some of it is useful or necessary, some of it would offend purists, and some of it even you will find ugly...
Paragraphs are split by one or more empty lines or with a \par). Generally, you can control spacing between paragraphs by adding a \smallskip, \medskip, \bigskip or \noskip before a paragraph starts. I've been known to abuse these to subtly suggest how much paragraphs are to be read as related.
If you want to specifically avoid indenting the first line, you can use \noindent. (Likewise you can use \indent to insert a horizontal jump when you want it, though I've never had to use it myself.) Note that noident can hurt your document's consistency, though.
Example use: (note the empty lines around a specific something-space have no effect, which is why I personally use said empty lines to indicate what type of skip is there)
\par\noindent Paragraph text 1. Another\\ paragraph, with arbitrary linebreak to mess things up. \par Donec bibendum lacus quis risus. Mauris eget ligula vel nisi ultrices dictum. Pellentesque mi augue, dictum ut, laoreet sit amet, nonummy ut, elit. \par\smallskip Nullam sem dui, consequat ut, cursus id, elementum vel, metus. In hac habitasse platea dictumst. \par\medskip\noindent Pellentesque tincidunt, libero vel lacinia luctus, nulla ante tempus metus, vitae vehicula quam nisi id massa. Sed sem urna, luctus a, imperdiet a, porttitor quis, metus. \bigskip Etiam molestie, risus in auctor ornare, sapien eros tincidunt sem, eu rhoncus tortor nibh nec felis. Quisque fermentum condimentum ligula. |
Itemize: \begin{itemize} \item First \item second \item[$\dag$] Manual bullet style \end{itemize} \hline Enumerate: \begin{enumerate} \item First \item second \item Nested list \begin{enumerate} \item First \item second \end{enumerate} \end{enumerate} \hline Description: \begin{description} \item[Theorem] ``An idea that has been demonstrated as true or is assumed to be so demonstrable.'' \item[Cow] Does the `moo' thing. \end{description}TODO: check \list, \trivlist. |
Aside from the obvious \begin{document} and \end{document} that define the document, there are more interesting environments, many of which have specific purposes - and are probably discussed better elsewhere.
For example, the letter environment (inside a letter documentclass, not to be confusing) allows for easy letter typesetting, and defines many a command to do so. See the example in the 'Document Setup' section. Another wide-effect environment is slide, which inside the slide documentclass groups content into individual slides (think overhead sheets, beamer).
There are also a number of environments with simple uses, often related to styling, amongst which things like quote, quotation, abstract, verse, itemize, enumerate, description, and such. A simpler case, alignment:
\begin{flushleft} Left\\ Text \end{flushleft} \begin{flushright} Right\\ Text \end{flushright} \begin{center} Center\\ Text \end{center} |
Note: these environments are based on \raggedleft, \raggedright, and \centering. Text in LaTeX is usually fully justified ,
The quote environment tends to be used for a short quote, quotation for longer ones. The difference is that quotation paragraphs have no blank space between them (they are indented as usual, though).
verse also has special formatting rules
The verbatim environent tells TeX to not interpret TeX, comparable to HTML's <pre>. An example of its use sits in the TeX Syntax section above.
You could use it for source code, but there are better options for that, that do syntax highlighting, and/or deal better with wrapping. If you want nothing fancy, use \verbatiminput{myfile.c} (part of the verbatim package). Slightly more complex are packages like lgrind and listings. See the tricks section.
There is also a shorthand for verbatim text, \verb. Basically, the first character after it is the delimiter - so you can write eg. \verb|int main(void) {| without having to worry that there's a curly bracket there. Or \verb*-\|/*. Or \verb,*wow*,.
Tables and lists are also environments, but common enough to deserve their own sections; see below.
See this list for more environments.
TeX is pretty smart at spacing and kerning, you probably don't want to touch it until you need something to be different.
The following is text mode spacing. Math mode has additional, more accurate control explained in the math section.
Note the differences (and lack of them) in the following. There are more details, such that
hyphenation won't happen on a ~.
See e.g. wikipedia about what ligatures are.
Many spaces not useful Just one is enough Unless you~~~~~really\ \ \ \ \ must have more %TeX may treat a period followed by a space (and some other things) % as a sentence break, which is a problem around abbreviations. % To make sure it doesn't, \ is a common solution Dr. Death Dr.\ Death Ecks vs. Sever Ecks vs.\ Sever %Similarly, a capital at the end is assumed to not end a sentence % IF you care, "\@. " is strictly correct. A problem when you use a TLA. Or other initialisms. A problem when you use a TLA\@. Or other initialisms. c~c Hard~space c\ c Inter-word\ space c\,c Thin\,space (short space) c\;c Thick\;space c\quad c Quad\quad space c\qquad c Double-quad\qquad space c\!c Negative thin\!space a\hspace{1mm}b\hspace{-1mm}c Arbitrary space Ligatures: ff fff fi ffi fl ffl % You can avoid them with a {} (among other ways): shelfful shelf{}ful |
Quotes hug strings automatically when you use ` (also called backtick, and sometimes seen a standalone grave accent, on the same key as the tilde on US keyboards) and ' (apostrophe). There are several types of dashes, though I should figure out which are typographically most correct for which purposes.
`single quote' ``double quotes'' "dumb quotes" %Nesting using just a separating space (like `` `) is possible, % but may insert too much space to your liking. `` `Things', you say?'' %You could use a thinspace instead: ``\,`Things', you say?'' %German low quotes % Only available with particular packages; babel is simplest % (specific language support packages may also help) % and there may be specific alias commands. \glqq foo\grqq ~~ \grqq bar\glqq %aliases may be "` and "' \glq foo\grq ~~ \grq bar\glq % You can cheat and use them outside their intended left/right % positions, but the spacing shows in the single quotes. % french guillemets: \flqq bar\frqq %aliases may be "< and "> \flq bar\frq inter-word dash (hyphen) page range dash, 10--26 (en dash) punctuation dash---like this (em dash) minus: $42 - 1$ (minus) |
Some language environments may redefine some of these. Babel's Dutch makes \" a trema, while the pinyin package/environment makes ` and ' act as grave and acute diacritics (among a few other changes).
NOTE: this is incomplete!
--- Form/Shape: \textup{Upright shape} \textit{Italic shape} \textsl{Slanted shape} \textsc{Smallcaps shape} --- Series: \textmd{Medium series} \textbf{Bold series} --- Families: \textrm{Roman family} \textsf{Sans Serif family} \texttt{Typewriter family} Shorthand: {\it Italics}, {\em Emphasis}, \\ {\bf Boldface}, {\sc SmallCaps} |
Combinations are possible, but don't choose more than one per category (slanted smallcaps won't work)
Most people seem to use the (LaTeX2e) shorthands.
Instead of italics, emph is more practical, because \\emph{emphasized text with \\emph{nested emph}} will make the nested emph show up as non-italics again.
{\tiny word} {\scriptsize word} {\footnotesize word} {\small word} --- {\normalsize word} --- {\large word} {\Large word} {\LARGE word} --- {\huge word} {\Huge word} |
For sizing in math mode, see the mention of big, Big, bigg, and Bigg.
TODO: check all of this.
It is technically possible to convert most any font for TeX use (including TrueType), but it's nontrivial, and easy to get wrong. You'll have better luck looking at installed packages.
Perhaps the most interesting package is PSNFSS, the 'PostScript New Font Selecting System'.
In it, you choose from 'Base 35' fonts, thirty-five fonts that any Level 2 PostScript
printer (and GhostScript) has.
(TODO: check exact upsides. The implied suggestion is that these will
print and show as vector characters, but is that actually true?)
There are various packages that change one or more of the font families, some part of the PSNFSS, some not, and there are some that are now obsolete. Examples (enlarged for detail, gray text means the font isn't changed) are:
(*) There is a note in psnfss that helvetica is somewhat larger than other fonts, and that you can scale it down using \usepackage[scaled=.92]{helvet}.
If you want to change (just) the fonts used in the section headings, look at the sectsty package.
Basic tables are made with the tabular environment (partly just specialization built on top of the array environment; some things that apply to it apply directly to tabular).
The quick intro is that cells are separated with an &, rows are separated with a \\. There is a mandatory argument to the enviroment start in which you define the amount of columns as well as some of its major styling (alignment, vertical lines, column padding).
l left-justified column c centered column r right-justified column p{width} paragraph column with text vertically aligned at the top m{width} paragraph column with text vertically aligned in the middle b{width} paragraph column with text vertically aligned at the bottom | vertical line || double vertical line *{num}{cols} is for shorthanding repetition. *{3}{llr} becomes llrllrllr @{} replace inter-columns contents with something else (default is.. \fill perhaps?) <{} prepend to cell contents (verify) (e.g $) >{} append to cell contents (verify) (e.g $)Notes:
Use \hline to insert horizontal lines at any point.
Syntax is \begin{tabular}[pos]{cols}, where pos is the hbtp-style float positioning, and usually omitted. Things you can do with basic table commands include:
\begin{tabular}{lc|r} \hline\hline rabbit & 12 & sold \\ frog & 3.5 & pending \\ \cline{2-3} & 15.5 nd{tabular} |
tabular* is like tabular, but also takes a target width for the table. The syntax:
\begin{tabular*}{width}[pos]{cols}
It is often useful to use some fraction of the available text/column/page width using e.g. 0.85\textwidth or \linewidth.
\hline % you can have two of these for a double line \cline{1-2} % means 'from beginning of col 1 to end of col 2' (so things like 1-1 are sensible too) \vline % usually you won't need these as full-column settings work fine
See also the hhline package (mentioned below).
You cannot nest tables without some trickery, partly because LaTeX would have no idea which & belongs to what table.
You can work around this by isolating the tables, e.g. using minipage (which itself requires a width, so helps control cell/column width).
For example, to get two tables side-by-side, you could use something like the following (indented for (some) clarity):
\begin{table} \begin{tabular}{ll} %left table \begin{minipage}{0.4\textwidth} \begin{tabular}{lr} left & table \end{tabular} \end{minipage} & \begin{minipage}{0.4\textwidth} \begin{tabular}{rl} %right table right & table \end{tabular} \end{minipage} \end{tabular} %the outer {table} is optional, there only in case you want to use: \label{nestbl} \caption{A nested table} \end{table}
Halfway advanced tables are a bit of a pain, so need detailing. (TODO: look at http://www.andy-roberts.net/misc/latex/latextutorial4.html)
Like tabular* (same syntax, different environment name) but actually changes the column (cell) widths, not the inter-column spacing, which avoids some strange spacing buglets in practice.
(This probably means the width is actually fairly accurate, whereas with tabular* it pretty much always overshoots because apparently the inter-columns spaces aren't counted?) (How does it do it? Repeated resizing? Does it mean identical table definitions with different values are formatted differently?)
(to write)
Allows you to create a cell that spans multiple columns. Inside a cell, put:
\multicolumn{num_cols}{alignment}{textext}
You can use this to have per-cell horizontal or vertical alignment differences by doing something like \multicolumn{1}{r}{} or \multicolumn{1}{p{size}}{}
\begin{tabular}{|lc|r|} \hline \multicolumn{3}{c}{\bf Overview} \\ \hline \hline rabbit & 12 & sold \\ frog & 3.5 & pending \\ \hline \end{tabular} |
Note that the vertical lines are missing here. You should use |c| in the \multicolumn if you want them.
Seems to play well with at least colortab.
Allows a cell to span multiple rows. Inside a cell, put:
\multirow{num_rows}{column_width}{textext}
Column width can also take *, meaning 'natural width', fitting the text inside it.
Doesn't listen to column flushing. Doesn't necessarily play well with colortab (probably others too) in that it seems tables are built up per row, drawing first the background and then the text -- meaning it is possible for a later row to draw over part of a multirow cell.
Colored backgrounds in tables. Works per column, row or cells-in-a-row
Don't forget to include pstricks (for the color definitions, I believe). See also colortab documentation.
The least verbose variation of the syntax:
\LCC color & specification & row \\ row & of & data \\ row & of & data \\ ... & ... & ... \\ \ECCOr, in slightly more compact use:
\definecolor{lightergray}{gray}{.875} \newcommand*\lightergray{\color{lightergray}} \begin{tabular}{|lc|r|} \hline \LCC \gray & \lightgray & \lightergray \\ rabbit & 12 & sold \\ frog & 3.5 & pending \\ \ECC \hline \end{tabular} |
Notes:
More or less the same capabilities as colortab, different implementation. It seems to be a little more robust.
Don't forget to include pstricks (for the color definitions, I believe).
See also the colortbl documentation
Does not directly work with multirow since lower rows draw over the higher ones. One workaround is putting the multirow cell in the lowest row it should draw over, and using a negative row span to draw upwards. Note that in the following example, the first row's third column must exist (as per &) or that cell will not be colored.
\begin{tabular}{|>{\columncolor{yellow}}lc|>{\columncolor{orange}}l|} rabbit & 0 & \\ frog & 0 & \multirow{-2}{30mm}{All out!} \\ \rowcolor[gray]{.9} newt & -5i & \cellcolor[gray]{.8} surreal \\ \end{tabular} |
The package also allows redeclaration of the rule color (\arrayrulecolor, doublerulesepcolor (space between the rules in a || or double \hline), which you can exploit in combination with \arrayrulewidth{size} and \doublerulesep{size}.
Notes:
The filled boxes for both color table types are wider than then the cells they would fill - this is a hack around the fact that otherwise the inter-column spacing would not be filled. It also screws with borders and the apparent width of a table. This is important to know if you control apsects like inter-column spacing, because the overhang does not automatically follow, and may make it hard to make multiple tables in the same document look exactly the same without fixing almost all sizing aspects about all of them.
Surpressing both the inter-column spacing as well as the colored cell overhang can be done with something like:
\begin{tabular}{@{}>{\columncolor{lightgray}[0px][0px]}p{70mm}@{}>{\columncolor{lightergray}[0px][0px]}p{70mm}@{}}
Tables that can span more than one page
Example: http://users.sdsc.edu/~ssmallen/latex/longtable.html
Basically a combination of tabularx and longtable.
Tables that can span more than one page
Dashed lines. Basically adds \hdashline , \cdashline{} and using : in the column spec, and tuning such lines skip/dash ratio.
Seems to play well with at least colortab.
hhline (documentation) is an analogue to \hline that allows detailed control of horizontal lines. Its styles:
horizontal lines (column to column): ~ No line - A single line = A double line (like \hline\hline) vertical lines: : interrupted/corner line | goes through hlines (can use two like in basic tabular) intersections: # uninterrupted double/double intersection (?) t top corner/intersection with double-horizontal b bottom corner/intersection with double-horizontal * *{3}{==#} expands to ==#==#==#, as in the *-form for the preamble.
Crazy example:
\begin{tabular}{||lc|r||l|} \hhline{=-t=t=} rabbit & 12 & sold & t \\ \hhline{=#~#=-|} frog & 3.5 & pending & t \\ \hhline{=|~|==} newt & -5i & surreal & f \\ \hhline{||=:~:=-|} grass & 3! & greener & t \\ \hhline{|==b=#-#} \end{tabular} |
While reading/writing, realize that the horizontal definitions are obligatory (above there are always four of ~,-,= in each definition) while the vertical interaction ones are optional (it is possible I used them illegally/pointlessly/strangely somewhere, mind).
There's usually no reason to touch this, but you can alter:
%inter column space (? verify) \setlength\tabcolsep{3mm} %thickness of horizontal, vertical lines \setlength\arrayrulewidth{1mm} %line separation in a double rule \setlength\doublerulesep{2.7mm} %fraction (default 1) of usual space to use between rows \renewcommand{\arraystretch}{1.5}
Which makes tables look something like:
Regular spacing:
\begin{tabular}{|l|l|l|} \hline one & two & three \\ \hline \end{tabular} |
Some spacing removed
\begin{tabular}{|@{}l@{}|l|@{}l|} \hline one & two & three \\ \hline \end{tabular} |
Only one spacer without vertical lines (...I think. It could be flexible spaces at work)
\begin{tabular}{|l@{}l@{}l@{}} \hline one & two & three \\ \hline \end{tabular} |
Apparently the default inter-column spacing seems to be rubber space (flexible width). To replace this with a fixed width, use something like @{\hspace{10mm}}. You can also use \extracolsep{} within a @-expression to change the spacing of multiple columns, until another \extracolsep{}.
Math is one of TeX's claims to fame as it is probably the most flexible formula formatter, and pretty intuitive to write at that - once you get used to it.
There are different ways of inserting formulae:
See also summaries like this.
Math mode has different rules for words, most noticably that it treats them as letters assumed to be variables that are being multiplied, so spacing will looks odd. To type normal text, you should enclose it in a block of non-mathmode using eg. \text{...and analogous} or \mbox{...and analogous}, or \operatorname{Sub} for operator names, which are typeset somewhat differently for clarity.
Note that certain things will get squished in text math mode to fit on a line, which will take more space in display math mode. For example, compare:
In $\int_{-\infty}^{1}x^2-2x+1$ text, also usable like CH$_3$COOH. $$\int_{-\infty}^{1}x^2-2x+1$$ |
It may still squish things in display math mode if the direct context forces it to. If you want to force a spacious-style \sum, \prod, \int or such, in either math mode, use e.g. $\displaystyle\sum_{i=0}^n i$. This is one of several such size change options that you have.
There are many symbols available to you inside and outside math mode, with and without extra packages.
The Comprehensive LaTeX Symbol List is
a useful reference.
Detexify is also be a very convenient find-by-drawing tool
$\alpha A \beta B \gamma \Gamma \delta \Delta \epsilon E \zeta Z \eta H \theta \Theta \iota I \kappa K \lambda \Lambda \mu M \nu N \xi \Xi o O \pi \Pi \rho P \sigma \Sigma \tau T \upsilon \Upsilon \phi \Phi \chi X \psi \Psi \omega \Omega %some common variations \varepsilon \vartheta \varpi \varrho \varsigma \varphi %and also: \mho $ |
(You would usually isolate these like {\cal A}
$ \cal A B C D E F G H I J K L M N O P Q R S T U V W X Y Z$ |
\cap \cup \uplus \setminus \bowtie~\Join \emptyset \sqcap \sqcup + - \times \div \cdot \pm \mp \oplus \ominus \otimes \oslash \vee \wedge \neg \forall \exists | \wr \triangleleft \lhd \triangleright \rhd \bigtriangleup \bigtriangledown \bigcirc \ast \star \diamond \circ \bullet \odot \dagger \dag \ddagger \ddag \amalg \unlhd \unrhd |
= \equiv \cong \models \sim \simeq \approx \asymp \doteq \propto \bowtie \Join \smile \frown \vdash \dashv \perp \| \mid \parallel |
\in \subset \supset \subseteq \supseteq \sqsubset \sqsupset \sqsubseteq \sqsupseteq < > \leq \geq \prec \succ \preceq \succeq \ll \gg |
TODO: add negative variations, see http://www.mathlinks.ro/LaTeX/AoPS_L_GuideSym.php
\left< \begin{array}{cc} a & b \\ c & d \end{array} \right> \left( \begin{array}{c} \begin{array}{lr|l} 1 & 5 & x_1 \\ 2 & 3 & x_2 \\ \end{array}\\ \left[ \begin{array}{c} z \\ \alpha \end{array} \right] \end{array} \right) \hline %--------------- x_n = \left\{ \begin {array}{rl} -1 & x < 0 \\ 1 & x \ge 0 \end{array} \text{as follows:~} \overbrace{ v_c + \underbrace{ n * \vec{v} }_{\not= 0} + v_t} }^{\text{vector transform}} \hline %--------------- v_t = \widehat{v_r * v_q} - \underline{f_t * f_{moo}} \widetilde{7i+x'''} \div \overrightarrow{przwalski} \underleftarrow{ \text{variations exist} } |
Particularly delimiters can be adjusted in size. Some will adjust in size contents, some can be forced: prefixing each with one of \big, \Big, \bigg and \Bigg. Overall, things used as delimiters include:
[ ] ( ) \{ \} / \backslash \vert \Vert \lfloor \rfloor \lceil \rceil \langle \rangle \lgroup \rgroup \lmoustache \rmoustache \uparrow \downarrow \updownarrow \left( \right) \left< \right> \left\{ \right\} \left. \right. % The last variation is invisible. While these need not match, they *should* balance, % so for example \left. x^2 \right\|_0^2
...and more. Some examples (for angle, group, moustache, floor, ceil):
TODO: consider including eqnarray environment, and a vertical-only example (eg. a vector) in the middle of a formula, with [t] or [b] vertical align.
\mbox{instead of } \vec{ij}, \text{~use~} \vec{\imath \jmath} a_1,~a_2,~\\ldots, a_n, a_{n+1} \begin{array}{|cccc|} c & o & \cdots & w \\ \vdots & \vdots & \ddots & \vdots \\ m & o & \cdots & o \end{array} a \cdot b \imath \jmath \ell \Im~\Re \wp \partial \infty \angle \surd \nabla x\prime x' \flat \natural \sharp \clubsuit \diamondsuit \spadesuit \heartsuit \diamond \triangle \Box \top \bot %spacing is rarely needed, % but sometimes useful. % \, and \: are less, % \; is more than usual; % \! is negative space \int ax \,{\rm d}x x\,x\:x\;a\!a |
TODO: add actual accents. Duh.
\leftarrow \rightarrow \Leftarrow \Rightarrow \leftrightarrow \Leftrightarrow \longleftarrow \longrightarrow \Longleftarrow \Longrightarrow \longleftrightarrow Longleftrightarrow \leftharpoonup \rightharpoondown \leftharpoondown \rightharpoonup \leftrightharpoons %neat related trick: wood $\stackrel{fire}{\longrightarrow}$ ashes |
\mapsto \longmapsto \nwarrow \uparrow \nearrow \swarrow \downarrow \searrow \updownarrow \Updownarrow \hookrightarrow \leadsto |
TODO: add these: http://www.combinatorics.net/weblib/A.7/a7.html
$$\sqrt{1+\sqrt{1+\sqrt{1+x}}}$$ \hline $$a_0 + \frac{1}{a_1+\frac{1}{a_2+\frac{1}{a_3}\ldots}}$$ %Note: amsmath's \dfrac is an alternative to frac that is less condensed, % so more readable if you use complex formulae inline \hline $$\sqrt[3]{8} = 2$$ \hline $$ \left< x_\text{before} \geq x_\text{after} \right> $$ \hline $$ \int_a^b x~{\textrm d}x $$ \hline $$ f(x,y,\\sigma) = \\frac{1}{2 \\pi \\sigma^2} e^{-(x^2+y^2) / (2 \\sigma^2)} $$ |
Note how in the x dx example, I did have to help it along.
A common annoyances about TeX is that graphics in your document isn't always so simple. I suggest using the graphicx package instead of the older and usually deprecated graphics and epsf. It works around older problem cases, and in my experience just works in most situations.
That leaves the main issue: that TeX and half of the formats it outputs do not support raster anything. With one exception, PDF via pdflatex.
In my experience there are two ways that will avoid most trouble: Going with vector everything, and embedding things in PDF.
An overview of the alternatives involved, though there are more conversion options than shown here:
This is not a complete overview. There are various other conversion methods. For example, to use JPEG in PostScript documents, you can also use jpegtopnm followed by pnmtops (huge files), or use jpeg2ps (small files, but only works in PostScript 2 or 3, because it relies on newer features that decode the JPEG data that is directly embedded).
Including an image with graphicx is fairly simple. You include the package using:
\usepackage{graphicx}...and an image with something like:
\includegraphics[width=5cm]{filename}
The size option is, well, optional, but regularly useful: Raster graphics don't
store physical dimensions and various postscript generators are too lazy to do so, so you
have to control how large something shows up.
In this case, the width will be 5cm, and the height will be scaled accordingly.
Yyou may prefer something that scales to whatever page size you have, like [width=0.90\textwidth]
You could also specify only height. Which of the two makes most sense depends on your layouting context and wishes.
Another option that is sometimes useful is angle, e.g. as in [angle=90] to fit a landscape image on a page, sideways.
You can put images in a separate directory to avoid some file clutter. You can tell TeX images are there using something like \graphicspath{{images/}}.
You don't need to mention file extension on images. (This is potentially handy: TeX will look for file types that the current driver supports, which means you could create documents referring to images in a way that both latex and pdflatex support, with different images but the exact same .tex file (and no weird TeX logic tricks), which should compile to (hopefully) identical looking documents. ...But perhaps only things like documentation generators will care about this.)
It is common for figures to be referenceable, and for them to have a caption.
To add these you will want a figure environment and add a \caption and \label:
\begin{figure} \includegraphics{bitefile} \caption{How to bite} \label{bite1} \end{figure}
On labels:
It is sometimes suggested to start labels with what they are, e.g. prepend fig: for images, tab: for tables and so on.
While tables-of-these-things will separate them, the labels used to refer to them are all on the same pile; you use the same command
to refer to tables, formulae, section, and others. For large documents, (and/or short labels) this can get messy.
To make a reference to something with a label, use \ref{thelabel}. In the document this will show up as the number of figure/table/whatever, so you often want to mention what it is yourself, for example "Biting, as Fig. \ref{bite1} demonstrates, ...".
The figure* environment apparently deals better (differently, anyway) with multi-column documents, and there are further figure environments, mostly for floating/wrapping.
On captions:
When you write a document in which you have list of figures near your TOC, you want to think about
caption length. You can add a shorter version like:
\caption[Historical biting in various species]{Here illustrated is a historically correct overview of
the method of biting for various species, where the major muscles and their attachments are highlighted.].
If you want to style the 'Figure ...' part under a figure, look at the caption package. A very quick example would be bolding just the 'Figure 1' part with \usepackage[labelfont=bf]{caption} (note: only works on relatively up to date version of caption).
The graphicx package is partially an update to graphics, and supports more image formats, like GIF, JPEG, TIFF, PNG, compressed EPS, MPS and PICT, and PDF.
Exactly which are supported will depend on the TeX output driver you use, as well as versions of things. Not everything does GIF or TIFF (I suggest you use convert those to the more widely supported PNG). There may be some other combinations that don't work.
The driver should be picked based on what you run: dvips when you use latex, and pdftex when you run pdflatex, though in some circumstances you have to force packages to use a specific mode with something like \usepackage[pdftex]{graphicx}. Usually this is when you have tricks like making the document do different things depending on the way it's compiled, which is advanced use anyway.
Know that TeX likes Encapsulated PostScript (.eps) files best, though more general PostScript
(.ps) usually works fine. Also know that because of the possibilities for complexity in these files
(PostScript is a Turing-complete programming language. I've heard of a game-of-life algorithm programmed
in PS and running on a printer), not all .eps files are created equal, nor are .ps files.
For example, it is possible to convert to compressed PS level 2 or PS level 3, which will only print on printers
that support it.
In some cases, you can get more generic postscript by running eps2eps or ps2ps on it,
which cleans it up a bit and(/but) may strip advanced features.
See eg. this for a little more background and suggestion of other programs to use.
Note: epstopdf is not the same as ps2pdf. The former is for images and respects bounding boxes; the latter is for documents and create page-size output.
Failing the above, you could render the postscript to a raster format, eg. png, with a utility like mogrify (I used mogrify -format png -density 70 -trim images2.ps for the image above), convert, or perhaps things like photoshop.
Figures are usually put in a figure environment, which has its own placement
semantics and listens to options.
It is common to see a \centering to horizontally center the image.
For more detailed control, you can put the \includegraphics in a \minidoc environment
and go from there.
Using just \includegraphics should put graphics just where you mention that, with some movement (floating). It floats, and TeX decides where, based on fit and positioning requests. Unless it floats to its own page you can cheat a little with \vspace and \hspace to shove it downwards and sideways, though bad bounding boxes may interfere there.
If you want text to go alongside, look at wrapfigure environment (and others below).
\subfigures are helpful if you want easy, tabular-like figures side by side, each with their own caption and such.
Note: This is a stub list. I have only tried one of these so far.
Wrapfig, which is made for text to flow around images. You can position on the left, right, inner and outer
(twoside) page edges. The wrapfigure's width is required, while further details like overhang (outside) and
how many lines is should make wrap (sort of a hard-settable vertical margin) are optional. See documentation
and descriptions, such as wrapfig.txt.
It deals okay with multiple-columns documents, can even work across multiple columns, but only with hackery.
Simple example (without an actual image, but you get the idea):
\begin{wrapfigure}{l}{60mm} \includegraphics{NoExample.png} \caption{How to bite} \label{bite1} \end{wrapfigure}
With a little creativity you can use this to emulate pullquotes. (note: this example isn't very good, I've yet to figure out how to do this elegantly. Note that the quotes depend on babel, and introduce some extra space because of their high/low placing and size) For example:
\begin{wrapfigure}[5]{o}[1cm]{.3\textwidth} \textcolor[rgb]{0.5,0.5,0.5}{ {\LARGE \grqq}\\ {\em \large Cu\-ra\-bi\-tur mat\-tis sce\-ler\-isque\ldots} \vspace{-5mm} \begin{flushright}{\LARGE \glqq}\end{flushright} } nd{wrapfigure}
Subfigure allows multiple images per figure, which includes some rudimentary flowing; things can easily go side by side, and/or under other parts using a \\.
Note that you can do the layouting part of this without the package, by playing with minipage (or similar). If you want real subfigures - including label management, you'll want this package.
Allows picture floating and positioning.
There is a rather large list of symbols in The Comprehensive LaTeX Symbol List (google search for it) with references to packages you may need. This includes basic TeX symbols, accented letters, greek, latin, additional math symbols, astronomical, biological, diagram symbols, dingbats, laundry symbols and more. A smaller reference is eg. this ISO-to-LaTeX combination reference.
Many character variations on the roman alphabet can be made with TeX commands, like \'e or \'{e} for , and \c c or \c{c} for . Most of these can be generated with out-of-the-box TeX, though unusual accents like ogoneks or accents on unusual cyrillic glyphs tend to depend on an extra package (like ogonek, cyracc) and possibly some indirectly necessary things that you'll probably know about them if you use them.
In the meantime, here's a fairly complete list of general TeX accents. Note that the accents tend to work on any letter, even the ones they don't make sense for, eg. the last one.
\'o \`o \^o \"o \~n \=o \.o \.Z \u{o} \v{o} \H{o} \r{u} \d{o} \t{oo} \c{c} \b{o} \ae ~ \AE \oe ~ \OE \o ~ \O \aa ~ \AA \l ~ \L \ss \c{\ss} |
Note: With babel, language environments may add notations. For example, when you are in babel's dutch language
mode you can write twee"en in which " is a trema, which is not equivalent to twee\"en, which is then
(actually always) specifically an umlaut. The difference is that a trema disappears when the word is hyphenated at that
specific letter, while an umlaut would stay.
This is small details you needn't necessarily worry about, though. I didn't know it, most people probably don't.
The basic line you use looks like \usepackage[dutch]{babel}. The option you hand the package is dutch in this case, but there are quite a few supported langauges. Regular types - like german, french, chech, finnish and russian - but also less expected ones, like bahasa (Indonesian), welsh and esparanto. One of babel's internal file types seems to be .dtx - on a unix system, running locate \.dtx should give you a good idea, if not a complete list, of the languages available to you.
Modern babel allows arbitrary switching between languages by inserting \selectlanguage{polish} commands to switch the curent language, or eg. { \foreignlanguage{german} Ich bin deutscher Text } for a block of another langauge. This does still require that you specified the languages you use when you included the package, like \usepackage[dutch,english,polish,german]{babel}. It is possible that some languages are not installed; LaTeX will complains no hyphenation patterns were loaded. I believe this mostly happens on compact TeX installations. In MikTeX you can use its package manager to fix this (filter on 'hyph').
TeX supports using arbitrary alphabets, like Cyrillic, CJK (Chinese, Japanese, Korean), Sanskrit, and a few more, but you often need to include some package and sometimes use special commands. Also, for alphabets not using a standardized encoding (as far as I know, TeX does not do Unicode, and I believe cyrillic has two more-or-less common encodings) you may run into conversion trouble, or the necessity to use even more packages. I have never needed any of this, so you'll have to find it yourself. this looks like an interesting start.
Spelling is a separate thing from typesetting, and not provided in babel or
any other package I know of. However, the *nix aspell package seems to deal with TeX,
and has an explicit mode for it, so something like aspell check -t --lang=nl dutch_file.tex,
which specifies to check the file using its dutch capability and interpreting it as TeX, should
work pretty well. It seems to understand TeX-accented letters like E\'en and \"Uber.
However, it does not correctly insert TeX accents, or probably any non-ASCII characters.
You will have to correct that yourself.
When doing research, it's common that you want to reference a book, article, report, thesis, and so on.
Ideally, this would involve nothing more than referring to a book by concept, by identifier, because
writing out the reference entries is unnecessarily complex, especially when someone asks for a specific
style (MLA, Chicago, APA, etc.) BibTeX makes this a lot easier.
(It is an alternative to thebibliography / bibitem style bilbiographies, which you write and
style yourself. But really, just use BibTeX)
BibTeX consists of two main things: A database (well, list) of citations, and the ability to refer to them (using identifiers you choose) and have them automatically formatted in LaTeX.
People often start off writing article-specific .bib files. If you write a lot, it turns out to be handier to create large .bib lists to use from all articles, and cite the things relevant to the specific article.
Set a citation style; before you begin the document, do a \bibliographystyle{plain}.
Some references mention basics like plain, abbrv, alpha, unsrt, and
a few natbib styles and ams variations.
You probably have a good deal more; run locate texmf | egrep '\.bst$' to find out which, and
find bibstyles.pdf online or similar for a comparison of styles.
Styles differ in how bibliography entries are formatted, sorting (alphabetical vs. citation order),
whether titles' capitalization is changed, and also in-text style (and possible identifier uniqueness guarantees)
in case of author-year duplicates, handling repeated citation (probably shortening all but the first),
whether the in-text marker is listed in the bibliography, and a few other details.
Universities, established journals, calls for papers and such may provide their own citation style, for consistency among
papers from the university, in the proceedings, and such.
See also pages like 'BibTeX and bibliography styles'
Reference the .bib file, adding \bibliography{bibfilename} (minus the .bib extension),
and place this in the document where you want the list of references.
You can control the header text, and you can also force a TOC entry for the billiography, see details below.
Add citations that reference that .bib's entries in your text.
Only entries you actually cite in a paper show up in the document (so you can have large .bib databases).
The basic command is \cite{identifier}, but there are some alternatives.
Another is using the natbib package, which provides customization. Some usage examples:
\citet{kruskal1984} | Kruskal (1984) |
\citet[p. 23]{kruskal1984} | Kruskal (1984, p. 23) |
\citep{kruskal1984} | (Kruskal 1984) |
\citep[see][p. 23]{kruskal1984} | (see Kruskal 1984, p. 23) |
\citealt{kruskal1984} | Kruskal 1984 |
\citealp{kruskal1984} | Kruskal, 1984 |
There are also \citet*{}, \citep*{}, \citealt*{}, which do not abbreviate to et al.
If mixed with \cite, its style will only match so many bibliography styles. You can use it exclusively, or use one of the natbib styles (like plainnat, abbrvnat, unsrtnat).
There is other tweaking, such as
There is also \nocite, which produces no text where it is placed, but still causes it to be used in the bibliography. This is often used write a custom citation, e.g. to make it flow a little better in your text. Beware of introducing ambiguous citations when you use this, though.
Using tools like rubber is an easier way of handling all this, because it just runs things until it's fine.
If you like doing / understanding it manually, the process is roughly:
This may be somewhat counterintuitive at first, but it makes sense when you consider .bib files are
databases that may well contain many more entries than you need. The intermediate step compiles a list of styled
citations for the bibliography.
Whenever values seem out of date, it pays to run everything again once or twice.
While the syntax is not too hard, you can avoid soe bother by using a .bib-managing program. There are various, including JabRef, pybliographer, BibTool, and more.
A bib file contains a list of referencees to works, each of a particular type and with a number of fields. The type is used in formatting the citation correctly, and implies recognition of certain fields that will be require for that. Fields that do not belong in an entry are ignored when formatting the citation. (this is useful for bib database editors, as they can easily add fields for internal use, such as note, keywords) There are also few optional-in-general fields, such as month - see the notes below the types.
Field names are case insensitive. In fact, pretty much everything other than the citation identifier is. I'm going to steal WinEdt's convention of reminding which fields are required versus optional with capitalisation, also so that you can easily copy-paste these:
@article is used for regular articles in journals and magazines.
@article{id, AUTHOR = {}, TITLE = {}, JOURNAL = {}, YEAR = {}, pages = {}, volume = {}, number = {} }
@mastersthesis and @phdthesis are bound to institutions, and often not (officially) published. and therefore a category of their own.
@mastersthesis{id, or @phdthesis{id, AUTHOR = {}, TITLE = {}, SCHOOL = {}, YEAR = {}, address = {} }
@inproceedings and @incollection are used to refer to a collection of independently written parts of a titled book, often a collection of articles on a subject, often as a result of some symposium, conference or other event.
There is a difference between the two, though it is largely semantic - inproceedings refers to themed, organized events
(conferences, symposia), while collections are meant more as useful collectables on a subject (and are less likely to
have a mentioned editor).
The editor is more common in inproceedings than in incollection.
Publisher, address, and editor are practically more common to see filled than pages or organization.
The address is intended for that of te publisher.
(@conference is an alias for @inproceedings (not for proceedings),
included for compatibility reasons.)
@incollection{id, or @inproceedings{id, AUTHOR = {}, TITLE = {}, BOOKTITLE = {}, YEAR = {}, publisher = {}, address = {}, editor = {}, pages = {} organization = {}, }
@proceedings refers more widely to to proceedings of a conference, or even the conference itself, rather than to a specific article. There also exists a @collection, though its use is discouraged somewhat.
@proceedings{id, TITLE = {}, YEAR = {}, publisher = {}, address = {}, editor = {}, organization = {} }
@book refers to a book as a whole. Address is that of the publisher.
@book{ AUTHOR = {}, TITLE = {}, PUBLISHER = {}, YEAR = {}, address = {}, edition = {}, series = {} }
@inbook is sometimes used to refer to a specific chapter. It is the same as book, but may also have chapter and/or pages:
@inbook{ AUTHOR = {}, TITLE = {}, PUBLISHER = {}, YEAR = {}, chapter = {}, pages = {}, address = {}, edition = {}, series = {} }
@booklet is used for something that is printed, but does not have a clear or singular publisher or sponsor.
@booklet{id, TITLE = {}, author = {}, year = {}, howpublished = {}, address = {} }
@manual is not too different from a booklet, and it seems used fairly rarely.
@manual{id, TITLE = {}, author = {}, year = {}, edition = {}, organization = {}, address = {} }
@techreport is similar to the last two, but is likely to have an author and be bound to an institution, and may well have a series.
@techreport{id, AUTHOR = {}, TITLE = {}, INSTITUTION = {}, YEAR = {}, type = {}, number = {}, address = {} }
@unpublished is used to refer to as of yet unpublished documents, articles and such. It seems to require note, which is generally an optional field.
@unpublished{id, AUTHOR = {}, TITLE = {}, NOTE = {}, year = {} }
@misc is a fallback category for when none of the others fit. It seems to be often be used to refer to internet-stored documents (often listing title, author, and url), articles released but not published as such (though unpublished also applies there).
@misc{id, author = {}, title = {}, howpublished = {}, year = {} }
Generally optional fields include:
@article{rstopo, author={C. P. Rourke and B. J. Sanderson}, title={On topological neighbourhoods}, journal={Compositio Math.}, volume={22}, pages={387--425}, year={1970}, review={\MR{45:7720}}, } @book{Wa:2007, author={C. T. C. Wall}, title={Surgery on compact manifolds}, edition={2}, publisher={Academic Press}, year={1970}, }
The short answer is that the citation styles usually do most of the work, parsing names into first and last parts, then displaying them in the way the style likes. To enter multiple names, split them with 'and'.
It parses assuming one of a few basic patterns. It seems to understand comma-less names as First Last, or First First Last
if more than two words appear. This means that the Last, First form is more convenient for longer names and those with parts,
such as in Last Last, First and de la Last, First.
In the case of additions like III and Jr, you use Last, Addition, First form, like "Sexton, III, Brendan".
Some styles will shorten names to initials, meaning you can mix initials and first names and get consistent output. Other styles may print what you have.
On syntax: Values can be inside "quotes", {curly braces, a.k.a. accolades}, or in the case of simple numerals,
without either.
You can also use @string-defined references, which are usually used to have acronyms mean some centrally set string. For example:
@string{ rug = "Rijksuniversiteit Groningen" } @mastersthesis{tt2007, author={G. Ir}, title="This and that", school=rug, year=2007 }
Also, the outermost braces can also be parentheses (e.g. @book() instead of @book{})
Words in book titles will often be capitalized, and article titles will be lowercased. To protect capitalization for proper nouns and such, use curly brackets around the word. Example: title={The {Bantu} Languages}.
To make the bibliography show up in the table of contents, add \addcontentsline{toc}{section}{Bibliografie}, probably
right before the \bibliography command.
The section is the type of entry you are imitating, and you may have to use another if you do not use the article
document type, or want it to show up at a different depth.
(TODO: verify whether it works correctly in the numbering. If not, I suggest you put it after everything else).
To change the name of the section, use \renewcommand{\bibname}{Bibliografie}. (TODO: verify).
Left/right pages, empty pages, page headers page numbering, that sort of thing.
Most documentclasses do not go out of their way to choose any of those to a specific style. The exception is book, which has a fairly recognizable style. It defines defines \frontmatter, \mainmatter, and \backmatter, which changes the page numbering style, and also leaves pages clear.
Some interesting commands:
For a commented example:
\pagestyle{empty} % no page numbering (until we say solater) % the title page is a special case, and for some strange reason, % removing the page number from it means more or less means you need to do: \titlepage \thispagestyle{empty} % specifically *after* the titlepage command \cleardoublepage % often makes sense after a titlepage in a longer spacious document \pagenumbering{roman} % lowercase roman numeras for the toc. Also implies numbering restart at i \tableofcontents \cleardoublepage \pagenumbering{arabic} % implies numbering restart at 1 \section{Introduction} Start of content...
Books have even-numbered pages on the left, odd-numbered ones on the right. You may wish to be consistent with that.
The \cleardoublepage applies when you use a two-sided document type or the twoside option. It makes the next page a right-hand (odd-numbered) page, inserting a blank (left) page if necessary. This generally makes sense to do directly after the title page, and before the start of the content.
LaTeX pages consist of a text body, a header, a footer, and a space for margin text. Using a paper size implies these sizes are set to reasonable values. It may be tedious to get this right sometimes, though. Note that the following list is for reference; geometry is often more convenient; see below.
(I should double-check this reference image:)
You can change sizes in various styles, including \setlength\textheight{9in} (\textheight=9in, \textheight 9in). It may be practical to adjust sizes using e.g. \addtolength\textheight{-2em}.
The geometry package (link on CTAN) is a little easier to deal with, doing calculation for allowing you to specify the margin sizes 'top', 'left', 'right', and 'bottom'. The package then calculates anything you don't mention (according to paperwidth = left+(textwidth+marginparsep+marginparwidth)+right and paperheight = top+(textheight+headheight+footskip)+bottom, where the bracketed parts are the main body: text plus header plus footer)
If you want to rotate things within pages, look at the lscape package. You can use geometry's landscape option, which also moves footnotes. This may or not be what you want.
See also: http://www.image.ufl.edu/help/latex/margins.shtml.
If you want accurate spacing control, horizontally or vertically, you can use \hspace{measurement} or \vspace likewise.
Example: \vspace{20mm} to make a large paragraph skip. The measures may be negative, though large negative spaces will probably cause confusion.
A line break / page break will consume these spaces, so you can push things over without it implying
there is a block of white. If you want to keep that space, use a * after the name, like \vspace*{}.
Measurements, where they have or can be specified, can be one of the following:
em width of the capital M in the current font ex height of the lowercase x in the current font mu math unit (18mu = 1em ) mm millimetre (1mm = 2.845pt (approx?)) cm centimetre (1cm = 10mm) in inch (1in = 25.4mm; 1in=72.27pt) pt (printer's) point (1pt = 1/72.27in) ...unless you're adobe, then it's 72 exactly. pc pica (1 pc = 12 pt) bp big point (72bp = 1in (exactly)) sp scaled point (1pt = 65536sp) (or 1sp = 65536pt ?) dd didot point (1157 dd = 1238 pt) cc cicero (1cc = 12dd)
It can also be useful to use things like .85\textwidth or \linewidth to get sizes relative to other sizes, which is useful for tables and diagrams. However, it seems that this somehow affects the floating behaviour, floating even things you told [!h].
After including the lettrine package, you can use something like \lettrine{T}{he first} time ... to produce the following.
(see also this demo document on nice variations)
It seems the 'drop' package that is mentioned to do the same is outdated and not included in modern TeX systems.
Lettrine defaults to a 2-line dropcap.
You can apply tweaks overall (e.g. enlarge all by altering loversize default), shaping tricks (e.g. shift in first line for specific letters - which may vary by how much you raised them), or one-off tricks (giving options to a specific \lettrine command). You can apply tweaks overall (e.g. enlarge all by altering loversize default), shaping tricks (e.g. shift in first line for specific letters - which may vary by how much you raised them), or one-off tricks (giving options to a specific \lettrine command). The more overall options include
You might like to combine this with GoudyIn, yfonts, or similar for calligraphic looking text - or plain use images.
See also http://texdoc.net/texmf-dist/doc/latex/lettrine/lettrine.pdf.
The listings package allows you to include source code, syntax-highlighted, from an external file.
First you include the package, then you set any options (the language, and possible formatting), either
as a general option or before each file (...because apparently it's a state thing, so if incuding more
than one type of source file, you should set this before or with each inclusion.)
Examples:
The C source: \lstset{language=C, basicstyle=\footnotesize, labelstyle=\tiny, labelstep=1 } \lstinputlisting{file.c} And the java source: \lstinputlisting[language=Java]{file.java}
The tiny font size used to be useful as this is based on verbatim and as such truncated long lones, though these days it should wrap (verify). You can also quickly define your own keywords to be highlighted; see the example halfway down this page.
There are more packages to do this, such as program and lgrind. I haven't looked at them yet, but at first glance they seem a little harder to handle. program seems to require you editing your code, which defeats the purpose a little. lgrind converts your code to TeX, which sounds handy enough.
A wc -w doc.tex won't be accurate as it will count TeX instructions. A better way is to compile to PS and convert it to ASCII, destroying the styling but keeping the words mostly intact. If you normally use pdflatex to compile to PDF directly you can use:
pdflatex doc.tex && pdftops doc.pdf && ps2ascii doc.ps | wc -wWhen you follow the DVI/PS route:
latex doc.tex && dvips -o - doc.dvi 2>/dev/null | ps2ascii | wc -w
This will still overestimate (consider broken words) but be much nearer the real count.
This is the tex prompt. Latex decided your document wasn't finished, possibly because you forgot an \end{document}.
You are trying to use a package that isn't installed. You can ask your sysadmin to install it globally, or install it in your home directory. See a section above about package installation
You either didn't properly nest environments, possibly because you misspelled an environment name in an \end{}.
Something, like usepackage, author definition, bibliography style settings, color declarations, etc. that should happen after \documentclass and before begin{document} happened elsewhere, probably inside the document text.
This is triggered by hyperref creating index links to numbered pages when you use \pagenumbering (for example to
get roman-numeral pages (the book class does this implicitly).
Specifically, this happens when page numbering is reset, which means that there is more than one page with the same
number, in which case you don't have a simple 1-to-whatever numbering anymore and the page number displayed on
a page will often differ from the how-manieth page it is in the actual document.
If that's okay/intended, you usually want to tell hyperref to create links and mention pages according to the
way they are named (e.g. ii (4 of 20)), by adding two options to hyperref:
plainpages=false and pdfpagelabels.
If you switch to arabic and back, you will still likely have the title page be (arabic) 1,
the TOC and such i to whatever, and then the main content 1 to whatever -- so you'll still have one duplicate, for 1.
See also this explanation, this mention and more.
You have more &s in table data than you specified you have columns in the \begin{tabular}{columnspec} argument. Can easily mean you forgot a \\ somewhere.
This usually means that TeX's files are in the wrong format after an install or upgrade. Regularly a fmtutil --all will fix this.
In my case I had upgraded to a slightly buggy beta (...version of teTeX). A slight downgrade followed by a fmutil --all fixed it.
See also pages like this.
Usually means a missing } somewhere.
You used a bad alignment letter (as in l, r, c, and so on) in the tabular column specification.
You always need units when specifying a length, even for zero lengths.
A TeX error that can mean various things, including accidentally using a backslash in an environment name, or forgetting a required argument in adjacent commands.
One reason is that you are using colortab with LCC/ECC and there is an empty line somewhere between the LCC and ECC.
Seems to have many causes, but seems to usually be caused by a \multicolumn. In my case I had a \cellcolor right before it, and multicolumns seem to be sensitive about the commands right before it.
Just that - an unclosed command (or range). Can also mean a missing obligatory argument.
Can mean various typos, such as a } too much.
Can mean an unclosed math mode range (like Costs $20.), or something that should only appear in math mode, such as \: and \And.
Can be various types of typo, such as \left{ when you meant \left\{ or \right when you want \right.
Tex expects a number and you probably gave it either a string or nothing. May mean you have a typo (e.g. a missing \) in a command that should return a number.
Overfull and underfull hbox messages ususally come from TeX's perfectionistic word spacing / line breaking logic.
This is rarely visually problematic, though in some cases it is.
You can make TeX less strict by telling it to be \sloppy
If it seems TeX doesn't know how to hyphenate a word you can tell it how, in the prelude: \hyphenation{man-u-script}, or inline: man\-u\-script. Both only inform latex of how to hyphenate, and neiter has any visual effect until latex decides to hyphenate.
Like the hbox variants, but vertically. Mostly seems to happen on when TeX can't really fit (long, unbroken) paragraphs well. Also happens when floats are very high and won't fit on a page.
Happens when you enter an illegal preamble character in \multicolumn (you may be thinking of \multirow, where a column size goes in the second argument).
inputenc allows you to use non-ASCII characters, and have TeX handle the necessary translation into TeX commands.
There are a metric ton of potential characters.
While most of the basics are covered, there are characters it doesn't yet know about, many of which seem to be the ones more ambiguous in use,
i.e. for which the right TeX depends somewhat on how you are using the characters, such as with some of the dozen or two existing quotation mark alternatives.
After you decide the mapping from Unicode codepoint to TeX you want, you must declare them, ading them to the document's
prologue, or perhaps to a file you include in every document you need the mapping in. Examples:
% 'low single comma quotation mark' \DeclareUnicodeCharacter{2019}{'} % accent acute, probably used as quote character \DeclareUnicodeCharacter{00B4}{'} % 'double low-9 quotation mark' \DeclareUnicodeCharacter{201E}{``} % some mathematical things: \DeclareUnicodeCharacter{00B1}{\ensuremath{\pm}} %plus-minus sign \DeclareUnicodeCharacter{00BC}{\ensuremath{\stackrel{1}{4}}} % French/belgian/german angle-bracket quotation marks \DeclareUnicodeCharacter{00ab}{\lfqq} % or \guillemotleft ? \DeclareUnicodeCharacter{00bb}{\frqq} % or \guillemotright ? \DeclareUnicodeCharacter{2039}{\lfq} \DeclareUnicodeCharacter{203a}{\frq} \DeclareUnicodeCharacter{20ac}{\euro } % from the eurosym package
The error doesn't tell you the code point it's missing, though. One solution is to less the .tex or .log file. Since it'll likely be UTF-8, which uses runs of high bytes, it should be shown like <E2><80><9E>. To decode this into the codepoint, use some unicode tool that allows input as hexadecimal UTF8. I use my own. Googling for the byte sequence may also work (try some variations, such as adding and removing spaces between bytes).
Tends to mean you forgot to close an argument, used a bracket ) instead of a curly bracket } or some such thing.
May also mean there is an implicit paragraph (empty line) inside a range (ranges can be implicit, as with \LCC to \ECC in colortab).
Tends to mean you forgot to end a command argument (forgot a }) (the error appears mostly when there in a paragraph in what with this typo is inside the argument) , or a mandatory argument is missing.
Usually means that you are using hyperref's bookmark option and the titles sent to those bookmarks contain TeX, which they shouldn't. One solution is to disable bookmarks, another is to specify one string for typesetting, another for the according bookmark entry; see pages on hyperref that mention \texorpdfstring.
You are using a command that is not defined.
Tends to mean a package was not included, you misspelled the command, or that you
used a driver-specific command with a driver that does not support it and so doesn't define it
(e.g. \c@lor@to@ps in pdftex).
The align environment is defined in the amsmath package, so include that. Alternatively, emulate the align with a simple table.
The dvips utility may be configured to send the PostScript it generates directly to the printer
(it's a semi-default configuration), which means that a printer daemon must be accessible when you
call dvips. (an incorrectly set CUPS_SERVER or an incomplete CUPS configuration can also cause this -
or similar for other print servers)
If, like most people, you just want a postscript file, explicitly tell dvips to write to a file
(-o outputfile), or change its configuration file (named config.ps.
It will likely currently have a line like o |lpr)
Print server is available (see dvips behaviour notes in the last entry) but it has no (default) printer defined.
If you actually meant to print, you can set a default printer (for the current user) using lpoptions -d printername.
If you want a postscript file, explicitly ask for one, or configure dvips to write files by default.
Happens when you defined a command with e.g. one parameter and you refer to parameter 2.
Code tried to create a command or environment where one already existed under that name. If this is your own code, try giving it another name, or if you mean to override behaviour, use the proper renew-type command.
It is possible to make references (to document labels, or URLs) clickable with the hyperref package. You may want to use pdfTeX as PDF is the only document standard for which all viewers support this, but in principle and even fair practicel most other formats will support links too.
To do this, you need to do a few things. For one, specify the driver,
say 'pdftex' to, the documentclass options:
\documentclass[pdftex,...]. This tells packages we are generating
a specific type of document, in this case PDF. (different types of outputs
support links, but the entire package is a little fragile, so the document
should to be written as directly as possible)
Then you need the hyperref package (here with example options): \usepackage[colorlinks,hyperindex]{hyperref}, which is a general TeX hyperlink package for a number of output document formats. See its
documentation and implications for various drivers via eg.
TUG, here.
How to create the link depends a little on your wishes; see alternative commands. I personally remember only two commands \href{theURL}{linktext} and \url{theURL} (title is the url).
In a simple test, I did not like the borders around all the links. Instead of bordering, the package can produce colored text by specifying colorlinks=true in the hyperref options (see e.g. visual configuration). I also don't like the colors it uses, so I redefined those too. The code I used (I use pdflatex directly):
\usepackage{color} \definecolor{darkblue}{rgb}{0.3,0.3,0.6} \usepackage[pdftex,pdftitle={The title}, colorlinks=true, linkcolor=darkblue, urlcolor=darkblue, anchorcolor=darkblue, filecolor=darkblue, linkcolor=darkblue, menucolor=darkblue, citecolor=darkblue ]{hyperref}
By default, hyperref makes colored links of everything it can think of, including citations, label references, footnote references, table of content items, and more.
You can change the appearance of a link by using TeX inside the title of a command like \href{}{}. This means you could for example make a small picture or piece of math show in the document, and have them link to larger pictures, explanatory webpages or such. Of course, don't do anything that readers will miss in printed versions, or is necessary for understanding but easy to miss (not everyone notices or knows about clickability if it doesn't look like something clickable)
PDF has supported embedding arbitrary files into the PDF since internal version 1.3 (which is a while ago now). Doing this in LaTeX needs to leverage the pdftex driver (i.e. using pdflatex), probably via the attachfile package. This also depends on hyperref and a few other newish packages; see the attachfile documentation.
You can change the appearance of a link and use almost any TeX. You could do things like making graphs clickable for the data they are based on, or perhaps even showing a picture that will yield the embedded video, but be aware that not all viewers support this, so don't use it for criticial features.
Presentations can be done in PDF (or other formats) since they are usually a combination of pretty preformatting and making bullet lists. Bullet items that appear a point at a time can be done by putting each in the next page, which is easily generated via a package like http://prosper.sourceforge.net/.
It allows you to have presentations viewable on almost everything (not just windows computers with the same version of Powerpoint installed), and easily use formulae in presentations. You lose the ability to use those hideous fade effects, though :P
Say you are writing the guide to some card game while drinking coffee and do not want to write \clubsuit, \diamondsuit, etc. or the formula for caffeine all the time, and want hearts and diamonds to show up red.
You could do the following, which defines two new commands: \caffeine for the formula,
and \hrt for a red math-mode heart.
\newcommand{\caffeine}{$C_8H_{10}N_4O_2$} \newcommand{\hrt}{\textcolor[rgb]{1.0,0.0,0.0}{ \ensuremath{$\heartsuit$}} } \noindent If you had too much \caffeine ~and play \hrt 9 at this point, a halfway decent opponent will understand your strategy now.
The second example has ensuremath, which is a LaTeX2e way of ensuring it's rendered in math mode. Since \newcommand and friends really do nothing more than insert their result, inserting a $ (for math mode) in the middle of math mode would stop it, and mess things up. This will work used both from inside and outside math mode.
There is a hard space after the use of \caffeine to avoid the next word sticking to it. There may be a cleaner way to solve this. (TODO: figure out)
Since the above examples do not use [optional] or {required} parameters, they can also be defined with \def, which is also convenient for shorthanding some things you use frequently, such as:
\def\be{\begin{equation}} \def\ee{\end{equation}}
Aliasing commands is even simpler:
\let\textcolour\textcolor
When you want simple templates with command parameters placed in them, you can do something like the following:
\newcommand{\mat}[6]{ \left< \begin{array}{cc|c} #1 & #2 & #5 \\ #3 & #4 & #6 \end{array} \right> }
When you want to behave differently depending on parameters, you'll have to start coding TeX, which takes a little while to learn. One relatively simple example (blatantly copy-pasted from here)
\usepackage{ifthen} \newcommand{\weekday}[1]% {% \ifthenelse{\equal{#1}{1}}{Monday}{}% \ifthenelse{\equal{#1}{2}}{Tuesday}{}% \ifthenelse{\equal{#1}{3}}{Wednesday}{}% \ifthenelse{\equal{#1}{4}}{Thursday}{}% \ifthenelse{\equal{#1}{5}}{Friday}{}% \ifthenelse{\equal{#1}{6}}{Saturday}{}% \ifthenelse{\equal{#1}{7}}{Sunday}{}% \ifthenelse{\equal{#1}{0}}{Sunday}{}% }
This resolves \weekday{1} to Monday, \weekday{2} to Tuesday, etc., and unknowns to an empty string.
You should use \renewcommand when the command exists and you want to refine it, but do not want to remove earlier use or exclude the package it is defined in. As the page behind the link for the weekday example notes, it is not very hard to add functionality with renewcommand instead of replacing it.
Read the short intro here or here, which is relevant reading anyhow.
To check:\newenvironment \newtheorem ? \newfont ?eg. http://zoonek.free.fr/LaTeX/LaTeX_samples_section/0.html
There are plenty of LaTeX tutorials and references online, many of which are understandable or complete, sometimes even both. The list includes:
Links for me to read:
General: http://en.wikibooks.org/wiki/LaTeX http://www.ctan.org/ http://www.tug.org/tex-archive/ http://texcatalogue.sarovar.org/index.html http://www.ichimusai.org/latex/ http://www.math.uiuc.edu/~hildebr/tex/course/ http://theoval.sys.uea.ac.uk/~nlct/latex/novices/novices_a4.pdf Generally used stuff: http://anziamj.austms.org.au/latexing.html (some nice dos and do nots) http://www.tex.ac.uk/cgi-bin/texfaq2html?label=algorithms (pseudocode formatting) FAQ http://www.tex.ac.uk/cgi-bin/texfaq2html?introduction=yes http://www.tex.ac.uk/cgi-bin/texfaq2html?label=impgraph Fonts: http://www.image.ufl.edu/help/latex/fonts.shtml http://www.cl.cam.ac.uk/users/rf/pstex/latexcommands.htm http://www.cs.utah.edu/support/contrib/thompson/latex/latex-fonts.html http://www.texnik.de/fonts/fonts.phtml http://www.kronto.org/thesis/tips/section-title.html http://www.ctan.org/tex-archive/help/Catalogue/bytopic.html#psnfsspack Font conversion: http://www.pegasus.rutgers.edu/~elflord/unix/latex/no-bs.html Note: Using \centering in a range/environment is less likely to introduce white space than begin/end{center}, (which is based on list code). Drawing: http://www.iam.ubc.ca/~newbury/tex/figures.html#picture http://tex.loria.fr/graph-pack/grf/grf.pdf Diagramming: http://osl.iu.edu/~tveldhui/misc/hasse.html Packages: http://www.dcs.ed.ac.uk/home/latex/texdoc.html http://www.sbg.ac.at/psy/latex/packages/rmreset.sty (avoids footnote numbering reset) Tricks: http://www.ee.surrey.ac.uk/Personal/D.Mavrakis/latex/digest.html http://www.iam.ubc.ca/~newbury/tex/title.html Math: http://www.math.uiuc.edu/~hildebr/tex/displays.html http://web.reed.edu/cis/help/LaTeX/math.html http://www.artofproblemsolving.com/LaTeX/AoPS_L_BasicMath.php ftp://ftp.ams.org/pub/tex/doc/amsmath/short-math-guide.pdf \/ as spacer when switching out of italic (?) \\* as variation of linebreak that doesn't do pagebreak \ifpdf using pdflatex \else using basic latex \fi this/that will not be broken on, this\slash that may be. i.e. is interpreted as a sentence-ending period i.e.\ is not url formatting: use url package double spacing: use setspace package A simpler alternative is: \renewcommand{\baselinestretch}{2.0} \normalsize ...however, this probably applies to too much. documentclass twocolumn space increase: \addtolength{\columnsep}{10mm} \addtocounter{secnumdepth}{1} %add paragraph numbering \pagenumbering{style} with style in arabic, roman, Roman, alph, Alph When you use \reversemarginpar to switch the sides, you have some spaces to fix. The first word in a marginpar will not by hyphenated. You can fool TeX by prepending a \hspace{0pt} parindent parskip baselineskip baselinestretch \setlength{\parindent}{0.15\textwidth} \setlength{\textwidth}{40zw} \setlength{\textheight}{40\baselineskip} footnotes - see also the endnote package %\marginpar \usepackage{multicol} \begin{multicols}{2} Lorem. \end{multicols} spacing http://www.eng.cam.ac.uk/help/tpl/textprocessing/squeeze.html overfullness http://www.tldp.org/HOWTO/TeTeX-HOWTO-3.html#tolerances common errors http://theoval.sys.uea.ac.uk/~nlct/latex/novices/node71.html http://web.mit.edu/rsi/www/pdfs/figtab-handouts.pdf http://www.cs.utexas.edu/~witchel/navel_latex.html http://www.cs.utexas.edu/~witchel/errorclasses.html Windows and TeX http://student.dcu.ie/~mcmahon4/WinTeX.html Funky: http://www.micropress-inc.com/texdocs/ http://gnuwin32.sourceforge.net/packages/wv.htm http://www.math.umbc.edu/~rouben/prosper/ Also take look at: http://olympus.het.brown.edu/~danieldf/latex/ http://www.tac.dk/cgi-bin/info2www?(latex)Margin%20Notes http://www.maths.abdn.ac.uk/~jrp/latex_course/firststeps/page6.htm Tabbing environment http://swp.yngve.com/tablespackages.html Commands to skim http://www.anthemion.co.uk/tex2rtf/manual/tex2rtf25.html pdfTeX manual: http://www.literateprogramming.com/pdftex.pdf google: documentclass options 'titlepage' and 'openright' Conversion to/from latex: http://www.grindeq.com/ http://www.chikrii.com/ http://kebrt.webz.cz/programs/word-to-latex/ http://www.hj-gym.dk/%7Ehj/writer2latex/ http://www.ktalk.com/
Last updated: Aug 2011. Feel free to suggest things to me.