Your document class (which we don't know) may provide easy ways to customize sectioning headings. In my example, I use the standard book
class and the titlesec package to change the properties of headings.
Notes: Instead of a fixed font size of 12pt, I've use the command \large
which will produce a size of 12pt given the default standard size of book
(10pt). Should you insist on a fixed size, I've added a \sizetwelvefixed
command (to be used instead of \large
). You also didn't specify if "normal" text should also by typeset in Times; in my example, Latin Modern is used for normal text and Times only for chapter headings.
\documentclass{book}
\usepackage{mathptmx}
\usepackage{lmodern}
\newcommand{\sizetwelvefixed}{\fontsize{12}{14.4}\selectfont}
\usepackage{titlesec}
% \titleformat{\chapter}[display]% OLD
% {\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}% OLD
% \titlespacing*{\chapter}{0pt}{50pt}{40pt}% OLD
\titleformat{\chapter}[display]% NEW
{\fontfamily{ptm}\large\bfseries\centering}{\chaptertitlename\ \thechapter}{5pt}{\large}% NEW
\titlespacing*{\chapter}{0pt}{30pt}{20pt}% NEW
\begin{document}
\chapter{Introduction}
Some text.
\end{document}
You need to do two things:
- Stop LaTeX from going to a new page; and
- Remove the initial (default) 50pt gap inserted before setting the chapter header.
The solutions to the above are (in abbreviated form):
\let\clearpage\relax
\vspace*{\dimexpr-50\p@-\baselineskip}
\documentclass[a4paper,11pt,openany,oneside]{book}
\usepackage{titlesec}% http://ctan.org/pkg/titlesec
\begin{document}
\begingroup%
\makeatletter%
\let\clearpage\relax% Stop LaTeX from going to a new page; and
\vspace*{\fill}%
\vspace*{\dimexpr-50\p@-\baselineskip}% Remove the initial (default) 50pt gap (plus 1 line)
\chapter{example}
Some text here...
\vspace*{\fill}%
\endgroup
\end{document}
The redefinition of \clearpage
is localized using a group (\begingroup
...\endgroup
; {
...}
would also work).
A better approach would be to merely set the text without using \chapter
but using the chapter fonts:
\documentclass[a4paper,11pt,openany,oneside]{book}
\usepackage{titlesec}% http://ctan.org/pkg/titlesec
\begin{document}
\vspace*{\fill}
{\centering\huge\bfseries Dedication\par}
\bigskip
\noindent Some text here...
\vspace*{\fill}
\end{document}
This allows you more control over the placement. I've used \bigskip
to separate the "title" - Dedication - from the remainder of the text. You could use whatever.
Alternatively, a very common approach to front matter (including something like a dedication) is typically to use \chapter*
and not worry about vertical alignment.
Best Answer
works only for a single line. For two or more lines use
\parbox{\linewidth}{\centering ...}