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.
That number is set by \ChNumVar
and you use Zapf Chancery. Comment that line or choose one of the other font families:
\documentclass[french]{book}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{xcolor}
\usepackage[Sonny]{fncychap}
%-----------
\ChNameVar{\Huge\fontfamily{put}\selectfont\color{black}}% Utopia
\ChNumVar{\Huge\fontfamily{pzc}\selectfont\color{blue}}% Zapf
\ChTitleVar{\Huge\fontfamily{phv}\selectfont\scshape\color{green}}% Helvetica
\begin{document}
\chapter {Contexte}\noindent\Large
\fontfamily{put}\selectfont ABCDEFGHIabcdefghj0123456\\
\fontfamily{pzc}\selectfont ABCDEFGHIabcdefghj0123456\\
\fontfamily{phv}\selectfont ABCDEFGHIabcdefghj0123456\\
\end{document}
Best Answer
Use the macro
\chaptervc
to start your chapters. As you can see, it takes only one argument, just like the regular\chapter
command.It works by putting the original
\chapter
command output at vertical center, by using two\vfill
s, one before, one after. Then it uses a\clearpage
to get a new page, since you wanted to have your chapter title in an independent page. (Though a\newpage
should also be good here, since it is very unlikely to remain any unprocessed floats at this point.)