Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

When I enclose text with line breaks within a center environment, there is extra space after the first line, but only if the font size has been changed.

The following working example prints the same block of text with line breaks four times, covering all combinations of whether the center environment \Large are used. Only when both center and \Large are used does it produce incorrect line spacing:

\documentclass{article}

\begin{document}

\newcommand{\mytext}{First Line \\ Second Line \\ Third Line \\}

First Line \\ Second Line \\ Third Line

{\Large First Line \\ Second Line \\ Third Line}

\begin{center} 
  First Line \\ Second Line \\ Third Line

  {\Large First Line \\ Second Line \\ Third Line}
\end{center}

\end{document}

Any thoughts on what's going on to produce this unexpected behavior?

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

Whenever you have a font size change, ensure that the end of paragraph (\par or a blank line or the end of a display environment) is in the scope of the larger font. Tex uses the settings at the end of the paragraph for the whole paragraph, so you have larger text set on a normalsize baseline. the definition of \\ used in center uses \par internally so in fact you get large (correct) spacing for all but the last line in that case. the markup should be:

\documentclass{article}

\begin{document}

\newcommand{\mytext}{First Line \\ Second Line \\ Third Line \\}

First Line \\ Second Line \\ Third Line

{\Large First Line \\ Second Line \\ Third Line\par}

\begin{center} 
  First Line \\ Second Line \\ Third Line

  \Large First Line \\ Second Line \\ Third Line
\end{center}

\end{document}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.