# What is the proper way to format syntax within ConTeXt?

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,12pt]

\setupbodyfont[stsong, 12 pt]

\setupbodyfont    [stsong, 12 pt]

\setupbodyfont[
stsong, 12 pt
]

\setupbodyfont
[
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:

``````\setuplayout[
grid=yes,
margin=10cm
]
``````

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. – Philipp Gesang May 14 '12 at 11:40
Is the comma after `margin=10cm` important? What are setups? – Village May 14 '12 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. – Philipp Gesang May 14 '12 at 11:54

``````\setuplayout