Difference between revisions of "System Macros"

From Wiki
Jump to navigation Jump to search
m (→‎Introduction: replaced dash with hyphen)
m (→‎Introduction: link to git repo; original link commented out in hope of future source update ;-))
Line 9: Line 9:
 
Disclaimer: Quite a lot of the explanation text is copied from source code documentation by Hans Hagen. Always assume that the errors are mine and the good jokes are his.
 
Disclaimer: Quite a lot of the explanation text is copied from source code documentation by Hans Hagen. Always assume that the errors are mine and the good jokes are his.
  
The current text will mostly deal with the file [[source:syst-gen.mkii|syst-gen.mkii]] (look [[source:syst-aux.mkiv|syst-aux.mkiv]] for MkIV).  
+
The current text will mostly deal with the file [[source:syst-gen.mkii|syst-gen.mkii]] (see [http://repo.or.cz/w/context.git/blob/HEAD:/tex/context/base/syst-aux.mkiv syst-aux.mkiv] <!-- [[source:syst-aux.mkiv|syst-aux.mkiv]] --> for MkIV).  
 
Most of those macros are very basic, and many of them are related to programming constructs like flow control (<code>\if</code> statements), data structures (comma separated lists), and definitions.
 
Most of those macros are very basic, and many of them are related to programming constructs like flow control (<code>\if</code> statements), data structures (comma separated lists), and definitions.
  

Revision as of 09:14, 7 June 2012

Introduction

All large macro packages for TeX have the need for a number of low-level macros to ease the programming effort. This is definitely true for the ConTeXt package, where the extensive use of key-value pairs and the multilingual interface introduce extra complications to the already tricky art of TeX programming.

Some of these internal macros are real gems, and nearly all of them can also be used in your own source documents. Although most of ConTeXt is described in the source code, sometimes the explanations are too technical for a casual user, and some of the documentation, especially the examples, is still in dutch.

The 'System Macros' documentation attempts to explain the most usable commands of the internal macro layer, using english examples to clarify usage.

Disclaimer: Quite a lot of the explanation text is copied from source code documentation by Hans Hagen. Always assume that the errors are mine and the good jokes are his.

The current text will mostly deal with the file syst-gen.mkii (see syst-aux.mkiv for MkIV). Most of those macros are very basic, and many of them are related to programming constructs like flow control (\if statements), data structures (comma separated lists), and definitions.

Contents

Fundamentals

Mnemonics & Aliases

Scratch Variables

Expansion Control

Handling Arguments

Definitions & Assignments

Branches & Decisions

Loops & Recursion

Action Processing

Comma Separated Lists

Key-Value Assignments

User Interaction