Title format and unnumbered sections

I'm writing a report that requires a particular style for titles as given by:

\titleformat{\chapter}{\fontsize{22pt}{0}}{}{0em}{\bf\LARGE\thechapter\\
~}


This shows up as intended below:

However, for my 'References' and 'Glossary' sections, a number shows up in the heading despite them being unnumbered.

\cleardoublepage
\phantomsection
\begin{thebibliography}{10}


Even a "test" chapter* has a number (also 7).

\chapter*{test}


Does anyone know how I might go about rectifying this?

• Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – Adam Liter Mar 17 '15 at 23:37

Your problem comes from the placement of the chapter label as the last argument of \titleformat. Here is a correct placement. Note the style you have to use is \display instead of the default hang:

\documentclass[12pt, a4paper]{book}%

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fourier}
\usepackage{lipsum}
\usepackage{titlesec}%

\titleformat{\chapter}[display]{\fontsize{22pt}{28pt}\bfseries}{\LARGE\thechapter}{1.5ex}{}

\usepackage{hyperref}

\begin{document}

\tableofcontents

\chapter{Introduction}

\lipsum[1]

\chapter*{Test}

\lipsum[2-3]

\cleardoublepage
\phantomsection
\begin{thebibliography}{10}
\end{thebibliography}

\end{document}


I discovered that posting this in the document before the needed section helped solve my problem:

\titleformat
{\chapter}
{\fontsize{22pt}{0}}
{}
{0em}
{\bf\LARGE}

• This is wrong syntax and will create problems for you later. \bf is a depreciated command its own problems. Use Bernhard's solution, which is the correct way doing this. – Sveinung Aug 30 at 14:42