我有几个公式太长,无法放入\textwidth
我的页面。这就是为什么我想用它们下面的结果公式来支撑它们。就像这样。
\documentclass{article}
\usepackage{amsmath}
\usepackage{mathtools}
\begin{document}
\begin{flalign*}
&\lefttext{\hspace{1cm}odd :} & \mathclap{\mathbf{Dark}\mathrm{[Bias]$-$}pix_\frac{n+1}{2}(x,y)} &&\\
&\lefttext{\hspace{1cm}even :} & \mathclap{\underbrace{ \dfrac{1}{2}\left(\mathbf{Dark}\mathrm{[Bias]}\text{-}pix_\frac{n}{2}(x,y) + \mathbf{Dark}\mathrm{[Bias]}\text{-}pix_{\frac{n}{2}+1}(x,y)\right)}_{= \text{Master-\textbf{Dark}[Bias]-}pix(x,y)}}
\end{flalign*}
\end{document}
我的问题如下两个。我怎样才能让下括号看起来不仅仅指向它下面的较长的括号?如果垂直空间稍微大一点,这样可能会更清楚。抱歉,每个\lefttext{}
方程式都有两个括号,有点复杂。其次,我怎样才能让结果行看起来像整个方程式的一部分,而不仅仅是某个方程式某个部分下的一小段文字解释?问题是它看起来不太像整个方程式。如果有人有另一种解决方案来呈现长方程式而不将它们分开,我也会很感激。
答案1
这里有一个解决方案,使用multline
,将您的方程式拆分为多行,并根据您的喜好与cases
或 结合使用:drcases
\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{multline*}
\text{Master-\textbf{Dark}[Bias]-}pix(x,y) \\
=
\begin{cases}
\mathbf{Dark}\mathrm{[Bias]}\text{-}pix_{\frac{n+1}{2}}(x,y) & \text{if $n$ is odd,} \\
\dfrac{1}{2}\left(\mathbf{Dark}\mathrm{[Bias]}\text{-}pix_{\frac{n}{2}}(x,y) + \mathbf{Dark}\mathrm{[Bias]}\text{-}pix_{\frac{n}{2}+1}(x,y)\right) & \text{if $n$ is even.} \\
\end{cases}
\end{multline*}
\begin{multline*}
\text{Master-\textbf{Dark}[Bias]-}pix(x,y) \\
=
\begin{cases}
\text{if $n$ is odd:} & \mathbf{Dark}\mathrm{[Bias]}\text{-}pix_\frac{n+1}{2}(x,y) \\
\text{if $n$ is even:} & \dfrac{1}{2}\left(\mathbf{Dark}\mathrm{[Bias]}\text{-}pix_{\frac{n}{2}}(x,y) + \mathbf{Dark}\mathrm{[Bias]}\text{-}pix_{\frac{n}{2}+1}(x,y)\right) \\
\end{cases}
\end{multline*}
\begin{multline*}
\begin{drcases}
\text{if $n$ is odd:} & \mathbf{Dark}\mathrm{[Bias]}\text{-}pix_{\frac{n+1}{2}}(x,y) \\
\text{if $n$ is even:} & \dfrac{1}{2}\left(\mathbf{Dark}\mathrm{[Bias]}\text{-}pix_{\frac{n}{2}}(x,y) + \mathbf{Dark}\mathrm{[Bias]}\text{-}pix_{\frac{n}{2}+1}(x,y)\right) \\
\end{drcases} \\
= \text{Master-\textbf{Dark}[Bias]-}pix(x,y)
\end{multline*}
\begin{multline*}
\begin{drcases}
\mathbf{Dark}\mathrm{[Bias]}\text{-}pix_{\frac{n+1}{2}}(x,y) & \text{if $n$ is odd,} \\
\dfrac{1}{2}\left(\mathbf{Dark}\mathrm{[Bias]}\text{-}pix_{\frac{n}{2}}(x,y) + \mathbf{Dark}\mathrm{[Bias]}\text{-}pix_{\frac{n}{2}+1}(x,y)\right) & \text{if $n$ is even.} \\
\end{drcases} \\
= \text{Master-\textbf{Dark}[Bias]-}pix(x,y)
\end{multline*}
\end{document}
或者使用缩写命令也一样:
\documentclass{article}
\usepackage{mathtools}
\newcommand\B{[\mathrm{Bias}]}
\newcommand\D{\mathbf{Dark}}
\begin{document}
\begin{multline*}
\text{Master-\textbf{Dark}[Bias]-}pix(x,y) \\
=
\begin{cases}
\D\B\text{-}pix_{\frac{n+1}{2}}(x,y) & \text{if $n$ is odd,} \\
\dfrac{1}{2}\left(\D\B\text{-}pix_{\frac{n}{2}}(x,y) + \D\B\text{-}pix_{\frac{n}{2}+1}(x,y)\right) & \text{if $n$ is even.} \\
\end{cases}
\end{multline*}
\begin{multline*}
\text{Master-\textbf{Dark}[Bias]-}pix(x,y) \\
=
\begin{cases}
\text{if $n$ is odd:} & \D\B\text{-}pix_{\frac{n+1}{2}}(x,y) \\
\text{if $n$ is even:} & \dfrac{1}{2}\left(\D\B\text{-}pix_{\frac{n}{2}}(x,y) + \D\B\text{-}pix_{\frac{n}{2}+1}(x,y)\right) \\
\end{cases}
\end{multline*}
\begin{multline*}
\begin{drcases}
\text{if $n$ is odd:} & \D\B\text{-}pix_{\frac{n+1}{2}}(x,y) \\
\text{if $n$ is even:} & \dfrac{1}{2}\left(\D\B\text{-}pix_{\frac{n}{2}}(x,y) + \D\B\text{-}pix_{\frac{n}{2}+1}(x,y)\right) \\
\end{drcases} \\
= \text{Master-\textbf{Dark}[Bias]-}pix(x,y)
\end{multline*}
\begin{multline*}
\begin{drcases}
\D\B\text{-}pix_{\frac{n+1}{2}}(x,y) & \text{if $n$ is odd,} \\
\dfrac{1}{2}\left(\D\B\text{-}pix_{\frac{n}{2}}(x,y) + \D\B\text{-}pix_{\frac{n}{2}+1}(x,y)\right) & \text{if $n$ is even.} \\
\end{drcases} \\
= \text{Master-\textbf{Dark}[Bias]-}pix(x,y)
\end{multline*}
\end{document}
编辑:至于您要求将公式居中并使用下括号:
用来\array
使某物居中。然后\underbrace
在整个数组下放置一个:
\documentclass{article}
\usepackage{MnSymbol}
\newcommand\B{[\mathrm{Bias}]}
\newcommand\D{\mathbf{Dark}}
\begin{document}
\begin{equation*}
\underbrace{
\begin{array}{rc}
\text{if $n$ is odd:} & \D\B\text{-}pix_{\frac{n+1}{2}}(x,y) \\
\text{if $n$ is even:} & \dfrac{1}{2}\left(\D\B\text{-}pix_{\frac{n}{2}}(x,y) + \D\B\text{-}pix_{\frac{n}{2}+1}(x,y)\right)
\end{array}
}_{= \text{Master-\textbf{Dark}[Bias]-}pix(x,y)}
\end{equation*}
\end{document}