\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}
所以基本上我想Theorem
在同一行上对齐\begin{center} A set $E$ is {\bf open} $\iff E^c$ is {\bf closed} \end{center}
而不产生另一条新行。flushleft
在中心环境内添加没有效果。
答案1
尝试使用仅有的 center
然后\phantom
对第一行进行一些框控制(通过):
\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}
第一行设置为全宽,使用显示的定理:左边是\phantom
定理:在右侧。