For some time, I have thought, perhaps mistakenly, that the precise placement or spacing around ConTeXt syntax was unimportant, e.g., under this assumption, all of these should produce the same results:


\setupbodyfont[stsong, 12 pt]

\setupbodyfont    [stsong, 12 pt]

    stsong, 12 pt

        stsong, 12 pt

I have, however, found some small problems appeared in my document, because I was improperly placing the syntax, e.g., this will not work:


This suggests that placement is perhaps important.

I have also discovered some additional spaces appearing in my document, e.g., between ) and ,, and it is likely the result of improper syntax formatting.

  • You should be safe if you delimit parameters with a comma: \setuplayout[ grid=yes, margin=10cm, ]. Also, you can try using setups which make Context ignore non-explicit spaces. May 14, 2012 at 11:40
  • 1
    Is the comma after margin=10cm important? What are setups?
    – Village
    May 14, 2012 at 11:43
  • (1) The comma tells the argument parser to finish the current entry, any spaces following this comma will be ignored. (2) Define with \startsetups [mysetups:foo] foo \stopsetups and retrieve via \setups{mysetups:foo}. Inside the {start|stop}setups environment, trailing spaces are ignored unless specified with \space or similar. May 14, 2012 at 11:54

1 Answer 1


Spaces are ignored after control sequences (as is normal in TeX), after commas, and after square brackets (either opening or closing).

Spaces in values become part of the value, which may or may not be harmful depending on the type of the value: for dimension assignments this is often ok, but for keyword values it most often results in ignored settings, and sometimes even in errors.

Imho, the nicest way to format ConTeXt's key-value commands is:


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.