I want to create a macro for times of days, as follows:
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.
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:
This expands to
a.m.ifnextchar. in the text (in this case the macro is not followed by a period.