5

I got an align-environment starting off with a sentence. After this introductory sentence I want to have the equations centered in the page, each equal-sign under each other. Following MEW:

\documentclass{article}

\usepackage{amsmath,bm}
\usepackage{mathtools}

\begin{document}

\begin{align} \label{eq:gen_alpha}
    \begin{aligned}
        \text{Given } \mathbf{d}_{n},\mathbf{v}_{n} \text{ and } \mathbf{a}_{n} \text{. Find } \mathbf{d}_{n+1},\mathbf{v}_{n+1}, \mathbf{a}_{n+1},\mathbf{d}_{n+\alpha_{f}},\mathbf{v}_{n+\alpha_{f}}, \mathbf{a}_{n+\alpha_{m}} \text {and } \bm{\Phi}_{n+1} \text{ so that:} \\  
        \mathbf{R}^{u}\left(\mathbf{d}_{n+\alpha_{f}},\mathbf{v}_{n+\alpha_{f}},\mathbf{a}_{n+\alpha_{m}},\mathbf{\Phi}_{n+1}\right) &= 0, \\
    \mathbf{R}^{c}\left(\mathbf{d}_{n+\alpha_{f}},\mathbf{\Phi}_{n+1}\right) &= 0, \\
        \mathbf{d}_{n+\alpha_{f}} &= \mathbf{d}_{n}+\alpha_{f}\left(\mathbf{d}_{n+1}-\mathbf{d}_{n}\right), \\      
        \mathbf{v}_{n+\alpha_{f}} &= \mathbf{v}_{n}+\alpha_{f}\left(\mathbf{v}_{n+1}-\mathbf{v}_{n}\right), \\
        \mathbf{a}_{n+\alpha_{m}} &= \mathbf{a}_{n}+\alpha_{m}\left(\mathbf{a}_{n+1}-\mathbf{a}_{n}\right), \\
        \mathbf{v}_{n+1} &= \mathbf{v}_{n}+\Delta t\left(\left(1-\gamma\right)\mathbf{a}_{n}+\gamma\mathbf{a}_{n+1}\right), \\  
        \mathbf{d}_{n+\alpha f} &= \mathbf{d}_{n}+\alpha_{f}\left(\mathbf{d}_{n+1}-\mathbf{d}_{n}\right).
    \end{aligned}
\end{align}

\end{document}

The text alignment is great, only all the equations should be centered.

Thanks for help :)

  • 1
    Welcome. Simply remove the first sentence from the align environment. Or enclose it within \intertext{sentence}. – Johannes_B Oct 31 '17 at 12:35
3

Remove the sentence from the aligned definition. Likewise, with only one numbered element, use equation instead of align.

\documentclass{article}

\usepackage{amsmath,bm}
\usepackage{mathtools}

\begin{document}

        Given $\mathbf{d}_{n}$, $\mathbf{v}_{n}$ and $\mathbf{a}_{n}$. Find $\mathbf{d}_{n+1}$, $\mathbf{v}_{n+1}$, $\mathbf{a}_{n+1}$, $\mathbf{d}_{n+\alpha_{f}}$, $\mathbf{v}_{n+\alpha_{f}}$, $\mathbf{a}_{n+\alpha_{m}}$ and $\bm{\Phi}_{n+1}$ so that:
