Removing Part Page & including bibliography leads to wrong arrangement in TOC











up vote
0
down vote

favorite












I have encountered a weird problem (in my eyes) to do with bibliographys in included chapters and the structure of a document and I just cannot find out whats the cause...



In the final document, I want to include a table of contents structured as follows:



Structure of the final document



I would like NOT to have the page for stating "PART 1 - Introduction", which I want to exclude using this command:



 renewcommand{part}[1]{addcontentsline{toc}{part}{#1}}


However, if I include this into my document, I end up with the following TOC:



Weird structure after removing page



--> The "Introduction" part moves to the bottom of the TOC



I have already figured out using a MWE, that it has something to do with including the bibliography inside a chapter that I am including, as a MWE with the bibliography in the main file was fine as well as including a chapter without a bibliography was fine - but the combination of those somehow triggers this?



This works:



documentclass{book}

usepackage{lipsum}
renewcommand{part}[1]{addcontentsline{toc}{part}{#1}} %removes pages with part headers

begin{document}

tableofcontents
cleardoublepage

part{Introduction}
%include{MWE_Chapter}
chapter{Wabbadabbadupdup} % (fold)
This is just a test and a citation citep{Carmichael2008} -

section{Hey ho Lets go}
lipsum

bibliographystyle{jneurosci} %apalike, abbrv
bibliography{library}

end{document}


This doesn't:



documentclass{book}

usepackage{lipsum}
renewcommand{part}[1]{addcontentsline{toc}{part}{#1}} %removes pages with part headers

begin{document}

tableofcontents
cleardoublepage

part{Introduction}
include{MWE_Chapter}

end{document}


with MWE_Chapter being:



chapter{Wabbadabbadupdup} % (fold)
This is just a test and a citation citep{Carmichael2008} -

section{Hey ho Lets go}
lipsum

bibliographystyle{jneurosci} %apalike, abbrv
bibliography{library}


I would really like to know what causes this behavior and if someone can reproduce it? Or if there is another possibility to remove the pages created by the part syntax without changing the TOC! Thanks!



The same by the way happens if I use



addcontentsline{toc}{part}{<Header of the part>} 


instead of the renewcommand to remove the part page










share|improve this question






















  • By your definition of part you will not have any part page again. If you want to remove it from the ToC, you must use more sophisticated strategies
    – Christian Hupfer
    Jan 25 at 20:16










  • Besides all, the document isn't compilable at all
    – Christian Hupfer
    Jan 25 at 20:21






  • 1




    I don't recommend it really, but try renewcommand{part}[1]{addcontentsline{toc}{part}{#1}null}, because you're getting into troubles with include here. The non - include version works as expected, but include has some issues with addcontentsline
    – Christian Hupfer
    Jan 25 at 20:25












  • I really do not understand what you want to achieve, but I'd not renew the part comment. If you just want an entry in the toc, add addcontentsline{toc}{part}{Introduction}, and if you want to increase the part number, put stepcounter{part}.
    – marmot
    Jan 25 at 20:28










  • @marmot What I want to achieve in the end is a common structure of the document including the part sections in the TOC, but not having a seperate page for each part, and then additionally have chapters with a bibliography each (natbib+chapterbib) - which is why I would like to include the chapters instead of having 1 big file. I already tried your suggested solution (and have included this in the question, see above) but get the same result.
    – Julia
    Jan 25 at 23:08















up vote
0
down vote

favorite












I have encountered a weird problem (in my eyes) to do with bibliographys in included chapters and the structure of a document and I just cannot find out whats the cause...



In the final document, I want to include a table of contents structured as follows:



Structure of the final document



I would like NOT to have the page for stating "PART 1 - Introduction", which I want to exclude using this command:



 renewcommand{part}[1]{addcontentsline{toc}{part}{#1}}


However, if I include this into my document, I end up with the following TOC:



Weird structure after removing page



--> The "Introduction" part moves to the bottom of the TOC



I have already figured out using a MWE, that it has something to do with including the bibliography inside a chapter that I am including, as a MWE with the bibliography in the main file was fine as well as including a chapter without a bibliography was fine - but the combination of those somehow triggers this?



This works:



documentclass{book}

usepackage{lipsum}
renewcommand{part}[1]{addcontentsline{toc}{part}{#1}} %removes pages with part headers

begin{document}

tableofcontents
cleardoublepage

part{Introduction}
%include{MWE_Chapter}
chapter{Wabbadabbadupdup} % (fold)
This is just a test and a citation citep{Carmichael2008} -

section{Hey ho Lets go}
lipsum

bibliographystyle{jneurosci} %apalike, abbrv
bibliography{library}

end{document}


This doesn't:



documentclass{book}

usepackage{lipsum}
renewcommand{part}[1]{addcontentsline{toc}{part}{#1}} %removes pages with part headers

begin{document}

tableofcontents
cleardoublepage

part{Introduction}
include{MWE_Chapter}

end{document}


with MWE_Chapter being:



chapter{Wabbadabbadupdup} % (fold)
This is just a test and a citation citep{Carmichael2008} -

section{Hey ho Lets go}
lipsum

bibliographystyle{jneurosci} %apalike, abbrv
bibliography{library}


I would really like to know what causes this behavior and if someone can reproduce it? Or if there is another possibility to remove the pages created by the part syntax without changing the TOC! Thanks!



The same by the way happens if I use



addcontentsline{toc}{part}{<Header of the part>} 


instead of the renewcommand to remove the part page










share|improve this question






















  • By your definition of part you will not have any part page again. If you want to remove it from the ToC, you must use more sophisticated strategies
    – Christian Hupfer
    Jan 25 at 20:16










  • Besides all, the document isn't compilable at all
    – Christian Hupfer
    Jan 25 at 20:21






  • 1




    I don't recommend it really, but try renewcommand{part}[1]{addcontentsline{toc}{part}{#1}null}, because you're getting into troubles with include here. The non - include version works as expected, but include has some issues with addcontentsline
    – Christian Hupfer
    Jan 25 at 20:25












  • I really do not understand what you want to achieve, but I'd not renew the part comment. If you just want an entry in the toc, add addcontentsline{toc}{part}{Introduction}, and if you want to increase the part number, put stepcounter{part}.
    – marmot
    Jan 25 at 20:28










  • @marmot What I want to achieve in the end is a common structure of the document including the part sections in the TOC, but not having a seperate page for each part, and then additionally have chapters with a bibliography each (natbib+chapterbib) - which is why I would like to include the chapters instead of having 1 big file. I already tried your suggested solution (and have included this in the question, see above) but get the same result.
    – Julia
    Jan 25 at 23:08













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have encountered a weird problem (in my eyes) to do with bibliographys in included chapters and the structure of a document and I just cannot find out whats the cause...



In the final document, I want to include a table of contents structured as follows:



Structure of the final document



I would like NOT to have the page for stating "PART 1 - Introduction", which I want to exclude using this command:



 renewcommand{part}[1]{addcontentsline{toc}{part}{#1}}


However, if I include this into my document, I end up with the following TOC:



Weird structure after removing page



--> The "Introduction" part moves to the bottom of the TOC



I have already figured out using a MWE, that it has something to do with including the bibliography inside a chapter that I am including, as a MWE with the bibliography in the main file was fine as well as including a chapter without a bibliography was fine - but the combination of those somehow triggers this?



This works:



documentclass{book}

usepackage{lipsum}
renewcommand{part}[1]{addcontentsline{toc}{part}{#1}} %removes pages with part headers

begin{document}

tableofcontents
cleardoublepage

part{Introduction}
%include{MWE_Chapter}
chapter{Wabbadabbadupdup} % (fold)
This is just a test and a citation citep{Carmichael2008} -

section{Hey ho Lets go}
lipsum

bibliographystyle{jneurosci} %apalike, abbrv
bibliography{library}

end{document}


This doesn't:



documentclass{book}

usepackage{lipsum}
renewcommand{part}[1]{addcontentsline{toc}{part}{#1}} %removes pages with part headers

begin{document}

tableofcontents
cleardoublepage

part{Introduction}
include{MWE_Chapter}

end{document}


with MWE_Chapter being:



chapter{Wabbadabbadupdup} % (fold)
This is just a test and a citation citep{Carmichael2008} -

section{Hey ho Lets go}
lipsum

bibliographystyle{jneurosci} %apalike, abbrv
bibliography{library}


I would really like to know what causes this behavior and if someone can reproduce it? Or if there is another possibility to remove the pages created by the part syntax without changing the TOC! Thanks!



The same by the way happens if I use



addcontentsline{toc}{part}{<Header of the part>} 


instead of the renewcommand to remove the part page










share|improve this question













I have encountered a weird problem (in my eyes) to do with bibliographys in included chapters and the structure of a document and I just cannot find out whats the cause...



In the final document, I want to include a table of contents structured as follows:



Structure of the final document



I would like NOT to have the page for stating "PART 1 - Introduction", which I want to exclude using this command:



 renewcommand{part}[1]{addcontentsline{toc}{part}{#1}}


However, if I include this into my document, I end up with the following TOC:



Weird structure after removing page



--> The "Introduction" part moves to the bottom of the TOC



I have already figured out using a MWE, that it has something to do with including the bibliography inside a chapter that I am including, as a MWE with the bibliography in the main file was fine as well as including a chapter without a bibliography was fine - but the combination of those somehow triggers this?



This works:



documentclass{book}

usepackage{lipsum}
renewcommand{part}[1]{addcontentsline{toc}{part}{#1}} %removes pages with part headers

begin{document}

tableofcontents
cleardoublepage

part{Introduction}
%include{MWE_Chapter}
chapter{Wabbadabbadupdup} % (fold)
This is just a test and a citation citep{Carmichael2008} -

section{Hey ho Lets go}
lipsum

bibliographystyle{jneurosci} %apalike, abbrv
bibliography{library}

end{document}


This doesn't:



documentclass{book}

usepackage{lipsum}
renewcommand{part}[1]{addcontentsline{toc}{part}{#1}} %removes pages with part headers

begin{document}

tableofcontents
cleardoublepage

part{Introduction}
include{MWE_Chapter}

end{document}


with MWE_Chapter being:



chapter{Wabbadabbadupdup} % (fold)
This is just a test and a citation citep{Carmichael2008} -

section{Hey ho Lets go}
lipsum

bibliographystyle{jneurosci} %apalike, abbrv
bibliography{library}


I would really like to know what causes this behavior and if someone can reproduce it? Or if there is another possibility to remove the pages created by the part syntax without changing the TOC! Thanks!



The same by the way happens if I use



addcontentsline{toc}{part}{<Header of the part>} 


instead of the renewcommand to remove the part page







table-of-contents bibliographies parts






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 25 at 20:13









Julia

1




1












  • By your definition of part you will not have any part page again. If you want to remove it from the ToC, you must use more sophisticated strategies
    – Christian Hupfer
    Jan 25 at 20:16










  • Besides all, the document isn't compilable at all
    – Christian Hupfer
    Jan 25 at 20:21






  • 1




    I don't recommend it really, but try renewcommand{part}[1]{addcontentsline{toc}{part}{#1}null}, because you're getting into troubles with include here. The non - include version works as expected, but include has some issues with addcontentsline
    – Christian Hupfer
    Jan 25 at 20:25












  • I really do not understand what you want to achieve, but I'd not renew the part comment. If you just want an entry in the toc, add addcontentsline{toc}{part}{Introduction}, and if you want to increase the part number, put stepcounter{part}.
    – marmot
    Jan 25 at 20:28










  • @marmot What I want to achieve in the end is a common structure of the document including the part sections in the TOC, but not having a seperate page for each part, and then additionally have chapters with a bibliography each (natbib+chapterbib) - which is why I would like to include the chapters instead of having 1 big file. I already tried your suggested solution (and have included this in the question, see above) but get the same result.
    – Julia
    Jan 25 at 23:08


















  • By your definition of part you will not have any part page again. If you want to remove it from the ToC, you must use more sophisticated strategies
    – Christian Hupfer
    Jan 25 at 20:16










  • Besides all, the document isn't compilable at all
    – Christian Hupfer
    Jan 25 at 20:21






  • 1




    I don't recommend it really, but try renewcommand{part}[1]{addcontentsline{toc}{part}{#1}null}, because you're getting into troubles with include here. The non - include version works as expected, but include has some issues with addcontentsline
    – Christian Hupfer
    Jan 25 at 20:25












  • I really do not understand what you want to achieve, but I'd not renew the part comment. If you just want an entry in the toc, add addcontentsline{toc}{part}{Introduction}, and if you want to increase the part number, put stepcounter{part}.
    – marmot
    Jan 25 at 20:28










  • @marmot What I want to achieve in the end is a common structure of the document including the part sections in the TOC, but not having a seperate page for each part, and then additionally have chapters with a bibliography each (natbib+chapterbib) - which is why I would like to include the chapters instead of having 1 big file. I already tried your suggested solution (and have included this in the question, see above) but get the same result.
    – Julia
    Jan 25 at 23:08
















By your definition of part you will not have any part page again. If you want to remove it from the ToC, you must use more sophisticated strategies
– Christian Hupfer
Jan 25 at 20:16




By your definition of part you will not have any part page again. If you want to remove it from the ToC, you must use more sophisticated strategies
– Christian Hupfer
Jan 25 at 20:16












Besides all, the document isn't compilable at all
– Christian Hupfer
Jan 25 at 20:21




Besides all, the document isn't compilable at all
– Christian Hupfer
Jan 25 at 20:21




1




1




I don't recommend it really, but try renewcommand{part}[1]{addcontentsline{toc}{part}{#1}null}, because you're getting into troubles with include here. The non - include version works as expected, but include has some issues with addcontentsline
– Christian Hupfer
Jan 25 at 20:25






I don't recommend it really, but try renewcommand{part}[1]{addcontentsline{toc}{part}{#1}null}, because you're getting into troubles with include here. The non - include version works as expected, but include has some issues with addcontentsline
– Christian Hupfer
Jan 25 at 20:25














I really do not understand what you want to achieve, but I'd not renew the part comment. If you just want an entry in the toc, add addcontentsline{toc}{part}{Introduction}, and if you want to increase the part number, put stepcounter{part}.
– marmot
Jan 25 at 20:28




I really do not understand what you want to achieve, but I'd not renew the part comment. If you just want an entry in the toc, add addcontentsline{toc}{part}{Introduction}, and if you want to increase the part number, put stepcounter{part}.
– marmot
Jan 25 at 20:28












@marmot What I want to achieve in the end is a common structure of the document including the part sections in the TOC, but not having a seperate page for each part, and then additionally have chapters with a bibliography each (natbib+chapterbib) - which is why I would like to include the chapters instead of having 1 big file. I already tried your suggested solution (and have included this in the question, see above) but get the same result.
– Julia
Jan 25 at 23:08




@marmot What I want to achieve in the end is a common structure of the document including the part sections in the TOC, but not having a seperate page for each part, and then additionally have chapters with a bibliography each (natbib+chapterbib) - which is why I would like to include the chapters instead of having 1 big file. I already tried your suggested solution (and have included this in the question, see above) but get the same result.
– Julia
Jan 25 at 23:08










1 Answer
1






active

oldest

votes

















up vote
0
down vote













So this problem I have seems to be linked to apparently one of the oldest bugs of Latex and I found an answer here (immediatewrite worked for me):



ToC numbering problem






share|improve this answer





















  • while this does explain the problem, i would tend to call it a misfeature rather than a bug. the designer of latex had a good idea with include, but clearly didn't think out the implications too well. would you consider closing this as a duplicate? it will still remain available for other users to find, who have a similar problem.
    – barbara beeton
    Oct 23 at 23:28













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',
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
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f412148%2fremoving-part-page-including-bibliography-leads-to-wrong-arrangement-in-toc%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








up vote
0
down vote













So this problem I have seems to be linked to apparently one of the oldest bugs of Latex and I found an answer here (immediatewrite worked for me):



ToC numbering problem






share|improve this answer





















  • while this does explain the problem, i would tend to call it a misfeature rather than a bug. the designer of latex had a good idea with include, but clearly didn't think out the implications too well. would you consider closing this as a duplicate? it will still remain available for other users to find, who have a similar problem.
    – barbara beeton
    Oct 23 at 23:28

















up vote
0
down vote













So this problem I have seems to be linked to apparently one of the oldest bugs of Latex and I found an answer here (immediatewrite worked for me):



ToC numbering problem






share|improve this answer





















  • while this does explain the problem, i would tend to call it a misfeature rather than a bug. the designer of latex had a good idea with include, but clearly didn't think out the implications too well. would you consider closing this as a duplicate? it will still remain available for other users to find, who have a similar problem.
    – barbara beeton
    Oct 23 at 23:28















up vote
0
down vote










up vote
0
down vote









So this problem I have seems to be linked to apparently one of the oldest bugs of Latex and I found an answer here (immediatewrite worked for me):



ToC numbering problem






share|improve this answer












So this problem I have seems to be linked to apparently one of the oldest bugs of Latex and I found an answer here (immediatewrite worked for me):



ToC numbering problem







share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 26 at 14:52









Julia

1




1












  • while this does explain the problem, i would tend to call it a misfeature rather than a bug. the designer of latex had a good idea with include, but clearly didn't think out the implications too well. would you consider closing this as a duplicate? it will still remain available for other users to find, who have a similar problem.
    – barbara beeton
    Oct 23 at 23:28




















  • while this does explain the problem, i would tend to call it a misfeature rather than a bug. the designer of latex had a good idea with include, but clearly didn't think out the implications too well. would you consider closing this as a duplicate? it will still remain available for other users to find, who have a similar problem.
    – barbara beeton
    Oct 23 at 23:28


















while this does explain the problem, i would tend to call it a misfeature rather than a bug. the designer of latex had a good idea with include, but clearly didn't think out the implications too well. would you consider closing this as a duplicate? it will still remain available for other users to find, who have a similar problem.
– barbara beeton
Oct 23 at 23:28






while this does explain the problem, i would tend to call it a misfeature rather than a bug. the designer of latex had a good idea with include, but clearly didn't think out the implications too well. would you consider closing this as a duplicate? it will still remain available for other users to find, who have a similar problem.
– barbara beeton
Oct 23 at 23:28




















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f412148%2fremoving-part-page-including-bibliography-leads-to-wrong-arrangement-in-toc%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

How to change which sound is reproduced for terminal bell?

Can I use Tabulator js library in my java Spring + Thymeleaf project?

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents