Setting local toc depth < main toc depth OR limiting the scope of a local tocIn memoir, can I number...

How can I handle a player who pre-plans arguments about my rulings on RAW?

Where is the fallacy here?

Did Amazon pay $0 in taxes last year?

Why did John Williams use a march to symbolise Indiana Jones?

Is there a full canon version of Tyrion's jackass/honeycomb joke?

Why do phishing e-mails use faked e-mail addresses instead of the real one?

It took me a lot of time to make this, pls like. (YouTube Comments #1)

How do you say "powers of ten"?

The need of reserving one's ability in job interviews

What are SHA-rounds?

Practical reasons to have both a large police force and bounty hunting network?

When to use mean vs median

Why I cant see italic font at the header?

I can't die. Who am I?

Reason why dimensional travelling would be restricted

It beats the alternative

Giving a talk in my old university, how prominently should I tell students my salary?

Sometimes a banana is just a banana

How can I create a Table like this in Latex?

Do you continue making death saving throws while petrified?

School performs periodic password audits. Is my password compromised?

Canadian citizen, on US no-fly list. What can I do in order to be allowed on flights which go through US airspace?

Starting index at zero

Can throughput exceed the bandwidth of a network



Setting local toc depth


In memoir, can I number abstracts as sections in the toc?Chapter title in TOC on two lines when using addcontentslineA TOC with size count of each of the partsIs there a way to limit the scope of the Table of Contents (tableofcontents command)?list of figures and tables when there are no figures or tables?Using scrbook, how to suppress page numbers for all but several chapters in TOC?How can I exclude a chapter from part in hyperref bookmarks?Can I limit the scope of a ToC depth change for a local ToC? (etocsettocdepth)How can I custom the titles of ToC, Bibliography and Index?Removing Part Page & including bibliography leads to wrong arrangement in TOC













0















I am trying to set the main tableofcontents and several localtableofcontents in a large document. The document consists of an introduction, several parts, a conclusion and a bibliography.



As for the tocs:




  • Introduction, Conclusion and Bibliography should be set as chapters on the main tableofcontents. The latter two should be unnumbered.

  • Each part's front page is to show a localtableofcontents of the part in question


I tried to achieve this, making use of the {etoc} package. The following MWE produces the main toc as desired:



documentclass{report}
usepackage{titlesec}
usepackage{etoc}

% to be able to show localtoc on part-page
titleclass{part}{top}
titleformat{part}[display]{normalfonthugefilcenterbfseries}{partname thepart}{0pt}{}

begin{document}

tableofcontents

chapter{Introduction}

part{A Part}
etocsettocstyle{}{}
etocsetnexttocdepth{section}
localtableofcontents
chapter{A Chapter}
section{A section}

part{Another Part}
etocsetnexttocdepth{section}
localtableofcontents
chapter{Another Chapter}
section{Another Section}

% (1) change local toc's depth
%etocsettocdepth{part}
%etocignoretoctocdepth

% (2) limit scope of last local toc
%etocsetnexttocdepth{part}
%invisiblelocaltableofcontents

chapter*{Conclusion}
% to add unnumbered conclusion to toc:
addcontentsline{toc}{chapter}{Conclusion}

bibliographystyle{plainnat}
% to add unnumbered bibliography to toc:
addcontentsline{toc}{chapter}{bibname}
bibliography{jobname}
end{document}


However, it fails to exclude the Conclusion and Bibliography from the last localtableofcontents:



enter image description here



My thoughts were to either:





  1. etocsettocdepth the last localtableofcontents to not include chapters anymore just before the conclusion

  2. limit the scope of the last localtableofcontents to not reach the conclusion anymore


My attempts are commented out in the MWE above. But they could just as well be executed, as they seem to have no effect anyway...



How do I exclude the Conclusion and the Bibliography from the last localtableofcontents?










share|improve this question

























  • For a similar purpose, I use minitoc instead of etoc, but may be this could help. For the formatting of local tables, minitoc uses the same macros as regular tables of contents. If this is also the case of your package, you could create a full .toc as usual with the maximal deoth and locally tweak the table of contents typesetting by redefining l@chapter, l@section and siblings to some macro that gobble` its arguments without typesetting anything. Minitoc is said incompatible with titlesec but it nevertheless works flawlessly.

    – Jhor
    23 hours ago











  • @Jhor I am not familiar with {minitoc}, but from what I gather it creates a separate file for each toc. {etoc} does not. It adds etoc@startlocaltoc{n} to the .toc file. And somehow it seems to know where to stop. But I don't know how to tell it to stop early...

    – D.Roepo
    20 hours ago













  • Of you main concern is the scope and not the depth, have a look to parttoc package that has all the features you want. Unfortunately, if you use it jointly with titlesec AND hyperref, you'll get hundreds of error messages...

    – Jhor
    19 hours ago
















0















I am trying to set the main tableofcontents and several localtableofcontents in a large document. The document consists of an introduction, several parts, a conclusion and a bibliography.



As for the tocs:




  • Introduction, Conclusion and Bibliography should be set as chapters on the main tableofcontents. The latter two should be unnumbered.

  • Each part's front page is to show a localtableofcontents of the part in question


I tried to achieve this, making use of the {etoc} package. The following MWE produces the main toc as desired:



documentclass{report}
usepackage{titlesec}
usepackage{etoc}

% to be able to show localtoc on part-page
titleclass{part}{top}
titleformat{part}[display]{normalfonthugefilcenterbfseries}{partname thepart}{0pt}{}

begin{document}

tableofcontents

chapter{Introduction}

part{A Part}
etocsettocstyle{}{}
etocsetnexttocdepth{section}
localtableofcontents
chapter{A Chapter}
section{A section}

part{Another Part}
etocsetnexttocdepth{section}
localtableofcontents
chapter{Another Chapter}
section{Another Section}

% (1) change local toc's depth
%etocsettocdepth{part}
%etocignoretoctocdepth

% (2) limit scope of last local toc
%etocsetnexttocdepth{part}
%invisiblelocaltableofcontents

chapter*{Conclusion}
% to add unnumbered conclusion to toc:
addcontentsline{toc}{chapter}{Conclusion}

bibliographystyle{plainnat}
% to add unnumbered bibliography to toc:
addcontentsline{toc}{chapter}{bibname}
bibliography{jobname}
end{document}


However, it fails to exclude the Conclusion and Bibliography from the last localtableofcontents:



enter image description here



My thoughts were to either:





  1. etocsettocdepth the last localtableofcontents to not include chapters anymore just before the conclusion

  2. limit the scope of the last localtableofcontents to not reach the conclusion anymore


My attempts are commented out in the MWE above. But they could just as well be executed, as they seem to have no effect anyway...



How do I exclude the Conclusion and the Bibliography from the last localtableofcontents?










share|improve this question

























  • For a similar purpose, I use minitoc instead of etoc, but may be this could help. For the formatting of local tables, minitoc uses the same macros as regular tables of contents. If this is also the case of your package, you could create a full .toc as usual with the maximal deoth and locally tweak the table of contents typesetting by redefining l@chapter, l@section and siblings to some macro that gobble` its arguments without typesetting anything. Minitoc is said incompatible with titlesec but it nevertheless works flawlessly.

    – Jhor
    23 hours ago











  • @Jhor I am not familiar with {minitoc}, but from what I gather it creates a separate file for each toc. {etoc} does not. It adds etoc@startlocaltoc{n} to the .toc file. And somehow it seems to know where to stop. But I don't know how to tell it to stop early...

    – D.Roepo
    20 hours ago













  • Of you main concern is the scope and not the depth, have a look to parttoc package that has all the features you want. Unfortunately, if you use it jointly with titlesec AND hyperref, you'll get hundreds of error messages...

    – Jhor
    19 hours ago














0












0








0








I am trying to set the main tableofcontents and several localtableofcontents in a large document. The document consists of an introduction, several parts, a conclusion and a bibliography.



As for the tocs:




  • Introduction, Conclusion and Bibliography should be set as chapters on the main tableofcontents. The latter two should be unnumbered.

  • Each part's front page is to show a localtableofcontents of the part in question


I tried to achieve this, making use of the {etoc} package. The following MWE produces the main toc as desired:



documentclass{report}
usepackage{titlesec}
usepackage{etoc}

% to be able to show localtoc on part-page
titleclass{part}{top}
titleformat{part}[display]{normalfonthugefilcenterbfseries}{partname thepart}{0pt}{}

begin{document}

tableofcontents

chapter{Introduction}

part{A Part}
etocsettocstyle{}{}
etocsetnexttocdepth{section}
localtableofcontents
chapter{A Chapter}
section{A section}

part{Another Part}
etocsetnexttocdepth{section}
localtableofcontents
chapter{Another Chapter}
section{Another Section}

% (1) change local toc's depth
%etocsettocdepth{part}
%etocignoretoctocdepth

% (2) limit scope of last local toc
%etocsetnexttocdepth{part}
%invisiblelocaltableofcontents

chapter*{Conclusion}
% to add unnumbered conclusion to toc:
addcontentsline{toc}{chapter}{Conclusion}

bibliographystyle{plainnat}
% to add unnumbered bibliography to toc:
addcontentsline{toc}{chapter}{bibname}
bibliography{jobname}
end{document}


However, it fails to exclude the Conclusion and Bibliography from the last localtableofcontents:



enter image description here



My thoughts were to either:





  1. etocsettocdepth the last localtableofcontents to not include chapters anymore just before the conclusion

  2. limit the scope of the last localtableofcontents to not reach the conclusion anymore


My attempts are commented out in the MWE above. But they could just as well be executed, as they seem to have no effect anyway...



How do I exclude the Conclusion and the Bibliography from the last localtableofcontents?










share|improve this question
















I am trying to set the main tableofcontents and several localtableofcontents in a large document. The document consists of an introduction, several parts, a conclusion and a bibliography.



As for the tocs:




  • Introduction, Conclusion and Bibliography should be set as chapters on the main tableofcontents. The latter two should be unnumbered.

  • Each part's front page is to show a localtableofcontents of the part in question


I tried to achieve this, making use of the {etoc} package. The following MWE produces the main toc as desired:



documentclass{report}
usepackage{titlesec}
usepackage{etoc}

% to be able to show localtoc on part-page
titleclass{part}{top}
titleformat{part}[display]{normalfonthugefilcenterbfseries}{partname thepart}{0pt}{}

begin{document}

tableofcontents

chapter{Introduction}

part{A Part}
etocsettocstyle{}{}
etocsetnexttocdepth{section}
localtableofcontents
chapter{A Chapter}
section{A section}

part{Another Part}
etocsetnexttocdepth{section}
localtableofcontents
chapter{Another Chapter}
section{Another Section}

% (1) change local toc's depth
%etocsettocdepth{part}
%etocignoretoctocdepth

% (2) limit scope of last local toc
%etocsetnexttocdepth{part}
%invisiblelocaltableofcontents

chapter*{Conclusion}
% to add unnumbered conclusion to toc:
addcontentsline{toc}{chapter}{Conclusion}

bibliographystyle{plainnat}
% to add unnumbered bibliography to toc:
addcontentsline{toc}{chapter}{bibname}
bibliography{jobname}
end{document}


However, it fails to exclude the Conclusion and Bibliography from the last localtableofcontents:



enter image description here



My thoughts were to either:





  1. etocsettocdepth the last localtableofcontents to not include chapters anymore just before the conclusion

  2. limit the scope of the last localtableofcontents to not reach the conclusion anymore


My attempts are commented out in the MWE above. But they could just as well be executed, as they seem to have no effect anyway...



How do I exclude the Conclusion and the Bibliography from the last localtableofcontents?







table-of-contents etoc






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited yesterday







D.Roepo

















asked yesterday









D.RoepoD.Roepo

1,15842348




1,15842348













  • For a similar purpose, I use minitoc instead of etoc, but may be this could help. For the formatting of local tables, minitoc uses the same macros as regular tables of contents. If this is also the case of your package, you could create a full .toc as usual with the maximal deoth and locally tweak the table of contents typesetting by redefining l@chapter, l@section and siblings to some macro that gobble` its arguments without typesetting anything. Minitoc is said incompatible with titlesec but it nevertheless works flawlessly.

    – Jhor
    23 hours ago











  • @Jhor I am not familiar with {minitoc}, but from what I gather it creates a separate file for each toc. {etoc} does not. It adds etoc@startlocaltoc{n} to the .toc file. And somehow it seems to know where to stop. But I don't know how to tell it to stop early...

    – D.Roepo
    20 hours ago













  • Of you main concern is the scope and not the depth, have a look to parttoc package that has all the features you want. Unfortunately, if you use it jointly with titlesec AND hyperref, you'll get hundreds of error messages...

    – Jhor
    19 hours ago



















  • For a similar purpose, I use minitoc instead of etoc, but may be this could help. For the formatting of local tables, minitoc uses the same macros as regular tables of contents. If this is also the case of your package, you could create a full .toc as usual with the maximal deoth and locally tweak the table of contents typesetting by redefining l@chapter, l@section and siblings to some macro that gobble` its arguments without typesetting anything. Minitoc is said incompatible with titlesec but it nevertheless works flawlessly.

    – Jhor
    23 hours ago











  • @Jhor I am not familiar with {minitoc}, but from what I gather it creates a separate file for each toc. {etoc} does not. It adds etoc@startlocaltoc{n} to the .toc file. And somehow it seems to know where to stop. But I don't know how to tell it to stop early...

    – D.Roepo
    20 hours ago













  • Of you main concern is the scope and not the depth, have a look to parttoc package that has all the features you want. Unfortunately, if you use it jointly with titlesec AND hyperref, you'll get hundreds of error messages...

    – Jhor
    19 hours ago

















For a similar purpose, I use minitoc instead of etoc, but may be this could help. For the formatting of local tables, minitoc uses the same macros as regular tables of contents. If this is also the case of your package, you could create a full .toc as usual with the maximal deoth and locally tweak the table of contents typesetting by redefining l@chapter, l@section and siblings to some macro that gobble` its arguments without typesetting anything. Minitoc is said incompatible with titlesec but it nevertheless works flawlessly.

– Jhor
23 hours ago





For a similar purpose, I use minitoc instead of etoc, but may be this could help. For the formatting of local tables, minitoc uses the same macros as regular tables of contents. If this is also the case of your package, you could create a full .toc as usual with the maximal deoth and locally tweak the table of contents typesetting by redefining l@chapter, l@section and siblings to some macro that gobble` its arguments without typesetting anything. Minitoc is said incompatible with titlesec but it nevertheless works flawlessly.

– Jhor
23 hours ago













@Jhor I am not familiar with {minitoc}, but from what I gather it creates a separate file for each toc. {etoc} does not. It adds etoc@startlocaltoc{n} to the .toc file. And somehow it seems to know where to stop. But I don't know how to tell it to stop early...

– D.Roepo
20 hours ago







@Jhor I am not familiar with {minitoc}, but from what I gather it creates a separate file for each toc. {etoc} does not. It adds etoc@startlocaltoc{n} to the .toc file. And somehow it seems to know where to stop. But I don't know how to tell it to stop early...

– D.Roepo
20 hours ago















Of you main concern is the scope and not the depth, have a look to parttoc package that has all the features you want. Unfortunately, if you use it jointly with titlesec AND hyperref, you'll get hundreds of error messages...

– Jhor
19 hours ago





Of you main concern is the scope and not the depth, have a look to parttoc package that has all the features you want. Unfortunately, if you use it jointly with titlesec AND hyperref, you'll get hundreds of error messages...

– Jhor
19 hours ago










0






active

oldest

votes











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


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f477826%2fsetting-local-toc-depth-main-toc-depth-or-limiting-the-scope-of-a-local-toc%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f477826%2fsetting-local-toc-depth-main-toc-depth-or-limiting-the-scope-of-a-local-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

Why does my Macbook overheat and use so much CPU and energy when on YouTube?Why do so many insist on using...

How to prevent page numbers from appearing on glossaries?How to remove a dot and a page number in the...

Puerta de Hutt Referencias Enlaces externos Menú de navegación15°58′00″S 5°42′00″O /...