I have been reading through mathtools' docs, and they provide an example that declared a paired delimiter that has a default behaviour if blank, using etoolbox:


Then, typing \norm{x} gives

image for latex norm

but typing \norm{} gives

second image for latex norm with cdot

which is pretty handy.

I want to know how this would apply to cases with multiple parameters. For example, suppose I had something simple like:


Is there a better way than checking all four cases of missing parameters? Or is there a better way?

Edit: Sorry, I forgot to add my current approach. At the moment, I have


I am not sure this feels right, but I am not experienced enough to know any better. Hence I am hoping to reach out on what would be the better approach.

  • " all four cases of missing parameters?" 4?? there are only 2 and as you want to separately test each and use cdot I am not sure what else you could do but have 2 tests? Mar 27, 2023 at 7:50
  • 1
    you have 4 cases only if you want to condition the insertion of the , to one or both of the arguments being empty
    – user691586
    Mar 27, 2023 at 8:14
  • Apologies for the confusion. I meant that because it is a two-parameter command, either one could be missing, both could be missing, or neither could be missing, which is four cases, which I wasn't certain how it would be best handled. Mar 27, 2023 at 9:32

1 Answer 1


It is right, but you can dispense with etoolbox, because the current LaTeX kernel has \IfBlankTF for the same purpose.







I suggest using an abstraction \blank command, so you can later change your mind about how to represent a void argument.

enter image description here

  • Thank you for your advice and feedback. I did not know about \IfBlankTF, so this is interesting to know. Very much appreciated. Mar 27, 2023 at 9:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .