4

I recently have had the need to make a math array or a tabular expand to fill the page width.

The effect I am trying to achieve is that for one line on the page, half is aligned at the left, and the other at the right.

For instance, just now, the following has been giving be problems...

$$
\begin{array}{l r}    
  \phi_{CJ}^* = \Sum_{SV} \psi_{CSJV} = P(S) P(S|V,C,S,J) & \text{(no summation on S or V which are in evidence.)}    
\end{array}
$$

The desired effect is that the first cell is aligned on the left margin, and the second is aligned on the right margin. Instead, the array is centred, with no space between the cells.

Many thanks

lockstep
  • 250,273

2 Answers2

2

With the amsmath package, use the flalign or flalign* environment:

\begin{flalign*}
   \phi_{CJ}^* = \sum_{SV} \psi_{CSJV} = P(S) P(S|V,C,S,J) &&& \text{(no summation on S or V which are in evidence.)}    
\end{flalign*} 
Jan Hlavacek
  • 19,242
1

Since you only want a single line set this way, the following works:

\hbox to \textwidth{$\displaystyle \phi_{CJ}^* = \sum_{SV}
   \psi_{CSJV} = P(S) P(S|V,C,S,J)$ \hfill
   (no summation on $S$ or $V$ which are in evidence.)}

That is, set it as an hbox of length the width of the text, and put stretchable glue between the two expressions so that this is the part that gets stretch. The \displaystyle is to ensure that it is typeset as in a displayed equation rather than as an in-line equation.