Command/cldcommand

Unofficial ConTeXt Wiki mirror

Last modified: 2024-09-15

Summary

The command \cldcommand is used to execute a ConTeXt command in Lua.

Settings

\cldcommand{...}
{...} command

Option Explanation
command a valid way to end context. in Lua

Description

Execute a ConTeXt command via lookup in the context table in LuaTeX. Defined as follows:
\def\cldcommand#1{\directlua\zerocount{context.#1}}
% so \cldcommand{somecommand} --> \directlua{context.somecommand}

Examples

Example 1

  • % Draw a black rule via Lua, passing the [...=...] as a Lua table
    \cldcommand{
        blackrule({
            width = "2em",
            height = "1em"
        })
    }
    
    % Draw a black rule directly
    \blackrule[
        width=4em,
        height=1em]
    

Notes

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: