# Center all same theorem

I would like to know if it's possible right from the definition of a theorem to center it :

\begin{center}
\begin{minipage}{5cm}
{

{
\theoremstyle{plain}
\theorembodyfont{\small}
\theoremsymbol{C.Q.F.D.}
\newtheorem*{dem}{Démonstration}
}

}
\end{minipage}
\end{center}


The code produces this :

My goal is to have all same type of theorem to be centered. Like this :

• Not using your setup. Instead one could tie into \begin{dem} and \end{dem} (via something like etoolbox). However, could you supply the community with a minimal working example (MWE) that they can work with? It should show the current output as well as your expected output, rather than just code snippets. – Werner Aug 11 '14 at 17:16
• Sure I will do it. But the fact is that I've seen this effect on a book (written with LaTeX for sure) and I don't really know how to reproduce it. – Le Duc Banal Aug 11 '14 at 17:29
• For the community's use, wrap the whole thing in a center environment and see what the output looks like. If it works for you, then that could be automated. If it doesn't, explain what should be different and perhaps include a screen shot (picture of some kind) of what it should look like. – Werner Aug 11 '14 at 17:30
• I added the result of the posted code to explain myself. – Le Duc Banal Aug 11 '14 at 17:44
• Do you only want indentation on the left? This can be done with \theoremindent <dimension> before \newtheorem*. Notice the lack of curly braces. – René B. Christensen Aug 11 '14 at 18:07

You can use etoolbox to tie into the \begin{dem} and \end{dem} components of your theorem:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{ntheorem,etoolbox,changepage,lipsum}

\theoremstyle{plain}
\theorembodyfont{\small}
\theoremsymbol{C.Q.F.D.}
\newtheorem*{dem}{Démonstration}
% Center theorem with respect to text block (2em indent on both sides)

adjustwidth from changepage is a list-like environment which is used to indent from either side and allows for breaking across the page boundary. You can adjust the 2em measure to suit your needs.