2

I know, that it is possible to add dot after the chapter / section / subsection number. But if I use

\renewcommand{\thechapter}{\arabic{chapter}.}
\renewcommand{\thesection}{\thechapter\arabic{section}.}
\renewcommand{\thesubsection}{\thesection\arabic{subsection}.}

(as in this solution: How to add a dot after the section number?), then I have too many dots in the case of number of figure / theorem etc. For example, if I apply

\documentclass[10pt]{book}
\usepackage{amsmath,amssymb,amsthm}

\usepackage[chapter]{algorithm}

\renewcommand{\thechapter}{\arabic{chapter}.}
\renewcommand{\thesection}{\thechapter\arabic{section}.}
\renewcommand{\thesubsection}{\thesection\arabic{subsection}.}

\newtheorem{defin}{Def.}[chapter]
\newtheorem{tw}[defin]{Th.}

\begin{document}

\chapter{New chapter}

\begin{defin}
Some definition
\end{defin}

\begin{algorithm}
\caption{Some algorithm}
\end{algorithm}

\begin{figure}[hptb]
\caption{Some caption}
\end{figure}

\section{New section}

\begin{defin}
Some definition
\end{defin}


\end{document}

then I have enter image description here

How could I remove the unnecessary dots in 1..1 and similar numbers? Thank you in advance for your answer. Edit: I have realized, that my question can be put in other way. Is this possible to add dots, but only: 1. in the case of titles of chapters / sections etc. 2. and in the case of table of contents, but not for other references?

| improve this question | | | | |
  • You should really apply the period (dot) to the target counter, e.g., \renewcommand{\thealgorithm}{\thechapter.\arabic{algorithm}}. – barbara beeton Dec 16 '19 at 16:48
0

It seems, that instead of this code

\renewcommand{\thechapter}{\arabic{chapter}.}
\renewcommand{\thesection}{\thechapter\arabic{section}.}
\renewcommand{\thesubsection}{\thesection\arabic{subsection}.}

I should use

\usepackage{titlesec}
\titlelabel{\thetitle .\quad}
\usepackage[dotinlabels]{titletoc}

But I'm still looking for the answer in the case of chapters.

| improve this answer | | | | |
  • Please don't answer your question. Instead, Edit your question. – ferahfeza Apr 20 '19 at 14:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.