4

enter image description here

I want to move my source outside the box, so that it is next to the equation number.

\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}
0

You just need \boxed together with 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}

enter image description here

0

It is not very clear how you like that citation appear (actually, this is unusual request, you should reformulate your text and citation have inside it). Se if one of the following solution is close to what you after for:

enter image description here

\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}

Off-topic: Package empheq load mathtools, mathtools load amsmath ...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.