# Centring a heading, including the numbering

I've got a problem that should be simple to fix. I'm using the fontspec to layout my chapter headings like so

%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode
\documentclass[oneside,a4paper,10pt]{book}
\usepackage{titlesec}
\usepackage[utf8x]{inputenc}
\usepackage{fontspec}
\titleformat{\chapter}[hang]
{\normalfont\fontsize{25}{30}\bfseries\centering \fontspec{Times New Roman}}}
{\chaptertitlename\ \thechapter:\space }{0pt}
{}[]
\begin{document}

\end{document}


and for the most part it works just as I want. There is however one slight issue, some of my chapter headings run onto two lines - that's fine. However instead of centring the the second line properly it's placed towards the right of the page.

I believe what it's doing is centring as though the page begins just after the "Chapter 1" part of the heading. Is there a way to tell it to center based on the whole page?

-
Welcome to TeX.sx! Please expand your code to a minimal working example (MWE), with a document class, (only!) all the necessary packages, etc. –  doncherry May 6 '12 at 13:35
All done. +charlimit –  Benjamin Confino May 6 '12 at 13:50
Thanks! Unfortunately, I can't help you with your problem, but I'm sure someone who can will come along soon. However, I do think you've got an erroneous brace in your code, sc. after Times New Roman; you only need two closing braces there. –  doncherry May 6 '12 at 13:57

I've succeeded with

\titleformat{\chapter}[hang]
{\normalfont\fontsize{25}{30}\bfseries\fontspec{Times New Roman}}
{}
{0pt}
{\centering\chaptertitlename\ \thechapter:\space}


However I wouldn't use \fontspec, but rather

\newfontfamily{\timesnr}[Ligatures=TeX]{Times New Roman}


and \timesnr instead of \fontspec{Times New Roman}

Never use the inputenc package with XeLaTeX.

-
That did it, thank you :) –  Benjamin Confino May 6 '12 at 14:07