[Tex/LaTex] How to change Chapter title case to CHAPTER

capitalizationsectioningtexpad

\documentclass[12pt, a4paper]{report}
\usepackage[left=3cm,top=3cm,right=2cm,bottom=2cm,bindingoffset=0.5cm]{geometry}
\usepackage{lipsum}
\usepackage{sectsty}
\usepackage{titlesec}
\renewcommand{\chaptername}{BAB}
\titleformat{\section}
  {\normalfont\fontsize{16}{16}\bfseries}{\thesection}{1em}{}

\usepackage[utf8]{inputenc}
\usepackage[bahasai,english]{babel}
\usepackage{showframe}% http://ctan.org/pkg/showframe
\usepackage{graphicx}
\usepackage[colorinlistoftodos]{todonotes}
\usepackage[linktocpage]{hyperref}
\hypersetup{
    colorlinks,
    citecolor=black,
    filecolor=black,
    linkcolor=black,
    urlcolor=black
}
\makeatletter
\def\@makechapterhead#1{%
  %%%%\vspace*{50\p@}% %%% removed!
  {\parindent \z@ \centering \normalfont
    \ifnum \c@secnumdepth >\m@ne
        \Large\bfseries \@chapapp\space \thechapter
        \par\nobreak
        \vskip 0\p@
    \fi
    \interlinepenalty\@M
    \LARGE \bfseries #1\par\nobreak
    \vskip 30\p@
  }}
\def\@makeschapterhead#1{%
  %%%%%\vspace*{50\p@}% %%% removed!
  {\parindent \z@ \centering
    \normalfont
    \interlinepenalty\@M
    \LARGE \bfseries  #1\par\nobreak
    \vskip 30\p@
  }}
\makeatother

I've tried with \renewcommand{\chaptername}{BAB} it doesn't changed (BAB is indonesian word for chapter). Thank you

Best Answer

If the main language in the document is Indonesian, you should load babel as

\usepackage[english,bahasai]{babel}

This will use “Bab” instead of “Chapter”. Now the problem is typesetting the name in uppercase letters: use \MakeUppercase{\@chapapp} in the redefined code for \@makechapterhead.

\documentclass[12pt, a4paper]{report}
\usepackage[
  left=3cm,
  top=3cm,
  right=2cm,
  bottom=2cm,
  bindingoffset=0.5cm
]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[english,bahasai]{babel} % <---- main language last

\usepackage{lipsum}

\usepackage{titlesec}

\titleformat{\section}
  {\normalfont\fontsize{16}{16}\bfseries}
  {\thesection}
  {1em}
  {}

\usepackage{graphicx}
\usepackage[colorinlistoftodos]{todonotes}
\usepackage[linktocpage]{hyperref}
\hypersetup{
    colorlinks,
    citecolor=black,
    filecolor=black,
    linkcolor=black,
    urlcolor=black
}
\makeatletter
\def\@makechapterhead#1{%
  %%%%\vspace*{50\p@}% %%% removed!
  {\parindent \z@ \centering \normalfont
    \ifnum \c@secnumdepth >\m@ne
        \Large\bfseries \MakeUppercase{\@chapapp}\space \thechapter % <--- uppercase
        \par\nobreak
        \vskip 0\p@
    \fi
    \interlinepenalty\@M
    \LARGE \bfseries #1\par\nobreak
    \vskip 30\p@
  }}
\def\@makeschapterhead#1{%
  %%%%%\vspace*{50\p@}% %%% removed!
  {\parindent \z@ \centering
    \normalfont
    \interlinepenalty\@M
    \LARGE \bfseries  #1\par\nobreak
    \vskip 30\p@
  }}
\makeatother

\begin{document}

\chapter{Test}

\end{document}

Don't load both sectsty and titlesec.

enter image description here