Space before chapters and contents
I am using LaTeX to write my dissertation, and I have realised that on the table of contents and on every chapter page, LaTeX leaves a lot of empty space.
What I mean is that lets say in the page where chapter 1 begins, from the top of the page until the chapter title there is much more vertical space than on any other page. The same goes with chapter 2 etc... and for contents page as well.
Can anybody help me to remove that space?
Is there any mistake in my code or something like that? Is this a default of LaTeX?
the preamble is
documentclass[12pt,twoside]{report}
pagestyle{plain}
usepackage{a4paper}
usepackage{setspace}
doublespacing
usepackage{amssymb}
usepackage{amsmath}
I've tried the methods below, but none of them work properly.
spacing sectioning chapters
migrated from stackoverflow.com Jan 4 '12 at 6:26
This question came from our site for professional and enthusiast programmers.
add a comment |
I am using LaTeX to write my dissertation, and I have realised that on the table of contents and on every chapter page, LaTeX leaves a lot of empty space.
What I mean is that lets say in the page where chapter 1 begins, from the top of the page until the chapter title there is much more vertical space than on any other page. The same goes with chapter 2 etc... and for contents page as well.
Can anybody help me to remove that space?
Is there any mistake in my code or something like that? Is this a default of LaTeX?
the preamble is
documentclass[12pt,twoside]{report}
pagestyle{plain}
usepackage{a4paper}
usepackage{setspace}
doublespacing
usepackage{amssymb}
usepackage{amsmath}
I've tried the methods below, but none of them work properly.
spacing sectioning chapters
migrated from stackoverflow.com Jan 4 '12 at 6:26
This question came from our site for professional and enthusiast programmers.
Please provide a minimal example. The spacing really depends on the document class and mabye related packages.
– Marco Daniel
Jan 4 '12 at 6:41
I want to add that this default behaviour ofscrreprt
is really strange. Usually you don't want so much whitespace before a chapter, at least if you have a limit of totally available space.
– TomM
Dec 26 '13 at 13:33
add a comment |
I am using LaTeX to write my dissertation, and I have realised that on the table of contents and on every chapter page, LaTeX leaves a lot of empty space.
What I mean is that lets say in the page where chapter 1 begins, from the top of the page until the chapter title there is much more vertical space than on any other page. The same goes with chapter 2 etc... and for contents page as well.
Can anybody help me to remove that space?
Is there any mistake in my code or something like that? Is this a default of LaTeX?
the preamble is
documentclass[12pt,twoside]{report}
pagestyle{plain}
usepackage{a4paper}
usepackage{setspace}
doublespacing
usepackage{amssymb}
usepackage{amsmath}
I've tried the methods below, but none of them work properly.
spacing sectioning chapters
I am using LaTeX to write my dissertation, and I have realised that on the table of contents and on every chapter page, LaTeX leaves a lot of empty space.
What I mean is that lets say in the page where chapter 1 begins, from the top of the page until the chapter title there is much more vertical space than on any other page. The same goes with chapter 2 etc... and for contents page as well.
Can anybody help me to remove that space?
Is there any mistake in my code or something like that? Is this a default of LaTeX?
the preamble is
documentclass[12pt,twoside]{report}
pagestyle{plain}
usepackage{a4paper}
usepackage{setspace}
doublespacing
usepackage{amssymb}
usepackage{amsmath}
I've tried the methods below, but none of them work properly.
spacing sectioning chapters
spacing sectioning chapters
edited Mar 30 '12 at 10:15
egreg
717k8719023197
717k8719023197
asked Jan 4 '12 at 5:36
user1015777user1015777
438267
438267
migrated from stackoverflow.com Jan 4 '12 at 6:26
This question came from our site for professional and enthusiast programmers.
migrated from stackoverflow.com Jan 4 '12 at 6:26
This question came from our site for professional and enthusiast programmers.
Please provide a minimal example. The spacing really depends on the document class and mabye related packages.
– Marco Daniel
Jan 4 '12 at 6:41
I want to add that this default behaviour ofscrreprt
is really strange. Usually you don't want so much whitespace before a chapter, at least if you have a limit of totally available space.
– TomM
Dec 26 '13 at 13:33
add a comment |
Please provide a minimal example. The spacing really depends on the document class and mabye related packages.
– Marco Daniel
Jan 4 '12 at 6:41
I want to add that this default behaviour ofscrreprt
is really strange. Usually you don't want so much whitespace before a chapter, at least if you have a limit of totally available space.
– TomM
Dec 26 '13 at 13:33
Please provide a minimal example. The spacing really depends on the document class and mabye related packages.
– Marco Daniel
Jan 4 '12 at 6:41
Please provide a minimal example. The spacing really depends on the document class and mabye related packages.
– Marco Daniel
Jan 4 '12 at 6:41
I want to add that this default behaviour of
scrreprt
is really strange. Usually you don't want so much whitespace before a chapter, at least if you have a limit of totally available space.– TomM
Dec 26 '13 at 13:33
I want to add that this default behaviour of
scrreprt
is really strange. Usually you don't want so much whitespace before a chapter, at least if you have a limit of totally available space.– TomM
Dec 26 '13 at 13:33
add a comment |
4 Answers
4
active
oldest
votes
Werner answered the questions for the standard classes. If you use scrbook
or scrreprt
(KOMA-script) the space before and after the chapter title is given by chapterheadstartvskip
and chapterheadendvskip
. These "lengths" are not defined as lengths, but as commands instead. To change the settings you must use renewcommand
:
renewcommand*{chapterheadstartvskip}{vspace*{1cm}}
renewcommand*{chapterheadendvskip}{vspace{2cm}}
With KOMA-script version 3.16, a new interface was introduced to change the appearance of sectioning commands, including chapters. You can now do something like this
RedeclareSectionCommand[beforeskip=0pt,
afterskip=2cm]{chapter}
2
Thank you for answering. Incidentally, I also found a reply by Markus Kohm himself which leads torenewcommand*{chapterheadstartvskip}{vspace*{-topskip}}
.
– henry
Jun 8 '13 at 7:55
@henry: Of course this is another possibility. topskip has a length of 11pt.
– Marco Daniel
Jun 8 '13 at 10:21
add a comment |
The default style for LaTeX's book class is quite generous with the whitespace on the page -- there's probably nothing wrong with your code.
One way to change the behavior of headings is to use the titlesec package, which allows you finegrained control over how all the levels of headings are displayed. For example, the following code in the preamble of the document would remove the whitespace above the chapter heading:
usepackage{titlesec}
titleformat{chapter}[display]
{normalfonthugebfseries}{chaptertitlename thechapter}{20pt}{Huge}
titlespacing*{chapter}{0pt}{0pt}{40pt}
In the last line, the four measurements are the left, upper and lower spacing around the heading, respectively. The second one is normally 50pt; it was changed here to 0pt to remove the white space above the chapter heading completely.
This does nothing in my tex document. Has anything changed?
– Ivan Perez
Sep 16 '18 at 18:28
add a comment |
This is the default behaviour of for chapter
(and chapter*
) in both book
and report
document class, so you're doing nothing wrong. This default length is 50pt
.
You could use the etoolbox
package to remove (or modify) the spacing above the chapter headings. Here's a minimal example that will work with either book
or report
document class:
documentclass{book}
usepackage{showframe}% http://ctan.org/pkg/showframe
usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
makeatletter
patchcmd{@makechapterhead}{vspace*{50p@}}{}{}{}% Removes space above chapter head
patchcmd{@makeschapterhead}{vspace*{50p@}}{}{}{}% Removes space above chapter* head
makeatother
begin{document}
chapter{A chapter}
chapter*{Another chapter}
end{document}
patchcmd
searches for vspace*{50p@}
in both @makechapterhead
and @makeschapterhead
and replaces it with nothing, thereby removing the space. If you want to add a little space, you can insert something different as the replacement text. For example
patchcmd{@makechapterhead}{vspace*{50p@}}{vspace*{20pt}}{}{}%
patchcmd{@makeschapterhead}{vspace*{50p@}}{vspace*{20pt}}{}{}%
will insert 20pt
instead of the default 50pt
.
showframe
was added to show the frame of the text block and was merely used for illustrative purposes - you can remove this.
An alternative to this would be to use the titlesec
package. However, in order to modify the chapter
spacing (via titlespacing{chapter}...
), you are also required to modify the chapter
format (via titleformat{chapter}...
). See the titlesec
documentation for more information.
Thank you! After all these years, your solution keeps being useful for people like me!
– mathreader
Apr 21 '18 at 16:18
add a comment |
With the report
class the space before a chapter title is 50pt. The easiest method for changing it is to patch the two relevant commands:
documentclass[a4paper,12pt,twoside]{report}
usepackage{amssymb}
usepackage{amsmath}
usepackage{setspace}
doublespacing
%pagestyle{plain} % default for report
usepackage{etoolbox}
makeatletter
patchcmd{@makechapterhead}{50p@}{0pt}{}{}
patchcmd{@makeschapterhead}{50p@}{0pt}{}{}
makeatother
<rest of the preamble>
begin{document}
<the document>
end{document}
You can play with the figures: instead of 0pt
you can put any dimension you want.
Note that there's no a4paper
package; to get page parameters suitable for ISO A4 paper you need to specify a4paper
as an option to documentclass
.
This somehow does not work for me with the book class. I want the "Chapter 1" line to appear right at the top. What am I doing wrong?
– Ivan Perez
Sep 16 '18 at 18:35
@IvanPerez What document class are you using?
– egreg
Sep 16 '18 at 19:00
The document class book
– Ivan Perez
Sep 16 '18 at 19:08
@IvanPerez Change0pt
to something like-24pt
(it depends on the main font size, though).
– egreg
Sep 16 '18 at 19:12
I changed it to -100pt, and it had no effect. It's like it's not using@makechapterhead
at all. I removed every import but this and left only one chapter to obtain a minimal example, and it still won't make a difference. I'm using Ubuntu 18.04, and installing latex from the default repositories.
– Ivan Perez
Sep 16 '18 at 19:26
|
show 3 more comments
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f39988%2fspace-before-chapters-and-contents%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
Werner answered the questions for the standard classes. If you use scrbook
or scrreprt
(KOMA-script) the space before and after the chapter title is given by chapterheadstartvskip
and chapterheadendvskip
. These "lengths" are not defined as lengths, but as commands instead. To change the settings you must use renewcommand
:
renewcommand*{chapterheadstartvskip}{vspace*{1cm}}
renewcommand*{chapterheadendvskip}{vspace{2cm}}
With KOMA-script version 3.16, a new interface was introduced to change the appearance of sectioning commands, including chapters. You can now do something like this
RedeclareSectionCommand[beforeskip=0pt,
afterskip=2cm]{chapter}
2
Thank you for answering. Incidentally, I also found a reply by Markus Kohm himself which leads torenewcommand*{chapterheadstartvskip}{vspace*{-topskip}}
.
– henry
Jun 8 '13 at 7:55
@henry: Of course this is another possibility. topskip has a length of 11pt.
– Marco Daniel
Jun 8 '13 at 10:21
add a comment |
Werner answered the questions for the standard classes. If you use scrbook
or scrreprt
(KOMA-script) the space before and after the chapter title is given by chapterheadstartvskip
and chapterheadendvskip
. These "lengths" are not defined as lengths, but as commands instead. To change the settings you must use renewcommand
:
renewcommand*{chapterheadstartvskip}{vspace*{1cm}}
renewcommand*{chapterheadendvskip}{vspace{2cm}}
With KOMA-script version 3.16, a new interface was introduced to change the appearance of sectioning commands, including chapters. You can now do something like this
RedeclareSectionCommand[beforeskip=0pt,
afterskip=2cm]{chapter}
2
Thank you for answering. Incidentally, I also found a reply by Markus Kohm himself which leads torenewcommand*{chapterheadstartvskip}{vspace*{-topskip}}
.
– henry
Jun 8 '13 at 7:55
@henry: Of course this is another possibility. topskip has a length of 11pt.
– Marco Daniel
Jun 8 '13 at 10:21
add a comment |
Werner answered the questions for the standard classes. If you use scrbook
or scrreprt
(KOMA-script) the space before and after the chapter title is given by chapterheadstartvskip
and chapterheadendvskip
. These "lengths" are not defined as lengths, but as commands instead. To change the settings you must use renewcommand
:
renewcommand*{chapterheadstartvskip}{vspace*{1cm}}
renewcommand*{chapterheadendvskip}{vspace{2cm}}
With KOMA-script version 3.16, a new interface was introduced to change the appearance of sectioning commands, including chapters. You can now do something like this
RedeclareSectionCommand[beforeskip=0pt,
afterskip=2cm]{chapter}
Werner answered the questions for the standard classes. If you use scrbook
or scrreprt
(KOMA-script) the space before and after the chapter title is given by chapterheadstartvskip
and chapterheadendvskip
. These "lengths" are not defined as lengths, but as commands instead. To change the settings you must use renewcommand
:
renewcommand*{chapterheadstartvskip}{vspace*{1cm}}
renewcommand*{chapterheadendvskip}{vspace{2cm}}
With KOMA-script version 3.16, a new interface was introduced to change the appearance of sectioning commands, including chapters. You can now do something like this
RedeclareSectionCommand[beforeskip=0pt,
afterskip=2cm]{chapter}
edited Mar 7 '15 at 19:44
Johannes_B
20.9k349199
20.9k349199
answered Jan 4 '12 at 6:44
Marco DanielMarco Daniel
78.1k13221387
78.1k13221387
2
Thank you for answering. Incidentally, I also found a reply by Markus Kohm himself which leads torenewcommand*{chapterheadstartvskip}{vspace*{-topskip}}
.
– henry
Jun 8 '13 at 7:55
@henry: Of course this is another possibility. topskip has a length of 11pt.
– Marco Daniel
Jun 8 '13 at 10:21
add a comment |
2
Thank you for answering. Incidentally, I also found a reply by Markus Kohm himself which leads torenewcommand*{chapterheadstartvskip}{vspace*{-topskip}}
.
– henry
Jun 8 '13 at 7:55
@henry: Of course this is another possibility. topskip has a length of 11pt.
– Marco Daniel
Jun 8 '13 at 10:21
2
2
Thank you for answering. Incidentally, I also found a reply by Markus Kohm himself which leads to
renewcommand*{chapterheadstartvskip}{vspace*{-topskip}}
.– henry
Jun 8 '13 at 7:55
Thank you for answering. Incidentally, I also found a reply by Markus Kohm himself which leads to
renewcommand*{chapterheadstartvskip}{vspace*{-topskip}}
.– henry
Jun 8 '13 at 7:55
@henry: Of course this is another possibility. topskip has a length of 11pt.
– Marco Daniel
Jun 8 '13 at 10:21
@henry: Of course this is another possibility. topskip has a length of 11pt.
– Marco Daniel
Jun 8 '13 at 10:21
add a comment |
The default style for LaTeX's book class is quite generous with the whitespace on the page -- there's probably nothing wrong with your code.
One way to change the behavior of headings is to use the titlesec package, which allows you finegrained control over how all the levels of headings are displayed. For example, the following code in the preamble of the document would remove the whitespace above the chapter heading:
usepackage{titlesec}
titleformat{chapter}[display]
{normalfonthugebfseries}{chaptertitlename thechapter}{20pt}{Huge}
titlespacing*{chapter}{0pt}{0pt}{40pt}
In the last line, the four measurements are the left, upper and lower spacing around the heading, respectively. The second one is normally 50pt; it was changed here to 0pt to remove the white space above the chapter heading completely.
This does nothing in my tex document. Has anything changed?
– Ivan Perez
Sep 16 '18 at 18:28
add a comment |
The default style for LaTeX's book class is quite generous with the whitespace on the page -- there's probably nothing wrong with your code.
One way to change the behavior of headings is to use the titlesec package, which allows you finegrained control over how all the levels of headings are displayed. For example, the following code in the preamble of the document would remove the whitespace above the chapter heading:
usepackage{titlesec}
titleformat{chapter}[display]
{normalfonthugebfseries}{chaptertitlename thechapter}{20pt}{Huge}
titlespacing*{chapter}{0pt}{0pt}{40pt}
In the last line, the four measurements are the left, upper and lower spacing around the heading, respectively. The second one is normally 50pt; it was changed here to 0pt to remove the white space above the chapter heading completely.
This does nothing in my tex document. Has anything changed?
– Ivan Perez
Sep 16 '18 at 18:28
add a comment |
The default style for LaTeX's book class is quite generous with the whitespace on the page -- there's probably nothing wrong with your code.
One way to change the behavior of headings is to use the titlesec package, which allows you finegrained control over how all the levels of headings are displayed. For example, the following code in the preamble of the document would remove the whitespace above the chapter heading:
usepackage{titlesec}
titleformat{chapter}[display]
{normalfonthugebfseries}{chaptertitlename thechapter}{20pt}{Huge}
titlespacing*{chapter}{0pt}{0pt}{40pt}
In the last line, the four measurements are the left, upper and lower spacing around the heading, respectively. The second one is normally 50pt; it was changed here to 0pt to remove the white space above the chapter heading completely.
The default style for LaTeX's book class is quite generous with the whitespace on the page -- there's probably nothing wrong with your code.
One way to change the behavior of headings is to use the titlesec package, which allows you finegrained control over how all the levels of headings are displayed. For example, the following code in the preamble of the document would remove the whitespace above the chapter heading:
usepackage{titlesec}
titleformat{chapter}[display]
{normalfonthugebfseries}{chaptertitlename thechapter}{20pt}{Huge}
titlespacing*{chapter}{0pt}{0pt}{40pt}
In the last line, the four measurements are the left, upper and lower spacing around the heading, respectively. The second one is normally 50pt; it was changed here to 0pt to remove the white space above the chapter heading completely.
answered Jan 4 '12 at 9:12
G-JG-J
1814
1814
This does nothing in my tex document. Has anything changed?
– Ivan Perez
Sep 16 '18 at 18:28
add a comment |
This does nothing in my tex document. Has anything changed?
– Ivan Perez
Sep 16 '18 at 18:28
This does nothing in my tex document. Has anything changed?
– Ivan Perez
Sep 16 '18 at 18:28
This does nothing in my tex document. Has anything changed?
– Ivan Perez
Sep 16 '18 at 18:28
add a comment |
This is the default behaviour of for chapter
(and chapter*
) in both book
and report
document class, so you're doing nothing wrong. This default length is 50pt
.
You could use the etoolbox
package to remove (or modify) the spacing above the chapter headings. Here's a minimal example that will work with either book
or report
document class:
documentclass{book}
usepackage{showframe}% http://ctan.org/pkg/showframe
usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
makeatletter
patchcmd{@makechapterhead}{vspace*{50p@}}{}{}{}% Removes space above chapter head
patchcmd{@makeschapterhead}{vspace*{50p@}}{}{}{}% Removes space above chapter* head
makeatother
begin{document}
chapter{A chapter}
chapter*{Another chapter}
end{document}
patchcmd
searches for vspace*{50p@}
in both @makechapterhead
and @makeschapterhead
and replaces it with nothing, thereby removing the space. If you want to add a little space, you can insert something different as the replacement text. For example
patchcmd{@makechapterhead}{vspace*{50p@}}{vspace*{20pt}}{}{}%
patchcmd{@makeschapterhead}{vspace*{50p@}}{vspace*{20pt}}{}{}%
will insert 20pt
instead of the default 50pt
.
showframe
was added to show the frame of the text block and was merely used for illustrative purposes - you can remove this.
An alternative to this would be to use the titlesec
package. However, in order to modify the chapter
spacing (via titlespacing{chapter}...
), you are also required to modify the chapter
format (via titleformat{chapter}...
). See the titlesec
documentation for more information.
Thank you! After all these years, your solution keeps being useful for people like me!
– mathreader
Apr 21 '18 at 16:18
add a comment |
This is the default behaviour of for chapter
(and chapter*
) in both book
and report
document class, so you're doing nothing wrong. This default length is 50pt
.
You could use the etoolbox
package to remove (or modify) the spacing above the chapter headings. Here's a minimal example that will work with either book
or report
document class:
documentclass{book}
usepackage{showframe}% http://ctan.org/pkg/showframe
usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
makeatletter
patchcmd{@makechapterhead}{vspace*{50p@}}{}{}{}% Removes space above chapter head
patchcmd{@makeschapterhead}{vspace*{50p@}}{}{}{}% Removes space above chapter* head
makeatother
begin{document}
chapter{A chapter}
chapter*{Another chapter}
end{document}
patchcmd
searches for vspace*{50p@}
in both @makechapterhead
and @makeschapterhead
and replaces it with nothing, thereby removing the space. If you want to add a little space, you can insert something different as the replacement text. For example
patchcmd{@makechapterhead}{vspace*{50p@}}{vspace*{20pt}}{}{}%
patchcmd{@makeschapterhead}{vspace*{50p@}}{vspace*{20pt}}{}{}%
will insert 20pt
instead of the default 50pt
.
showframe
was added to show the frame of the text block and was merely used for illustrative purposes - you can remove this.
An alternative to this would be to use the titlesec
package. However, in order to modify the chapter
spacing (via titlespacing{chapter}...
), you are also required to modify the chapter
format (via titleformat{chapter}...
). See the titlesec
documentation for more information.
Thank you! After all these years, your solution keeps being useful for people like me!
– mathreader
Apr 21 '18 at 16:18
add a comment |
This is the default behaviour of for chapter
(and chapter*
) in both book
and report
document class, so you're doing nothing wrong. This default length is 50pt
.
You could use the etoolbox
package to remove (or modify) the spacing above the chapter headings. Here's a minimal example that will work with either book
or report
document class:
documentclass{book}
usepackage{showframe}% http://ctan.org/pkg/showframe
usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
makeatletter
patchcmd{@makechapterhead}{vspace*{50p@}}{}{}{}% Removes space above chapter head
patchcmd{@makeschapterhead}{vspace*{50p@}}{}{}{}% Removes space above chapter* head
makeatother
begin{document}
chapter{A chapter}
chapter*{Another chapter}
end{document}
patchcmd
searches for vspace*{50p@}
in both @makechapterhead
and @makeschapterhead
and replaces it with nothing, thereby removing the space. If you want to add a little space, you can insert something different as the replacement text. For example
patchcmd{@makechapterhead}{vspace*{50p@}}{vspace*{20pt}}{}{}%
patchcmd{@makeschapterhead}{vspace*{50p@}}{vspace*{20pt}}{}{}%
will insert 20pt
instead of the default 50pt
.
showframe
was added to show the frame of the text block and was merely used for illustrative purposes - you can remove this.
An alternative to this would be to use the titlesec
package. However, in order to modify the chapter
spacing (via titlespacing{chapter}...
), you are also required to modify the chapter
format (via titleformat{chapter}...
). See the titlesec
documentation for more information.
This is the default behaviour of for chapter
(and chapter*
) in both book
and report
document class, so you're doing nothing wrong. This default length is 50pt
.
You could use the etoolbox
package to remove (or modify) the spacing above the chapter headings. Here's a minimal example that will work with either book
or report
document class:
documentclass{book}
usepackage{showframe}% http://ctan.org/pkg/showframe
usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
makeatletter
patchcmd{@makechapterhead}{vspace*{50p@}}{}{}{}% Removes space above chapter head
patchcmd{@makeschapterhead}{vspace*{50p@}}{}{}{}% Removes space above chapter* head
makeatother
begin{document}
chapter{A chapter}
chapter*{Another chapter}
end{document}
patchcmd
searches for vspace*{50p@}
in both @makechapterhead
and @makeschapterhead
and replaces it with nothing, thereby removing the space. If you want to add a little space, you can insert something different as the replacement text. For example
patchcmd{@makechapterhead}{vspace*{50p@}}{vspace*{20pt}}{}{}%
patchcmd{@makeschapterhead}{vspace*{50p@}}{vspace*{20pt}}{}{}%
will insert 20pt
instead of the default 50pt
.
showframe
was added to show the frame of the text block and was merely used for illustrative purposes - you can remove this.
An alternative to this would be to use the titlesec
package. However, in order to modify the chapter
spacing (via titlespacing{chapter}...
), you are also required to modify the chapter
format (via titleformat{chapter}...
). See the titlesec
documentation for more information.
edited Jan 4 '12 at 7:08
answered Jan 4 '12 at 6:39
WernerWerner
443k679761673
443k679761673
Thank you! After all these years, your solution keeps being useful for people like me!
– mathreader
Apr 21 '18 at 16:18
add a comment |
Thank you! After all these years, your solution keeps being useful for people like me!
– mathreader
Apr 21 '18 at 16:18
Thank you! After all these years, your solution keeps being useful for people like me!
– mathreader
Apr 21 '18 at 16:18
Thank you! After all these years, your solution keeps being useful for people like me!
– mathreader
Apr 21 '18 at 16:18
add a comment |
With the report
class the space before a chapter title is 50pt. The easiest method for changing it is to patch the two relevant commands:
documentclass[a4paper,12pt,twoside]{report}
usepackage{amssymb}
usepackage{amsmath}
usepackage{setspace}
doublespacing
%pagestyle{plain} % default for report
usepackage{etoolbox}
makeatletter
patchcmd{@makechapterhead}{50p@}{0pt}{}{}
patchcmd{@makeschapterhead}{50p@}{0pt}{}{}
makeatother
<rest of the preamble>
begin{document}
<the document>
end{document}
You can play with the figures: instead of 0pt
you can put any dimension you want.
Note that there's no a4paper
package; to get page parameters suitable for ISO A4 paper you need to specify a4paper
as an option to documentclass
.
This somehow does not work for me with the book class. I want the "Chapter 1" line to appear right at the top. What am I doing wrong?
– Ivan Perez
Sep 16 '18 at 18:35
@IvanPerez What document class are you using?
– egreg
Sep 16 '18 at 19:00
The document class book
– Ivan Perez
Sep 16 '18 at 19:08
@IvanPerez Change0pt
to something like-24pt
(it depends on the main font size, though).
– egreg
Sep 16 '18 at 19:12
I changed it to -100pt, and it had no effect. It's like it's not using@makechapterhead
at all. I removed every import but this and left only one chapter to obtain a minimal example, and it still won't make a difference. I'm using Ubuntu 18.04, and installing latex from the default repositories.
– Ivan Perez
Sep 16 '18 at 19:26
|
show 3 more comments
With the report
class the space before a chapter title is 50pt. The easiest method for changing it is to patch the two relevant commands:
documentclass[a4paper,12pt,twoside]{report}
usepackage{amssymb}
usepackage{amsmath}
usepackage{setspace}
doublespacing
%pagestyle{plain} % default for report
usepackage{etoolbox}
makeatletter
patchcmd{@makechapterhead}{50p@}{0pt}{}{}
patchcmd{@makeschapterhead}{50p@}{0pt}{}{}
makeatother
<rest of the preamble>
begin{document}
<the document>
end{document}
You can play with the figures: instead of 0pt
you can put any dimension you want.
Note that there's no a4paper
package; to get page parameters suitable for ISO A4 paper you need to specify a4paper
as an option to documentclass
.
This somehow does not work for me with the book class. I want the "Chapter 1" line to appear right at the top. What am I doing wrong?
– Ivan Perez
Sep 16 '18 at 18:35
@IvanPerez What document class are you using?
– egreg
Sep 16 '18 at 19:00
The document class book
– Ivan Perez
Sep 16 '18 at 19:08
@IvanPerez Change0pt
to something like-24pt
(it depends on the main font size, though).
– egreg
Sep 16 '18 at 19:12
I changed it to -100pt, and it had no effect. It's like it's not using@makechapterhead
at all. I removed every import but this and left only one chapter to obtain a minimal example, and it still won't make a difference. I'm using Ubuntu 18.04, and installing latex from the default repositories.
– Ivan Perez
Sep 16 '18 at 19:26
|
show 3 more comments
With the report
class the space before a chapter title is 50pt. The easiest method for changing it is to patch the two relevant commands:
documentclass[a4paper,12pt,twoside]{report}
usepackage{amssymb}
usepackage{amsmath}
usepackage{setspace}
doublespacing
%pagestyle{plain} % default for report
usepackage{etoolbox}
makeatletter
patchcmd{@makechapterhead}{50p@}{0pt}{}{}
patchcmd{@makeschapterhead}{50p@}{0pt}{}{}
makeatother
<rest of the preamble>
begin{document}
<the document>
end{document}
You can play with the figures: instead of 0pt
you can put any dimension you want.
Note that there's no a4paper
package; to get page parameters suitable for ISO A4 paper you need to specify a4paper
as an option to documentclass
.
With the report
class the space before a chapter title is 50pt. The easiest method for changing it is to patch the two relevant commands:
documentclass[a4paper,12pt,twoside]{report}
usepackage{amssymb}
usepackage{amsmath}
usepackage{setspace}
doublespacing
%pagestyle{plain} % default for report
usepackage{etoolbox}
makeatletter
patchcmd{@makechapterhead}{50p@}{0pt}{}{}
patchcmd{@makeschapterhead}{50p@}{0pt}{}{}
makeatother
<rest of the preamble>
begin{document}
<the document>
end{document}
You can play with the figures: instead of 0pt
you can put any dimension you want.
Note that there's no a4paper
package; to get page parameters suitable for ISO A4 paper you need to specify a4paper
as an option to documentclass
.
answered Mar 30 '12 at 10:22
egregegreg
717k8719023197
717k8719023197
This somehow does not work for me with the book class. I want the "Chapter 1" line to appear right at the top. What am I doing wrong?
– Ivan Perez
Sep 16 '18 at 18:35
@IvanPerez What document class are you using?
– egreg
Sep 16 '18 at 19:00
The document class book
– Ivan Perez
Sep 16 '18 at 19:08
@IvanPerez Change0pt
to something like-24pt
(it depends on the main font size, though).
– egreg
Sep 16 '18 at 19:12
I changed it to -100pt, and it had no effect. It's like it's not using@makechapterhead
at all. I removed every import but this and left only one chapter to obtain a minimal example, and it still won't make a difference. I'm using Ubuntu 18.04, and installing latex from the default repositories.
– Ivan Perez
Sep 16 '18 at 19:26
|
show 3 more comments
This somehow does not work for me with the book class. I want the "Chapter 1" line to appear right at the top. What am I doing wrong?
– Ivan Perez
Sep 16 '18 at 18:35
@IvanPerez What document class are you using?
– egreg
Sep 16 '18 at 19:00
The document class book
– Ivan Perez
Sep 16 '18 at 19:08
@IvanPerez Change0pt
to something like-24pt
(it depends on the main font size, though).
– egreg
Sep 16 '18 at 19:12
I changed it to -100pt, and it had no effect. It's like it's not using@makechapterhead
at all. I removed every import but this and left only one chapter to obtain a minimal example, and it still won't make a difference. I'm using Ubuntu 18.04, and installing latex from the default repositories.
– Ivan Perez
Sep 16 '18 at 19:26
This somehow does not work for me with the book class. I want the "Chapter 1" line to appear right at the top. What am I doing wrong?
– Ivan Perez
Sep 16 '18 at 18:35
This somehow does not work for me with the book class. I want the "Chapter 1" line to appear right at the top. What am I doing wrong?
– Ivan Perez
Sep 16 '18 at 18:35
@IvanPerez What document class are you using?
– egreg
Sep 16 '18 at 19:00
@IvanPerez What document class are you using?
– egreg
Sep 16 '18 at 19:00
The document class book
– Ivan Perez
Sep 16 '18 at 19:08
The document class book
– Ivan Perez
Sep 16 '18 at 19:08
@IvanPerez Change
0pt
to something like -24pt
(it depends on the main font size, though).– egreg
Sep 16 '18 at 19:12
@IvanPerez Change
0pt
to something like -24pt
(it depends on the main font size, though).– egreg
Sep 16 '18 at 19:12
I changed it to -100pt, and it had no effect. It's like it's not using
@makechapterhead
at all. I removed every import but this and left only one chapter to obtain a minimal example, and it still won't make a difference. I'm using Ubuntu 18.04, and installing latex from the default repositories.– Ivan Perez
Sep 16 '18 at 19:26
I changed it to -100pt, and it had no effect. It's like it's not using
@makechapterhead
at all. I removed every import but this and left only one chapter to obtain a minimal example, and it still won't make a difference. I'm using Ubuntu 18.04, and installing latex from the default repositories.– Ivan Perez
Sep 16 '18 at 19:26
|
show 3 more comments
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f39988%2fspace-before-chapters-and-contents%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Please provide a minimal example. The spacing really depends on the document class and mabye related packages.
– Marco Daniel
Jan 4 '12 at 6:41
I want to add that this default behaviour of
scrreprt
is really strange. Usually you don't want so much whitespace before a chapter, at least if you have a limit of totally available space.– TomM
Dec 26 '13 at 13:33