# replacing macros parameters by its definition [duplicate]

Usually, I use many macros in my documents to save time. I am searching for clever "ideas, methods, tools" which can replace macros by its definition. For example, if we have a the following document

\documentclass[a4paper,10pt,english]{article}
\usepackage{amsfonts}
\newcommand{\bN}{\mathbb{N}}
\newcommand{\bZ}{\mathbb{Z}}
\begin{document}
$\bN$ and $\bZ$ are closed under the operation of addition
\end{document}


I want the content to be converted to

   $\mathbb{N}$ and $\mathbb{Z}$ are closed under the operation of addition


Remark: I know that I can do this using find/replace in the editor. Here, I am asking about other possibilities.

Best regards

• What you're asking for is in fact impossible in the general case; expansion is a decently complicated topic with regard to TeX. There is certainly a question on this site that addresses this idea fully, but I'm on mobile and unable to find it. (I know for a fact that I've asked one about this myself; I believe it was a duplicate even then.) – Sean Allred Apr 5 '14 at 3:58
• Possible duplicates: tex.stackexchange.com/q/3174/7674 and tex.stackexchange.com/q/67709/7674 – Robert Apr 5 '14 at 3:58