Latex Treats and Tricks

How to get smaller margins?
Use package a4wide or geometry (\usepackage[left=1cm,top=1cm,right=1cm,nohead,nofoot]{geometry}) or use package simplemargins or set margins manually, eg: \setlength{\topmargin}{0.5cm}.
How to get smaller headings?
Use: \usepackage[small,compact]{titlesec} or \usepackage[small,it]{caption}
How to get vertical space?
Use: \vspace{\fill} or \vspace{10cm} or \hfill or \qquad.
How to get Polish diacritics?
Use the right encoding (UTF-8 or ISO-8859-2/LATIN-2) of the file and define it in the input encodings. Use babel package. When all fails do this:
\usepackage[T1]{fontenc}
\newcommand\ahook{\k{a}} \newcommand\Ahook{\k{A}}
\newcommand\capos{\'{c}} \newcommand\Capos{\'{C}}
\newcommand\ehook{\k{e}} \newcommand\Ehook{\k{E}}
\newcommand\ldash{\l} \newcommand\Ldash{\L}
\newcommand\napos{\'{n}} \newcommand\Napos{\'{N}}
\newcommand\oapos{\'{o}} \newcommand\Oapos{\'{O}}
\newcommand\sapos{\'{s}} \newcommand\Sapos{\'{S}}
\newcommand\zdot{\.{z}} \newcommand\Zdot{\.{Z}}
\newcommand\zapos{\'{z}} \newcommand\Zapos{\'{Z}}
which all produce these (including uppercase too), in the same order: Example usage:
El{\zdot}bieta Kr{\ehook}pska
How to make a picture from LaTeX?
Use latex2html or pdftoppm.
How to get 1.5 linespace?
Use:\questionnespread{1.3}
How to create a horizontal line?
Use: \begin{center}\rule{.48\textwidth}{0.1mm}\end{center}
How to get sorted citations, say [1,6-9,20] instead of [1,9,20,6,7,8]?
Use: \usepackage{cite}.
Be careful, they might not want to use this package in the final proceedings and you'll end up with ugly looking references.
How to find a nice font?
Look in Font Catalogue.
How to pretty-print code in a paper?
Use one of the packages: lgrind, algorithm+algorithmic or lstlisting. I actually create listings and tables in LyX and export them as lstlistings to LaTeX. Here's a script which converts all LyX files to LaTeX and removes `preamble' and 'footer', so that they be included in another LaTeX file.
How to use LaTeX half-WYSIWYG?
I use LyX and GVim with the syntax installed. Other editors supporting LaTeX: Kile (KDE), TeXmacs.
How to handle large files of bibtex references?
I use JabRef which is open-source. I have heard EndNode is good. Editing by hand quickly leads to errors.
How to use edit tables?
Editing the tables in LaTeX is the only things that LaTeX really sucks at. I edit tables with LyX, export them to LaTeX and include in my original document. Here's a script which converts all LyX files to LaTeX and removes `preamble' and 'footer', so that they be included in another LaTeX file.
How to write a resume/CV with LaTeX?
Use the wonderful res document class. See here for examples.
How to change indentation?
To indent each paragraph use package indentfirst. To remove indentation use \setlength{\parindent}{0in}. To remove an indentation before a single paragraph use \noindent.
How to easily add picutres?
If it's a PDF or Postscript picture use includegraphics. PDF images can only be processed with pdflatex. Examples of including figures here and here. Alternatively you can use the "DeclareGraphicsExtensions" to include images with other extensions. Unless the image is a vector graphics including an image in latex generally produces poor results. No such problem in Beamer, why..?
How to create abbreviated unsorted bibtex style ?
This is abbrv-unsrt.bst: abbreviated unsorted bibtex style. It's identical to abbrv just not sorted so citations appear in the order of citing rather than alphabetical order. All I did was to take abbrv and remove the sorting part. For alphabetical order use the standard abbrv style.
How to correct hyphenation?
To generally discourage hyphenation use \pretolerance=1500 or \tolerance=some big number but less than 10000. To encourage hyphenation make the parameter smaller. To correct a single hyphenation do this my\-looo\-ooong\-word which tells latex where it is allowed to break the word. Solution for very desperate or very lazy is to put a line break.
How to discourage short lines at the end of a paragraph?
Add \looseness=-1 at the end of that paragraph.
How to spellcheck LaTeX files
Use aspell (I recomment this option because it seemed easier in usage):
aspell -d en_US check file.tex
or ispell:
ispell -c -t file.tex
What is overfull or underfull box ?
Such a warning means that LaTeX could not get a line spacing right - with all the options tried, it was always too long or too short, so the warning was printed for the user to resolve it manually. Try changing the line a bit. If you recompile with a draft option, the problem will be shown as a black rectangle.
How to fit more in a paper?
To squeeze more in a paper you can try the following:
Before submission:
Check your LaTeX with
lacheck mainfile.tex
chktex mainfile.tex
Recompile multiple times.
Spellcheck.
Where can I find more LaTeX solutions?
I found these sites offering great LaTeX tricks: