# What is the difference between \pgfutil@empty and \empty in an \ifx environment

I've seen that sometimes (most in TikZ code) people use \pgfutil@empty to test a macro.

Is there any benefit from using \pgfutil@empty instead of the \empty macro?

Also, is there any usage or good practices for the preference of one over the other? Can you elaborate in which cases you prefer one over the other? Or even if one is obsolete and you should always use the other?

-

## 1 Answer

TikZ/PGF was designed to be usable with LaTeX, ConTeXt, and Plain TeX, and therefore cannot rely on certain things existing that might be considered "standard" by a LaTeX-only package. Therefore, PGF (re)defines a load of stuff that it knows it will use from the LaTeX core so that it can use it with ConTeXt and Plain TeX. These tend to be macros with the prefix pgfutil@. We thus have \pgfutil@empty, \pgfutil@firstofone, and so forth.

If you are writing something for general use that depends on TikZ/PGF then it is good practice to use these versions instead of the LaTeX ones since then whatever you are writing is more likely to work in the different engines - or even if you aren't bothered about it, then it makes it easier for someone else to adapt it. However, in your own private LaTeX code then it doesn't matter.

-
Can you point where all these internal macros are defined? – Dror Sep 6 '13 at 5:54
@Dror The \pgfutil@ macros are defined in pgfutil-common.tex. – Loop Space Sep 6 '13 at 6:34