Changes

Jump to navigation Jump to search
293 bytes added ,  16:22, 11 November 2019
no edit summary
|attributes=
}}
 
== [[Help:Reference|Syntax]] (autogenerated) ==
<syntax>define</syntax>
== [[Help:Reference|Syntax]] ==
<tr valign="top" class="third">
<td class="cmd">{...}</td>
<td><i>text</i> ''macro contents''</td>
</tr>
</table>
== Description ==
<code>\define</code> is like the TeX primitive <code>\def</code>: it defines a new TeX macro.
=== * In MkII, {{cmd|define}} is like the TeX primitive {{tex|def}}: it defines a new TeX macro. * In MkIV {{cmd|define vs }} is like {{tex|unexpanded}}{{tex|def ===}}Unlike <code>: and \defineexpandable is like {{tex|def</code>, it will '''not allow }}.The optional bracketed argument denotes the number of parameters you can give to redefineyour command. ''macro contents' an already defined command' is the result when the macro gets expanded.
The optional (bracketed) argument denotes the number of parameters you can give to your command. "text" is the result when the macro gets expanded.  == pitfalls Pitfalls ==<code>\define</code> does not use <code>\{{tex|long</code>, }}; that means that in MkIImultiple paragraphs (e.g. through <code>\{{tex|par</code> }} or <codett>\endgraf</codett>)
inside arguments will not work.
The name of the new command may not include numbers.
== comment Example ==<pre>is there any bonus when I use \define instead of \def? -PG</pre>
<context mode=mkiv source="yes">
% wiki mode=mkiv
\define\hello{Good morning}
== Example ==% You may not use numbers% \define[1]\mp3{The ID3 Tag of the MP3 file is: #1}% but this will work:\define[1]\mpThree{The ID3 Tag of the MP3 file is: #1}
<context source="yes">% You can use non-ASCII characters in MkIV, but not in MkII.% This example is compiled using mkiv.\define[1]\helloKüFst{Good morningKüstenfunkstelle, #1!}
\starttext
\hello \KüFst{mom12
\stoptext
</context>
== See also ==
[http://en.wikibooks.org/wiki/TeX/* {{tex|def http://en.wikibooks.org/wiki/TeX/def]}}
<!== Help from ConTeXt-- something like [[cmdMailinglist/Forum ==All issues with:goto{{Forum|\goto]] -->{{SUBPAGENAME}}}}
[[Category:ReferenceCommand/enInternals|define]]

Navigation menu