While TextMate may have a nice solution for this, there's also the LaTeX way of solving this.
Save the attached document as header.tex, adapt it to your needs and source that on the first line of each section.
And in your whole document use the following lines before you source the others.
\newcommand{\setflag}{\newif \ifwhole \wholetrue}
If desired, you can also include a static chapter/section counter like so: \setcounter{chapter}{1}
But then again, if you use latexmk.pl, you aren't gonna need that.
Jeroen.
\providecommand{\setflag}{\newif \ifwhole \wholefalse} \setflag
\ifwhole\else \documentclass[11pt,a4paper,twoside,openright]{report} \usepackage{url} \usepackage[british]{babel} \usepackage{verbatim} \usepackage{eurosym} \usepackage{graphicx} \usepackage{tabularx} % \usepackage{side} \usepackage{rotating} \usepackage{fancyhdr} \usepackage{theorem}
\pagestyle{fancyplain} \lhead{}\rhead{}\cfoot{}\chead{} %\lfoot[\fancyplain{}{\bfseries\thepage}]{} \rfoot[]{\thepage} \lfoot[\thepage]{} \renewcommand{\headrule}{}
\setlength{\oddsidemargin}{0.55in} \setlength{\evensidemargin}{0.55in}
{\theoremstyle{break} {\theorembodyfont{\normalfont} \newtheorem{example}{Example}}} {\theoremstyle{break} \newtheorem{definition}{Definition}[chapter]} \newtheorem{defin}[definition]{Definition}
\def\mbarrow{\stackrel{\textnormal{\tiny{\ MB}}}{\longleftarrow}} \def\notmodels{\mathrel|\joinrel\neq}
\begin{document} \fi