# Extra space before labeled theorem body with thmbox or thmtools+thmbox

Package thmbox seems to add an extra space at the beginning of the body of the labeled theorems. See example below. Package thmtools with the thmbox option does the same. Latex original, package amsthm and package ntheorem do not add the extra space. I can solve the problem that occurs with thmbox by placing a % just after the label. However, I do not want to do that because I should edit each already written theorem. Problem is solved by including \ignorespaces in option bodystyle of thmbox. However, then the body is indented. If bodystyle is defined using \noindent\ignorespaces then the body is not indented, but the extra space shows up again.

\documentclass{report}

% ----- no extra space

%\newtheorem{theorem}{Theorem}

%\usepackage{amsthm}
%\newtheorem{theorem}{Theorem}

%\usepackage{ntheorem}
%\newtheorem{theorem}{Theorem}

% ----- extra space

\usepackage{thmbox}
\newtheorem{theorem}{Theorem}

%\usepackage{thmtools}
%\declaretheorem[thmbox=M]{theorem}

\begin{document}

\begin{theorem}\label{L1}
With label.
\end{theorem}
\begin{theorem}
Without label.
\end{theorem}
\begin{theorem}     \label{L2}%
With label, but solved, even having space characters here and there.
\end{theorem}

\end{document}
-
The question is how do I solve the problem with package thmbox or package thmtools with option thmbox, without editing each already written labeled theorem. –  ASdeL Jan 10 '12 at 20:11
It is not obvious, but there is an extra space added at the beginning of the line when there is a \label{} unless one uses \label{}% (trailing % added). Interestingly, even the thmbox documentation shows the use as \label{}%. –  Peter Grill Jan 11 '12 at 3:13
There also seems to be a different spacing problem when amsthm is used, but not with ntheorem. With amsthm, there appears to be an additional space before the 3 in Theorem 3. –  Peter Grill Jan 11 '12 at 3:18
You are right. This extra space seems to be added not because of the label or space characters, but because of the long text within the body. That is, in order to obtain evenly spaced "words". With a shorter body no extra space appears before the 3. –  ASdeL Jan 11 '12 at 13:51