12

I am trying to center this page but it will not work. All is get is for the first line to be indented about one "tab" space to the right, but the second line will not shift. However, the first line's indent does not appear to be centered either. Is it possible that the binding offset or the indentfirst package is interacting with this negatively? All of the other pages seem to work just fine. Any help would be appreciated.

\documentclass[12pt, a4paper, twoside]{article}
\usepackage[margin=1in,bindingoffset=15.5mm,heightrounded]{geometry}
\usepackage[T1]{fontenc}
\usepackage{indentfirst}
\begin{document}
\pagestyle{empty}
\vspace*{36 pt}
{\centering
\textbf{\emph{\Huge{Since I Saw You Last,\\There's a Change Upon You}}}
}
\end{document}
1

3 Answers 3

16
\documentclass[12pt, a4paper, twoside]{article}
\usepackage[margin=1in,bindingoffset=15.5mm,heightrounded]{geometry}
\usepackage[T1]{fontenc}
\usepackage{indentfirst}
\begin{document}
\pagestyle{empty}
\vspace*{36 pt}
\begin{center}\Huge\bfseries\itshape
Since I Saw You Last,\\There's a Change Upon You
\end{center}
\end{document}

Note that \centering and size change commands such as \Huge should always be used in a way that the end of paragraph is in scope of the command, otherwise you will get Huge text on a normal sized baseline, and inconsistent spacing. \Huge does not take an argument it is just \Huge not \Huge{.....}.

1
  • Note that underlining multiple lines of text with the "soul" package results in bad centering, too! I worked around this problem using soul's \ul{} on every line separately.
    – Martin
    Commented Jul 29, 2020 at 16:55
18

You must end the paragraph before closing the group. I also suggest to use the switch variants of the font commands in this cases (less braces)

\documentclass[12pt, a4paper, twoside]{article}
\usepackage[margin=1in,bindingoffset=15.5mm,heightrounded]{geometry}
\usepackage[T1]{fontenc}
\usepackage{indentfirst}
\begin{document}
\pagestyle{empty}
\vspace*{36 pt}
{\centering\Huge\em\bfseries
  Since I Saw You Last,\\There's a Change Upon You\par
}
\end{document}
3
  • 1
    Compared to David's answer, this stays closer to the original in two respects: \em retains the semantic meaning of \emph{}, the actual formatting of which may be changed e.g. by the package ulem -- David's \itshape only usually has the same effect in the output, sc. \emph{}/\em is set in italics by default. Keeping the \centering switch doesn't add any additional space after the heading -- as David's center environment does.
    – doncherry
    Commented Jul 25, 2012 at 15:37
  • @doncherry True although those changes were intentional in my version. This is some kind of display quote definition so you want to set the font. The semantic of emphasis in any font distinguished from the current one would almost certainly be wrong. Similarly while it's true that center adds vertical space the thing to do is accept that and adjust the immediately preceding \vspace if necessary. (no criticism of this answer which answered the question as posed, just responding to your comment) Commented Jul 25, 2012 at 16:27
  • I had something like \newcommand{\heading}[1]{{\centering\textbf{#1}}}. "You must end the paragraph before closing the group." was the information I was missing. After adding `\\` it works. Commented Sep 23, 2013 at 19:36
8

Use the center environment, rather than the \centering declaration.

\documentclass[12pt, a4paper, twoside]{article}
\usepackage[margin=1in,bindingoffset=15.5mm,heightrounded]{geometry}
\usepackage[T1]{fontenc}
\usepackage{indentfirst}
\begin{document}
\pagestyle{empty}
\vspace*{36 pt}
\begin{center}
\textbf{\emph{\Huge Since I Saw You Last,\\ There's a Change Upon You}}
\end{center}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .