I want to create a macro for times of days, as follows:
\newcommand{\pmtime}{a.m.\xspace}
The problem is that LaTeX thinks that the last period in a.m. denotes the end of a sentence, hence the space produced by \xspace is too large.
\newcommand{\amtime}{a.m.\ }
The above is not helpful either, since a regular size space is now added, even when the macro does in fact occur at the end of a sentence.
I read about \@ifnextchar and tried the following:
\newcommand{\amtime}{a.m.\@ifnextchar.{}{\ }}
This expands to a.m.ifnextchar. in the text (in this case the macro is not followed by a period.

