What does \s! do?

As requested by Esteis, I am just moving my answer from another question here. Once Esteis modifies the other question, I'll delete the answer from there, and only keep this one.

What are those pesky \c!..., \v!..., \e!... macros and why does ConTeXt use them?

An often ignored feature of ConTeXt is that it has a multilingual interface. Most tutorials and manuals start with:

\starttext
Hello world
\stoptext

and ask you to compile a document using context filename (which in turn loads the default cont-en format). However, you can also use a French interface

\demarretexte
Hello world
\stoppetexte

if you compile the document with context --interface=fr filename (which in turn loads the French cont-fr format) or add

% interface=fr

on the first line of your file and compile the document with context filename. You can look into mult-def.lua for the available languages and the names of macros in that language.

Defining such a multilingual interface for macros is easy: just \def the French \demarretexte to the English \starttext in the cont-fr format; and do so for all the macros. (This is approximately what ConTeXt does, although now it uses Lua to simplify the mappings).

But ConTeXt also uses a key-value driven interface. In the English interface, you write:

\startchapter[title={A long title in which we say hello to the world},
             marking={Hello world}, % short title for headers and footer
             bookmark={World}, %title for bookmarks
            ]
Hello World.
\stopchapter

So, in the French interface, you'd like to write:

\demarrechapitre[titre={Que celui où nous dire bonjour au monde},
               marquage={Bonjour monde},
               marquepage={Monde}]
Bonjour monde
\stoppechapitre 

How should such a multilingual a key-value driven interface be defined? This is where the \c!... and \v!... macros come in. (Remember that in \unprotected mode ! is a letter, so \c!something is a macro with a name 'c!something`). In the core packages, ConteXt defines

 \definehead[\v!chapter][...]

This defines (amongst other things) a macro \e!start\v!chapter: in the English interface, \e!start=start, \v!chapter=chapter; in the French interface \e!start=demarre, \v!chapter=chapitre. Hence we get \startchapter and \demarrechapitre.

When typesetting a chapter head, ConTeXt uses \currentheadparameter\c!title as the title. In the English interface \c!title translates to title and ConTeXt looks for the title key; in the French interface \c!title translates to titre and ConteXt looks for titre key. Voila, we have a multilingual key-value interface.


\s! is an internal ConTeXt prefix for macros and should be used only if you know what you are doing. For a user defined typescript, use something like

\starttypescript[sans][biolinum][name]
    \setups[font:fallback:Serif]
    \definefontsynonym [Sans]           [name:Linux Biolinum O]             [features=default]
    \definefontsynonym [SansBold]       [name:Linux Biolinum O Bold]        [features=default]
    \definefontsynonym [SansItalic]     [name:Linux Biolinum O Italic]      [features=default]
    \definefontsynonym [SansBoldItalic] [name:Linux Biolinum Slanted O Bold][features=default]
    \definefontsynonym [SansSlanted]    [name:Linux Biolinum O Slanted]     [features=default]
    \definefontsynonym [SansSlantedBold][name:Linux Biolinum Slanted O Bold][features=default]
\stoptypescript