Changes

Jump to navigation Jump to search
994 bytes added ,  17:48, 21 October 2020
m
Still drafting intro
<context source="yes" text="which produces">
\definehighlight[definedLaterdefinedTerm][style=it]The quick brown \definedLaterdefinedTerm{fox} jumped over the lazy \definedLaterdefinedTerm{dogs}.
</context>
Even though this example contains some extra complications, it gives another illustration of how you can use ''define'' to make more readable and reusable code in ConTeXt.
== ExampleDelimiters in ConTeXt ==One other useful thing to understand about ConTeXt is how it uses delimiters. Aside from ''start-stop'' commands, there are two main delimiters in ConTeXt:  # '''square brackets''': arguments to ConTeXt commands are enclosed in [ ].# '''curly braces'' notation ': in ConTeXt, { } are used as delimiters to group text as a single self-contained unit. === Square brackets ===You have already seen lots of examples of how arguments to ConTeXt commands are enclosed in [ ]. ConTeXt commands usually have 1, 2, or 3 arguments, and each one is enclosed in [ ]. For example this use of {{cmd|definehighlight}} has two arguments:<texcode>\definehighlight[definedTerm][style=it]</texcode> Many ConTeXt commands have optional arguments. These can be written as [ ] or just completely omitted. Some arguments in ConTeXt are single words or strings, as in {{code|definedTerm}} above. Other arguments are ''key=value'' pairs, as in {{code|style=it}} above. Still other arguments are comma-separated lists of strings and/or ''key=value'' pairs, as in:<texcode>\definehighlight[definedTerm][style=it, color=red]</texcode> It is worth noting that although each argument is delimited by [ ],  === Curly braces ===
You have now seen examples of four of the five notational conventions listed above: all of them except the ''curly braces'' notation.
</context>
== Delimiters in ConTeXt ==
# '''square brackets''': Enclose arguments to ConTeXt commands in [ ].
# '''curly braces''': Use { } as delimiters to group text as a single self-contained unit.
53

edits

Navigation menu