Page LayoutHow to remove chapter/section/subsection name on the upper left corner

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
Shandy Verdyo
Posts: 5
Joined: Fri Jul 31, 2020 8:15 am

How to remove chapter/section/subsection name on the upper left corner

Post by Shandy Verdyo »

Hi, i'm new in LaTeX. I'm currently working on book-class onesided and using

Code: Select all

\frontmatter
and

Code: Select all

\mainmatter
.

I want:
  • my frontmatter part (preface, ToC, LoT, LoF) has roman numeral on the bottom center

    My mainmatter part (Chapter 1 - end of the document) has arabic numeral on the upper right corner
Since my frontmatter must has page numbering on the bottom, i use

Code: Select all

\pagestyle{fancy}
.
And it affects page numbering on the mainmatter on the bottom center as well, that i want it to be on the upper right corner. So, i use this command to fix this (move the page numbering to the upper right corner):

Code: Select all

\pagestyle{headings}
.
I put that command after mainmatter and it works. But the bad part is the chapter/section/subsection included on the upper left corner which i don't want it.

So, how to remove this (upper left part: chapter/section/subsection name on left header) without ruins everything?

Please help me, 2 days I tried and searched for this but nothing worked. :cry:

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

How to remove chapter/section/subsection name on the upper left corner

Post by Ijon Tichy »

A Infominimal working example would help us to avoid a lot of speculation. Without I need to ask: Have you configured your fancy pagestyle already? The fancyhdr manual explains how to use, e.g., \fancyhead{} to remove everything from the head of that style. It also explains pagestyle headings is a style with automatic runnig heads. Manual running heads can be done using pagestyle myheadings. Pagestyle plain is with page numbers only (without running heads) and pagestyle empty is without anything. But all pagestyles depend on the used classes (and sometimes on the used packages too).
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
Shandy Verdyo
Posts: 5
Joined: Fri Jul 31, 2020 8:15 am

How to remove chapter/section/subsection name on the upper left corner

Post by Shandy Verdyo »

Here is my MWE, Please help me

Code: Select all

\documentclass[a4paper,12pt,oneside,openany]{book}
    \usepackage{pgf, tikz}
    \usepackage[a4paper, inner=4cm, outer=3cm, top=4cm, bottom=3cm]{geometry}
    \usepackage{geometry}
    \usepackage[onehalfspacing]{setspace}
    \usepackage{fancyhdr}
    \usepackage{titlesec}
    \usepackage{setspace}
    \usepackage[titles]{tocloft}
    \usepackage{tocbibind}
    \usepackage{indentfirst}
    \usepackage{blindtext}
    \usepackage{tocloft}
    \usepackage{etoolbox}
    
    \patchcmd{\section}{\bfseries}{\bfseries\boldmath}{}{}
    \setlength{\cftbeforesecskip}{10pt}
    \setlength{\cftbeforesubsecskip}{10pt}
    \fancyhf{}
    \cfoot{\thepage}
    \linespread{1.5}
    \pagestyle{plain}
    \renewcommand\cftchapdotsep{\cftdotsep}
    \titleformat{\chapter}[block]
    	{\normalfont\bfseries\centering}
    	{}{0pt}{}
    \titleformat{\section}
    	{\normalfont\bfseries}
    	{\thesection}{1em}{}
    \titlespacing*{\chapter}{0pt}{10pt}{20pt}
    \titlespacing*{\section}{0pt}{0pt}{0pt}
    
    \renewcommand{\contentsname}{DAFTAR ISI}
    \renewcommand{\listtablename}{DAFTAR TABEL}
    \renewcommand{\listfigurename}{DAFTAR GAMBAR}
    
    \addtocontents{toc}{\protect\null\protect\hfill{Halaman}\protect\par}
    \setlength\parindent{1.25cm} 
    
    
    
    \begin{document}
    
    \clearpage
    \thispagestyle{empty}
    \include{cover1}
    \frontmatter %
    
    \pagestyle{fancy}	
    \renewcommand{\headrulewidth}{0pt}
    \addcontentsline{toc}{chapter}{\textbf{HALAMAN JUDUL}}
    \include{cover2}
    \begin{spacing}{0.1}
    	\tableofcontents
    	\listoffigures
    	\listoftables
    \end{spacing}
    
    
    \mainmatter 
    \pagestyle{headings}
    \include{bab1}
    
    \end{document}
