[Tex/LaTex] Left align three columns in Latex

align

I have an equation in multiple lines. I want to left-align the equations in three columns. How can I do this in Latex?

I am currently using

\begin{equation}
\begin{aligned}
&Column1& &Column2&  &Column3 \\
&Column1& &Column2&  &Column3 \\
&Column1& &Column2&  &Column3 \\
\end{equation} 
\end{aligned}

However, with the above expression the third column is right-aligned rather than being left aligned.

Here is an example:

\begin{equation}\label{formula:QPQC}
\begin{aligned}
&\underset{x}{\textbf{Maximize} }& &x^TFx+2f^Tx & & \\
&\textbf{Subject to} & &p_i^Tx+p_{i0}\geq 0 &i=1,\ldots,I \\
& & &v_m^Tx+v_{m0}=0 &m=1,\ldots,M \\
& & & x^TQ_zx+2q_z^Tx+q_{z0}=0 &z=1,\ldots,Z ,
\end{aligned}
\end{equation}

Best Answer

You are missing an & between the second and third column.

Here are some suggestions for avoiding the mistake and for improving the output:

  1. give && in pairs next to each other and keep the alignment in the input

  2. define macros for “Maximize” and “Subject to”

  3. use \dots instead of \ldots.

\documentclass{article}
\usepackage{amsmath}

\newcommand{\Maximize}[1]{\underset{#1}{\mathbf{Maximize}}}
\newcommand{\Subjto}{\mathbf{Subject\ to}}

\begin{document}

\begin{equation}\label{formula:QPQC}
\begin{aligned}
&\Maximize{x} && x^TFx+2f^Tx &            &&             \\
&\Subjto      && p_i^Tx+p_{i0}\geq 0      && i=1,\dots,I \\
&             && v_m^Tx+v_{m0}=0          && m=1,\dots,M \\
&             && x^TQ_zx+2q_z^Tx+q_{z0}=0 && z=1,\dots,Z,
\end{aligned}
\end{equation}

\end{document}

enter image description here