How can I pass a blank to this command

\newcommand{\iam}[1][happy]{I am #1.}

so that I get this result

I am .

Note: My actual command operates in the math mode, so the space between "am" and "." is of no concern.

  • 2
    \iam[]? ........ ... – cfr Oct 25 '14 at 20:54
  • OK. It isn't much of an answer but it is all yours ;). – cfr Oct 25 '14 at 21:13

To pass an empty optional argument, thus overriding the non-blank default, just use []:

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.