User avatar
Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

How to remove chapter/section/subsection name on the upper left corner

Post by Ijon Tichy »

It's neither minimal nor complete. Without the external files, which we do not have, it produces only three pages DAFTAR ISI, DAFTAR TABEL, and DAFTAR GAMBAR without anything in the page head. So I do not see any problem.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
Shandy Verdyo
Posts: 5
Joined: Fri Jul 31, 2020 8:15 am

How to remove chapter/section/subsection name on the upper left corner

Post by Shandy Verdyo »

Hi again. Thanks for reply. Ok, i'll inform all of my codes, and hope you can help me.

cover1.tex :

Code: Select all

\begin{figure}[!hbt] 
\centering
\includegraphics[width=3cm, height=3cm]{logo}
\end{figure}
\begin{center}
	\textbf{APLIKASI INTEGRAL BROMWICH DALAM MENYELESAIKAN TRANSFORMASI LAPLACE PADA PEMODELAN PERTUMBUHAN PENDUDUDUK INDONESIA DENGAN PERSAMAAN DIFERENSIAL ORDE SATU}
\end{center}
\vspace{1cm}
\begin{center}
	\textbf{SKRIPSI}
\end{center}
\vspace{1.5cm}
\begin{center}
	\textbf{Oleh\\ Muhammad Fahmy Absa \\ NIM 170210101064}
\end{center}
\vspace{1.5cm}
\begin{center}
	\textbf{	PROGRAM STUDI PENDIDIKAN MATEMATIKA\\ JURUSAN PENDIDIKAN MIPA\\ FAKULTAS KEGURUAN DAN ILMU PENDIDIKAN\\ UNIVERSITAS JEMBER\\ 2020}
\end{center}
cover2.tex :

Code: Select all

\begin{figure}[!hbt] 
	\centering
	\includegraphics[width=3cm, height=3cm]{logo}
\end{figure}
\vspace{5mm}
\begin{center}
	\textbf{APLIKASI INTEGRAL BROMWICH DALAM MENYELESAIKAN TRANSFORMASI LAPLACE PADA PEMODELAN PERTUMBUHAN PENDUDUDUK INDONESIA DENGAN PERSAMAAN DIFERENSIAL ORDE SATU}
\end{center}
%\addcontentsline{toc}{chapter}{\textbf{HALAMAN JUDUL}}
\vspace{0.8cm}
\begin{center}
	\textbf{SKRIPSI}
\end{center}
\vspace{0.8cm}
\begin{center}
	\textbf{Oleh\\ Muhammad Fahmy Absa \\ NIM 170210101064}
\end{center}
\vspace{1cm}
\begin{center}
\begin{tabular}{ll}
	Dosen Pembimbing 1	&:\\
	Dosen Pembimbing 2	&:\\
	Dosen Penguji 1		&:\\
	Dosen Penguji 2		&:
\end{tabular}
\end{center}
\vspace{0.8cm}
\begin{center}
	\textbf{	PROGRAM STUDI PENDIDIKAN MATEMATIKA\\ JURUSAN PENDIDIKAN MIPA\\ FAKULTAS KEGURUAN DAN ILMU PENDIDIKAN\\ UNIVERSITAS JEMBER\\ 2020}
\end{center}

\addcontentsline{toc}{chapter}{\textbf{HALAMAN JUDUL}}
\chapter*{\textbf{HALAMAN PERSEMBAHAN}}
\addcontentsline{toc}{chapter}{\textbf{HALAMAN PERSEMBAHAN}}
%Puji syukur ke hadirat Allah S.W.T

\chapter*{\textbf{HALAMAN MOTTO}}
\addcontentsline{toc}{chapter}{\textbf{HALAMAN MOTTO}}
%\blindtext
	
\chapter*{\textbf{HALAMAN PERNYATAAN}}
\addcontentsline{toc}{chapter}{\textbf{HALAMAN PERNYATAAN}}
%\blindtext

