General ⇒ Formatting for Chapter Number
Formatting for Chapter Number
Hey,
I have a problem in a document. I write a master thesis with the book class and I want to make the chapter format as
Chapter (1) instead Chapter 1
Chapter (2) instead Chapter 2
Chapter (3) instead Chapter 3
...
Thanx
I have a problem in a document. I write a master thesis with the book class and I want to make the chapter format as
Chapter (1) instead Chapter 1
Chapter (2) instead Chapter 2
Chapter (3) instead Chapter 3
...
Thanx
Last edited by localghost on Sat Sep 15, 2012 11:01 am, edited 2 times in total.
- Stefan Kottwitz
- Site Admin
- Posts: 10290
- Joined: Mon Mar 10, 2008 9:44 pm
Formatting for Chapter Number
Hi amradly,
welcome to the board!
It can easily be redefined. Just put into your preamble:
Stefan
welcome to the board!
It can easily be redefined. Just put into your preamble:
Code: Select all
\renewcommand*{\thechapter}{(\arabic{chapter})}
LaTeX.org admin
Re: Formatting for Chapter Number
Hey,
thanks Stefan... it is working well!
But I have another problem, the chapter becomes Chapter (1) but the section becomes
(1).1
(1).2
(1).3
...
Thanks in advance
thanks Stefan... it is working well!
But I have another problem, the chapter becomes Chapter (1) but the section becomes
(1).1
(1).2
(1).3
...
Thanks in advance
- Stefan Kottwitz
- Site Admin
- Posts: 10290
- Joined: Mon Mar 10, 2008 9:44 pm
Formatting for Chapter Number
That's consistent, because a section 1 in chapter (1) may be called (1).1. But no problem, it can be changed in a similar way:
Stefan
Code: Select all
\renewcommand*{\thesection}{\arabic{chapter}.\arabic{section}}
LaTeX.org admin
Re: Formatting for Chapter Number
Thanks Stevan for your effort,
I want also to remove the vertical space between chapter title and the "chapter" keyword so I want the chapter will be
Chapter (1) | instead Chapter (1)
Introduction |
Introduction
I want also to remove the vertical space between chapter title and the "chapter" keyword so I want the chapter will be
Chapter (1) | instead Chapter (1)
Introduction |
Introduction
- Stefan Kottwitz
- Site Admin
- Posts: 10290
- Joined: Mon Mar 10, 2008 9:44 pm
Formatting for Chapter Number
Regarding spacing, font, and formatting of headings in general, have a look at the
titlesec package. The manual is some stuff to read, because of the many features, but an easy start is given by the examples for standard classes. They are a good start for customization.
Stefan

Stefan
LaTeX.org admin
- localghost
- Site Moderator
- Posts: 9201
- Joined: Fri Feb 02, 2007 12:06 pm
Formatting for Chapter Number
If it is only about getting rid of that vertical space without any other modifications to the other heading levels, you can patch a helper macro for the
Best regards and welcome to the board
Thorsten
\chapter
command by the etoolbox package.
Code: Select all
\documentclass[11pt]{book}
\usepackage[T1]{fontenc}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\@makechapterhead}{\vspace 20\p@}{}{}{}
\makeatother
\begin{document}
\chapter{Foo}
\end{document}
Best regards and welcome to the board
Thorsten
- Attachments
-
- The old chapter formatting.
- chapter-before.png (2.76 KiB) Viewed 4332 times
-
- The new chapter formatting.
- chapter-after.png (2.69 KiB) Viewed 4332 times
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]
¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
Board Rules
Avoidable Mistakes[/size]
¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
Re: Formatting for Chapter Number
@Stefan_K ,
thanks, I download the manual of titlesec package and I found the "titlespacing"
\titlespacing*{<command>}{<left>}{<beforesep>}{<aftersep>}[<right>]
but I don't need it , I want to remove vertical space between chapter title and the "chapter" keyword.
@localghost,
thanks, the figure you attached is really what I want , but the code is n't working well I think the titlesec package will be good but I don't know how....
Regards,
thanks, I download the manual of titlesec package and I found the "titlespacing"
\titlespacing*{<command>}{<left>}{<beforesep>}{<aftersep>}[<right>]
but I don't need it , I want to remove vertical space between chapter title and the "chapter" keyword.
@localghost,
thanks, the figure you attached is really what I want , but the code is n't working well I think the titlesec package will be good but I don't know how....
Regards,
- localghost
- Site Moderator
- Posts: 9201
- Joined: Fri Feb 02, 2007 12:06 pm
Formatting for Chapter Number
The words "code isn't working" are not a good description of the problem. Make sure that you have a TeX system that is up to date.amradly wrote:[…] the figure you attached is really what I want , but the code is n't working well I think the titlesec package will be good but I don't know how. […]
Add the
\listfiles
command as very first line to my code example, run the compiler and search the log file (*.log) for the list of used files (quite at the end). This is what I get.
Code: Select all
*File List*
book.cls 2007/10/19 v1.4h Standard LaTeX document class
bk11.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
fontenc.sty
t1enc.def 2005/09/27 v1.99g Standard LaTeX file
etoolbox.sty 2011/01/03 v2.1 e-TeX tools for LaTeX
etex.sty 1998/03/26 v2.0 eTeX basic definition package (PEB)
***********
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]
¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
Board Rules
Avoidable Mistakes[/size]
¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1