# Why \\ increases interline spacing before the command in center environment?

This is about the effect of the line breaking command "\\" in center environment. It appears that the command has the effect of increasing the interline spacing of text appearing before the command. The outputs of the following inputs illustrate this. The codes in Examples 3 and 4 produce the same output with a bigger interline spacing when compared to the output of Example 1.

Why is it so?

Example 1

\begin{center}
{\huge\bf Lapped biorthogonal transform  based  low complexity
image compression algorithm  for wireless sensor network }
\end{center}


Example 2

\begin{center}
{\huge\bf Lapped biorthogonal transform\\  based  low complexity
image\\ compression algorithm  for\\ wireless sensor network }
\end{center}


Example 3

\begin{center}
{\huge\bf Lapped biorthogonal transform \\  based  low complexity
image\\ compression algorithm  for\\  wireless sensor network \\ }
\end{center}


Example 4

\begin{center}
{\huge\bf Lapped biorthogonal transform  based  low complexity
image compression algorithm  for wireless sensor  network \\ }
\end{center}


I don't know whether this problem has been posed earlier. Much thanks in advance.

• You should end the paragraph before closing the groups. – Gonzalo Medina Jul 13 '13 at 13:56

## 2 Answers

It's not as you are thinking: \\ doesn't increase the distance; rather, its absence reduces it. Let's see why.

A command such as \huge doesn't only change the type size, but also the ‘baselineskip’, that is, the distance from the current baseline (the imaginary line where characters sit) to the preceding one.

However, when TeX typesets a paragraph, it uses only one value of the \baselineskip parameter, the one which is current when the paragraph ends.

• Example 1
The only end-of-paragraph command is issued by \end{center}, which is scanned after the brace } that also ends the scope of the \huge command; thus, in this case, the \baselineskip relative to the normal size is used. However, TeX has a mechanism so that lines do not overlap and you get the effect of too near lines.

• Example 2
It's almost the same: the last line is very near to the preceding one because the end-of-paragraph again happens after }. The first three lines are correctly spaced because in the center environment a \\ command issues an end-of-paragraph command.

• Example 3 This is the correct one, because the last \\ ends the paragraph before the } is scanned. The subsequent end-of-paragraph issued by \end{center} does nothing.

• Example 4
This is similar to the previous one, only you are letting TeX to decide where doing the line breaks.

What's the correct way? Here it is; either

\begin{center}
\huge\bfseries Lapped biorthogonal transform \\  based  low complexity
image\\ compression algorithm  for\\  wireless sensor network
\end{center}


or

\begin{center}
\huge\bfseries Lapped biorthogonal transform  based  low complexity
image compression algorithm  for wireless sensor  network
\end{center}


without the braces and the final \\. Choose one or the other depending on whether you want to decide the line breaks or not.

Note that the \huge declaration is switched off when \end{center} is processed, so the rest of the document will revert to normal size.

Note also that \bf is a deprecated command and \bfseries is to be preferred in this situation. For a single boldface word, use \textbf{word} rather than the oldstyle {\bf word}.

• Thanks a lot for the very detailed explanation. Thanks again for all the time you spent answering my question. Thanks. – user33607 Jul 13 '13 at 17:51

this is the expected behavior.

you have wrapped the text in a group without ending the paragraph, so the baselines applied are those for the surrounding environment. one double blackslash has no effect on this setting, but when the text is broken this way multiple times, all but the last force resolution of the baseline of the previous segment.

in this case, since the text is surrounded by the group formed by the \begin{...} ... \end{...} construction, all you really need to do is this:

\begin{center}
\huge\bfseries Lapped biorthogonal transform  based  low complexity
image compression algorithm  for wireless sensor  network
\end{center}


just remove the extra braces, and the baselines will be appropriate for \huge within the centered group. the normal situation will revert after \end{center}.

notice that i've replaced \bf by \bfseries. \bf is obsolete; it should be replaced by \textbf{...} or {\bfseries ...} as appropriate.