# First row of array is the first line

I want to code an array on which the first row would be the first line. I used the array environment.

Here is what I get but it's not what I want (the line is centered on the second row).

Here is my code

$\begin{array}{ll} C = \{ \, (\bar q(0),\bar q(T)) \, |\, &\theta_i(0) = \theta_i(T)\;\; i=1,2, \\ &x(0)=0,\, x(T) = x_T \mbox{ (fixed)},\\ &q^0(0)=0\, \}. \end{array}$

• Welcome to TeX SX! Write \begin{array}[t]{ll}. – Bernard Jul 25 '16 at 16:32

Some suggestions:

• Use \mid to denote the conditioning operation

• Suppress the intercolumn whitespace between the two columns of the array environment

• Load the amsmath package and use \text instead of \mbox

• Consider using slightly-enlarged curly braces and outer round parentheses, using \bigl and \bigr. If you choose to do so, you should also use \bigm| instead of \mid.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
$\begin{array}[t]{l@{}l} C = \bigl\{ \, \bigl(\bar{q}(0),\bar{q}(T)\bigr) \bigm| {} & \theta_i(0) = \theta_i(T), \quad i=1,2, \\ & x(0)=0, x(T) = x_T \text{ (fixed)},\\ & q^0(0)=0 \, \bigr\}. \end{array}$
\end{document}