Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
    
So ... what exactly is your question? Please advise. –  Mico Jan 10 '12 at 20:03
    
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
add comment

1 Answer 1

Put the \label at the end:

\begin{theorem}
With label.\label{L1}
\end{theorem}

It's a bug in thmbox way of doing its work.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.