# [NTG-context] the difference between \def and \define

Wolfgang Schuster schuster.wolfgang at gmail.com
Mon Apr 15 16:04:10 CEST 2013

Am 15.04.2013 um 15:47 schrieb Tim Li <timli2013 at outlook.com>:

> In plain TeX, we always use \def for creating a new macro, but in ConTeXt, sometimes it won't work, especially when making own chapter titles. The \def can produce the error message like this : "Argument of \... has an extra }". \define in ConTeXt can solve this problem.
>
> What's the difference between \def and \define? Can I use \define to replace all \def?

The \define command is a short form for \unexpanded\def which prevents commands to be expanded when used inside \edef or when passed to Lua.

Most of the high level commands are created to be unexpanded and expandable commands are used for internal functions.

Wolfgang

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ntg.nl/pipermail/ntg-context/attachments/20130415/7b9c83e2/attachment.html>