[Tex/LaTex] Is it possible to change the appearance of a \ref


I am using article class, and by default, the numbers of the sections, subsections appear like 1 section, 2 section in time I want them to appear like 1. section, 2. section (with dots).

I have redefined the format of my section, subsection, etc. as follows:


because I wanted . after the number of the section and the subsection. Fortunately, I got the format that I want, but now I have another problem, when I use the cross-reference to the section or the subsection, I got extra . after the reference, like: as we have seen in section 1.., or section 2.. it is unwanted. How can I get rid of this extra .? Is there anyway to change or redefine the appearance of the \ref?

Best Answer

My answer to can i change refs output can be adjusted for this:






See section~\ref{test} and subsection~\ref{subtest} and subsubsection~\ref{subsubtest}!


Note that this is a little bit of a hack.

You could also adjust the sectioning commands using titlesec instead.

Related Question