Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

\newcommand, \renewcommand, \providecommand 的区别 #29

Open
shaodongtang opened this issue Oct 13, 2018 · 1 comment
Open

\newcommand, \renewcommand, \providecommand 的区别 #29

shaodongtang opened this issue Oct 13, 2018 · 1 comment

Comments

@shaodongtang
Copy link

参考https://tex.stackexchange.com/questions/36175/what-do-newcommand-renewcommand-and-providecommand-do-and-how-do-they-differ
\newcommand 定义一个新命令,如果已经定义了它,则会产生错误。
\renewcommand 重新定义了预定义的命令,如果尚未定义则会发生错误。
\providecommand 定义了一个新命令(如果尚未定义)

@shaodongtang
Copy link
Author

\newcommand 定义命令时,可使用“长参数”,即参数中可带空行或\par
命令;
\newcommand* 定义命令时,则不可以使用“长参数”.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants