当我定义宏时,单词后没有空格,错误?

当我定义宏时,单词后没有空格,错误?

我定义了一个宏,但发现单词间距不见了。我是不是漏掉了什么?

\documentclass[11pt, oneside]{article}

\newcommand{\abc}{$abc$}
\newcommand{\abcSpace}{$abc$ }

\begin{document}

Word spacing here $abc$ is correct.

Word spacing here \abc is incorrect.

Why do I need to define macro like this \abcSpace in order to have a space?

But within brackets, this space again is not what I want: (\abcSpace).


\end{document}  

答案1

使用宏可以{}解决问题。

\documentclass[11pt, oneside]{article}

\newcommand{\abc}{$abc$}

\begin{document}

Word spacing \abc{} is correct now.

Within brackets: (\abc{}).

\end{document}  

相关内容