# thmtools - Align theorem header

How to prevent LaTeX from creating stretching space inside theorem headers, using a thmtools theorem?

In this example, I want "Theorem 1. " to be aligned with "Theorem 2. ".

\documentclass[12pt, a4paper]{article}
\usepackage[utf8]{inputenc}

\usepackage{amsthm}
\usepackage{thmtools}

\declaretheoremstyle[
notefont=\bfseries,
notebraces={(}{)},
bodyfont=\itshape,
qed=,
]{custom}

\declaretheorem[style = custom, name = Theorem]{thm}

\begin{document}
\begin{thm}
This is a small theorem.
\end{thm}
\begin{thm}
This is a theorem which is a little bit larger and that ends withareallybigword.
\end{thm}
\end{document}


To prevent the stretching, you can place the head in an \mbox, for instance. The formatting of the theorem's head can be changed using the headformat key in \declaretheoremstyle.

Here's a complete example built on yours.

\documentclass[12pt, a4paper]{article}
\usepackage[utf8]{inputenc}

\usepackage{amsthm}
\usepackage{thmtools}

\declaretheoremstyle[
notefont=\bfseries,
notebraces={(}{)},
bodyfont=\itshape,
qed=,