Changes

Jump to navigation Jump to search
1,037 bytes removed ,  16:49, 8 June 2020
m
no edit summary
This is an evolving copy of the original article [http://tex.aanhet.net/context/syst-gen-doc.pdf ConTeXt System Macros, part 1: general macros] by [[User:Taco|Taco]]. === Abstract =Introduction ==
All large macro packages for TeX have the need for a number of low-level macros to easy ease the programming effort. This is definately 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.
This series of articles will try The 'System Macros' documentation attempts to highlight explain the most usable commands of the internal macro layer, using english examples, and removing most of the technical stuff (like the definitions of the macros themselves, and the optimization history)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.
__TOC__ == Introduction == This article The current text will mostly deal with the file [[source:syst-gen.texmkii| 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). All except the first couple of macros appear in this file, which is input immediately after the inclusion of a stripped down version of the plain TeX format. Most of the following those macros are very basic, most and many of them are related to programming constructs like flow control (<code>\if</code> statements), data structures (comma separated lists), and definitions. [[System Macros/Fundamentals]] [[System_Macros/Mnemonics_and_Aliases]] [[System_Macros/Scratch_Variables]] [[System_Macros/Expansion_Control]] [[System_Macros/Handling_Arguments]] [[System_Macros/Definitions_and_Assignments]] [[System_Macros/Branches_and_Decisions]] [[System_Macros/Action_Processing]]
[[System_Macros/Comma_Separated_Lists]]== Contents ==
[[System_MacrosSystem Macros/Key_Value_AssignmentsFundamentals|Fundamentals]]
== User interaction ==[[System_Macros/Mnemonics_and_Aliases|Mnemonics & Aliases]]
This macro hardly needs explanation. It stops TeX until you input something.[[System_Macros/Scratch_Variables|Scratch Variables]]
Macros for showing messages. In the multi-lingual modules, we will also introduce a mechanism for message passing. For the moment we stick to the core macros:[[System_Macros/Expansion_Control|Expansion Control]]
<texcode>\writestring {string}\writeline\writestatus {category} {message}<[[System_Macros/texcode>Handling_Arguments|Handling Arguments]]
Messages are formatted: the category appears within a fixed number of columns, on it's own, followed by a colon. One can provide the maximum width of the identification string with the macro <code>\statuswidth<[[System_Macros/code>.Definitions_and_Assignments|Definitions & Assignments]]
For debugging purposes we can enhance macros with the next alternative. Here <code>debuggerinfo<[[System_Macros/code> stands for both a macro accepting two arguments and a boolean (in fact a few macro's too).Branches_and_Decisions|Branches & Decisions]]
<texcode>\debuggerinfo {subcategory} {message}<[[System_Macros/texcode>Loops_and_Recursion|Loops & Recursion]]
This message will only be output if <code>\debuggerinfo<[[System_Macros/code> is true. (it usually isn't). If you need to calculate something to be used inside the message, embrace your calculating code with <code>\ifdebuggerinfo ... \fi</code>.Action_Processing|Action Processing]]
[[System_Macros/Comma_Separated_Lists|Comma Separated Lists]]
[[System_Macros/Key_Value_Assignments|Key-Value Assignments]]
[[System_Macros/User_Interaction|User Interaction]]
[[Category:ConTeXt programmingProgramming and Databases]][[Category:Inside ConTeXtTools]]

Navigation menu