LaTeX forum ⇒ 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).
Shandy Verdyo
Posts: 5
Joined: Fri Jul 31, 2020 8:15 am

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

Postby Shandy Verdyo » Sat Aug 01, 2020 5:19 am

Hi, i'm new in LaTeX. I'm currently working on book-class onesided and using
Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \frontmatter
and
Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \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] [Expand/Collapse] [Download] ({untitled.tex})
  1. \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] [Expand/Collapse] [Download] ({untitled.tex})
  1. \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:

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

Postby Ijon Tichy » Sat Aug 01, 2020 8:08 am

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).

Shandy Verdyo
Posts: 5
Joined: Fri Jul 31, 2020 8:15 am

Postby Shandy Verdyo » Sat Aug 01, 2020 8:25 am

Here is my MWE, Please help me

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \documentclass[a4paper,12pt,oneside,openany]{book}
  2. \usepackage{pgf, tikz}
  3. \usepackage[a4paper, inner=4cm, outer=3cm, top=4cm, bottom=3cm]{geometry}
  4. \usepackage{geometry}
  5. \usepackage[onehalfspacing]{setspace}
  6. \usepackage{fancyhdr}
  7. \usepackage{titlesec}
  8. \usepackage{setspace}
  9. \usepackage[titles]{tocloft}
  10. \usepackage{tocbibind}
  11. \usepackage{indentfirst}
  12. \usepackage{blindtext}
  13. \usepackage{tocloft}
  14. \usepackage{etoolbox}
  15.  
  16. \patchcmd{\section}{\bfseries}{\bfseries\boldmath}{}{}
  17. \setlength{\cftbeforesecskip}{10pt}
  18. \setlength{\cftbeforesubsecskip}{10pt}
  19. \fancyhf{}
  20. \cfoot{\thepage}
  21. \linespread{1.5}
  22. \pagestyle{plain}
  23. \renewcommand\cftchapdotsep{\cftdotsep}
  24. \titleformat{\chapter}[block]
  25. {\normalfont\bfseries\centering}
  26. {}{0pt}{}
  27. \titleformat{\section}
  28. {\normalfont\bfseries}
  29. {\thesection}{1em}{}
  30. \titlespacing*{\chapter}{0pt}{10pt}{20pt}
  31. \titlespacing*{\section}{0pt}{0pt}{0pt}
  32.  
  33. \renewcommand{\contentsname}{DAFTAR ISI}
  34. \renewcommand{\listtablename}{DAFTAR TABEL}
  35. \renewcommand{\listfigurename}{DAFTAR GAMBAR}
  36.  
  37. \addtocontents{toc}{\protect\null\protect\hfill{Halaman}\protect\par}
  38. \setlength\parindent{1.25cm}
  39.  
  40.  
  41.  
  42. \begin{document}
  43.  
  44. \clearpage
  45. \thispagestyle{empty}
  46. \include{cover1}
  47. \frontmatter %
  48.  
  49. \pagestyle{fancy}
  50. \renewcommand{\headrulewidth}{0pt}
  51. \addcontentsline{toc}{chapter}{\textbf{HALAMAN JUDUL}}
  52. \include{cover2}
  53. \begin{spacing}{0.1}
  54. \tableofcontents
  55. \listoffigures
  56. \listoftables
  57. \end{spacing}
  58.  
  59.  
  60. \mainmatter
  61. \pagestyle{headings}
  62. \include{bab1}
  63.  
  64. \end{document}

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

Postby Ijon Tichy » Sat Aug 01, 2020 9:26 am

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.

Shandy Verdyo
Posts: 5
Joined: Fri Jul 31, 2020 8:15 am

Postby Shandy Verdyo » Sat Aug 01, 2020 11:09 am

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

cover1.tex :
Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \begin{figure}[!hbt]
  2. \centering
  3. \includegraphics[width=3cm, height=3cm]{logo}
  4. \end{figure}
  5. \begin{center}
  6. \textbf{APLIKASI INTEGRAL BROMWICH DALAM MENYELESAIKAN TRANSFORMASI LAPLACE PADA PEMODELAN PERTUMBUHAN PENDUDUDUK INDONESIA DENGAN PERSAMAAN DIFERENSIAL ORDE SATU}
  7. \end{center}
  8. \vspace{1cm}
  9. \begin{center}
  10. \textbf{SKRIPSI}
  11. \end{center}
  12. \vspace{1.5cm}
  13. \begin{center}
  14. \textbf{Oleh\\ Muhammad Fahmy Absa \\ NIM 170210101064}
  15. \end{center}
  16. \vspace{1.5cm}
  17. \begin{center}
  18. \textbf{ PROGRAM STUDI PENDIDIKAN MATEMATIKA\\ JURUSAN PENDIDIKAN MIPA\\ FAKULTAS KEGURUAN DAN ILMU PENDIDIKAN\\ UNIVERSITAS JEMBER\\ 2020}
  19. \end{center}