\chapter*{\textbf{HALAMAN PENGAJUAN}}
\addcontentsline{toc}{chapter}{\textbf{HALAMAN PENGAJUAN}}
%\blindtext
	
\chapter*{\textbf{HALAMAN PENGESAHAN}}
\addcontentsline{toc}{chapter}{\textbf{HALAMAN PENGESAHAN}}
%\blindtext

\chapter*{\textbf{RINGKASAN}}
\addcontentsline{toc}{chapter}{\textbf{RINGKASAN}}
%\blindtext
	
\chapter*{\textbf{KATA PENGANTAR}}
\addcontentsline{toc}{chapter}{\textbf{KATA PENGANTAR}}
%\blindtext
bab1.tex :

Code: Select all

\refstepcounter{chapter}
\chapter*{\textbf{BAB 1. PENDAHULUAN}}
\addtocontents{toc}{\setlength{\cftbeforechapskip}{20pt}}
\addcontentsline{toc}{chapter}{\textbf{BAB 1. PENDAHULUAN}}  
\thispagestyle{empty}

\section{\textbf{Latar Belakang}}      
\blindtext
\subsection{mama}      
\blindtext
\section{\textbf{Latar Belakang}}      
\blindtext
\subsection{mama}      
\blindtext
\subsection{mama}      
\blindtext
\section{\textbf{Latar Belakang}}      
\blindtext
\subsection{mama}      
\blindtext
\subsection{mama}      
\blindtext
\subsection{mama}      
\blindtext
\subsection{mama}      
\blindtext

\refstepcounter{chapter}
\chapter*{\textbf{BAB 2. MAMA}}
\addcontentsline{toc}{chapter}{\textbf{BAB 2. MAMA}}  
\thispagestyle{empty}

\section{\textbf{mama}}      
\blindtext
\subsection{mama}      
\blindtext
\subsection{mama}      
\blindtext
\section{\textbf{mama}}      
\blindtext
\section{\textbf{mama}}      
\blindtext

\refstepcounter{chapter}
\chapter*{\textbf{BAB 3. SAYA}}
\addcontentsline{toc}{chapter}{\textbf{BAB 3. SAYA}}  
\thispagestyle{empty}

\section{\textbf{SAYA}}      
\blindtext
\section{\textbf{AYA}}      
\blindtext
\section{\textbf{SAYA}}      
\blindtext
Actually this is not a complete document. So, it's normal if you see some chapter and sections have the weird names. But that's not my point. I just need to remove the chapter/section/subsection name on the left header.
Shandy Verdyo
Posts: 5
Joined: Fri Jul 31, 2020 8:15 am

How to remove chapter/section/subsection name on the upper left corner

Post by Shandy Verdyo »

Hi, still there is no answer for my question? Sorry, but i really need the answer asap. I really appreciate for any help
User avatar
Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

How to remove chapter/section/subsection name on the upper left corner

Post by Ijon Tichy »

It's still neither minimal nor complete/workable. So I cannot test it. But I think, I've already answered your question:
The fancyhdr manual explains how to use, e.g., \fancyhead{} to remove everything from the head of that style. It also explains pagestyle headings is a style with automatic runnig heads. Manual running heads can be done using pagestyle myheadings. Pagestyle plain is with page numbers only (without running heads) and pagestyle empty is without anything. But all pagestyles depend on the used classes (and sometimes on the used packages too).
So either use \fancyhead (and \fancyfoot) to configure pagestyle fancy as you want it or use pagestyle plain (and maybe pagestyle myheadings) without package fancyhdr.

BTW: You should not use \chapter* for numbered chapters. You should configure \chapter to format the chapters as you want them. This should be able with package titlesec that you are already using.

And you should use a language package like babel to switch to the language terms and hyphenation of the language you are using. In you case this could be \usepackage[bahasa]{babel}, but I'm not sure (the correct option may also be, e.g., indon or bahasai, I never used any of them).

BTW: After two tries in getting a Infominimal working example, I think, I'm not able to help you, because I'm even not able to tell you, what I would need to do so. Mostly this is my fault. Sorry, but for me it's time to give up the attempt.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
Post Reply