ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <schuster.wolfgang@googlemail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: questions regarding `\date`
Date: Sat, 28 Aug 2010 22:51:34 +0200	[thread overview]
Message-ID: <A60C3889-6C8B-41BE-AD3F-D82BBC89D481@gmail.com> (raw)
In-Reply-To: <20100828190221.GA9645@gaston.couberia.bzh>


Am 28.08.2010 um 21:02 schrieb Peter Münster:

> On Sat, Aug 28 2010, Wolfgang Schuster wrote:
> 
>> It's a problem with the optional argument, if the second argument is
>> missing the space after the first is gobbled but it can be fixed.
> 
> It's a general problem with ConTeXt macros. The same applies for example for
> \externalfigure. Should this be fixed for all commands, that can be used in
> running text, or should this behaviour just be well documented?

\unprotect

\unexpanded\def\externalfigure
  {\doifnextoptionalelse\doexternalfigure\donothing}

\def\doexternalfigure[#1]%
  {\strictdoifnextoptionalelse{\dodoexternalfigure[#1]}{\nodoexternalfigure[#1]}}

\def\nodoexternalfigure[#1]%
  {\dododoexternalfigure[#1][][]}

\def\dodoexternalfigure[#1][#2]%
  {\strictdoifnextoptionalelse{\dododoexternalfigure[#1][#2]}{\dododoexternalfigure[#1][#2][]}

\def\dododoexternalfigure[#1][#2][#3]% [label][file][settings] | [file][settings] | [file][parent][settings]
   {\bgroup
    \doifelsenothing{#1}
      {\framed[\c!width=\defaultfigurewidth,\c!height=\defaultfigureheight]{external\\figure\\no name}}
      {\doifundefinedelse{\??ef\??ef#1}
         {\useexternalfigure[\s!dummy][#1][#2][#3]%
          \getvalue{\??ef\??ef\s!dummy}[]} % [] is dummy arg 5
         {\doifassignmentelse{#2}
            {\getvalue{\??ef\??ef#1}[#2]}%
            {\getvalue{\??ef\??ef#1}[#3]}}}%
   \globallet\currentresourcecomment\empty
    \egroup}

\protect

\starttext
this is how a \externalfigure[cow][height=\lineheight] looks i the netherlands
\stoptext

Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


  parent reply	other threads:[~2010-08-28 20:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-28 14:02 Paul Menzel
2010-08-28 18:54 ` Wolfgang Schuster
2010-08-28 19:02   ` Peter Münster
2010-08-28 19:10     ` Wolfgang Schuster
2010-08-28 20:51     ` Wolfgang Schuster [this message]
2010-08-29 10:17     ` Wolfgang Schuster
2010-08-31  8:29 ` Paul Menzel
2010-08-31  9:48   ` Philipp Gesang
2010-08-31 11:41     ` Taco Hoekwater
2010-08-31 12:14       ` Philipp Gesang
2010-08-31 13:03       ` Martin Schröder

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=A60C3889-6C8B-41BE-AD3F-D82BBC89D481@gmail.com \
    --to=schuster.wolfgang@googlemail.com \
    --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).