Difference: LaTeX (1 vs. 33)

Revision 332014-03-01 - KevinLeytonBrown

Line: 1 to 1
 
META TOPICPARENT name="EmpiricalAlgorithmics"

LaTeX tips and tricks

Line: 198 to 198
 

Tables

Added:
>
>
Force LaTeX not to reposition tables:

In the preamble:

\usepackage{float}
\restylefloat{table}

Then for each table you can use the H placement option (e.g. \begin{table}[H]) to make sure it doesn't get repositioned. Don't use "h".

 
\usepackage{booktabs}

Revision 322013-06-26 - KevinLeytonBrown

Line: 1 to 1
 
META TOPICPARENT name="EmpiricalAlgorithmics"

LaTeX tips and tricks

Line: 214 to 214
  A good reference for how to make beautiful tables, particularly when they're complicated and hierarchical: http://www.ece.cmu.edu/~pueschel/teaching/guides/guide-tables.pdf
Added:
>
>
To place whitespace between rows (better than hlines):

\newcommand{\interrowspace}{.6em} \addlinespace[\interrowspace]

 

Misc trickery


Revision 312013-06-04 - KevinLeytonBrown

Line: 1 to 1
 
META TOPICPARENT name="EmpiricalAlgorithmics"

LaTeX tips and tricks

Line: 19 to 19
 \renewcommand{\dbltopfraction}{0.9} % for double-column styles \renewcommand{\dblfloatpagefraction}{0.7} % for double-column styles
Added:
>
>
% other figure trickery \floatsep: space left between floats (12.0pt plus 2.0pt minus 2.0pt) \textfloatsep: space between last top float or first bottom float and the text (20.0pt plus 2.0pt minus 4.0pt) \intextsep : space left on top and bottom of an in-text float (12.0pt plus 2.0pt minus 2.0pt) \dbltextfloatsep is \textfloatsep for 2 column output (20.0pt plus 2.0pt minus 4.0pt). \dblfloatsep is \floatsep for 2 column output (12.0pt plus 2.0pt minus 2.0pt). \abovecaptionskip: space above caption (10.0pt). \belowcaptionskip: space below caption (0.0pt).
 %% make lists small \newcommand{\denselist}{\itemsep 0pt\topsep-6pt\partopsep-6pt}

Revision 302012-10-15 - KevinLeytonBrown

Line: 1 to 1
 
META TOPICPARENT name="EmpiricalAlgorithmics"

LaTeX tips and tricks

Line: 9 to 9
 

Space squeezing


Added:
>
>
%% add a line to a page \enlargethispage{\baselineskip}
 %% keep figures from going onto a page by themselves \renewcommand{\topfraction}{0.9} \renewcommand{\textfraction}{0.07}

Revision 292012-07-03 - KevinLeytonBrown

Line: 1 to 1
 
META TOPICPARENT name="EmpiricalAlgorithmics"

LaTeX tips and tricks

Line: 177 to 177
 \def\@makefnmark{\@textsuperscript{\normalfont\fnsymbol{footnote}}}% \makeatother
