[Tex/LaTex] Format title for \chapter*{}

chaptersformattinghorizontal alignmenttitlesec

I have formatted Chapter titles using the package titlesec, but the formatting is unsuccessful in applying to my chapters with an asterisk *, (those chapters which I do not want appearing in my table of contents.)

That is, I would like to center and make \huge a title which corresponds to \chapter*{Some Title}.

For all my other chapters, I have successfully used:

 \titleformat{\chapter}[display]
{\normalfont\huge\bfseries}{\centering\chaptertitlename\ \thechapter}{20pt}{\huge}

How may I do this for \chapter*{}, using titlesec or otherwise?

This is under \documentclass{report}.

EDIT:

\documentclass[12pt]{report}

\usepackage{tocloft}
\usepackage{titlesec}

\begin{document}

\titleformat{\chapter}[display]
{\normalfont\huge\bfseries}{\centering\chaptertitlename\ \thechapter}{20pt}{\huge}

\tableofcontents{}

\addcontentsline{toc}{chapter}{Unnumbered Title}
\chapter*{Unnumbered Title}
I would like the title above centered

\chapter{Numbered Title}
...centered like this chapter heading above

\end{document}

Thank you!

Best Answer

You can have what you want with the numberless key. I'm not sure whether you want unnumbered chapters to be in the table of contents; the below code does it, but it's easy to undo it if you don't want. Just use:

\titleformat{\chapter}[display] {\normalfont\huge\bfseries\filcenter}{\chaptertitlename\ \thechapter}{20pt}{}
\titleformat{name=\chapter,numberless}[block] {\normalfont\huge\filcenter\bfseries}{}{0pt}{\huge}[\addcontentsline{toc}{chapter}{\chaptertitle}]