In my Latex-file there is the following part for defining new environments for theorem, lemma and so on:

enter image description here

Unfortunately, this produces some mistakes. When I write a new theorem, lemma etc. then the beginning is not correct as you may see here: The first letter of the first word is not shown correctly.

I am no expert in Latex and do not see how to change my code to delete this error. Can you please help me?

enter image description here

  • 3
    Please do not add code in an image, that is not copyable for us to test it on our computers. Please add an compilable code, minimalised to show only your probem (called MWE, minimal working example). Welcome to the side!
    – Mensch
    Oct 23, 2015 at 20:01
  • 1
    Welcome to TeX.SX! It's not clear what those definitions are supposed to do. But they're very wrong, in my opinion. A sample of how you call them is needed. Why not using \newtheorem?
    – egreg
    Oct 23, 2015 at 20:04
  • I assume you are doing something like \begin{theorem}Content of theorem.\end{theorem}. In that case, C is treated as the mandatory argument and ontent of theorem. is treated as the body. The way you've defined the environment, it takes one optional and one required argument. So the syntax is \begin{theorem}[<optional>]{<required>}<contents>\end{theorem}. But, as @egreg says, this is not a good way to do it in any case.
    – cfr
    Oct 23, 2015 at 20:19
  • 1
    I suspect you're calling \begin{theorem}[Theorem 1] Let ...\end{theorem}, but it should be \begin{theorem}{1} Let ...\end{theorem}
    – egreg
    Oct 23, 2015 at 20:20
  • My answer here introduces \(provide/re)newcommand(*), \(provide/re)newenvironment(*) etc. It may be helpful.
    – cfr
    Oct 23, 2015 at 20:21

1 Answer 1


By what I can see from the picture, the expected call of the environments you define is of the form

Let $\mathscr{H}$ be a Hilbert space ...

and your output seems instead the result of

\begin{theorem}[Theorem 1]
Let $\mathscr{H}$ be a Hilbert space ...

which is wrong. Use the former syntax.


I have doubts about your way of using LaTeX. Given those definitions, just one new environment suffices. You can call

Let $\mathscr{H}$ be a Hilbert space ...

In the situation of ...

and the output would be exactly the same, without the need for six almost identical definitions.

However, this is against the spirit of LaTeX, where manual numbering can and should be avoided. For theorem-like statements, LaTeX provides \newtheorem, which is improved by loading the amsthm package.


\theoremstyle{definition} % body font upright


Let $\mathscr{H}$ be a Hilbert space and $\mathscr{M}$ a closed
subspace of~$\mathscr{H}$. Moreover, let $x\in\mathscr{H}$. Then
there is a unique element $\hat{x}\in\mathscr{M}$ such that
\lVert x-\hat{x}\rVert = \inf_{y\in\mathscr{M}}\lVert x-y\rVert.
Additionally, $\hat{x}\in\mathscr{M}$ and \eqref{eq:projection}~iff
$\hat{x}\in\mathscr{M}$ and $(x-\hat{x}\in\mathscr{M}^{\perp}$.

See \cite[p.~51]{BD91}.

In the situation of Theorem~\ref{thm:projection}, let $\mathcal{I}$
denote the identity map on $\mathscr{H}$. Then there is a unique map
$P_{\mathscr{M}}$ of $\mathscr{H}$ onto $\mathscr{M}$ such that
$\mathcal{I}-P_{\mathscr{M}}$ maps $\mathscr{H}$ onto $\mathscr{M}^{\perp}$.


\bibitem[BD91]{BD91} Whatever



enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .