I want to store the argument of a macro in a temporary variable, but I know in advance that some people will incorrectly enclose the argument in parentheses as well as braces (long story). Specifically, some users will say something like


while others will say


I want the macro \bernardto store the string abc in the temporary variable in both cases. How do I achieve this?

  • Is Bernard the person? :-D Mar 2, 2011 at 0:40
  • @Matthew - sadly not. Their name is Legion, for they are many. Mar 2, 2011 at 16:13

1 Answer 1


\bernard{(abc)} \bTemp
\bernard{abc}   \bTemp
  • 1
    Nice. Maybe Ian needs a \newbernard macro that defines a command that takes Bernard-style arguments. Mar 2, 2011 at 18:12

You must log in to answer this question.

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