Page Layout ⇒ Table of Contents enhanced ? First the chapters listing
Table of Contents enhanced ? First the chapters listing
chapter 1, followed by all sections in chapter 1.
After that Chapter 2, followed by all sections in chapter2 , and
so on.
Since I like to use hyperref to help me to navigate through the book, so I think if I can have a listing of all chapters, WITHOUT the sections, and then when I click on a link to particular chapter, I will get to the place where all sections under that chapter are listed. This way, I could very quickly get to a section very quickly without skipping all irrelevant chapters and those accompanied sections.
This is a very nice feature, can we enable it ?
Thanks !
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Table of Contents enhanced ? First the chapters listing
Best regards
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Table of Contents enhanced ? First the chapters listing
I got some gibberish CChapter1,Chapter2,Chapter3,...\usepackage{titlesec}
\usepackage{titletoc}
\include{common-places}
\include{abbrev}
\begin{document}
\startcontents[chapters]
\printcontents[chapters]
\stopcontents[chapters]
%\startcontents[parts]
%\printcontents[parts]
%\stopcontents[parts]
\tableofcontents
in one try, but then later on I got error messages.
! Missing \endcsname inserted.
<to be read again>
\let
l.2 \contentsline {chapter}
{\numberline {1}Some very basic graphics topics}{
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Table of Contents enhanced ? First the chapters listing
Code: Select all
\documentclass[11pt,a4paper,english]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage[raggedright]{titlesec}
\usepackage{titletoc}
\usepackage[math]{blindtext}
\usepackage[linktocpage]{hyperref}
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
[\vspace*{2pc} \normalfont\normalsize \startcontents \printcontents{l}{1}{}]
\begin{document}
\addtocontents{toc}{\protect\setcounter{tocdepth}{0}}
\addtocontents{ptc}{\protect\setcounter{tocdepth}{2}}
\tableofcontents
\chapter{First Chapter}\label{chp:one}
\blindtext
\section{First Section}\label{sec:oneone}
\blindtext
\section{Second Section}\label{sec:onetwo}
\blindtext
\chapter{Second Chapter}\label{chp:two}
\blindtext
\section{First Section}\label{sec:twoone}
\blindtext
\section{Second Section}\label{sec:twotwo}
\blindtext
\chapter{Third Chapter}\label{chp:three}
\blindtext
\section{First Section}\label{sec:threeone}
\blindtext
\section{Second Section}\label{sec:threetwo}
\blindtext
\end{document}
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Table of Contents enhanced ? First the chapters listing
Re: Table of Contents enhanced ? First the chapters listing
underlined so that when I click on it, it will go to correct page?
Right now, I have to click on the page numbers at the right end of each entry to go a particular page.
I am hoping that I can click on any words within a line to nagivate, i.e., I have more "areas" to choose. Thanks.
The same issue happens in the main TOC and the toc for each individual chapter.
Table of Contents enhanced ? First the chapters listing
remove the option linktocpage from the list of options for the hyperref package; i.e., instead of
Code: Select all
\usepackage[linktocpage]{hyperref}
Code: Select all
\usepackage{hyperref}
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Table of Contents enhanced ? First the chapters listing
Code: Select all
\usepackage[breaklinks=true]{hyperref}
Best regards
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10