Difference between revisions of "Command/startctxfunctiondefinition"
< Command
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
− | |||
− | |||
<cd:commandgroup name="ctxfunctiondefinition" type="environment" xmlns:cd="http://wiki.contextgarden.net/commanddoc/20200807"> | <cd:commandgroup name="ctxfunctiondefinition" type="environment" xmlns:cd="http://wiki.contextgarden.net/commanddoc/20200807"> | ||
− | <cd:shortdesc> | + | <cd:shortdesc><!-- a short command summary goes here --> |
− | <!-- a short command summary goes here --> | ||
The environment <tt>\startctxfunctiondefinition ... \stopctxfunctiondefinition</tt> defines a macro that is a lua function without arguments. | The environment <tt>\startctxfunctiondefinition ... \stopctxfunctiondefinition</tt> defines a macro that is a lua function without arguments. | ||
</cd:shortdesc> | </cd:shortdesc> | ||
Line 16: | Line 13: | ||
</cd:command> | </cd:command> | ||
</cd:variants> | </cd:variants> | ||
− | <cd:description> | + | <cd:description>This defines a TeX macro without arguments that when expanded runs a block of lua code instead of executing TeX commands. |
− | This defines a TeX macro without arguments that when expanded runs a block of lua code instead of executing TeX commands. | ||
</cd:description> | </cd:description> | ||
− | <cd:examples> | + | <cd:examples><cd:example title=""><texcode> |
− | <cd:example title=""> | + | \startctxfunctiondefinition foo |
− | <texcode> | + | context('hello world') |
− | \startctxfunctiondefinition foo | + | \stopctxfunctiondefinition |
− | context('hello world') | ||
− | \stopctxfunctiondefinition | ||
\foo | \foo | ||
</texcode> | </texcode> | ||
− | </cd:example> | + | </cd:example></cd:examples> |
− | + | <cd:notes></cd:notes> | |
− | </cd:examples> | ||
− | <cd:notes> | ||
− | |||
− | |||
− | |||
− | |||
− | </cd:notes> | ||
<cd:seealso> | <cd:seealso> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<cd:commandref name="_ctxfunctiondefinition"></cd:commandref> | <cd:commandref name="_ctxfunctiondefinition"></cd:commandref> | ||
<cd:commandref name="startctxfunction"></cd:commandref> | <cd:commandref name="startctxfunction"></cd:commandref> | ||
<cd:commandref name="_ctxfunction"></cd:commandref> | <cd:commandref name="_ctxfunction"></cd:commandref> | ||
− | <cd:source file="luat-ini.mkiv" originator="system"></cd:source> | + | <cd:source file="luat-ini.mkiv" originator="system"></cd:source> |
− | <cd:wikipage originator="system" page="Category:Lua"></cd:wikipage> | + | <cd:wikipage originator="system" page="Category:Lua"></cd:wikipage></cd:seealso> |
− | </cd:seealso> | ||
</cd:commandgroup> | </cd:commandgroup> |
Latest revision as of 16:42, 27 August 2020
Contents
\startctxfunctiondefinition ... \stopctxfunctiondefinition
Summary
The environment \startctxfunctiondefinition ... \stopctxfunctiondefinition defines a macro that is a lua function without arguments.
Settings
Description
This defines a TeX macro without arguments that when expanded runs a block of lua code instead of executing TeX commands.
Examples
Example 1
\startctxfunctiondefinition foo context('hello world') \stopctxfunctiondefinition \foo