0

i found related problems to this, See duplicate. but, when i tried to use this codes, this ruined my chapter fontsize like this: see picture

i have setting the fontsize of the chapter using \titleformat. So, i've changed the chapter fontsize to 12pt. And after using code from duplicate link, my fontsize was ruin and getting bigger.

This is my codes:

\documentclass[a4paper,12pt,oneside,openany]{book}
\usepackage[a4paper, inner=4cm, outer=3cm, top=4cm, bottom=3cm]{geometry}
\usepackage[onehalfspacing]{setspace}
\usepackage{fancyhdr}
\usepackage{titlesec}
\usepackage{setspace}
\usepackage{tocloft}
\fancyhf{}
\cfoot{\thepage}
\linespread{1.5}
\pagestyle{plain}
\renewcommand\cftchapdotsep{\cftdotsep}  %MY ATTEMPT HERE
\titleformat{\chapter}[display]
    {\bfseries\centering}
    {\chaptertitlename \thechapter}{12pt}{}
\titlespacing*{\chapter}{0pt}{10pt}{10pt}

\renewcommand{\contentsname}{DAFTAR ISI}
\renewcommand{\listtablename}{DAFTAR TABEL}
\renewcommand{\listfigurename}{DAFTAR GAMBAR}


\begin{document}
\clearpage
\thispagestyle{empty}

\frontmatter %

\pagestyle{fancy}   
\renewcommand{\headrulewidth}{0pt}
\include{cover1}
\include{cover2}
\linespread{1}
\tableofcontents %TABLE OF CONTENTS
\listoffigures
\listoftables
\mainmatter %

\end{document}

Btw, i'm using cmd: \chapter*{...} and \addcontentsline{toc}{chapter}. To create chapter title. Not shown on my code cz it includes on another file. I split my main file into some parts.

1 Answer 1

1

I'm not entirely sure what your problem is but perhaps using the titles option to tocloft solves it.

% chapterdotsprob.tex SE 555536

\documentclass[a4paper,12pt,oneside,openany]{book}
\usepackage[a4paper, inner=4cm, outer=3cm, top=4cm, bottom=3cm]{geometry}
\usepackage[onehalfspacing]{setspace}
\usepackage{fancyhdr}
\usepackage{titlesec}
\usepackage{setspace}
\usepackage[titles]{tocloft}
\fancyhf{}
\cfoot{\thepage}
\linespread{1.5}
\pagestyle{plain}
\renewcommand\cftchapdotsep{\cftdotsep}  %MY ATTEMPT HERE
\titleformat{\chapter}[display]
    {\bfseries\centering}
    {\chaptertitlename \thechapter}{12pt}{}
\titlespacing*{\chapter}{0pt}{10pt}{10pt}
%\renewcommand\cftchapdotsep{\cftdotsep}  %MY ATTEMPT HERE

\renewcommand{\contentsname}{DAFTAR ISI}
\renewcommand{\listtablename}{DAFTAR TABEL}
\renewcommand{\listfigurename}{DAFTAR GAMBAR}


\begin{document}
\clearpage
\thispagestyle{empty}

\frontmatter %

\pagestyle{fancy}   
\renewcommand{\headrulewidth}{0pt}
\include{cover1}
\include{cover2}
\linespread{1}
\tableofcontents %TABLE OF CONTENTS
\listoffigures
\listoftables
\mainmatter %

\chapter{One}
Some text
\chapter{Two}
More text.

\end{document}

The titles option makes the titles of the ToC, etc., look like those of the chapters in the document.

1
  • It works! Thank you very much for the help.
    – user516076
    Jul 29, 2020 at 21:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .