I have a macro that adds some text to its arg. I'd like for the macro to output nothing if the arg is empty.
Something like
Code: Select all
\newcommand{\hexaddr}[1]{%
\texttt{\#0#1h}%
}
It sounds like ifmtarg should do the trick, but it doesn't work for me.
Here's a simplistic example, using code in the ifmtarg docs:
Code: Select all
\documentclass{article}
\usepackage{ifmtarg}
\newcommand{\isempty}[1]{%
\@ifmtarg{#1}{YES}{NO}}
\begin{document}
Should be empty: \isempty{}
Not empty: \isempty{notempty}
\end{document}
I'm using pdflatex on a typical MiKTeX 2.9 install.Should be empty: ifmtargYESNO
Not empty: ifmtargnotemptyYESNO
Clearly, I'm not using the package correctly. Can someone help me understand what I'm doing wrong?
Thanks.
todd.