I use a environment called loesung which I created by myself. Now I have a formula in that environment, but I want to have that formulas centered. Not left aligned, here is my code:
%http://tex.stackexchange.com/questions/69043/center-formula-in-self-created-environment
\documentclass{book}
\usepackage[ngerman]{babel}
%\usepackage{geometry}
%\geometry{left=4cm,right=3cm, top=2cm, bottom=2cm}
\usepackage{amsmath,amsthm}
\usepackage{mdframed}
\usepackage{xcolor}
\usepackage{hyperref}[2011/02/05]
\definecolor{cloesung}{rgb}{0.972,0.93725,0.85098}
\newtheoremstyle{mystyle2}
{\topsep}{\topsep}{}{}%
{\bfseries}{}{.5em}{}%
\newmdtheoremenv[hidealllines=true,
backgroundcolor=cloesung,skipabove=\topsep,
skipbelow=\topsep]{loesung}{L\"osung}
\begin{document}
\begin{loesung}\text{blafasel}\\
\begin{align*}
c &= a+b\\
\intertext{description} a+b \intertext{is ....}
d &= h+g
\end{align*}
\end{loesung}
\end{document}
So my problem is, that the formulas should be centered? How can I do this? I tried \centering and \begin{center} but it does not work?
Thanks a lot cya






Undefined control sequence. l.64 newmdtheoremenv. Also it has to be$a+b$instead of&a+b&. Usually equations should be centered by default and only left aligned ifamsmathgets the optionfleqn. – canaaerus Aug 27 '12 at 19:57xcolortwo times andcolor? For a good MWE there is no need for packages likebookmark,xcolorand so on. – Kurt Aug 27 '12 at 20:16\listfiles, process the exact example code you posted in your question, and then upload elsewhere the obtained.logfile; add a comment here providing the link to the.logfile so we can have a look at it. – Gonzalo Medina Aug 27 '12 at 20:39