构建方程和方程数组(框起来)

构建方程和方程数组(框起来)

我想将方程式和方程式数组整齐地放在一个框或框架内。我还喜欢在align环境中对齐对象,例如在eqnarray环境 [r|c|l] 中,请参见下面的示例。

工作示例:

\documentclass{article}[A4]
\usepackage{amsmath,amssymb}

\newenvironment{bbox}
{\par\smallskip\centering\begin{lrbox}{0}%
\begin{minipage}[c]{0.99\textwidth}}
{\end{minipage}\end{lrbox}%
\framebox[0.99\textwidth]{\usebox{0}}%
\par\medskip
\ignorespacesafterend}

\begin{document}

\title{Box test}

I want to box equations. For a simple equation:
\begin{equation} \label{1}
\boxed{ 1 + 2 = \pi - 0.14 \quad  \implies \quad \pi \in \mathbb{Q}  }
\end{equation}
Eqnarray:
\begin{eqnarray}
1 + 2 = \pi - 0.14  & \implies & \pi \in \mathbb{Q} 
\end{eqnarray}
Align:
\begin{align}
1 + 2 = \pi - 0.14  & \implies & \pi \in \mathbb{Q} 
\end{align}
I want the \texttt{align} to be aligned like \texttt{eqnarray}, how to do that?

For align and eqnarray the \texttt{boxed} won't work,
\begin{verbatim}
\begin{align}
\boxed{ 1 + 2 = \pi - 0.14  & \implies & \pi \in \mathbb{Q} }
\end{align}
\end{verbatim}
Using the environment ``bbox'' it seems to work but has some space in the top so it looks a little bit ugly:
\begin{bbox}
\begin{align}
 1 + 2 = \pi - 0.14  & \implies & \pi \in \mathbb{Q} 
\end{align}
\end{bbox}
I want it to look like equation \eqref{1}

How to do that?

结果: 此 LaTeX 代码的结果

编辑:那么多线方程呢?

Multiline:
\begin{align}
\Aboxed{ 1 + 2 = \pi - 0.14   \implies & \pi \in \mathbb{Q}  \\
3 \ne \pi \implies & \pi \in \mathbb{R} } 
\end{align}

也可以看看: 使用框架框在 eqnarray 之外创建环境

相关内容