ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Brooks Moses <bmoses@stanford.edu>
Subject: Re: Converting math from LaTeX to ConTeXt
Date: Thu, 29 Jul 2004 09:46:38 -0700	[thread overview]
Message-ID: <4.3.1.2.20040729093952.00b45f90@cits1.stanford.edu> (raw)
In-Reply-To: <20040727114251.GG25818@cebitec.uni-bielefeld.de>

At 04:42 AM 7/27/2004, you wrote:
>On Sun, Jul 25, 2004 at 10:31:24PM -0700, Brooks Moses wrote:
[things I need to translate from LaTeX to ConTeXt]
> >   \renewcommand{\vec}[1]{{\boldsymbol{#1}}}
> >   \renewcommand{\hatn}{\hat{\vec{n}}}
> >   \newcommand{\filter}[1]{\overline{#1}}
>
>You can use the tex primitve
>\def\vec#1{{\boldsymbol{#1}}
>or the context way
>\define[1]\vec{{\boldsymbol{#1}}
>
>But afaik there is no checking if a command is already defined?

I started poking through the ConTeXt source to see what I could find, and 
came across the following in the syst-ext.tex file:

   \def\define#1%
     {\ifx#1\undefined
        \expandafter\def
      \else
        \message{[\noexpand#1is already defined]}%
        \expandafter\def\expandafter\gobbleddefinition
      \fi#1}

   \def\redefine#1%
     {\ifx#1\undefined\else
        \message{[\noexpand#1is redefined]}%
      \fi
      \def#1}

This appears to be doing the checks for commands being previously defined 
or not, as desired.  However, I'm completely lost as to how we get from 
here to the \define[1] syntax.  What am I missing?

- Brooks

  reply	other threads:[~2004-07-29 16:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-26  5:31 Brooks Moses
2004-07-27 11:42 ` Eckhart Guthöhrlein
2004-07-29 16:46   ` Brooks Moses [this message]
2004-08-07 15:12 ` Giuseppe Bilotta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4.3.1.2.20040729093952.00b45f90@cits1.stanford.edu \
    --to=bmoses@stanford.edu \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).