ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* first steps with \dosingleempty
@ 2008-09-11  6:31 Goebel, Juergen
  2008-09-11  7:21 ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: Goebel, Juergen @ 2008-09-11  6:31 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 854 bytes --]

Hi,

Regarding the following example I've got two questions.

(1) Why don't I ever see the argument #2 in the output?
(2) What do I have to do to suppress the unwanted space
after the end of the output of this macro (as can be seen
in the result before the following comma)?

Regards,

Juergen


\def\Geb{\dosingleempty\doMyGeb}
\def\doMyGeb[#1]#2#3{, x %
   \iffirstargument%
      Aha
   \else
     \ifsecondargument%
       #2
     \else%
       ... %C%
     \fi
   \fi
   \ifthirdargument%
     #3%
   \else%
     ...%
   \fi}

\starttext

\Geb{Ulm}{11. 9. 2008} % should deliver x Ulm 11. 9. 2008
\Geb[Ulm]{Ulm}{11. 9. 2008} % should deliver x Aha Ulm 11. 9. 2008
\Geb{}{11. 9. 2008} % should deliver x ... 11. 9. 2008
\Geb{Ulm}{} % should deliver x Ulm ...
\Geb{}{} % should deliver x ...

\stoptext





[-- Attachment #1.2: Type: text/html, Size: 2688 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: first steps with \dosingleempty
  2008-09-11  6:31 first steps with \dosingleempty Goebel, Juergen
@ 2008-09-11  7:21 ` Hans Hagen
  2008-09-11  7:56   ` Goebel, Juergen
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2008-09-11  7:21 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Goebel, Juergen wrote:
> Hi,
> 
> Regarding the following example I've got two questions.
> 
> (1) Why don't I ever see the argument #2 in the output?
> (2) What do I have to do to suppress the unwanted space
> after the end of the output of this macro (as can be seen
> in the result before the following comma)?
> 
> Regards,
> 
> Juergen
> 
> 
> \def\Geb{\dosingleempty\doMyGeb}
> \def\doMyGeb[#1]#2#3{, x %
>    \iffirstargument%
>       Aha
>    \else
>      \ifsecondargument%
>        #2
>      \else%
>        ... %C%
>      \fi
>    \fi
>    \ifthirdargument%
>      #3%
>    \else%
>      ...%
>    \fi}
> 
> \starttext
> 
> \Geb{Ulm}{11. 9. 2008} % should deliver x Ulm 11. 9. 2008
> \Geb[Ulm]{Ulm}{11. 9. 2008} % should deliver x Aha Ulm 11. 9. 2008
> \Geb{}{11. 9. 2008} % should deliver x ... 11. 9. 2008
> \Geb{Ulm}{} % should deliver x Ulm ...
> \Geb{}{} % should deliver x ...
> 
> \stoptext

\unexpanded\def\Geb{\dosingleempty\doMyGeb}

\def\doMyGeb[#1]#2#3%
   {, x \iffirstargument Aha \fi
    \doifsomethingelse{#2}{#2}{...}\space
    \doifsomethingelse{#3}{#3}{...}%
    \par}


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: first steps with \dosingleempty
  2008-09-11  7:21 ` Hans Hagen
@ 2008-09-11  7:56   ` Goebel, Juergen
  2008-09-11  8:04     ` Patrick Gundlach
  2008-09-11  8:12     ` Wolfgang Schuster
  0 siblings, 2 replies; 7+ messages in thread
From: Goebel, Juergen @ 2008-09-11  7:56 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hans Hagen wrote:

> \unexpanded\def\Geb{\dosingleempty\doMyGeb}
> 
> \def\doMyGeb[#1]#2#3%
>    {, x \iffirstargument Aha \fi
>     \doifsomethingelse{#2}{#2}{...}\space
>     \doifsomethingelse{#3}{#3}{...}%
>     \par}

Thanks a lot, elegant and much shorter.
But, alas, I can't test it yet since the
\doifsomethingelse seems to be somewhat
newer.  My oldtimer (according to Hraban)
shall really be updated during the next 
days or weeks ... 

Does anyone know when the TL 2008 will be
distributed to the DANTE-members?

Juergen
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: first steps with \dosingleempty
  2008-09-11  7:56   ` Goebel, Juergen
@ 2008-09-11  8:04     ` Patrick Gundlach
  2008-09-11 10:28       ` Goebel, Juergen
  2008-09-11  8:12     ` Wolfgang Schuster
  1 sibling, 1 reply; 7+ messages in thread
From: Patrick Gundlach @ 2008-09-11  8:04 UTC (permalink / raw)
  To: ntg-context

Hi,

> Does anyone know when the TL 2008 will be
> distributed to the DANTE-members?

very likely, but you should consider trying out the official context
distribution:

http://distribution.contextgarden.net/


Patrick
-- 
ConTeXt wiki and more: http://contextgarden.net
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: first steps with \dosingleempty
  2008-09-11  7:56   ` Goebel, Juergen
  2008-09-11  8:04     ` Patrick Gundlach
@ 2008-09-11  8:12     ` Wolfgang Schuster
  1 sibling, 0 replies; 7+ messages in thread
From: Wolfgang Schuster @ 2008-09-11  8:12 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, Sep 11, 2008 at 9:56 AM, Goebel, Juergen
<juergen.goebel@eads.com> wrote:
> Hans Hagen wrote:
>
>> \unexpanded\def\Geb{\dosingleempty\doMyGeb}
>>
>> \def\doMyGeb[#1]#2#3%
>>    {, x \iffirstargument Aha \fi
>>     \doifsomethingelse{#2}{#2}{...}\space
>>     \doifsomethingelse{#3}{#3}{...}%
>>     \par}
>
> Thanks a lot, elegant and much shorter.
> But, alas, I can't test it yet since the
> \doifsomethingelse seems to be somewhat
> newer.  My oldtimer (according to Hraban)
> shall really be updated during the next
> days or weeks ...

You could use \doifelsenothing with reverse order for the second
and third argument, \doifsomethingelse was included after the
TL 2008 ConTeXt release.

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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: first steps with \dosingleempty
  2008-09-11  8:04     ` Patrick Gundlach
@ 2008-09-11 10:28       ` Goebel, Juergen
  2008-09-11 10:37         ` Wolfgang Schuster
  0 siblings, 1 reply; 7+ messages in thread
From: Goebel, Juergen @ 2008-09-11 10:28 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Patrick Gundlach wrote:

> http://distribution.contextgarden.net/

Hmm, is there a zip-file or something like this, which 
I can download via http or ftp for use with windows?  I 
think of something like context-setup-mswin.zip, only 
not minimal.  I would very much appreciated a link to
this resource.

TIA,

Juergen
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: first steps with \dosingleempty
  2008-09-11 10:28       ` Goebel, Juergen
@ 2008-09-11 10:37         ` Wolfgang Schuster
  0 siblings, 0 replies; 7+ messages in thread
From: Wolfgang Schuster @ 2008-09-11 10:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, Sep 11, 2008 at 12:28 PM, Goebel, Juergen
<juergen.goebel@eads.com> wrote:
> Patrick Gundlach wrote:
>
>> http://distribution.contextgarden.net/
>
> Hmm, is there a zip-file or something like this, which
> I can download via http or ftp for use with windows?  I
> think of something like context-setup-mswin.zip, only
> not minimal.  I would very much appreciated a link to
> this resource.

http://www.pragma-ade.com/download-1.htm

mswincontext.zip

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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-09-11 10:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-11  6:31 first steps with \dosingleempty Goebel, Juergen
2008-09-11  7:21 ` Hans Hagen
2008-09-11  7:56   ` Goebel, Juergen
2008-09-11  8:04     ` Patrick Gundlach
2008-09-11 10:28       ` Goebel, Juergen
2008-09-11 10:37         ` Wolfgang Schuster
2008-09-11  8:12     ` Wolfgang Schuster

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).