I'm using thmtools to make ultra-fancy theorems. I would like the Theorem name and number (e.g., "Theorem 1") to jut out into the left margin of the text, and the note (e.g., "The Fundamental Theorem of Calculus" be in the regular text. But I can't get the alignment quite right. Here is a minimal example:
\documentclass{article}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{thmtools}
\pagestyle{empty}
\declaretheoremstyle[
headfont=\bfseries,
notefont=\normalfont,
bodyfont=\itshape,
headpunct=\newline,
headformat={%
\makebox[0pt][r]{\NAME\ \NUMBER\ }{\NOTE}%
},
]{theorem}
\declaretheorem[style=theorem]{theorem}
% I need to undeclare the proof environment that amsthm provides but I can't use \renewenvironment
\let\proof\relax
\let\endproof\relax
\declaretheoremstyle[
headfont=\scshape,
notefont=\itshape
bodyfont=\normalfont,
headpunct=\relax,
headformat={%
\makebox[0pt][r]{\NAME\ }\NOTE},
]{proof}
\declaretheorem[
style=proof,
qed=\qedsymbol]{proof}
\begin{document}
\begin{theorem}[The Fundamental Theorem of Calculus]
Let $f$ be an integrable function on $[a,b]$ and define
\[
g(x) = \int_a^x f(t) \,dt.
\]
If $f$ is continuous at $x$ in $(a,b)$, then $g$ is differentiable at $x$ and
\[
g'(x) = f(x).
\]
\end{theorem}
\begin{proof}
Let $h>0$ be given so that $x+h < b$ (The case $h<0$ is treated similarly). We have
\[
\frac{g(x+h) - g(x)}{h} = \frac{1}{h} \int_x^{x+h} f(t)\,dt.
\]
Let $M_h$ be the maximum value of $f$ on $[x,x+h]$, and let $m_h$ the minimum value of $f$ on $[x,x+h]$. We have
\[
m_h \cdot h \leq \int_x^{x+h}f(t)\,dt \leq M_h \cdot h
\]
So
\[
m_h \leq \frac{g(x+h) - g(x)}{h} \leq M_h.
\]
Since $f$ is continuous at $x$, as $h\to 0$, both $m_h$ and $M_h$ tend to $f(x)$.
\end{proof}
\end{document}

As you can see, the note is too far to the right. And in the proof environment, there is no note, but the text begins too far to the right as well.
What's putting the extra space in there and how can I get rid of it?
Edit Scroll down to my answer to see how I solved it. I accepted Phil's answer because it's less hacky than Gonzalo's (did not involve @) and got me closest to the result I wanted.

\makebox[0pt][r]{\NAME\ \NUMBER\ }\NOTE}to\makebox[0pt][r]{\NAME\ \NUMBER}\NOTE}. Maybexspacepackage is helpful. – Rushavski Mar 16 '11 at 00:59:-)– Hendrik Vogt Mar 17 '11 at 17:45\thmt@spacewith a\providecommanddefaulting it to a space, so it will be configurable in a less hackish way. (No concrete release date on that yet, though.) – Ulrich Schwarz Mar 21 '11 at 18:37