I need \section
(\subsection
, \subsubsection
…) titles printed with dot after numbering.
Example:
- My Title
For this purpose i use:
\renewcommand\thesection{\normalfont \arabic{section}.}
\renewcommand\thesubsection{\thesection\arabic{subsection}.}
\renewcommand\thesubsubsection{\thesubsection\arabic{subsubsection}.}
\renewcommand\theparagraph{\thesubsubsection\arabic{paragraph}.}
But this method also adds extra dot to \ref{}
commands. So code "Look at section \ref{section:label}
." produces string "Look at section 3.."
Is there any way to add dot only to headlines and ToC, but not to references?
Best Answer
Here is how to do with
titlesec/titletoc
. The dot after the label is added by\titleformat
, not by\thesection
. As for the dot in the table of contents, it is an option in titletoc. In addition, I usecleveref
for a simpler writing of cross-references.