\begin{equation} \label{eq:gen_alpha}
    \begin{aligned}  
        \mathbf{R}^{u}\left(\mathbf{d}_{n+\alpha_{f}},\mathbf{v}_{n+\alpha_{f}},\mathbf{a}_{n+\alpha_{m}},\mathbf{\Phi}_{n+1}\right) &= 0, \\
    \mathbf{R}^{c}\left(\mathbf{d}_{n+\alpha_{f}},\mathbf{\Phi}_{n+1}\right) &= 0, \\
        \mathbf{d}_{n+\alpha_{f}} &= \mathbf{d}_{n}+\alpha_{f}\left(\mathbf{d}_{n+1}-\mathbf{d}_{n}\right), \\      
        \mathbf{v}_{n+\alpha_{f}} &= \mathbf{v}_{n}+\alpha_{f}\left(\mathbf{v}_{n+1}-\mathbf{v}_{n}\right), \\
        \mathbf{a}_{n+\alpha_{m}} &= \mathbf{a}_{n}+\alpha_{m}\left(\mathbf{a}_{n+1}-\mathbf{a}_{n}\right), \\
        \mathbf{v}_{n+1} &= \mathbf{v}_{n}+\Delta t\left(\left(1-\gamma\right)\mathbf{a}_{n}+\gamma\mathbf{a}_{n+1}\right), \\  
        \mathbf{d}_{n+\alpha f} &= \mathbf{d}_{n}+\alpha_{f}\left(\mathbf{d}_{n+1}-\mathbf{d}_{n}\right).
    \end{aligned}
\end{equation}

\end{document}

enter image description here

2

This might be what you are looking for. gerdieAlign

\documentclass{article}

\usepackage{amsmath,bm}
\usepackage{mathtools}

\begin{document}

\begin{align*} \label{eq:gen_alpha}
        \intertext{Given  $\mathbf{d}_{n},\mathbf{v}_{n}$  and  $\mathbf{a}_{n}$. Find  $\mathbf{d}_{n+1},\mathbf{v}_{n+1}, \mathbf{a}_{n+1},\mathbf{d}_{n+\alpha_{f}},\mathbf{v}_{n+\alpha_{f}}, \mathbf{a}_{n+\alpha_{m}}$ and  $\bm{\Phi}_{n+1}$  so that:} 
        \mathbf{R}^{u}\left(\mathbf{d}_{n+\alpha_{f}},\mathbf{v}_{n+\alpha_{f}},\mathbf{a}_{n+\alpha_{m}},\mathbf{\Phi}_{n+1}\right) &= 0, \\
    \mathbf{R}^{c}\left(\mathbf{d}_{n+\alpha_{f}},\mathbf{\Phi}_{n+1}\right) &= 0, \\
        \mathbf{d}_{n+\alpha_{f}} &= \mathbf{d}_{n}+\alpha_{f}\left(\mathbf{d}_{n+1}-\mathbf{d}_{n}\right), \\      
        \mathbf{v}_{n+\alpha_{f}} &= \mathbf{v}_{n}+\alpha_{f}\left(\mathbf{v}_{n+1}-\mathbf{v}_{n}\right), \\
        \mathbf{a}_{n+\alpha_{m}} &= \mathbf{a}_{n}+\alpha_{m}\left(\mathbf{a}_{n+1}-\mathbf{a}_{n}\right), \\
        \mathbf{v}_{n+1} &= \mathbf{v}_{n}+\Delta t\left(\left(1-\gamma\right)\mathbf{a}_{n}+\gamma\mathbf{a}_{n+1}\right), \\  
        \mathbf{d}_{n+\alpha f} &= \mathbf{d}_{n}+\alpha_{f}\left(\mathbf{d}_{n+1}-\mathbf{d}_{n}\right).
\end{align*}

\end{document}
2

I'd not align the equality signs of the first two relations, because they're of a different kind and the display would be very unbalanced.

\documentclass{article}

\usepackage{amsmath,bm}
\usepackage{mathtools}

