[Tex/LaTex] Uppercase, bold and underlined chapter title

chapterstitlesec

I have my document like this (in main.tex):

% Document type: report (master/bachelor thesis)
\documentclass[a4paper,12pt,appendix]{report}

\input{template/FormatsAndDefs.tex} % here I have specified various format settings

\begin{document}
  \input{thesis.tex}
\end{document}

In FormatsAndDefs.tex I have specified format for chapter titles like this:

\usepackage[T1]{fontenc}
\usepackage{titlesec}
% various other packages

\titleformat{\chapter}
  {\normalfont\Large\bfseries}{\thechapter}{.5em}{\vspace{.5ex}}[\titlerule]
\titlespacing*{\chapter}      
    {0pt}{0pt}{15pt}

So my title chapters are formatted like this:
enter image description here

How can I make this chapter title "Introducion" in ALL UPPERCASE while keeping it bold and underlined?

I have tried to use \MakeUppercase :

\titleformat{\chapter}
  {\normalfont\LARGE\bfseries}{\MakeUppercase{\thechapter}}{.5em}{\vspace{.5ex}}[\titlerule]

but chapter remained still the same as shown in the picture.

Best Answer

You need to have a handle on the chapter title, and the only way to do this is to use the explicit option with titlesec:

enter image description here

\documentclass{report}

\usepackage[explicit]{titlesec}
\usepackage{lipsum}

\titleformat{\chapter}
  {\normalfont\Large\bfseries}{\thechapter \quad \MakeUppercase{#1}}{.5em}{\vspace{.5ex}}[\titlerule]
\titlespacing*{\chapter}
  {0pt}{0pt}{15pt}

\begin{document}

\chapter{Introduction}

\lipsum

\end{document}

This option allows you to explicitly state the sectional title as #1, where you can now wrap it within \MakeUppercase.

Related Question