Problem on position of bookmarks in PDF
I am writing a book that has 3 parts and each part has many sections. After compiling the .tex
file, some of the bookmarks of the .pdf
file are misplaced as shown in below:
and its MWE
documentclass[12pt,a4paper]{book}
usepackage{hyperref}
author{A}
title{B}
begin{document}
maketitle
tableofcontents
part{title}
section{title}
section{title}
section{title}
part{title}
section{title}
section{title}
section{title}
part{title}
section{title}
section{title}
section{title}
end{document}
Whats wrong? Any idea how to fix this problem?
sectioning hyperref bookmarks
|
show 1 more comment
I am writing a book that has 3 parts and each part has many sections. After compiling the .tex
file, some of the bookmarks of the .pdf
file are misplaced as shown in below:
and its MWE
documentclass[12pt,a4paper]{book}
usepackage{hyperref}
author{A}
title{B}
begin{document}
maketitle
tableofcontents
part{title}
section{title}
section{title}
section{title}
part{title}
section{title}
section{title}
section{title}
part{title}
section{title}
section{title}
section{title}
end{document}
Whats wrong? Any idea how to fix this problem?
sectioning hyperref bookmarks
3
I think this happened because you missedchapter{...}
.book
document class expects the following hierarchy: part → chapter → section → subsection → ...
– andselisk
9 hours ago
I know this priority. but I don't want to use chapters.
– C.F.G
8 hours ago
2
You could change to article which does have parts and sections but no chapters…
– TeXnician
6 hours ago
2
@C.F.G: You could use thebookmark
package, that 'sanitizes' the bookmarks and keeps the levels in order, but actually, omitting chapters is an logical error!
– Christian Hupfer
6 hours ago
1
Omitting the chapter will also lead to section numbers like0.5
showing up, which is awful.
– Christian Hupfer
6 hours ago
|
show 1 more comment
I am writing a book that has 3 parts and each part has many sections. After compiling the .tex
file, some of the bookmarks of the .pdf
file are misplaced as shown in below:
and its MWE
documentclass[12pt,a4paper]{book}
usepackage{hyperref}
author{A}
title{B}
begin{document}
maketitle
tableofcontents
part{title}
section{title}
section{title}
section{title}
part{title}
section{title}
section{title}
section{title}
part{title}
section{title}
section{title}
section{title}
end{document}
Whats wrong? Any idea how to fix this problem?
sectioning hyperref bookmarks
I am writing a book that has 3 parts and each part has many sections. After compiling the .tex
file, some of the bookmarks of the .pdf
file are misplaced as shown in below:
and its MWE
documentclass[12pt,a4paper]{book}
usepackage{hyperref}
author{A}
title{B}
begin{document}
maketitle
tableofcontents
part{title}
section{title}
section{title}
section{title}
part{title}
section{title}
section{title}
section{title}
part{title}
section{title}
section{title}
section{title}
end{document}
Whats wrong? Any idea how to fix this problem?
sectioning hyperref bookmarks
sectioning hyperref bookmarks
edited 6 hours ago
Christian Hupfer
148k14193386
148k14193386
asked 9 hours ago
C.F.G
462312
462312
3
I think this happened because you missedchapter{...}
.book
document class expects the following hierarchy: part → chapter → section → subsection → ...
– andselisk
9 hours ago
I know this priority. but I don't want to use chapters.
– C.F.G
8 hours ago
2
You could change to article which does have parts and sections but no chapters…
– TeXnician
6 hours ago
2
@C.F.G: You could use thebookmark
package, that 'sanitizes' the bookmarks and keeps the levels in order, but actually, omitting chapters is an logical error!
– Christian Hupfer
6 hours ago
1
Omitting the chapter will also lead to section numbers like0.5
showing up, which is awful.
– Christian Hupfer
6 hours ago
|
show 1 more comment
3
I think this happened because you missedchapter{...}
.book
document class expects the following hierarchy: part → chapter → section → subsection → ...
– andselisk
9 hours ago
I know this priority. but I don't want to use chapters.
– C.F.G
8 hours ago
2
You could change to article which does have parts and sections but no chapters…
– TeXnician
6 hours ago
2
@C.F.G: You could use thebookmark
package, that 'sanitizes' the bookmarks and keeps the levels in order, but actually, omitting chapters is an logical error!
– Christian Hupfer
6 hours ago
1
Omitting the chapter will also lead to section numbers like0.5
showing up, which is awful.
– Christian Hupfer
6 hours ago
3
3
I think this happened because you missed
chapter{...}
. book
document class expects the following hierarchy: part → chapter → section → subsection → ...– andselisk
9 hours ago
I think this happened because you missed
chapter{...}
. book
document class expects the following hierarchy: part → chapter → section → subsection → ...– andselisk
9 hours ago
I know this priority. but I don't want to use chapters.
– C.F.G
8 hours ago
I know this priority. but I don't want to use chapters.
– C.F.G
8 hours ago
2
2
You could change to article which does have parts and sections but no chapters…
– TeXnician
6 hours ago
You could change to article which does have parts and sections but no chapters…
– TeXnician
6 hours ago
2
2
@C.F.G: You could use the
bookmark
package, that 'sanitizes' the bookmarks and keeps the levels in order, but actually, omitting chapters is an logical error!– Christian Hupfer
6 hours ago
@C.F.G: You could use the
bookmark
package, that 'sanitizes' the bookmarks and keeps the levels in order, but actually, omitting chapters is an logical error!– Christian Hupfer
6 hours ago
1
1
Omitting the chapter will also lead to section numbers like
0.5
showing up, which is awful.– Christian Hupfer
6 hours ago
Omitting the chapter will also lead to section numbers like
0.5
showing up, which is awful.– Christian Hupfer
6 hours ago
|
show 1 more comment
1 Answer
1
active
oldest
votes
The hierarchy of levels (that's why it is called level) in book
class, is with their associated numbers, starting from top to bottom
part (-1) - chapter (0) - section (1) - subsection (2) - subsubsection
(3) - paragraph (4) - subparagraph (5)
Omitting one level is a logical error that confuses hyperref
. Either do not omit chapter
or use the bookmark
package that cleans up the wrong leveling.
A third method involves reassigning the level numbers for the bookmarks, i.e. there is a toclevel@X
which X
standing for one of the above mentioned levels.
Please note, that this does not cure the problem that the sections appear with a 0
as prefix in the section number and section numbers are never reset this way (since the chapter counter is not stepped).
Summary: The proper way is to switch to article
or including chapter
as sectioning level.
documentclass[12pt,a4paper]{book}
usepackage{hyperref}
makeatletter
renewcommand{toclevel@section}{0}
renewcommand{toclevel@subsection}{1}
renewcommand{toclevel@subsubsection}{2}
renewcommand{toclevel@paragraph}{3}
renewcommand{toclevel@subparagraph}{4}
makeatother
%usepackage{bookmark}
author{A}
title{B}
begin{document}
maketitle
tableofcontents
part{title}
section{title}
section{title}
section{title}
part{title}
section{title}
section{title}
section{title}
part{title}
section{title}
section{title}
section{title}
end{document}
add a comment |
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%2f467991%2fproblem-on-position-of-bookmarks-in-pdf%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The hierarchy of levels (that's why it is called level) in book
class, is with their associated numbers, starting from top to bottom
part (-1) - chapter (0) - section (1) - subsection (2) - subsubsection
(3) - paragraph (4) - subparagraph (5)
Omitting one level is a logical error that confuses hyperref
. Either do not omit chapter
or use the bookmark
package that cleans up the wrong leveling.
A third method involves reassigning the level numbers for the bookmarks, i.e. there is a toclevel@X
which X
standing for one of the above mentioned levels.
Please note, that this does not cure the problem that the sections appear with a 0
as prefix in the section number and section numbers are never reset this way (since the chapter counter is not stepped).
Summary: The proper way is to switch to article
or including chapter
as sectioning level.
documentclass[12pt,a4paper]{book}
usepackage{hyperref}
makeatletter
renewcommand{toclevel@section}{0}
renewcommand{toclevel@subsection}{1}
renewcommand{toclevel@subsubsection}{2}
renewcommand{toclevel@paragraph}{3}
renewcommand{toclevel@subparagraph}{4}
makeatother
%usepackage{bookmark}
author{A}
title{B}
begin{document}
maketitle
tableofcontents
part{title}
section{title}
section{title}
section{title}
part{title}
section{title}
section{title}
section{title}
part{title}
section{title}
section{title}
section{title}
end{document}
add a comment |
The hierarchy of levels (that's why it is called level) in book
class, is with their associated numbers, starting from top to bottom
part (-1) - chapter (0) - section (1) - subsection (2) - subsubsection
(3) - paragraph (4) - subparagraph (5)
Omitting one level is a logical error that confuses hyperref
. Either do not omit chapter
or use the bookmark
package that cleans up the wrong leveling.
A third method involves reassigning the level numbers for the bookmarks, i.e. there is a toclevel@X
which X
standing for one of the above mentioned levels.
Please note, that this does not cure the problem that the sections appear with a 0
as prefix in the section number and section numbers are never reset this way (since the chapter counter is not stepped).
Summary: The proper way is to switch to article
or including chapter
as sectioning level.
documentclass[12pt,a4paper]{book}
usepackage{hyperref}
makeatletter
renewcommand{toclevel@section}{0}
renewcommand{toclevel@subsection}{1}
renewcommand{toclevel@subsubsection}{2}
renewcommand{toclevel@paragraph}{3}
renewcommand{toclevel@subparagraph}{4}
makeatother
%usepackage{bookmark}
author{A}
title{B}
begin{document}
maketitle
tableofcontents
part{title}
section{title}
section{title}
section{title}
part{title}
section{title}
section{title}
section{title}
part{title}
section{title}
section{title}
section{title}
end{document}
add a comment |
The hierarchy of levels (that's why it is called level) in book
class, is with their associated numbers, starting from top to bottom
part (-1) - chapter (0) - section (1) - subsection (2) - subsubsection
(3) - paragraph (4) - subparagraph (5)
Omitting one level is a logical error that confuses hyperref
. Either do not omit chapter
or use the bookmark
package that cleans up the wrong leveling.
A third method involves reassigning the level numbers for the bookmarks, i.e. there is a toclevel@X
which X
standing for one of the above mentioned levels.
Please note, that this does not cure the problem that the sections appear with a 0
as prefix in the section number and section numbers are never reset this way (since the chapter counter is not stepped).
Summary: The proper way is to switch to article
or including chapter
as sectioning level.
documentclass[12pt,a4paper]{book}
usepackage{hyperref}
makeatletter
renewcommand{toclevel@section}{0}
renewcommand{toclevel@subsection}{1}
renewcommand{toclevel@subsubsection}{2}
renewcommand{toclevel@paragraph}{3}
renewcommand{toclevel@subparagraph}{4}
makeatother
%usepackage{bookmark}
author{A}
title{B}
begin{document}
maketitle
tableofcontents
part{title}
section{title}
section{title}
section{title}
part{title}
section{title}
section{title}
section{title}
part{title}
section{title}
section{title}
section{title}
end{document}
The hierarchy of levels (that's why it is called level) in book
class, is with their associated numbers, starting from top to bottom
part (-1) - chapter (0) - section (1) - subsection (2) - subsubsection
(3) - paragraph (4) - subparagraph (5)
Omitting one level is a logical error that confuses hyperref
. Either do not omit chapter
or use the bookmark
package that cleans up the wrong leveling.
A third method involves reassigning the level numbers for the bookmarks, i.e. there is a toclevel@X
which X
standing for one of the above mentioned levels.
Please note, that this does not cure the problem that the sections appear with a 0
as prefix in the section number and section numbers are never reset this way (since the chapter counter is not stepped).
Summary: The proper way is to switch to article
or including chapter
as sectioning level.
documentclass[12pt,a4paper]{book}
usepackage{hyperref}
makeatletter
renewcommand{toclevel@section}{0}
renewcommand{toclevel@subsection}{1}
renewcommand{toclevel@subsubsection}{2}
renewcommand{toclevel@paragraph}{3}
renewcommand{toclevel@subparagraph}{4}
makeatother
%usepackage{bookmark}
author{A}
title{B}
begin{document}
maketitle
tableofcontents
part{title}
section{title}
section{title}
section{title}
part{title}
section{title}
section{title}
section{title}
part{title}
section{title}
section{title}
section{title}
end{document}
edited 6 hours ago
answered 6 hours ago
Christian Hupfer
148k14193386
148k14193386
add a comment |
add a comment |
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2f467991%2fproblem-on-position-of-bookmarks-in-pdf%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
3
I think this happened because you missed
chapter{...}
.book
document class expects the following hierarchy: part → chapter → section → subsection → ...– andselisk
9 hours ago
I know this priority. but I don't want to use chapters.
– C.F.G
8 hours ago
2
You could change to article which does have parts and sections but no chapters…
– TeXnician
6 hours ago
2
@C.F.G: You could use the
bookmark
package, that 'sanitizes' the bookmarks and keeps the levels in order, but actually, omitting chapters is an logical error!– Christian Hupfer
6 hours ago
1
Omitting the chapter will also lead to section numbers like
0.5
showing up, which is awful.– Christian Hupfer
6 hours ago