# HG changeset patch # User Franz Glasner # Date 1777709309 -7200 # Node ID 03e9031b5eca30ae36d30e4268e38925c3959417 # Parent d8ca835c74eaaadc0755317314cebe33dc5f9b1a Some details and examples about \tt-XXX and \ttx-XXX in the docs diff -r d8ca835c74ea -r 03e9031b5eca docs/details.rst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/details.rst Sat May 02 10:08:29 2026 +0200 @@ -0,0 +1,65 @@ +.. -*- coding: utf-8; indent-tabs-mode: nil; -*- + + +********* + Details +********* + + +Explicit Token Types +==================== + +Handle keywords and operators that are not handled by default or change +the default handling of some expressions. + +`XX` represents a value in the :mod:`pygments.token.STANDARD_TYPES` dict. +Its corresponding token type (the associated `key` in this `dict`) is used as +token type. + +``\\tt-XX/SINGLE-CHAR`` + + no escaping needed + + `SINGLE-CHAR` is a single character and can be *every* character + (including a carriage-return or line-feed) + +``\\ttx-XX{CHARACTERS}`` + +``\\ttx-XX(CHARACTERS)`` + +``\\ttx-XX[CHARACTERS]`` + +``\\ttx-XX`` + +``\\ttx-XXCHARACTERS`` + + No escaping possible! There are enough alternatives available! + + `SEP` is one of ``/:|=*+!\$~``. + + +Examples: + +.. code-block:: AlgPseudocode + + \text{• \\tt-kc/C} \tt-kc/C \rem C as Keyword.Constant + \text{• \\tt-ow/∈} \tt-ow/∈ \rem ∈ as Operator.Word + \text{• \\ttx-kc{A New Constant Keyword\}} \ttx-kc{A New Constant Keyword} \rem As a new Keyword.Constant + \text{• \\ttx-nv{A New Variable Name\}} \ttx-nv{A New Variable Name} \rem An explicit Name.Variable + \text{• \\ttx-k(∈ ∌)} \ttx-k(∈ ∌) \rem ∈ and ∌ as (ordinary) Keywords + \text{• \\ttx-o<∈ ∌>} \ttx-o<∈ ∌> \rem ∈ and ∌ as (ordinary) Operators + /* + * The line below has ∈_∌ as (peculiar) function name. + * Their params are automatic. + */ + \text{• \\ttx-nf<∈_∌>(p1, p2)} \ttx-nf<∈_∌>(p1, p2) + /* + * The line below has ∈_∌ as (peculiar) decorator name (as used in Python). + * Their params are automatic. + */ + \text{• \\ttx-nd[∈_∌](p1, p2)} \ttx-nd[∈_∌](p1, p2) + /* + * This is a non-existing token type: you get some generic error marking + * with a Generic.Error token and no expansion. + */ + \text{• \\ttx-NON-EXISTING[∈_∌](p1, p2)} \ttx-NON_EXISTING[∈_∌](p1, p2)