Document Classes ⇒ Table of Contents
Table of Contents
- Attachments
-
- index_scan.jpg (95.69 KiB) Viewed 2988 times
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
Table of Contents
I'm not a very experienced user, so I'm pretty sure some others might provide better solutions. Anyway, in case you find it helpful, here is the code:
Code: Select all
\documentclass[a4paper,10pt]{report}
% Encoding and language
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenx}
\usepackage[spanish]{babel}
% The following prevents section numbers from
% being restarted after every chapter
\usepackage{remreset}
\makeatletter \@removefromreset{section}{chapter} \makeatother
% Changing chapter and section numerals
\renewcommand{\thechapter}{\Roman{chapter}}
\renewcommand{\thesection}{\arabic{section}}
% Change "Índice general" to "Índice"
\addto\captionsspanish{
\renewcommand\contentsname{Índice}}
% Section and toc formatting
\usepackage{titlesec,titletoc}
% Chapter formatting
\titleformat{\chapter}%
[block]%
{\begin{center}\Large}%
{\MakeUppercase{\chaptertitlename} \thechapter\ --}%
{5pt}%
{\MakeUppercase}%
[\rule{2cm}{.8pt}\end{center}]
% TOC chapter formatting
\titlecontents{chapter}%
[0pt]%
{\begin{center}}%
{{\scshape \chaptertitlename} \thecontentslabel.---\itshape}%
{}%
{}%
[\end{center}]
% TOC section formatting
\titlecontents{section}%
[0pt]%
{}%
{Lección \thecontentslabel.ª---}%
{\scshape}%
{\titlerule*[1pc]{...}\contentspage}%
[]
\begin{document}
\tableofcontents
\clearpage
\addcontentsline{toc}{section}{Introducción}
\chapter*{Introducción}
\chapter{Enlace, ordenación y sentido en el plano}
\section{Las relaciones de incidencia}
\section{Las relaciones de orden y separación}
\section{El sentido en el plano}
\chapter{Congruencia y paralelismo en el plano}
\section{Movimiento y congruencia}
\section{Simetrías y perpendicularidad en el plano}
\section{Las traslaciones y el paralelismo}
\section{La circunferencia}
\end{document}
Table of Contents
Code: Select all
\usepackage{titletoc,titlesec}
\addto\captionsspanish{\renewcommand{\contentsname}{\bfseries\rm\Huge{\'Indice}}}
\addto\captionsspanish{\renewcommand{\partname}{Cap\'itulo}}
\addto\captionsspanish{\renewcommand{\chaptername}{Lecci\'on}}
\titleformat{\chapter}[block]
{\filcenter\bfseries\Large\scshape}
{\bfseries\Large\scshape{\chaptertitlename} \bfseries\Large\scshape{\thechapter}\bfseries\Large{\rm\textordfeminine.---}}
{1ex}
{}
\titlecontents{part}[1em]{\addvspace{2pc}\Large\scshape\bfseries{Cap\'itulo}\hspace{.5em}}{\Large\itshape\thecontentslabel\\*[.2pc]}{\contentsmargin{0pt}\Large}{\hfill\Large\contentspage}
[\begin{center}\addvspace{-1pc}\rule{0.2\linewidth}{1pt}\end{center}]
\titlecontents{chapter}[56pt]{\addvspace{1pc}\scshape}{\contentsmargin{5pt}
\bfseries\makebox[0pt][r]{\large\scshape{Lecci\'on}\hspace{.3pc}\large\thecontentslabel{.}\enspace}\large}
{\contentsmargin{0pt}\large}{\titlerule*[0.5pc]{.}\large\bfseries\contentspage}[\addvspace{-1.5pc}]
- Attachments
-
- Indice_070109.jpg (57.26 KiB) Viewed 2875 times