# Remove space between “Theorem” and theorem number when using ntheorem

I am using the ntheorem package for hypotheses and subhyotheses (i.e. H1a, H1b, etc.), with the latter being unimportant for my problem. Just as an info for you to understand why I cannot simply use the amsthm package.

My code gives me H 1 instead of H1 as output, and I want to remove that space between "H" and "1". Find a screenshot attached. Thank you!!

Here is my MWE:

\documentclass{scrreprt}

\usepackage{ntheorem}
\newtheorem{hyp}{H}     %I tried \newtheorem{hyp}{H\ignorespaces} - not working

\begin{document}

\begin{hyp}
The higher the mountain the harder the hike.
\end{hyp}

\end{document}


• You will need to define your own theorem style. The default, you show here, is called plain, look in ntheorem.sty for the code for plain, copy it and adjust accordingly. – daleif May 17 '17 at 16:00
• Thanks, that worked perfect! If you wanna give that as an answer instead of a comment I can put that question on "solved". – Paul May 17 '17 at 16:24
• I don't collect point, why don't you write one yourself, good exercise (plus I'm on a tablet, so interacting with the site is rather slow) – daleif May 17 '17 at 16:25

Thanks to daleif's helpful comment I was able to solve the question by creating a \newtheoremstyle, based on the default style "plain" found in ntheorem.sty.

Plain style:

\newtheoremstyle{plain}%


One can see that the space occurs because of the space in ##1\ ##2, so changing ##1\ ##2 to ##1##2 solved my problem.

This leads to the following corrected MWE:

\documentclass{scrreprt}

\usepackage{ntheorem}

\makeatletter %
\newtheoremstyle{hypotheses}%
\makeatother

\theoremstyle{hypotheses}
\newtheorem{hyp}{H}

\begin{document}

\begin{hyp}
The higher the mountain the harder the hike.
\end{hyp}

\end{document}


with the output:

Hope this might help some of you in the future as well.

• Btw you should probably name the plain style you show plain, and not hypotheses, more instructive give your explanation after it. – daleif May 17 '17 at 19:03