4

Since I switched to ConTeXt from plain TeX, I always get confused about macros in it. Now it is the command option in \setup* of ConTeXt.

In ConTeXt, some macros, like \setuphead, \setuplist, have some options which contain the command=\...#1#2 that we can define some \def\... to assign. for example, the \setuphead:

    \setuphead [1][2]
      1. SECTION
      2. ...
         command = \...#1#2
         ...

An example using this is given in page 209 of the ConTeXt manual

    {\hbox to \hsize
       {\hfill
        \framed[height=1cm, width=2cm, align=left]{#1}%
        \framed[height=1cm, width=4cm, align=right]{#2}}}

here, it is obviously that #1 is the headnumber and #2 the title. At the same time, some commands don't have the examples like this, so, how can I get the information about what meaning the parameters (#1, #2, and so on) refer to?

2
  • 1
    Empirically works best ;) But almost always, the arguments are to-be-typeset text arguments (as opposed to e.g. setups or variables) and generally, they are in the expected order: the text object that you expect to be the leftmost in the typeset output tends to be #1, next is #2, et cetera. Mar 25 '13 at 8:20
  • Yeah, Taco, although some details are not presented in ConTeXt manual, the guess fits the experiments well :)
    – Lucas
    Mar 25 '13 at 8:29
5

Empirically works best ;)

But almost always, the arguments are to-be-typeset text arguments (as opposed to e.g. setups or variables) and generally, they are in the expected order: the text object that you expect to be the leftmost in the typeset output tends to be #1, next is #2, et cetera.

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.