[Tex/LaTex] Long equation with left and right justified

equationshorizontal alignment

Good day to all,

I have below equation, the first equation exceeds my margin if written in one line. So I want it appear in two lines which the first line is justified at the left side and the second line is justified at the right. Is this is a good practice or I have to put it in other way, which is accepted by mathematician especially.

This is the output of my latex command

\documentclass{report}
\usepackage{amssymb,amsmath}

\begin{document}

\begin{eqnarray}\nonumber
\mathbf{c}_m^t(b_0\mathbf{I}_m +b_{1}\mathbf{Q}_{m}+b_{2}\mathbf{Q}^2_{m}+\cdots +b_n \mathbf{Q}_m^n)\mathbf{H}_m=&\\ \label{panjang}
=\mathbf{eQ}_m^{\alpha}(a_0 \mathbf{I}_m^{}+a_1\mathbf{Q}_m+a_2\mathbf{Q}_m^{2}+\cdots+a_n\mathbf{Q}_m^{n})\mathbf{H}_m
\end{eqnarray}
where \(\mathbf{e}=\begin{bmatrix}\sqrt{m} & 0 & \cdots & 0\end{bmatrix}\). Rewrite Eqn. \ref{panjang} with
\begin{eqnarray}g_1(\mathbf{Q}_{m})=a_0 \mathbf{I}_m+a_1\mathbf{Q}_m^{}+a_2\mathbf{Q}_m^{2}+\cdots+a_n\mathbf{Q}_m^{ n}\end{eqnarray} 
and 
\begin{eqnarray}
g_2(\mathbf{Q}_{m})=b_0\mathbf{I}_m +b_{1}\mathbf{Q}_{m}+b_{2}\mathbf{Q}^2_{m}+\cdots +b_n \mathbf{Q}_m^n\end{eqnarray} it becomes
\begin{eqnarray}
\mathbf{c}_m^t g_{2}(\mathbf{Q}_{m})&=&
\mathbf{e}\mathbf{Q}_m^\alpha g_1(\mathbf{Q}_{m}).
\end{eqnarray}

\end{document}

Best Answer

As mentioned for example in the UK TeX FAQ the use of eqnarray is discouraged.

To achieve the layout you want, you can use for example the multline environment from amsmath. What else can be done is described for example in the Short Math Guide for LaTeX. I would not put a = on the end of the first line. But otherwise I think your approach is the best way to go in this case.

Related Question