6
votes
2answers
144 views

Allowing first undelimited argument to be empty

Consider the following macro definitions: \def\mymacro#1{\mymacroii#1\nil} \def\mymacroii#1#2\nil{% \ifx\\#1\\% empty% \else #1% \fi }% \mymacro{foo}% -> f \mymacro{} \bye This is ...
9
votes
2answers
172 views

Is it possible to use $ as a macro delimiter?

Experimenting with macro definitions that use strange delimiters (see e.g. this or this question), I thought it would be fun to have a macro that takes an argument of the form "a/b" and turns this ...
11
votes
1answer
136 views

(Re)definition of commands that use delimiters other than braces (e.g. \underbrace)

How do you go about redefining a command such as \underbrace, which uses an "uncommon" delimiter, i.e. _, between its two arguments, so that the redefined command be usable in exactly the same way as ...
10
votes
1answer
286 views

Macro delimiter

I'd like to have a macro to split up another macro content, with field separator being a space. So: \def\mytext{foo bar} \def\secondof#1 #2{#2} \secondof\mytext What? What do you mean: "runaway ...