https://wiki.contextgarden.net/index.php?title=starttexdefinition&feed=atom&action=history
starttexdefinition - Revision history
2024-03-29T11:30:46Z
Revision history for this page on the wiki
MediaWiki 1.34.1
https://wiki.contextgarden.net/index.php?title=starttexdefinition&diff=30082&oldid=prev
Taco: Text replacement - "<syntax type="environment">" to "<syntax>start"
2020-08-07T09:22:39Z
<p>Text replacement - "<syntax type="environment">" to "<syntax>start"</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 09:22, 7 August 2020</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l5" >Line 5:</td>
<td colspan="2" class="diff-lineno">Line 5:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== [[Help:Reference|Syntax]] (autogenerated) ==</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== [[Help:Reference|Syntax]] (autogenerated) ==</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><syntax <del class="diffchange diffchange-inline">type="environment"</del>><del class="diffchange diffchange-inline">texdefinition</del></syntax></div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><syntax><ins class="diffchange diffchange-inline">starttexdefinition</ins></syntax></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== [[Help:Reference|Syntax]] ==</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== [[Help:Reference|Syntax]] ==</div></td></tr>
</table>
Taco
https://wiki.contextgarden.net/index.php?title=starttexdefinition&diff=29957&oldid=prev
Taco: Text replacement - "<syntax type=“environment”>" to "<syntax type="environment">"
2020-07-24T19:48:54Z
<p>Text replacement - "<syntax type=“environment”>" to "<syntax type="environment">"</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 19:48, 24 July 2020</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l5" >Line 5:</td>
<td colspan="2" class="diff-lineno">Line 5:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== [[Help:Reference|Syntax]] (autogenerated) ==</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== [[Help:Reference|Syntax]] (autogenerated) ==</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><syntax type=<del class="diffchange diffchange-inline">“environment”</del>>texdefinition</syntax></div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><syntax type=<ins class="diffchange diffchange-inline">"environment"</ins>>texdefinition</syntax></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== [[Help:Reference|Syntax]] ==</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== [[Help:Reference|Syntax]] ==</div></td></tr>
</table>
Taco
https://wiki.contextgarden.net/index.php?title=starttexdefinition&diff=29906&oldid=prev
Taco: Text replacement - "<syntax>start" to "<syntax type=“environment”>"
2020-07-24T19:43:03Z
<p>Text replacement - "<syntax>start" to "<syntax type=“environment”>"</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 19:43, 24 July 2020</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l5" >Line 5:</td>
<td colspan="2" class="diff-lineno">Line 5:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== [[Help:Reference|Syntax]] (autogenerated) ==</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== [[Help:Reference|Syntax]] (autogenerated) ==</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><syntax><del class="diffchange diffchange-inline">starttexdefinition</del></syntax></div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><syntax <ins class="diffchange diffchange-inline">type=“environment”</ins>><ins class="diffchange diffchange-inline">texdefinition</ins></syntax></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== [[Help:Reference|Syntax]] ==</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== [[Help:Reference|Syntax]] ==</div></td></tr>
</table>
Taco
https://wiki.contextgarden.net/index.php?title=starttexdefinition&diff=25027&oldid=prev
Usonianhorizon at 16:28, 11 November 2019
2019-11-11T16:28:25Z
<p></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 16:28, 11 November 2019</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l3" >Line 3:</td>
<td colspan="2" class="diff-lineno">Line 3:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|attributes=</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|attributes=</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>}}</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>}}</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">== [[Help:Reference|Syntax]] (autogenerated) ==</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"><syntax>starttexdefinition</syntax></ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== [[Help:Reference|Syntax]] ==</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== [[Help:Reference|Syntax]] ==</div></td></tr>
</table>
Usonianhorizon
https://wiki.contextgarden.net/index.php?title=starttexdefinition&diff=22041&oldid=prev
Marco: Create page
2013-08-26T23:10:34Z
<p>Create page</p>
<p><b>New page</b></p><div>{{Reference<br />
|name=starttexdefinition<br />
|attributes=<br />
}}<br />
<br />
== [[Help:Reference|Syntax]] ==<br />
<table cellspacing="4" cellpadding="2" class="cmd"><br />
<tr><br />
<td colspan="2" class="cmd">\starttexdefinition<br />
<span class="first" style="color:red;"> ... </span><span class="second"> ... </span><span class="third"> ... </span><span class="fourth" >command</span><span class="fifth" > ... </span></td><br />
</tr><br />
<tr valign="top" class="first"><br />
<td class="cmd">...</td><br />
<td>global (optional)</td><br />
</tr><br />
<tr valign="top" class="second"><br />
<td class="cmd">...</td><br />
<td>unexpanded (optional)</td><br />
</tr><br />
<tr valign="top" class="third"><br />
<td class="cmd">...</td><br />
<td>expanded (optional)</td><br />
</tr><br />
<tr valign="top" class="fifth"><br />
<td class="cmd">...</td><br />
<td>#arguments</td><br />
</tr><br />
</table><br />
<br />
<br />
== Description ==<br />
<br />
The {{code|starttexdefinition}} uses the {{code|start…stop}} syntax to define<br />
new control sequences. They directly map to the brace-delimited definitions.<br />
It's also possible to define commands that take arguments. Both, the numbered<br />
syntax and the MkVI name-syntax are supported. To use MkVI syntax, save the<br />
file as {{code|file.mkvi}} or place the line <tt>%% macros=mkvi</tt> at the<br />
beginning of the document. The command features several modifier sequences,<br />
which are demonstrated in the following examples.<br />
<br />
== Example ==<br />
<br />
<texcode><br />
%% \def\command{…}<br />
\starttexdefinition command<br />
…<br />
\stoptexdefinition<br />
<br />
%% \def\command#1#2{…}<br />
\starttexdefinition command #1 #2<br />
…<br />
\stoptexdefinition<br />
<br />
%% \def\command#name#options{…}<br />
\starttexdefinition command #name #options<br />
…<br />
\stoptexdefinition<br />
<br />
%% \unexpanded\def\command#name#options{…}<br />
\starttexdefinition unexpanded command #name #options<br />
…<br />
\stoptexdefinition<br />
<br />
%% \gdef\command{…}<br />
\starttexdefinition global command<br />
…<br />
\stoptexdefinition<br />
<br />
%% \unexpanded\gdef\command{…}<br />
\starttexdefinition global unexpanded command<br />
…<br />
\stoptexdefinition<br />
<br />
%% \unexpanded\edef\command#arg{…}<br />
\starttexdefinition global unexpanded command #arg<br />
…<br />
\stoptexdefinition<br />
<br />
%% \unexpanded\xdef\command#arg{…}<br />
\starttexdefinition global unexpanded expanded command #arg<br />
…<br />
\stoptexdefinition<br />
</texcode><br />
<br />
== Pitfalls ==<br />
<br />
The order in which the modifier sequences {{code|global}}, {{code|unexpanded}}<br />
and {{code|expanded}} appear matters. One difference between traditional<br />
definitions and the start-stop environment is that spaces are ignored in the<br />
{{code|texdefinition}} environment, so line endings don't have to be littered<br />
with percent signs and the definitions tend to be more readable. This is<br />
usually what is desired when writing macros. However, it has to be taken into<br />
account when encapsulating Lua code.<br />
<br />
<texcode><br />
%% no problems here<br />
\def\somecommand<br />
{\startluacode<br />
if true then<br />
else<br />
end<br />
\stopluacode}<br />
<br />
\somecommand<br />
<br />
%% this will fail<br />
\starttexdefinition somecommand<br />
\startluacode<br />
if true then<br />
else<br />
end<br />
\stopluacode<br />
\stoptexdefinition<br />
<br />
\somecommand<br />
</texcode><br />
<br />
The above {{code|texdefinition}} example will fail, since the line endings,<br />
which normally result in a space are ignored and the spaces collapsed, so Lua<br />
receives {{code|if true thenelseend}}, which is not valid. The solution is to<br />
add a space and place a percent sign, which will not be removed in that case.<br />
<br />
<texcode><br />
%% this works<br />
\starttexdefinition somecommand<br />
\startluacode<br />
if true then %%<br />
else %%<br />
end<br />
\stopluacode<br />
\stoptexdefinition<br />
<br />
\somecommand<br />
</texcode><br />
<br />
== See also ==<br />
* {{tex|def}}<br />
* {{cmd|define}}<br />
<br />
== Help from ConTeXt-Mailinglist/Forum ==<br />
All issues with:<br />
{{Forum|{{SUBPAGENAME}}}}<br />
<br />
[[Category:Command/Internals|starttexdefinition]]</div>
Marco