1
\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

0

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

2

You can see a simple example I made to make the Chapter label being UPPERCASE.

\documentclass{book}
\usepackage{titlesec}
\titleformat{\chapter}
   [display] %possible values are hang, leftmargin, drop, etc.
   {\Huge} % format to be applied to the whole title
   {\MakeUppercase{\chaptertitlename} \thechapter} %label setting
   {0pt} %horizontal separation between label and title body
   {\MakeUppercase} %code preceding the title body
\renewcommand{\chaptername}{BAB} %to change "chapter" into "bab"
\begin{document}
   \chapter{Preface}
   \section{Introduction}
   \section{Preliminary}
\end{document}

All I said is in titlesec package documentation. Go here for other explanation about formatting title.

0

Please place \renewcommand{\chaptername} after \begin{document}

\documentclass[12pt, a4paper]{report}
\usepackage[left=3cm,top=3cm,right=2cm,bottom=2cm,bindingoffset=0.5cm]{geometry}
\usepackage{lipsum}
\usepackage{sectsty}
\usepackage{titlesec}
\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
}
\begin{document}
\makeatletter
\renewcommand{\chaptername}{BAB}
\def\@makechapterhead#1{%
  %%%%\vspace*{50\p@}% %%% removed!
  {\parindent \z@ \centering \normalfont
    \ifnum \c@secnumdepth >\m@ne
        \Large\bfseries \chaptername\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

\chapter{Test}

Trial

\end{document}
  • I've tried your setup I think the problem from using babel into my language. – aqb May 27 '17 at 7:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.