How remove indention in theorem environment?

How is it possible to remove the indention at the beginning of the theorem text?

\documentclass{article}
\usepackage{amsthm}
\usepackage{thmtools}
\declaretheorem[thmbox=L]{boxtheorem L}

\begin{document}
\begin{boxtheorem L}[Euclid]
For every prime $p$, there is a prime $p'>p$.
In particular, there are infinitely many primes.
\end{boxtheorem L}
\end{document}

-

This is slightly curious behaviour from the package that you don't notice in many situations. The space is caused by the line break after [Euclid]. Placing a percent sign directly after [Euclid] hides the newline and removes that space.

\documentclass{article}
\usepackage{amsthm}
\usepackage{thmtools}
\declaretheorem[thmbox=L]{boxtheorem L}

\begin{document}
\begin{boxtheorem L}[Euclid]%
For every prime $p$, there is a prime $p'>p$.
In particular, there are infinitely many primes.
\end{boxtheorem L}
\end{document}


The documentation of thmtools is careful to use percent signs at other places in the documentation, but not in the examples related to the thmbox option.

-
In both the question and the answer, $p’>p$ should be $p'>p$ so the prime shows up. –  Ethan Bolker Mar 22 '13 at 19:58
@Swann: Thanks, sometimes the answer is so simple... ;) –  user4811 Mar 22 '13 at 20:19
@EthanBolker Well spotted. I have now corrected this. –  Andrew Swann Mar 23 '13 at 16:57

This is due to bad interactions between the packages thmtools and thmbox, I believe. A way to solve this particular situation seems to be patching an internal command of thmtools.

\documentclass{article}
\usepackage{amsthm}
\usepackage{thmtools}

\usepackage{etoolbox}
\makeatletter
\patchcmd\thmt@parsetheoremargs
{\let\@parsecmd\@empty}
{\let\@parsecmd\ignorespaces}
{}{}
\makeatother

\declaretheorem[thmbox=L]{boxtheorem L}

\begin{document}
\begin{boxtheorem L}[Euclid]
For every prime $p$, there is a prime $p'>p$.
In particular, there are infinitely many primes.
\end{boxtheorem L}
\end{document}


-