使用 \begin{empheq} 将源移到框外的框式公式

使用 \begin{empheq} 将源移到框外的框式公式

在此处输入图片描述

我想将源移到框外,以便它位于方程编号旁边。

\documentclass[a4paper,12pt,headsepline]{scrreprt} 
\usepackage{amsmath}   % Mathe 
\usepackage{mathtools} 
\usepackage{empheq} 

\bibliographystyle{unsrt}   % Zitierweise %quotestyle

\begin{document} 

\begin{empheq}[box=\fbox]{align} 
\rho\cdot \left(\dfrac{\partial w}{\partial t} + u\cdot \dfrac{\partial w}{\partial x} + v\cdot \dfrac{\partial w}{\partial y} + w\cdot \dfrac{\partial w}{\partial z}\right)  = 
A_{z}} - \dfrac{\partial p}{\partial z} + & \nonumber 
\\ 
\dfrac{\partial}{\partial x} \left[\mu \cdot \left(\dfrac{\partial w}{\partial x} + \dfrac{\partial u}{\partial z}\right)\right] + & \cite[S.25]{Quelle} 
\\ 
\dfrac{\partial}{\partial y} \left[\mu\cdot \left(\dfrac{\partial v}{\partial z} + \dfrac{\partial w}{\partial y}\right)\right] + \dfrac{\partial}{\partial z}\left[\mu\cdot \left( 2\cdot \dfrac{\partial w}{\partial z} - \dfrac{2}{3}\cdot (\nabla\cdot \overrightarrow{c})\right)\right] & \nonumber \label{eqn:Gleichung} 
\end{empheq} 

\end{document}

答案1

您只\boxed需要aligned

\documentclass[a4paper,12pt,headsepline]{scrreprt} 
\usepackage{amsmath}

\newcommand{\pd}[2]{\frac{\partial #1}{\partial #2}}

\begin{document} 

\begin{equation}\label{eqn:Gleichung} 
\boxed{
  \!\begin{aligned}
  &\rho\cdot \left(\pd{w}{t} + u\cdot \pd{w}{x} + v\cdot \pd{w}{y} + w\cdot \pd{w}{z}\right)
  \\
  &\quad= A_{z} - \pd{p}{z}
     + \pd{}{x}\left[\mu \cdot \left(\pd{w}{x} + \pd{u}{z}\right)\right]
     + \pd{}{y}\left[\mu\cdot \left(\pd{v}{z} + \pd{w}{y}\right)\right]
  \\
  &\qquad+ \pd{}{z}\left[\mu\cdot \left( 2\cdot \pd{w}{z} - 
                         \frac{2}{3}\cdot (\nabla\cdot \vec{c}\,)\right)
                   \right]
  \end{aligned}
}
\quad\cite[S.25]{Quelle} 
\end{equation}

% just to get a number instead of ??
\begin{thebibliography}{1}

\bibitem{Quelle} Some item

\end{thebibliography}

\end{document}

在此处输入图片描述

答案2

不太清楚您希望该引文如何出现(实际上,这是一个不寻常的要求,您应该重新表述您的文本和其中的引文)。看看以下解决方案是否接近您想要的:

在此处输入图片描述

\documentclass[a4paper,12pt,headsepline]{scrreprt}
\usepackage{empheq}

\begin{document}
    \begin{empheq}[box=\fbox]{align}
    \MoveEqLeft
\rho\cdot \left(\dfrac{\partial w}{\partial t} 
    + u\cdot \dfrac{\partial w}{\partial x} 
    + v\cdot \dfrac{\partial w}{\partial y} 
    + w\cdot \dfrac{\partial w}{\partial z}\right)
                    \tag{\cite[S.25]{Quelle}}   \\  
        & = \begin{multlined}[t]A_{z} - \dfrac{\partial p}{\partial z} 
    +  \dfrac{\partial}{\partial x}\left[\mu \cdot \left(\dfrac{\partial w}{\partial x} 
    + \dfrac{\partial u}{\partial z}\right)\right]  \\ 
    + \dfrac{\partial}{\partial y} \left[\mu\cdot \left(\dfrac{\partial v}{\partial z} 
    + \dfrac{\partial w}{\partial y}\right)\right]  
    + \dfrac{\partial}{\partial z}\left[\mu\cdot \left( 2\cdot \dfrac{\partial w}{\partial z} - \dfrac{2}{3}\cdot (\nabla\cdot \overrightarrow{c})\right)\right]
            \end{multlined} 
                    \label{eqn:Gleichung}
\end{empheq}

\begin{empheq}[box=\fbox]{align}
    \refstepcounter{equation}
    \MoveEqLeft
\rho\cdot \left(\dfrac{\partial w}{\partial t}
    + u\cdot \dfrac{\partial w}{\partial x}
    + v\cdot \dfrac{\partial w}{\partial y}
    + w\cdot \dfrac{\partial w}{\partial z}\right)
                        \notag    \\
    = A_{z} 
    & - \dfrac{\partial p}{\partial z}
      +  \dfrac{\partial}{\partial x}\left[\mu \cdot \left(\dfrac{\partial w}{\partial x}
      + \dfrac{\partial u}{\partial z}\right)\right]  
                        \tag{\cite[S.25]{Quelle})\quad(\theequation}\\
    & + \dfrac{\partial}{\partial y} \left[\mu\cdot \left(\dfrac{\partial v}{\partial z}
      + \dfrac{\partial w}{\partial y}\right)\right]
                        \notag    \\
    & + \dfrac{\partial}{\partial z}\left[\mu\cdot \left(2\cdot \dfrac{\partial w}{\partial z} - \dfrac{2}{3}\cdot (\nabla\cdot \overrightarrow{c})\right)\right]
                        \label{eqn:Gleichung}
                        \notag
    \end{empheq}
\end{document}

无关: 包裹empheq加载mathtoolsmathtools加载amsmath...

相关内容