So, I'm hacking something related to nameref and during the hacking, I find on the beginning of page 3 of the nameref manual on my computer (dated 2016/05/21) that
We redefine
\labelso that it also writes the name of the current section to the .aux file; if the name ends in a dot, we zap it.
I checked the newest documentation of nameref in the CTAN and this sentence is still there. Actually, I don't want this functionality to work for my own \newcounter since it does end with a dot.
So, my questions are
Why do they do something like if the name ends in a dot, we zap it?
Is there a good way to hack this locally to make
\labelaware of the ending dot? Why locally? I'm assuming that there exists a good reason for the first question so that I'm not recommended to erase this entirely.Actually I understand that this functionality is realized by this definition on the same page
\def\NR@strip@period#1.\ltx@empty#2\@nil{#1}But, I'm quite confused by its use since this
\defis followed by three commands in a row while the usual one looks just like\def\newcommand<argument>\oldcommand. So, can anyone explain how this line works to me? Or maybe point to me some reference. So that I can myself figure out the hacking.