cover2.tex :
Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \begin{figure}[!hbt]
  2. \centering
  3. \includegraphics[width=3cm, height=3cm]{logo}
  4. \end{figure}
  5. \vspace{5mm}
  6. \begin{center}
  7. \textbf{APLIKASI INTEGRAL BROMWICH DALAM MENYELESAIKAN TRANSFORMASI LAPLACE PADA PEMODELAN PERTUMBUHAN PENDUDUDUK INDONESIA DENGAN PERSAMAAN DIFERENSIAL ORDE SATU}
  8. \end{center}
  9. %\addcontentsline{toc}{chapter}{\textbf{HALAMAN JUDUL}}
  10. \vspace{0.8cm}
  11. \begin{center}
  12. \textbf{SKRIPSI}
  13. \end{center}
  14. \vspace{0.8cm}
  15. \begin{center}
  16. \textbf{Oleh\\ Muhammad Fahmy Absa \\ NIM 170210101064}
  17. \end{center}
  18. \vspace{1cm}
  19. \begin{center}
  20. \begin{tabular}{ll}
  21. Dosen Pembimbing 1 &:\\
  22. Dosen Pembimbing 2 &:\\
  23. Dosen Penguji 1 &:\\
  24. Dosen Penguji 2 &:
  25. \end{tabular}
  26. \end{center}
  27. \vspace{0.8cm}
  28. \begin{center}
  29. \textbf{ PROGRAM STUDI PENDIDIKAN MATEMATIKA\\ JURUSAN PENDIDIKAN MIPA\\ FAKULTAS KEGURUAN DAN ILMU PENDIDIKAN\\ UNIVERSITAS JEMBER\\ 2020}
  30. \end{center}
  31.  
  32. \addcontentsline{toc}{chapter}{\textbf{HALAMAN JUDUL}}
  33. \chapter*{\textbf{HALAMAN PERSEMBAHAN}}
  34. \addcontentsline{toc}{chapter}{\textbf{HALAMAN PERSEMBAHAN}}
  35. %Puji syukur ke hadirat Allah S.W.T
  36.  
  37. \chapter*{\textbf{HALAMAN MOTTO}}
  38. \addcontentsline{toc}{chapter}{\textbf{HALAMAN MOTTO}}
  39. %\blindtext
  40.  
  41. \chapter*{\textbf{HALAMAN PERNYATAAN}}
  42. \addcontentsline{toc}{chapter}{\textbf{HALAMAN PERNYATAAN}}
  43. %\blindtext
  44.  
  45. \chapter*{\textbf{HALAMAN PENGAJUAN}}
  46. \addcontentsline{toc}{chapter}{\textbf{HALAMAN PENGAJUAN}}
  47. %\blindtext
  48.  
  49. \chapter*{\textbf{HALAMAN PENGESAHAN}}
  50. \addcontentsline{toc}{chapter}{\textbf{HALAMAN PENGESAHAN}}
  51. %\blindtext
  52.  
  53. \chapter*{\textbf{RINGKASAN}}
  54. \addcontentsline{toc}{chapter}{\textbf{RINGKASAN}}
  55. %\blindtext
  56.  
  57. \chapter*{\textbf{KATA PENGANTAR}}
  58. \addcontentsline{toc}{chapter}{\textbf{KATA PENGANTAR}}
  59. %\blindtext


bab1.tex :
Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \refstepcounter{chapter}
  2. \chapter*{\textbf{BAB 1. PENDAHULUAN}}
  3. \addtocontents{toc}{\setlength{\cftbeforechapskip}{20pt}}
  4. \addcontentsline{toc}{chapter}{\textbf{BAB 1. PENDAHULUAN}}
  5. \thispagestyle{empty}
  6.  
  7. \section{\textbf{Latar Belakang}}
  8. \blindtext
  9. \subsection{mama}
  10. \blindtext
  11. \section{\textbf{Latar Belakang}}
  12. \blindtext
  13. \subsection{mama}
  14. \blindtext
  15. \subsection{mama}
  16. \blindtext
  17. \section{\textbf{Latar Belakang}}
  18. \blindtext
  19. \subsection{mama}
  20. \blindtext
  21. \subsection{mama}
  22. \blindtext
  23. \subsection{mama}
  24. \blindtext
  25. \subsection{mama}
  26. \blindtext
  27.  
  28. \refstepcounter{chapter}
  29. \chapter*{\textbf{BAB 2. MAMA}}
  30. \addcontentsline{toc}{chapter}{\textbf{BAB 2. MAMA}}
  31. \thispagestyle{empty}
  32.  
  33. \section{\textbf{mama}}
  34. \blindtext
  35. \subsection{mama}
  36. \blindtext
  37. \subsection{mama}
  38. \blindtext
  39. \section{\textbf{mama}}
  40. \blindtext
  41. \section{\textbf{mama}}
  42. \blindtext
  43.  
  44. \refstepcounter{chapter}
  45. \chapter*{\textbf{BAB 3. SAYA}}
  46. \addcontentsline{toc}{chapter}{\textbf{BAB 3. SAYA}}
  47. \thispagestyle{empty}
  48.  
  49. \section{\textbf{SAYA}}
  50. \blindtext
  51. \section{\textbf{AYA}}
  52. \blindtext
  53. \section{\textbf{SAYA}}
  54. \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

Postby Shandy Verdyo » Sat Aug 01, 2020 1:23 pm

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: 296
Joined: Mon Dec 24, 2018 10:12 am

Postby Ijon Tichy » Sat Aug 01, 2020 1:25 pm

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.


Return to “Page Layout”

Who is online

Users browsing this forum: No registered users and 3 guests