# How can I justify without making a new line in mdframed?

 \begin{mdframed}[backgroundcolor=green]
\textbf{Theorem:}
\begin{center} A set $E$ is {\bf open} $\iff E^c$ is {\bf closed} \end{center}
\centerline{or equivalently,}
\centerline{A set $E$ is {\bf open} $\iff E^c$ is {\bf closed} }
\end{mdframed}


So basically I want to get Theorem to align on the same line as \begin{center} A set $E$ is {\bf open} $\iff E^c$ is {\bf closed} \end{center} without producing another new line. Adding flushleft inside the center environment has no effect.

-
you can easily use minipage inside mdframed environment – smh Dec 25 '12 at 1:08

Try using only center and then some box-control (via \phantom) for the first line:

\documentclass{article}
\usepackage{xcolor,mdframed}% http://ctan.org/pkg/{xcolor,mdframed}
\begin{document}
% Original layout/use
\begin{mdframed}[backgroundcolor=green]
\textbf{Theorem:}
\begin{center} A set $E$ is {\bf open} $\iff E^c$ is {\bf closed} \end{center}
\centerline{or equivalently,}
\centerline{A set $E$ is {\bf open} $\iff E^c$ is {\bf closed} }
\end{mdframed}

\bigskip

% Updated layout/use
\begin{mdframed}[backgroundcolor=green]
\begin{center}
\textbf{Theorem:} \hfill A set~$E$ is \textbf{open} $\iff E^c$ is \textbf{closed} \hfill \phantom{\textbf{Theorem:}} \\
or equivalently, \\
A set~$E$ is \textbf{open} $\iff E^c$ is \textbf{closed}
\end{center}
\end{mdframed}

\end{document}


The first line is set at full width using a displayed Theorem: on the left, and a \phantom Theorem: on the right.

-
Say I want to make some space in between each line (vertical space), how would I accomplish this? seperating the centers and adding \\ didn't work – Hawk Dec 25 '12 at 1:15
@jak: Use \\[<len>] where you specify <len>. For example, \\[\jot] inserts a 3pt gap, \\[\baselineskip] inserts a empty line. – Werner Dec 25 '12 at 4:46