\newcommand{\bv}[1]{%
  \ifcat\noexpand#1\relax
    \bm{#1}%
  \else
    \mathbf{#1}%
  \fi
}

\begin{document}

Given $\bv{d}_{n}$, $\bv{v}_{n}$ and $\bv{a}_{n}$, find $\bv{d}_{n+1}$,
$\bv{v}_{n+1}$, $\bv{a}_{n+1}$, $\bv{d}_{n+\alpha_{f}}$, $\bv{v}_{n+\alpha_{f}}$,
$\bv{a}_{n+\alpha_{m}}$ and $\bv{\Phi}_{n+1}$ so that:
\begin{equation}\label{eq:gen_alpha}
\begin{aligned}
&\bv{R}^{u}(\bv{d}_{n+\alpha_{f}},\bv{v}_{n+\alpha_{f}},\bv{a}_{n+\alpha_{m}},\bv{\Phi}_{n+1})=0,\\
&\bv{R}^{c}(\bv{d}_{n+\alpha_{f}},\bv{\Phi}_{n+1}) = 0, \\
&\begin{aligned}
\bv{d}_{n+\alpha_{f}} &= \bv{d}_{n}+\alpha_{f}(\bv{d}_{n+1}-\bv{d}_{n}), \\
\bv{v}_{n+\alpha_{f}} &= \bv{v}_{n}+\alpha_{f}(\bv{v}_{n+1}-\bv{v}_{n}), \\
\bv{a}_{n+\alpha_{m}} &= \bv{a}_{n}+\alpha_{m}(\bv{a}_{n+1}-\bv{a}_{n}), \\
\bv{v}_{n+1} &= \bv{v}_{n}+\Delta t((1-\gamma)\bv{a}_{n}+\gamma\bv{a}_{n+1}), \\
\bv{d}_{n+\alpha f} &= \bv{d}_{n}+\alpha_{f}(\bv{d}_{n+1}-\bv{d}_{n}).
\end{aligned}
\end{aligned}
\end{equation}

\end{document}

enter image description here

Find a better name for \bv (the command expects the argument to be a single Latin letter or a single command for a Greek letter). I also removed all \left and \right that serve no purpose, other than introducing unwanted spaces.

Alternatively, center the first two and leave some vertical space after them.

\documentclass{article}

\usepackage{amsmath,bm}
\usepackage{mathtools}

\newcommand{\bv}[1]{%
  \ifcat\noexpand#1\relax
    \bm{#1}%
  \else
    \mathbf{#1}%
  \fi
}

\begin{document}

Given $\bv{d}_{n}$, $\bv{v}_{n}$ and $\bv{a}_{n}$, find $\bv{d}_{n+1}$,
$\bv{v}_{n+1}$, $\bv{a}_{n+1}$, $\bv{d}_{n+\alpha_{f}}$, $\bv{v}_{n+\alpha_{f}}$,
$\bv{a}_{n+\alpha_{m}}$ and $\bv{\Phi}_{n+1}$ so that:
\begin{equation}\label{eq:gen_alpha}
\begin{gathered}
\bv{R}^{u}(\bv{d}_{n+\alpha_{f}},\bv{v}_{n+\alpha_{f}},\bv{a}_{n+\alpha_{m}},\bv{\Phi}_{n+1})=0,\\
\bv{R}^{c}(\bv{d}_{n+\alpha_{f}},\bv{\Phi}_{n+1}) = 0, \\[1ex]
\begin{aligned}
\bv{d}_{n+\alpha_{f}} &= \bv{d}_{n}+\alpha_{f}(\bv{d}_{n+1}-\bv{d}_{n}), \\
\bv{v}_{n+\alpha_{f}} &= \bv{v}_{n}+\alpha_{f}(\bv{v}_{n+1}-\bv{v}_{n}), \\
\bv{a}_{n+\alpha_{m}} &= \bv{a}_{n}+\alpha_{m}(\bv{a}_{n+1}-\bv{a}_{n}), \\
\bv{v}_{n+1} &= \bv{v}_{n}+\Delta t((1-\gamma)\bv{a}_{n}+\gamma\bv{a}_{n+1}), \\
\bv{d}_{n+\alpha f} &= \bv{d}_{n}+\alpha_{f}(\bv{d}_{n+1}-\bv{d}_{n}).
\end{aligned}
\end{gathered}
\end{equation}

\end{document}

enter image description here

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.