Changes

Jump to navigation Jump to search
610 bytes removed ,  17:37, 21 October 2020
m
Continuing to draft Intro to ConTeXt
</context>
In practice, you will often see people skip over the {{cmd|defineindenting}}, but as discussed above, for many reasons it is helpful to include it, for many reasons.
== Another small example ==
For another example of what you might want to customize, suppose that you want to boldface terms that will define later in your document. At first glance, it might be tempting just to italicize each one individually, as in:
<context source="yes" text="which produces">
The quick brown {\it fox} jumped over the lazy {\it dogs}.
</context>
== Another example: ''define'' notation ==LetBased on the discussions above though, you should know why this isn&rsquo;s look at another examplet a good idea. Suppose What should you have do instead? For a ConTeXt documenthint, and you want to place a box with rounded corners around some text. The the way to place boxes around that ConTeXt formats highlighted text in ConTeXt is called ''highlight''. You might think that you could use {{code|framed\starthighlight}} {{code|\stophighlight}}, so (and that would be a good guess, since that would fit in keeping with the Applying Principle) to apply that type overall logic of formatting ConTeXt. However, those commands are still under development, so you enclose the text in can't use them yet. But {{cmd|startframedsetuphighlight}} and {{cmd|stopframeddefinehighlight}}. Since you want rounded cornersdo exist, and they let you specify the argument {{code|corner{{=}}round}} for rounded corners too: <context source="yes">\startframed[corner=round]An exampleconfigure and define ways to highlight text.\stopframed</context>
As There is a slight twist though: when you can seeuse {{cmd|definehighlight}}, you put the arguments in with since the ''square bracketsstart-stop'' notation. But what if version of highlights have not yet been implemented, you want to make this configuration the default for ''all'' of your frames in the document? You instead can use the ''setup'' notation for this. The command {{cmd|setupframed|[corner=round]}} will make this name you defined to produce the default configuration for the rest of the documenthighlighting, as in:
<context source="yes" text="which produces">\setupframeddefinehighlight[definedLater][cornerstyle=roundit]The quick brown \startframedAn exampledefinedLater{fox} jumped over the lazy \definedLater{dogs}.\stopframed
</context>
When As long as you have set it up this way, you no longer have to type keep in the arguments every time you have a box around text. But more importantly, by making this configuration separately at the beginning of your document, you have set up a uniform style throughout your document. This makes it easy to make global style adjustments, which is a very powerful feature.  But what if you want to have two types of frames, one with rounded corners and one without, and you'll be using both of them lots of times? This is where the ''define'' notation comes in. You can use mind that {{cmdcode|defineframeddefinedLater}} twice to define two meaningfully named configurations (say is really just an alternative version in place of {{code|definitionFrame\starthighlight}} with rectangular corners and {{code|exampleFrame\stophighlight}} with rounded corners(which aren&rsquo;t implemented in ConTeXt yet) that you can refer to throughout your document: <context source="yes">\defineframed[definitionFrame][align=flushleft]\defineframed[exampleFrame][align=flushleft, corner=round] \startframed[definitionFrame]A definition.\stopframed \startframed[exampleFrame]An examplethis still fits into the overall logic of ConTeXt.\stopframed</context>
Now if at Even though this example contains some later time you want to change the way that you format the frames around your definitions and examplesextra complications, it is easy gives another illustration of how you can use ''define'' to do so. You just change the {{cmd|defineframed}} commands where those frame formats are created, and the change will be applied consistently make more readable and globally to your whole documentreusable code in ConTeXt.
== Example: ''curly braces'' notation ==
53

edits

Navigation menu