Added:
>
>
% symbol footnotes with a special command that can be interspersed with other footnotes % use: \symbolfootnote[1]{footnote} to get an *, 2 = dagger, 3=ddag; etc. 0 is unnumbered footnote. \long\def\symbolfootnote[#1]#2{\begingroup\def\thefootnote{\fnsymbol{footnote}}\footnote[#1]{#2}\endgroup}
 

Tables

Revision 282012-01-25 - KevinLeytonBrown

Line: 1 to 1
 
META TOPICPARENT name="EmpiricalAlgorithmics"

LaTeX tips and tricks

Line: 179 to 179
 
Added:
>
>

Tables

\usepackage{booktabs}

\begin{table}
\begin{tabular}{ccc}
\toprule
\textbf{a} & \textbf{b} & \textbf{c} \\ 
\midrule
1 & 2 & 3 \\ 
\bottomrule
\end{tabular}
\end{table}

A good reference for how to make beautiful tables, particularly when they're complicated and hierarchical: http://www.ece.cmu.edu/~pueschel/teaching/guides/guide-tables.pdf

 

Misc trickery


Revision 272011-10-17 - KevinLeytonBrown

Line: 1 to 1
 
META TOPICPARENT name="EmpiricalAlgorithmics"

LaTeX tips and tricks

Line: 183 to 183
 
% place a note for editing

Changed:
<
<
\renewcommand{\note}[1]{~\\\frame{\begin{minipage}[c]{\textwidth}\vspace{2pt}\center{#1}\vspace{2pt}\end{minipage}}\vspace{3pt}\\}
>
>
\newcommand{\note}[1]{} \providecommand{\note}[1]{~\\\frame{\begin{minipage}[c]{\textwidth}\vspace{2pt}\center{#1}\vspace{2pt}\end{minipage}}\vspace{3pt}\\}
  % version for 2-column documents \renewcommand{\note}[1]{~\\\frame{\begin{minipage}[c]{\columnwidth}\vspace{2pt}\center{#1}\vspace{2pt}\end{minipage}}\vspace{3pt}\\}

Revision 262011-09-28 - KevinLeytonBrown

Line: 1 to 1
 
META TOPICPARENT name="EmpiricalAlgorithmics"

LaTeX tips and tricks

Line: 22 to 22
 %% make section headings take up less space ("medium" can be replaced by "tiny", "small" or "big"--tiny is the normal font) \usepackage[medium,compact]{titlesec}
Added:
>
>
%% an alternative, which might look better and is more adjustable %% the negative number in beforeskip means that the indent in the following paragraph is suppressed %% a negative afterskip means that there's no linebreak after the heading \makeatletter \renewcommand\section{\@startsection {section}{1}{0mm}%name, level, indent {-2.5ex \@plus -1ex \@minus -.2ex}% beforeskip {1ex \@plus.2ex}% afterskip {\normalfont\large\bfseries}}% style \renewcommand\subsection{\@startsection {subsection}{2}{0mm}%name, level, indent {-2.25ex\@plus -1ex \@minus -.2ex}%beforeskip {.8ex \@plus .2ex}%afterskip {\normalfont\normalsize\bfseries}}% style \makeatother
 %% a trick that makes the title take up less space for many style files (but not article) \addtolength{\titlebox}{-1.8cm}

Revision 252011-07-04 - KevinLeytonBrown

Line: 1 to 1
 
META TOPICPARENT name="EmpiricalAlgorithmics"

LaTeX tips and tricks

Line: 79 to 79
 }

%% change margins

Added:
>
>
% the best way: \usepackage[margin=1in]{geometry}

%old-school:

 \setlength{\textwidth}{7in} \setlength{\textheight}{8.75in} \setlength{\oddsidemargin}{-0.25in}

Revision 242011-06-27 - KevinLeytonBrown

Line: 1 to 1
 
META TOPICPARENT name="EmpiricalAlgorithmics"

LaTeX tips and tricks

Line: 174 to 174
 % get an extra line on one page \enlargethispage{\baselineskip}
Added:
>
>
% argmax and argmin \newcommand{\argmax}{\mathop{\arg\max}} \newcommand{\argmin}{\mathop{\arg\min}}
 % best bibliography style for APA-style citations \usepackage{apacite} \renewcommand{\APACrefbtitle}[2]{\Bem{#1}} % this prevents booktitle field in "inproceedings" citations going into lowercase

Revision 232011-04-10 - KevinLeytonBrown

Line: 1 to 1
 
META TOPICPARENT name="EmpiricalAlgorithmics"

LaTeX tips and tricks

Line: 92 to 92
 

Fonts and symbols

Added:
>
>
Find that latex symbol by drawing it.
 
% compact font that is good for tables; can also use {9pt}{8pt} depending on style file
\fontfamily{cmss}\fontseries{uc}

Revision 222011-02-02 - KevinLeytonBrown

Line: 1 to 1
 
META TOPICPARENT name="EmpiricalAlgorithmics"

LaTeX tips and tricks

Line: 10 to 10
 
%% keep figures from going onto a page by themselves 

Changed:
<
<
\renewcommand{\topfraction}{0.85} \renewcommand{\textfraction}{0.1} \renewcommand{\floatpagefraction}{0.75}
>
>
\renewcommand{\topfraction}{0.9} \renewcommand{\textfraction}{0.07} \renewcommand{\floatpagefraction}{0.9} \renewcommand{\dbltopfraction}{0.9} % for double-column styles \renewcommand{\dblfloatpagefraction}{0.7} % for double-column styles
  %% make lists small \newcommand{\denselist}{\itemsep 0pt\topsep-6pt\partopsep-6pt}

Revision 212010-11-01 - KevinLeytonBrown

Line: 1 to 1
 
META TOPICPARENT name="EmpiricalAlgorithmics"

LaTeX tips and tricks

Line: 180 to 180
 \bibpunct{[}{]}{;}{n}{,}{,} \bibliographystyle{plain}
Added:
>
>
% keep hyperref from looking ugly (fuller version with metadata for PDF in mas.tex) \hypersetup{pdftex, backref=true, pagebackref=true, % backrefs in bib. Apparently doesn't work with mlapa colorlinks=false, % if this is true, the text is colored instead pdfborder=0 0 0, % no colored border around links either pdfdisplaydoctitle=true }
 % in beamer, make a block without a title \begin{block}{} block text \end{block}

Revision 202010-07-02 - KevinLeytonBrown

Line: 1 to 1
 
META TOPICPARENT name="EmpiricalAlgorithmics"

LaTeX tips and tricks

Line: 208 to 208
 \urlstyle{new} %% then in a footnote: \footnote{\urlstyle{newFN}\url{http://whatever.com}\urlstyle{new} is worth checking out.}
Added:
>
>
%create a ref that takes the value of a counter. Use this to make a forward reference to a counter's value % %at the top: \newcounter{countsomething} This is my counter's final value: \ref{numsomething}. % %throughout, or hidden inside a repeatedly used macro: \addtocounter{countsomething}{1} % %at the end: \makeatletter% \immediate\write\@mainaux{% %use the following version if hyperref is being used \string\newlabel{numsomething}{{\arabic{countsomething}}{\arabic{page}}{}{}{}}% %use the following version if hyperref is not being used \string\newlabel{numsomething}{{\arabic{countsomething}}{\arabic{page}}}% }% \makeatother%
 

Spacing displays

Revision 192010-07-02 - KevinLeytonBrown

Line: 1 to 1
 
META TOPICPARENT name="EmpiricalAlgorithmics"

LaTeX tips and tricks

Line: 99 to 99
 % relative font sizes \usepackage{relsize} {\smaller ... }
Added:
>
>
% another option, allows nonstandard sizes \usepackage{scalefont} {\scalefont{1.2} ... }
  %% get an actual tilde (~) in latex without resorting to $\sim$: \textasciitilde

Revision 182010-01-27 - KevinLeytonBrown

Line: 1 to 1
 
META TOPICPARENT name="EmpiricalAlgorithmics"

LaTeX tips and tricks

Line: 96 to 96
 \fontsize{10pt}{9pt} \selectfont
Added:
>
>
% relative font sizes \usepackage{relsize} {\smaller ... }
 %% get an actual tilde (~) in latex without resorting to $\sim$: \textasciitilde
Line: 216 to 220
 

Useful links

Changed:
<
<
>
>
 

-- Main.kevinlb - 13 Apr 2005

Revision 172010-01-27 - KevinLeytonBrown

Line: 1 to 1
 
META TOPICPARENT name="EmpiricalAlgorithmics"

LaTeX tips and tricks

Line: 190 to 190
 \begin{theorem}...repeated theorem...\end{theorem} \setcounter{theorem}{\value{thmbackup}}
Added:
>
>
%% Define a new style for URLs that will use a smaller font. %% use a different one for footnotes (requires manual switching) \makeatletter \def\url@newstyle{% \@ifundefined{selectfont}{\def\UrlFont{\sf}}{\def\UrlFont{\small\ttfamily}}} \def\url@newFNstyle{% \@ifundefined{selectfont}{\def\UrlFont{\sf}}{\def\UrlFont{\scriptsize\ttfamily}}} \makeatother \urlstyle{new} %% then in a footnote: \footnote{\urlstyle{newFN}\url{http://whatever.com}\urlstyle{new} is worth checking out.}
 

Revision 162010-01-02 - KevinLeytonBrown

Line: 1 to 1
 
META TOPICPARENT name="EmpiricalAlgorithmics"

LaTeX tips and tricks

Line: 179 to 179
 % in beamer, have nonugly math fonts \usefonttheme[onlymath]{serif}
Added:
>
>
% reset the theorem counter to a previously referenced value % e.g., for repeating a theorem in an appendix % of course, also works with lemma, corollary, etc. \usepackage{refcount} \newcounter{thmbackup} \setcounter{thmbackup}{\value{theorem}} \setcounterref{theorem}{thm:name} \addtocounter{theorem}{-1} \begin{theorem}...repeated theorem...\end{theorem} \setcounter{theorem}{\value{thmbackup}}
 

Spacing displays

Revision 152009-11-26 - NandoDeFreitas

Line: 1 to 1
 
META TOPICPARENT name="EmpiricalAlgorithmics"

LaTeX tips and tricks

Line: 176 to 176
 % in beamer, make a block without a title \begin{block}{} block text \end{block}
Added:
>
>
% in beamer, have nonugly math fonts \usefonttheme[onlymath]{serif}
 

Spacing displays

Revision 142009-07-01 - KevinLeytonBrown

Line: 1 to 1
 
META TOPICPARENT name="EmpiricalAlgorithmics"

LaTeX tips and tricks

Line: 173 to 173
 \bibpunct{[}{]}{;}{n}{,}{,} \bibliographystyle{plain}
Added:
>
>
% in beamer, make a block without a title \begin{block}{} block text \end{block}
 

Spacing displays

Revision 132009-05-22 - KevinLeytonBrown

Line: 1 to 1
 
META TOPICPARENT name="EmpiricalAlgorithmics"

LaTeX tips and tricks

Line: 122 to 122
 \[\textstyle \sum_i x^i\]

Added:
>
>

Footnotes

% repeat the same footnote multiple times
one\footnotemark[\arabic{footnote}]
two\footnotemark[\arabic{footnote}]
\footnotetext{Whatever}

% another way of doing the same thing, which creates different-numbered footnotes if there's a page break
\usepackage{fixfoot}
\DeclareFixedFootnote{\whatever}{Whatever.}
one\whatever
two\whatever

% Make footnotes one-per-page
\usepackage{perpage} 
\MakePerPage{footnote}

% number footnotes with symbols
\makeatletter
\def\@makefnmark{\@textsuperscript{\normalfont\fnsymbol{footnote}}}%
\makeatother

 

Misc trickery


Line: 147 to 173
 \bibpunct{[}{]}{;}{n}{,}{,} \bibliographystyle{plain}
Deleted:
<
<
% repeat the same footnote multiple times one\footnotemark[\arabic{footnote}] two\footnotemark[\arabic{footnote}] \footnotetext{Whatever}

% another way of doing the same thing, which creates different-numbered footnotes if there's a page break \usepackage{fixfoot} \DeclareFixedFootnote{\whatever}{Whatever.} one\whatever two\whatever

 

Spacing displays

Revision 122009-05-21 - KevinLeytonBrown

Line: 1 to 1
 
META TOPICPARENT name="EmpiricalAlgorithmics"

LaTeX tips and tricks

Line: 39 to 39
 %% make the whole document shorter--this one is very powerful. Experiment with the number; 0.97 will do a lot and looks OK \renewcommand{\baselinestretch}{0.97}
Added:
>
>
% To densify sections \let\oldsection=\section \renewcommand{\section}[1]{% \vspace{-.5em}\oldsection{#1}\vspace{-.25em}% }% \let\oldsubsection=\subsection \renewcommand{\subsection}[1]{% \vspace{-.5em}\oldsubsection{#1}\vspace{-.25em}% }%
 % To squeeze space in the bibliography: \let\oldthebibliography=\thebibliography \let\endoldthebibliography=\endthebibliography

Revision 112009-05-12 - KevinLeytonBrown

Line: 1 to 1
 
META TOPICPARENT name="EmpiricalAlgorithmics"

LaTeX tips and tricks

Line: 136 to 136
 \usepackage{natbib} \bibpunct{[}{]}{;}{n}{,}{,} \bibliographystyle{plain}
Added:
>
>
% repeat the same footnote multiple times one\footnotemark[\arabic{footnote}] two\footnotemark[\arabic{footnote}] \footnotetext{Whatever}

% another way of doing the same thing, which creates different-numbered footnotes if there's a page break \usepackage{fixfoot} \DeclareFixedFootnote{\whatever}{Whatever.} one\whatever two\whatever

 

Spacing displays

Revision 102009-04-29 - KevinLeytonBrown

Line: 1 to 1
 
META TOPICPARENT name="EmpiricalAlgorithmics"

LaTeX tips and tricks

Line: 39 to 39
 %% make the whole document shorter--this one is very powerful. Experiment with the number; 0.97 will do a lot and looks OK \renewcommand{\baselinestretch}{0.97}
Added:
>
>
% To squeeze space in the bibliography: \let\oldthebibliography=\thebibliography \let\endoldthebibliography=\endthebibliography \renewenvironment{thebibliography}[1]{% \begin{oldthebibliography}{#1}% \setlength{\parskip}{0ex}% \setlength{\itemsep}{0ex}% }% {% \end{oldthebibliography}% }
  %% densify spacing in bibliographies \newcommand{\bibfix}{% PUT \bibfix in file.bbl after first line

Revision 92009-01-29 - KevinLeytonBrown

Line: 1 to 1
 
META TOPICPARENT name="EmpiricalAlgorithmics"

LaTeX tips and tricks

Line: 106 to 106
 % place a note for editing \renewcommand{\note}[1]{~\\\frame{\begin{minipage}[c]{\textwidth}\vspace{2pt}\center{#1}\vspace{2pt}\end{minipage}}\vspace{3pt}\\}
Added:
>
>
% version for 2-column documents \renewcommand{\note}[1]{~\\\frame{\begin{minipage}[c]{\columnwidth}\vspace{2pt}\center{#1}\vspace{2pt}\end{minipage}}\vspace{3pt}\\}
 % Sometimes the footnotes don't appear at the bottom of the page. Than you have to use \usepackage[bottom]{footmisc}

Revision 82009-01-12 - KevinLeytonBrown

Line: 1 to 1
 
META TOPICPARENT name="EmpiricalAlgorithmics"

LaTeX tips and tricks

Line: 117 to 117
 \renewcommand{\APACrefbtitle}[2]{\Bem{#1}} % this prevents booktitle field in "inproceedings" citations going into lowercase \bibliographystyle{apacite}
Changed:
<
<
>
>
% bibliography that looks like [22], but with \emcite capabilities too \usepackage{natbib} \bibpunct{[}{]}{;}{n}{,}{,} \bibliographystyle{plain}
 

Spacing displays

Revision 72008-12-04 - KevinLeytonBrown

Line: 1 to 1
 
META TOPICPARENT name="EmpiricalAlgorithmics"

LaTeX tips and tricks

Line: 96 to 96
  % get an inline equation to be displayed like an {equation} (e.g., subscripts under \sum) $\displaystyle \sum_i x^i$
Added:
>
>
% the alternative, to get a displaymath equation to display like an inline one (perhaps to save space): \[\textstyle \sum_i x^i\]
 

Misc trickery

Revision 62008-11-18 - KevinLeytonBrown

Line: 1 to 1
 
META TOPICPARENT name="EmpiricalAlgorithmics"

LaTeX tips and tricks

Line: 94 to 94
 \newcommand{\boxV}{\slashed{V}} \newcommand{\boxv}{\slashed{\mathscr{v}}}
Added:
>
>
% get an inline equation to be displayed like an {equation} (e.g., subscripts under \sum) $\displaystyle \sum_i x^i$
 

Misc trickery

Revision 52008-10-10 - KevinLeytonBrown

Line: 1 to 1
 
META TOPICPARENT name="EmpiricalAlgorithmics"

LaTeX tips and tricks

Line: 61 to 61
 \setlength{\evensidemargin}{-0.25in} \setlength{\headsep}{10pt}
Deleted:
<
<
%% get an actual tilde (~) in latex without resorting to $\sim$: \textasciitilde
 %% make vertical rubber space \vfill % this makes a pre-defined amount of rubber space. It's equivalent to \vspace\fill \vskip 10pt % this makes a fixed amount. It's a TeX command, so no curly braces.
Added:
>
>

Fonts and symbols

 
Added:
>
>

 % compact font that is good for tables; can also use {9pt}{8pt} depending on style file \fontfamily{cmss}\fontseries{uc} \fontsize{10pt}{9pt} \selectfont
Changed:
<
<
% Sometimes the footnotes don't appear at the bottom of the page. Than you have to use \usepackage[bottom]{footmisc}
>
>
%% get an actual tilde (~) in latex without resorting to $\sim$: \textasciitilde

%% lowercase script letters \DeclareFontFamily{OT1}{pzc}{} \DeclareFontShape{OT1}{pzc}{m}{it}{<-> s * [1.200] pzcmi7t}{} \DeclareMathAlphabet{\mathscr}{OT1}{pzc}{m}{it}

%% superimpose one symbol on another to make a new symbol %% the arguments are x and y alignment, in em (pos or neg) %% here I superimpose a square with a capital V and a small v %% largesquare comes from the mnsymbol package; boxempty comes from stmaryrd \usepackage{slashed} \usepackage{mnsymbol} \usepackage{stmaryrd} \declareslashed{}{\largesquare}{-.01}{0.005}{V} \declareslashed{}{\boxempty}{.06}{-.04}{\mathscr{v}} \newcommand{\boxV}{\slashed{V}} \newcommand{\boxv}{\slashed{\mathscr{v}}}

 
Added:
>
>

Misc trickery


 % place a note for editing \renewcommand{\note}[1]{~\\\frame{\begin{minipage}[c]{\textwidth}\vspace{2pt}\center{#1}\vspace{2pt}\end{minipage}}\vspace{3pt}\\}
Added:
>
>
% Sometimes the footnotes don't appear at the bottom of the page. Than you have to use \usepackage[bottom]{footmisc}
 % get an extra line on one page \enlargethispage{\baselineskip}

Revision 42008-09-13 - KevinLeytonBrown

Line: 1 to 1
 
META TOPICPARENT name="EmpiricalAlgorithmics"

LaTeX tips and tricks

Line: 82 to 82
 % get an extra line on one page \enlargethispage{\baselineskip}
Added:
>
>
% best bibliography style for APA-style citations \usepackage{apacite} \renewcommand{\APACrefbtitle}[2]{\Bem{#1}} % this prevents booktitle field in "inproceedings" citations going into lowercase \bibliographystyle{apacite}
 

Spacing displays

Revision 32008-09-05 - KevinLeytonBrown

Line: 1 to 1
 
META TOPICPARENT name="EmpiricalAlgorithmics"

LaTeX tips and tricks

Line: 79 to 79
 % place a note for editing \renewcommand{\note}[1]{~\\\frame{\begin{minipage}[c]{\textwidth}\vspace{2pt}\center{#1}\vspace{2pt}\end{minipage}}\vspace{3pt}\\}
Added:
>
>
% get an extra line on one page \enlargethispage{\baselineskip}
 

Spacing displays

Revision 22008-05-16 - KevinLeytonBrown

Line: 1 to 1
 
META TOPICPARENT name="EmpiricalAlgorithmics"

LaTeX tips and tricks

Line: 76 to 76
 % Sometimes the footnotes don't appear at the bottom of the page. Than you have to use \usepackage[bottom]{footmisc}
Added:
>
>
% place a note for editing \renewcommand{\note}[1]{~\\\frame{\begin{minipage}[c]{\textwidth}\vspace{2pt}\center{#1}\vspace{2pt}\end{minipage}}\vspace{3pt}\\}
 

Spacing displays

Revision 12007-09-27 - KevinLeytonBrown

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="EmpiricalAlgorithmics"

LaTeX tips and tricks

This page is part of the EmpiricalAlgorithmics web.

Space squeezing

%% keep figures from going onto a page by themselves 
\renewcommand{\topfraction}{0.85}
\renewcommand{\textfraction}{0.1}
\renewcommand{\floatpagefraction}{0.75}

%% make lists small
\newcommand{\denselist}{\itemsep 0pt\topsep-6pt\partopsep-6pt}

%% make section headings take up less space ("medium" can be replaced by "tiny", "small" or "big"--tiny is the normal font)
\usepackage[medium,compact]{titlesec}

%% a trick that makes the title take up less space for many style files (but not article)
\addtolength{\titlebox}{-1.8cm}

%% for article, and maybe other styles, to make the title take up less space you can add negative
%% vspace directly to the title, author and date commands.  Here's one configuration that worked for me:
\title{\vspace{-2.5em} title...}
\author{\vspace{-.5em} author...}
\date{\vspace{-1.25em}}

%% print a diagram showing the names of all constants related to margins etc.
\usepackage{layout}
\layout

%% make a paragraph one line shorter without deleting any words!  Put the following at the beginning, the wrap the paragraph in {}
\looseness=-1

%% make the whole document shorter--this one is very powerful.  Experiment with the number; 0.97 will do a lot and looks OK
\renewcommand{\baselinestretch}{0.97}


%% densify spacing in bibliographies
\newcommand{\bibfix}{%	 PUT \bibfix in file.bbl after first line
	 \setlength{\parsep}{\parskip}%
	 \setlength{\itemsep}{0cm}%
	 \setlength{\topsep}{\parskip}%
	 \setlength{\parskip}{0cm}%
	 \setlength{\partopsep}{0cm}%
	 \setlength{\listparindent}{\parindent}%
	 \setlength{\labelwidth}{10pt}%
	 \setlength{\labelsep}{0pt}%
	 \setlength{\leftskip}{0pt}%
	 \setlength{\leftmargin}{0pt}%
}

%% change margins
\setlength{\textwidth}{7in}
\setlength{\textheight}{8.75in}
\setlength{\oddsidemargin}{-0.25in}
\setlength{\evensidemargin}{-0.25in}
\setlength{\headsep}{10pt}

%% get an actual tilde (~) in latex without resorting to $\sim$:
\textasciitilde

%% make vertical rubber space
\vfill % this makes a pre-defined amount of rubber space. It's equivalent to \vspace\fill
\vskip 10pt % this makes a fixed amount.  It's a TeX command, so no curly braces.

% compact font that is good for tables; can also use {9pt}{8pt} depending on style file
\fontfamily{cmss}\fontseries{uc}
\fontsize{10pt}{9pt}
\selectfont

% Sometimes the footnotes don't appear at the bottom of the page. Than you have to use 
\usepackage[bottom]{footmisc}

Spacing displays

  • Spacing in displays. Usually it's best to leave the spacing up to TeX. However, if explicit horizontal spacing is needed (for example, to set an expression like (n \to \infty) apart from the rest of the display, or to separate two equations on the same line), \quad in most cases generates the right amount of space. Don't try to create spacing with a bunch of explicit spaces ("\ "); the spacing generated in this way is usually not optimal, and the explicit spaces will likely have to be removed (and possibly replaced by \quad) when the paper is typeset at the publisher's end.
  • Avoid blank lines before or after a display, unless you really want to start a new paragraph: It is tempting to surround displayed math material by blank lines in the source file, to make them stand out and easier to locate. However, this is usually wrong, since blank lines are interpreted as paragraph breaks, may generate some additional vertical spacing and cause the next line of text to be indented - something you usually don't want. If you want to set off displays in your source file, do so by inserting a line with comment symbols, such as %%%%% equation 3.1 %%%%%%%%%%%%%% before and/or after the display.
  • Correcting underful vboxes and bad page breaks. By default, TeX does not break pages inside display environments such as align. If a paper has many multiline formulas, this may cause "underful vboxes", which can look very poor if the badness (reported by TeX in the log file) is a few thousand. One way to remedy this is to put the command \allowdisplaybreaks in the preamble. However, this may cause some poor pagebreaks which may have to be fixed. A compromise solution is to use \allowdisplaybreaks locally, on the individual displays that cause problems: {\allowdisplaybreaks \begin{align} ... \end{align} }. The best solution is to prevent this problem by avoiding excessively long displays (say, with five or more lines). It is often not hard to break up a very long display into two, for example by inserting a phrase like "By the Cauchy-Schwarz inequality, the last expression is at most" in the middle of the overlong display, followed by the remaining lines of the display.
  • Multiline subscripts on sums or integrals. Use the \substack{...} command, which works much like the \sb ... \endsb pair in amstex. It is much easier to use, and produces better looking output than an array environment or a construct using \atop (derived from plain tex).

Useful links

-- Main.kevinlb - 13 Apr 2005

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback