Some Basic Commands
There are three main types of commands in ConTeXt:
- start-stop: To apply something to some text, enclose the text in
- setup: To configure something for the rest of the document, use
- define: To create a named customization of something, use
Many commands don’t fit into one of these types, but here are some that do. For brevity, throughout this list
\startsomething is shorthand for
These commands relate to the structure of a document.
- \starttext: In a typical document, the text to be typeset is enclosed by this. \definetext and \setuptext are defined but have little documentation and don’t appear to be used much.
- \startdocument and \setupdocument: If customization is wanted, the text to be typeset can be enclosed by \startdocument instead of \starttext. The command \startdocument allows for document metadata and can be configured with \setupdocument.
- \definehead and \setuphead: The generic name for a section of a document in head, so these commands allow you to define and customize your own sections. The main built-in sections are: part, chapter, section, subsection, subsubsection, and their numberless counterparts. See the Titles page for further details.
- \setupheader/\setupfooter: These can be used to customize the headers and footers of a document, including whether or not anything should be displayed in them.
- \setupheadertexts/\setupfootertexts: If the headers and footers are set to display text, these commands allow you to customize what those texts are.
- \definemakeup, \setupmakeup, and \startmakeup: A makeup is a page with a different formatting than the rest of the pages in the document (such as a title page or colophon). Use these commands to make and customize the formatting of such a page.
- \definesectionblock and \setupsectionblock: A section block is a section of the document with its own page numbering format (such as the built-in section blocks
appendix). You can use these commands to define and customize section blocks.
- \definestartstop and \setupstartstop: Use these commands to define and customize your own start-stop regions.
- \setupblock and \setupblock: Use these commands to define and customize your own formats for blocks of text. These are somewhat similar to start-stop regions, but there is one major difference: there commands such as \hideblocks to turn off the display of blocks. For other such commands, see the documentation for \setupblock.
- \definelist and \setuplist: Use these to define and customize your own types of lists.
- \definelistalternative and \setuplistalternative: These commands allow you to define and customize options for the
alternativekey in \setuplist.
- \definedescription and \setupdescription: With these commands, you can define and customize your own descriptions. For more details about descriptions, see the Description page.
- \definecombinedlist and \setupcombinedlist: Use these to define and custsomize combined lists. A combined list is a generalization of the table of contents. See the Table of Contents page for further details.
- \definepagebreak: This allows you to define a configuration for page breaks, as used in many different commands (including \pagebreak and \page.)
Text formatting and decoration commands
These commands relate to how text is displayed, without repositioning the text (much).
- \definehighlight and \setuphighlight: These allow you to define and configure different ways of highlighting text.
- \defineframed, \setupframed: Use these to define and configure ways to place frames around single paragraphs of text. Note that this doesn’t break across pages.
- \defineframedtext and \setupframedtext: Use these to define and configure ways to place frames around multiple paragraphs of text. Note that this doesn’t break across pages.
- \definetextbackground and \setuptextbackground: Use these to define and configure ways to place frames around multiple paragraphs of text, in a way that will break across pages.
- \definemathframed and \setupmathframed: Use these to define and configure ways to place frames around symbols within mathematics. (\definemathframed does not seem to be documented at this point, so it may or may not be implemented.)
- \defineblank and \setupblank: These allow you to configure empty vertical space to insert in your document with \blank.
- \definehspace: This allows you to configure empty horizontal space to insert in your document with \hspace.
- \setupwhitespace: Use this to set the default amount of vertical space between paragraphs.
- \setupinterlinespace: Use this to set the default amount of vertical space between lines within paragraphs.
- \definelines and \setuplines: These allow you to define regions in which a new line in code really does mean a new line in the compiled output. As described in the Verse page, this is particularly suitable for typesetting poetry.
- \definetyping and \setuptyping: A typing region is a region in which you are typesetting verbatim text, such as computer code. These commands allow you to define and configure such regions.
- \definetype and \setuptype: type is inline text that you are typesetting verbatim, such as computer code. These commands allow you to define and configure such regions.
Layout and design commands
These commands relate to how text is laid out on the page, and possibly involve moving or positioning the text.
- \definepapersize and \setuppapersize: Use these commands to define paper sizes and to set a document’ paper size.
- \definelayout and \setuplayout: These allow you to define page layouts (which include the margins) and to set a document’s page layout. See the Layout page for further details.
- \setuppagenumbering: Use this to set how a document's pages are to be numbered. This setting is valid starting from where the \setuppagenumbering is issued, so to set the numbering for the whole document, put this command at the start.
- \definelayer and \setuplayer: A layer is ConTeXt’s way to allow for absolute positioning on a page. These commands allow you to define and configure layers. See the Layers section for more information.
- \setupcolors: This command allows you to set configure how color will be used in the document. See the Color page for more information.
- \definecolor: Use this to give a name to a specific color.
- \definecolorgroup: Use this to give a number to a group of colors.
- \definepalet and \setuppalet: Use these to define and activate color palettes that can then be switched among throughuout the document. See the documentation for \setuppalet for further information.
- \defineoverlay: overlays are predefined snippets that you can stack on each other. This command allows you to create overlays. See the Overlays page for further information.
- \definecombination and \setupcombination: A combination is an alignment of several images. Use these commands to define and customize combinations. See the Combinations page for further information.
These commands have various functions that don’t relate directly to text formatting and design.
- \defineconversion: Use this command to define a conversion, or way of transforming text, such as to upper-case or from a to (a). Then you can use such a conversion within various commands, such as \setupitemize.
- \convertnumber: Use this command to convert numbers from one form to another, such as from Arabic numerals to lower-case Roman numerals.
- \setupscale: A scale is a way of scaling text. This command allows you to customize the way that text is scaled with the \scale command. There is a similar \setuprotate for configuring rotations.