Saturday, November 26, 2022

Center Chapter in Latex

 \documentclass[12pt,letterpaper,twoside]{book}
%------------------------------------------------------------------ 
%agar chapter ada di center
\usepackage{titlesec}
\titleformat{\chapter}[display]
  {\normalfont\huge\bfseries\centering}{\centering\chaptertitlename\ \thechapter}{20pt}{\Huge}
\titlespacing*{\chapter} {0pt}{50pt}{40pt}
%------------------------------------------------------------------ 

\ begin{document}
\tableofcontents
\addcontentsline{toc}{chapter}{Chap 1.}
\chapter*{CHAP 1}
\chapter{CHAP 2}
\appendix
\chapter{Test appendix}
\ end{document}


No comments :

Post a Comment