1

I am using text with in aligned environment as

\begin{equation}
\begin{aligned}
\Vert \Vert^2_F&= tr\{()\}\\
 &=\Vert\Vert_F^2\\
\shortintertext{which after differentiation gives}
\mathbf{a}&=[] 
\end{aligned}
\end{equation}

Things are fine, but the equation number is not aligned in center but at the bottom right to last equality $\mathbf{a}&=[]$.

How to align equation number somewhere middle right of whole equation environment.?

1

It's not common to place an equation number next to a line of text. To achieve this look, you could (a) use an align* environment so that no equation numbers show up on math-mode lines, and (b) set up a helper macro, called \showeq in the example below, that serves to insert a formatted equation number at the end of the line that contains text.

\documentclass{article}
\usepackage{mathtools}
\newcommand\showeq{\hspace{\fill}\refstepcounter{equation}(\theequation)}
\begin{document}

\begin{align*}
\Vert \Vert^2_F&= tr\{()\} \\
               &= \Vert\Vert_F^2 \\
\shortintertext{which after differentiation gives\showeq}
    \mathbf{a} &= []
\end{align*}

\end{document}
  • Didn't worked. Equation number still at the bottom, while i want to place it to right of short text – Astro Oct 8 '15 at 7:01
  • 1
    @VinayakAbrol - Thanks for clarifying where the equation number should be shown. I'll revise my answer accordingly. – Mico Oct 8 '15 at 7:13

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.