# Does \\ in the last line of an array have any effect?

Consider the following example:

\begin{array}{l}
line 1 \\
line 2 \\
\end{array}


Is the \\ in the last line completely optional or are there circumstances under which it has any effect?

-
If you want to add a horizonal line at the bottom. You need the \\  there. If you don't want anything underneath then the \\  is superfluous and has no effect. –  Roelof Spijker Jan 16 '12 at 12:10

## 1 Answer

As @whlt3 said it is required if you intend to have a final horizontal line \hline or a partical line via \cline{...} or if you want to have some extra space blow that line produced via the optional argument of \\. If not then it is completely optional. I would however suggest to use \\ on all lines as that allows you to easily add or reorder rows in your table without the need to worry about the row markers.

However, as @egreg pointed out this is only true for tabular or array environments: within amsmath environments such as align the \\functions as a row separator so that a final \\will result in a spurious extra row.

-
While a final \\ is optional in array or tabular environments, it mustn't be used in environments such as align or gather, where it produces a spurious blank line. –  egreg Jan 16 '12 at 13:15
@egrep you are right, thanks. updated the answer accordingly –  Frank Mittelbach Jan 16 '12 at 13:31
Note that the @user notifications don't work inside question and answer posts, only in comments and in the chat. –  Martin Scharrer Jan 16 '12 at 13:57
@Martin will try to remember next time –  Frank Mittelbach Jan 16 '12 at 14:31