How do I center the contents of each cell in the middle column? I am approximating it with \phantom
, but there's got to be a better way.
\begin{alignat*}{3}
&E&\quad&\mathrm{par}&&\quad\Sigma,\\
&\Psi&\quad&\phantom{p}\mathrm{"}\phantom{r}&&\quad\frac{\epsilon V}{1+4\pi\epsilon F},\\
&\Psi&\quad&\phantom{p}\mathrm{"}\phantom{r}&&\quad\frac{(1+4\pi\epsilon F)^2}{\epsilon}.
\end{alignat*}
thanks
Best Answer
At its heart the
alignat
environment is built on TeX's\halign
. In that environment you can ignore the formatting specifications for a given column by issuing\omit
. Thus writingwill give you a centered column of text, since the column specification not only included the left/right alignment but also that the meterial is set as mathematics. It is probably best to create a separate command to provide this construction, which may then be used anywhere in an
alignat
,align
or similar enviroment, at the beginning of a cell:Sould you wish to span multiple columns the relevant command is
\multispan
, e.g.\multispan{3}\hfill text \hfill
will place text spread over three columns and centered.Alternatively, as Harish Kumar suggests you can use
array
ortabular
:However, the default line spacing from
alignat
is better and you don't need to worry about adjusting the math styles.