1

Is it possible to center equations using align?

A simple example:

\documentclass{article}

\usepackage{amsmath}

\begin{document}
\begin{align*}
    &\text{a} = \frac{\text{x}}{\text{y}} \sim 1.5\times10^{-3} ,& \\
    &\text{b} = \frac{\text{y}}{\text{z}} \sim 1.5\times10^{-1} ,&\\
    &\text{c} = \frac{\text{z}}{\text{a}} \sim 1.5\times10^{-1} .&
\end{align*}
\end{document}

The equation length should not be relevant.

1
  • 1
    You can get the result you want by removing all the ampersands. But the gather environment might be better for your needs.
    – Andrey L.
    Commented Jul 5 at 12:57

1 Answer 1

4

You're adding a second pair of columns with the trailing &, which LaTeX reserves space for. Remove it.

I changed \text{a} and the similar constructs into a, because the traditional method for typesetting variables is using italic type. If you really want upright type it should be \mathrm{a}.

\documentclass{article}

\usepackage{amsmath}

\begin{document}

% this is just to show the center
\noindent\hspace*{\fill}\smash{\vrule depth 4cm height 0cm width 0.1pt}\hspace*{\fill}


\begin{align*}
a &= \frac{x}{y} \sim 1.5\times10^{-3} , \\
b &= \frac{y}{z} \sim 1.5\times10^{-1} , \\
c &= \frac{z}{a} \sim 1.5\times10^{-1} .
\end{align*}

\end{document}

In the code, the mysterious line is just to draw a rule in the center of the type box.

Note also the position of &, so that the different widths of the left-hand sides are compensated and the equals signs are aligned.

enter image description here

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .