Appendix equation number: remove space after dot

appendixequationsspacing

In an appendix setting, for equation numbers I consistently get, e.g., (A. 1) as opposed to (A.1). The space vanishes once the number counter hits 10, e.g. (A.10). How do I remove that added space following the dot?

Here is a working latex example:

\documentclass{article}
\begin{document}
\setcounter{equation}{0}
\renewcommand{\theequation}{{\thesection}.
\arabic{equation}} \appendix

\section{Appendix}

\begin{equation}
    a=b.
\end{equation}

\end{document}

Once compiled, I getenter image description here

Any help would be much appreciated.

Best Answer

Every white character in the main body of TeX family's code is supposed to be a space... but more than one spaces are still supposed to be one space ... In your case you have a "return" character at the commented point in your code: (This creates the unwanted space)

See the comment please:

\documentclass{article}
\begin{document}
\setcounter{equation}{0}
\renewcommand{\theequation}{{\thesection}.% Eliminate this space
\arabic{equation}} \appendix

\section{Appendix}

\begin{equation}
    a=b.
\end{equation}

\end{document}

So, eliminate it with a comment (%) symbol... or just remove completely the return character from there