GeneralHow to end a chapter{} and start a chapter*{}

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
arrobaRonD96
Posts: 1
Joined: Sun Oct 27, 2019 4:49 am

How to end a chapter{} and start a chapter*{}

Post by arrobaRonD96 »

Hello community. My problem appear in headings of my first chapter*{}. Before my chapter*{} I have:

\listoftables
\addcontentsline{toc}{chapter}{Index of Table}

When I'm in chapter*{} the heading is from the the chapter{Index of Table}. What do I do?
Any help will be useful.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

How to end a chapter{} and start a chapter*{}

Post by Ijon Tichy »

arrobaRonD96 wrote:\listoftables
\addcontentsline{toc}{chapter}{Index of Table}
Sorry, but this is already wrong, because you are adding the last page of the index of tables to the table of contents instead of the first one. You have at least to use something like:

Code: Select all

\cleardoublepage% start next open page
\csname phantomsection\endcsname% for hyperref (doesn't matter, if hyperref is not used)
\addcontentsline{toc}{chapter}{Index of Tables}% ToC entry
\markboth{Index of Tables}{Index of Tables}% running head
\listoftables
But sometimes it would be better to add the \addcontentsline and \markboth to the auxiliary file of the index of tables using \addtocontents. And if you'd use tocbasic to generate the index of tables you could simply use \setuptoc to activate the feature to add the index of tables to the table of contents. And if you also are using a KOMA-Script class you can even use a class option to do all the work. (And in such a case you even should not use \addcontentsline but \addchaptertocentry.) So—as almost ever—it would have been useful to show us not only a code snippet but a Infominimal working example.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
Post Reply