TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I understand that TeX macro arguments can be parsed using proper delimiters. And as the classic example goes in The TeXbook,

enter image description here

Along the same line, I tried to define a macro (for some special purpose, the following is actually a much simpler scenario of my situation),


\def\mycommand\cone\bgroup#1\egroup\ctwo #2.#3\end{#1:#2:#3}


\mycommand\cone{One}\ctwo Two.Three\end


Where, \cone and \ctwo are used/system defined macros, and I am not interested in these definitions, rather I would like to ignore them. My points of interest are the three arguments.

Now, when I try compile the above file, I get the error message,

! Use of \mycommand doesn't match its definition.
l.10 \mycommand\cone{
                     One}\ctwo Two.Three

This is where I get stuck.

Please note that the "\cone{One}\ctwo Two.Three" part is rather unalterable. So, any suggested change will have to be in the definition of \mycommand.

I know that as has been pointed out also in The TeXbook, the parameter list can not contain any braces. To circumvent this, I tried using \bgroup and \egroup.

share|improve this question
up vote 7 down vote accepted
\def\mycommand\cone\bgroup#1\egroup\ctwo #2.#3\end{#1:#2:#3}

would require explict \bgroup. It seems like you want

\def\mycommand\cone#1\ctwo #2.#3\end{#1:#2:#3}


\mycommand\cone{One}\ctwo Two.Three\end


 \mycommand\cone One\ctwo Two.Three\end

would have #1 = One

share|improve this answer
Indeed TeX strips off a pair of braces around a delimited argument if this doesn't lead to unbalanced braces (double dangerous bend at the end of page 203 that ends on the following page of the TeXbook). – egreg Nov 4 '13 at 17:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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