# Adding a dot in chapter's name without cross-referencing problems

I would like to add a dot after the number of each section (including chapters) in a report class document. I'd prefer not to have to resort to Koma-script solutions. There are a lot of other good ideas here: How to add a dot after the section number? but either they don't take care of the problem that cross-referencing comes with a dot as well, or they include only sections and below and not chapters. My Latex knowledge is too limited to generalize Mico's solution by myself, but it should be straightforward (seriously this question should be a comment to these posts, but I'm not allowed to comment :) ).

Alternatively, one could use the fix proposed here: Remove dot-after-number in figure captions while keeping the dot in chapter/section captions with label/ref instead of figure... So see, I'm pretty close but still missing something!

• Welcome to tex.sx. Jun 19, 2019 at 19:59
• Did you try the titlesec solution? Jun 19, 2019 at 23:19
• @Bernard The titlesec solution worked fine except for chapters, plus there is a conflict with fancyhdr apparently... I guess these two are redundant.
– Ella
Jun 20, 2019 at 16:55
• Could post a minimal example illustrating the problem? As to fancyhdr, a very nice titleps comes with titlesec, and it can easily define or redefine page headers and footers styles. Jun 20, 2019 at 17:24
• Actually I wasn't using titlesec and fancyhdr together on purpose; the latter was part of a thesis style I just blindly implemented. It turns out calling titlesec after fancyhdr makes it work alright, in case anyone can benefit from that. Strangely it does not add a dot for chapters, but I just put one by hand in the chapter header as well as in the page header in the style file. Thanks all! I'm validating the answer anyway since it did answer my question as it was.
– Ella
Jun 21, 2019 at 13:58

\documentclass{report}

\usepackage{etoolbox}
\makeatletter

• Thanks, would work great if not for fancyhdr...