Page LayoutSupress "chapter 1"

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
faun
Posts: 14
Joined: Thu Apr 28, 2011 1:13 pm

Supress "chapter 1"

Post by faun »

Good day,

Yesterday I made my first steps into LaTeX. However, I have a problem. I included some screenshots to explain my problem.

Screenshot 1
screenshot-1.png
screenshot-1.png (10.25 KiB) Viewed 2476 times
Here you see the problem. Normally, my chapter is "chapter 1". But automatically there is "hoofdstuk 1" (which is Dutch for chapter 1).

Screenshot 2
screenshot-2.png
screenshot-2.png (11.08 KiB) Viewed 2476 times
I found out you can supress this with following code:

Code: Select all

\addto\captionsdutch{
\renewcommand\chaptername{}}        
\renewcommand{\thechapter}{}  
But then, the sections Start from .1 instead of 1.1. So I can't use that solution also.

Screenshot 3
screenshot-3.png
screenshot-3.png (11.27 KiB) Viewed 2476 times
When I use following code:

Code: Select all

\addto\captionsdutch{
\renewcommand\chaptername{}} 
Only the "hoofdstuk" is gone. The number is still there. But I do want the number next to my chapter. Not above it.


Anyone has a solution?

PS: in addition, I give my whole code.

Code: Select all

\documentclass[a4paper,11pt]{report}


\usepackage[dutch]{babel}           
\addto\captionsdutch{
\renewcommand\chaptername{}}        
%\renewcommand{\thechapter}{}        
\usepackage[latin1]{inputenc}       
\usepackage{palatino} 
\usepackage{graphicx} 

\newcommand{\nroman}{\renewcommand{\thepage}{\roman{page}}\setcounter{page}{0}}   
\newcommand{\narabic}{\renewcommand{\thepage}{\arabic{page}}\setcounter{page}{1}}   

           
\begin{document}
\global\emergencystretch = .3\hsize

\nroman 



\newpage


\newpage
\narabic 


\chapter{Chapter 1 (test)}
\section{section 1}
\subsection{subsection 1}

\chapter{Chapter 2 (test)}
\section{section 1}
\subsection{subsection 1}


\end{document}

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Supress "chapter 1"

Post by meho_r »

Welcome to the forum and thanks for respecting the rules and people's time by providing a compilable minimal working example.

One (and probably the easiest) way would be to use titlesec package. This way, you don't have to change anything babel- and language-related, simply define couple of parameters using commands provided by titlesec. E.g.:

Code: Select all

\documentclass[a4paper,11pt]{report}

\usepackage[dutch]{babel}           
 
\usepackage[latin1]{inputenc}       

\usepackage{palatino} 
\usepackage{graphicx} 

\newcommand{\nroman}{\renewcommand{\thepage}{\roman{page}}\setcounter{page}{0}}   
\newcommand{\narabic}{\renewcommand{\thepage}{\arabic{page}}\setcounter{page}{1}}   

\usepackage{titlesec}

\titleformat{\chapter}
	{\Huge\bfseries}% Text formatting
	{\thechapter}% Setting the number
	{1em}% Spacing between the number and the title
	{}% A command or text after the title
           
\begin{document}

\global\emergencystretch = .3\hsize

\nroman 

\newpage

\newpage

\narabic 

\chapter{Chapter 1 (test)}

\section{section 1}

\subsection{subsection 1}

\chapter{Chapter 2 (test)}

\section{section 1}

\subsection{subsection 1}

\end{document}
faun
Posts: 14
Joined: Thu Apr 28, 2011 1:13 pm

Supress "chapter 1"

Post by faun »

This works perfect, thanks!

Just one quick question, due to supressing chapter 1, there is alot of whitespace above my "new" chapter 1. How can I set my new chapter a bit higher?

It's only there, on the next page there is no whitespace. Editing the general margin won't resolve this I think. :x

Screenshot 4:
screenshot-4.png
screenshot-4.png (74.59 KiB) Viewed 2476 times
PS: excuse me for my poor level of English :?
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Supress "chapter 1"

Post by meho_r »

Titlesec package provides a solution for that too. E.g., put this code below \titleformat in the code I posted earlier and adjust spaces as you like (you can even use negative numbers):

Code: Select all

\titlespacing*{\chapter}%
      {0pt}% Left indentation
      {1cm}% Space above the title
      {12pt}% Space below the title
      []% Right margin; this is optional and doesn't have to be specified; remove if not needed
Post Reply