0

I have the following problem: enter image description here I attempted to center it both vertically and horizontally, however the second line, as you can see, is not centered. For clarity, here is how I'd expect it to look (taken from Word): enter image description here I am aware that it is a different font, but that doesn't matter.

Any help to make the first Section Heading look like the second would be greatly appreciated!

To center it, I used the code from this answer

Here is the code (it is probably terrible, I just started using Latex):

\documentclass{article}
\usepackage{titlesec}
\usepackage{lmodern}

\titleformat{\section}{\fontfamily{lmr}\selectfont\fontsize{72pt}{86.4pt}\bfseries}{\thesection}{1em}{}

\begin{document}

\clearpage
\vspace*{\fill}
\begin{center}
\begin{minipage}{\textwidth}
\centering
\section*{Example Section}
\end{minipage}
\end{center}
\vfill
\clearpage
\end{document}

1 Answers1

2

enter image description here

All the formatting should be in the definition of \section not in the document.

\documentclass{article}
\usepackage{titlesec}
\usepackage{lmodern}

\newcommand\zzz[1]{%
\clearpage
\vspace*{\fill}
{\centering\fontfamily{lmr}\selectfont\fontsize{72pt}{86.4pt}\bfseries#1\par}
\vspace*{\fill}
\clearpage}

\titleformat{\section}{\zzz}{\thesection}{1em}{}

\begin{document}

\section*{Example Section}

zzz
\end{document}
David Carlisle
  • 757,742