ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Alan Braslau via ntg-context <ntg-context@ntg.nl>
To: Bruce Horrocks via ntg-context <ntg-context@ntg.nl>
Cc: Alan Braslau <alan.braslau@icloud.com>
Subject: Re: How to extend an existing macro to take optional parameters?
Date: Mon, 13 Mar 2023 20:08:52 -0600	[thread overview]
Message-ID: <20230313200852.0bf47214@boo.my.domain> (raw)
In-Reply-To: <7b7e83ac-0e4b-ac37-c1c2-b0e715de837a@freedom.nl>

Designating "optional" parameters within [...] is a LaTeX notion.
ConTeXt handles parameters differently.

Alan


> > and I'd like to be able to extend it so that any of the following
> > can be used:
> > 
> >    \mycommand{aa}{bb}{cc}
> >    \mycommand{aa}{bb}{cc}{dd}
> >    \mycommand{aa}{bb}{cc}{dd}[ee]
> > 
> > or
> > 
> >    \mycommand[ee]{aa}{bb}{cc}{dd}  % if this is more the ConTeXt way
> > 
> > where {dd} is the optional extra parameter and, if it is present,
> > then [ee] can also be optionally added (because it controls how
> > {dd} is printed).
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2023-03-14  2:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-12 13:24 Bruce Horrocks via ntg-context
2023-03-13 21:39 ` Hans Hagen via ntg-context
2023-03-14  2:08   ` Alan Braslau via ntg-context [this message]
2023-03-15  1:32     ` Bruce Horrocks via ntg-context
2023-03-15  1:27   ` Bruce Horrocks via ntg-context

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=20230313200852.0bf47214@boo.my.domain \
    --to=ntg-context@ntg.nl \
    --cc=alan.braslau@icloud.com \
    /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).