I'm using the book class and I want to remove the final dot in the section number, i.e, I have
1. Chapter Name
1.1. Section Name
1.1.1. Subsection Name
1.1.1.1. Subsubsection Name
I want
1. Chapter Name
1.1 Section Name
1.1.1 Subsection Name
1.1.1.1 Subsubsection Name
Looking for similar post, I found [How remove dot after section number in ToC with babel's spanish? and although the solution is very good I still have a problem: when I use the code es-nosectiondot the dot of the chapter disappears in the ToC, same is for LoF and LoT, i.e, Figure 1 (Table 1) instead Figure 1. (Table 1.), so, following the post I use the code \def\numberline#1{\hb@xt@\@tempdima{#1\if&\else.\fi\hfil}}, which is useful because it solves the previous problem, but now the dot of the section, subsection and subsubsection appears in the ToC, i.e,
1. Chapter Name
1.1. Section Name
1.1.1. Subsection Name
1.1.1.1. Subsubsection Name
This is my MWE:
\documentclass{book}
\usepackage[spanish,es-nosectiondot]{babel}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\counterwithout{figure}{chapter}
\counterwithout{table}{chapter}
\addto\captionsspanish{%
\renewcommand{\tablename}%
{Tabla}%
}
\makeatletter
%%add prefix Figura/Tabla in LoF/LoT
\long\def\@caption#1[#2]#3{%
\par
\addcontentsline{\csname ext@#1\endcsname}{#1}%
{\protect\numberline{\csname fnum@#1\endcsname}{\ignorespaces #2}}%
\begingroup
\@parboxrestore
\if@minipage
\@setminipage
\fi
\normalsize
\@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
\endgroup}
\renewcommand*\l@figure{\@dottedtocline{1}{0em}{5em}}%
\let\l@table\l@figure
%%egreg's code
\def\numberline#1{\hb@xt@\@tempdima{#1\if&\else.\fi\hfil}}
\makeatother
\begin{document}
\tableofcontents
\listoffigures
\listoftables
\chapter{Chapter}
\section{Section}
\begin{table}[h]
\caption{Some table}
\centering abc
\end{table}
\begin{figure}[h]
\caption{A figure}
\centering xyz
\end{figure}
\subsection{Subsection}
\subsubsection{Subsubsection}
\end{document}
I want
ToC
1. Chapter
1.1 Section
1.1.1 Subsection
1.1.1.1 Subsubsection
LoT
Table 1.
LoF
Figure 1.
1.1 The Section
Content
1.1.1 The Subsection
Content
1.1.1.1 The Subsubsection
Content





figureandtablenumbers (including in the LoF and LoT), and (c) you want to prefix the strings "Figura" and "Tabla", resp., to the numbers in the LoF and LoT. Is this understanding correct? – Mico Feb 21 '19 at 19:54titlesec) that was generated for this purpose? – Dr. Manuel Kuehner Feb 21 '19 at 20:24babelpackage, aren't you disregarding your own supreme requirement? Seriously, though: Many packages that are well suited to meeting your formatting objectives have been around for a long time, they are readily available with all TeX distributions, and are they are well debugged. I suggest you go back to the persons who came up with the absurd requirement that no external LaTeX packages are allowed and try to show them the errors in their ways. – Mico Feb 21 '19 at 20:35