ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* defining commands
@ 2010-02-05  8:03 Marius
  2010-02-05  9:29 ` Wolfgang Schuster
  0 siblings, 1 reply; 10+ messages in thread
From: Marius @ 2010-02-05  8:03 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hello all,

How do I define the \setuptitlepage and \placetitlepage commands in the
environment file? These commands are used as shown in the example below.

%%%%%%%%%%%%%%%%%%%%
\environment docenv

\setuptitlepage[author=weare,
                      name=thisismyname,
                      draft=yes]

\starttext
\placetitlepage

\chapter{First}

kasj dlkasjdfl asdf
asdfkjaslfd jalsfd

\stoptext
%%%%%%%%%%%%%%%%%%%%

Thank you,
Marius

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

[-- Attachment #2: Type: text/plain, Size: 486 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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: defining commands
  2010-02-05  8:03 defining commands Marius
@ 2010-02-05  9:29 ` Wolfgang Schuster
  2010-02-05 13:57   ` Marius
  2010-02-05 17:53   ` Hans Hagen
  0 siblings, 2 replies; 10+ messages in thread
From: Wolfgang Schuster @ 2010-02-05  9:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 05.02.10 09:03, schrieb Marius:
> Hello all,
>
> How do I define the \setuptitlepage and \placetitlepage commands in the
> environment file? These commands are used as shown in the example below.

Since you do not explain what do you expect from both commands it's not 
possible to give you an answer but you can find on the wiki [1] a 
example for a \setuptitle and \placetitle command which can be copied 
and used in your document.

[1] 
http://wiki.contextgarden.net/Document_Titles#In_ConTeXt:_A_more_advanced_solution

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
___________________________________________________________________________________


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

* Re: defining commands
  2010-02-05  9:29 ` Wolfgang Schuster
@ 2010-02-05 13:57   ` Marius
  2010-02-05 17:36     ` Hans Hagen
  2010-02-05 17:53   ` Hans Hagen
  1 sibling, 1 reply; 10+ messages in thread
From: Marius @ 2010-02-05 13:57 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Thank you for the link, the answer to my question was as in the example you
gave, but with a single argument. The solution to my problem given below
works, but I can't find the answer to the following question. What is the
difference between \dosingleempty and \dosingleargument ?

%%%%%%%%%%%%%%%%%%%%%%%
\unprotect

\definesystemvariable {dt}

\def\setuptitle
  {\dosingleempty\dosetuptitle}

\def\dosetuptitle[#1]%
  {\def\dodosetuptitle##1%
     {\getparameters[\??dt][#1]}%
  \processcommalist[#1]\dodosetuptitle}

\def\placetitle
  {\startalignment[\v!middle]
   \blank[\v!force,2*\v!big]
   \@@dttitle
   \blank[3*\v!medium]
   \@@dtauthor
   \blank[2*\v!medium]
   \@@dtdate
   \blank[3*\v!medium]
   \stopalignment}

\setuptitle
  [\c!title=,
   \c!author=,
   \c!date=\currentdate]

\protect
%%%%%%%%%%%%%%%%%%%%

On Fri, Feb 5, 2010 at 11:29 AM, Wolfgang Schuster <
schuster.wolfgang@googlemail.com> wrote:

> Am 05.02.10 09:03, schrieb Marius:
>
>  Hello all,
>>
>> How do I define the \setuptitlepage and \placetitlepage commands in the
>> environment file? These commands are used as shown in the example below.
>>
>
> Since you do not explain what do you expect from both commands it's not
> possible to give you an answer but you can find on the wiki [1] a example
> for a \setuptitle and \placetitle command which can be copied and used in
> your document.
>
> [1]
> http://wiki.contextgarden.net/Document_Titles#In_ConTeXt:_A_more_advanced_solution
>
> Wolfgang

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

[-- Attachment #2: Type: text/plain, Size: 486 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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: defining commands
  2010-02-05 13:57   ` Marius
@ 2010-02-05 17:36     ` Hans Hagen
  0 siblings, 0 replies; 10+ messages in thread
From: Hans Hagen @ 2010-02-05 17:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 5-2-2010 14:57, Marius wrote:
> Thank you for the link, the answer to my question was as in the example you
> gave, but with a single argument. The solution to my problem given below
> works, but I can't find the answer to the following question. What is the
> difference between \dosingleempty and \dosingleargument ?

the first one does not complain when no argument is given

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


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

* Re: defining commands
  2010-02-05  9:29 ` Wolfgang Schuster
  2010-02-05 13:57   ` Marius
@ 2010-02-05 17:53   ` Hans Hagen
  2010-02-05 18:08     ` Wolfgang Schuster
  1 sibling, 1 reply; 10+ messages in thread
From: Hans Hagen @ 2010-02-05 17:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Idris Samawi Hamid

On 5-2-2010 10:29, Wolfgang Schuster wrote:
> Am 05.02.10 09:03, schrieb Marius:
>> Hello all,
>>
>> How do I define the \setuptitlepage and \placetitlepage commands in the
>> environment file? These commands are used as shown in the example below.
>
> Since you do not explain what do you expect from both commands it's not
> possible to give you an answer but you can find on the wiki [1] a
> example for a \setuptitle and \placetitle command which can be copied
> and used in your document.
>
> [1]
> http://wiki.contextgarden.net/Document_Titles#In_ConTeXt:_A_more_advanced_solution

using no macros ... wikifyable ...

\startsetups titlepage
     \startstandardmakeup
         \definedfont[SerifBold at 40pt]
         \setupinterlinespace
         \getvariable{document}{title}
         \vfill
         \definedfont[SerifBold at 20pt]
         \setupinterlinespace
         \getvariable{document}{author}
     \stopstandardmakeup
\stopsetups

\setvariables
     [document]
     [title=Whatever,
      author=Not Me]

\setvariables
     [whatever]
     [set={\setup[whateverpage]}]

\startsetups whateverpage
     \startstandardmakeup
         \definedfont[SerifBold at 40pt]
         \setupinterlinespace
         \getvariable{whatever}{title}
         \vfill
     \stopstandardmakeup
\stopsetups

\starttext
     \setups[titlepage]
     \setvariables[whatever][title=One]
     \setvariables[whatever][title=Two]
\stoptext

in the whatever case each setvariables will trigger a setup, so one has 
a sort of macro with key/value support


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


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

* Re: defining commands
  2010-02-05 17:53   ` Hans Hagen
@ 2010-02-05 18:08     ` Wolfgang Schuster
  2010-02-05 18:19       ` Hans Hagen
  0 siblings, 1 reply; 10+ messages in thread
From: Wolfgang Schuster @ 2010-02-05 18:08 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 05.02.10 18:53, schrieb Hans Hagen:
> \setvariables
>     [whatever]
>     [set={\setup[whateverpage]}]
nice feature for setvariables lovers :)

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
___________________________________________________________________________________


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

* Re: defining commands
  2010-02-05 18:08     ` Wolfgang Schuster
@ 2010-02-05 18:19       ` Hans Hagen
  2010-02-05 18:21         ` Wolfgang Schuster
  0 siblings, 1 reply; 10+ messages in thread
From: Hans Hagen @ 2010-02-05 18:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 5-2-2010 19:08, Wolfgang Schuster wrote:
> Am 05.02.10 18:53, schrieb Hans Hagen:
>> \setvariables
>> [whatever]
>> [set={\setup[whateverpage]}]
> nice feature for setvariables lovers :)

yes, for those getting the creeps of #1 an dso

btw, i'm sure that you've seen

\starttexdefinition blabla #1 #2

which like setups ignores spaces so one can have readable macros

Hans


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


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

* Re: defining commands
  2010-02-05 18:19       ` Hans Hagen
@ 2010-02-05 18:21         ` Wolfgang Schuster
  2010-02-05 18:29           ` Hans Hagen
  0 siblings, 1 reply; 10+ messages in thread
From: Wolfgang Schuster @ 2010-02-05 18:21 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

Am 05.02.10 19:19, schrieb Hans Hagen:
> btw, i'm sure that you've seen
>
> \starttexdefinition blabla #1 #2
>
> which like setups ignores spaces so one can have readable macros
i was the one who requested the parameterless version

\starttexdefinition commandonly

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
___________________________________________________________________________________


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

* Re: defining commands
  2010-02-05 18:21         ` Wolfgang Schuster
@ 2010-02-05 18:29           ` Hans Hagen
  0 siblings, 0 replies; 10+ messages in thread
From: Hans Hagen @ 2010-02-05 18:29 UTC (permalink / raw)
  To: Wolfgang Schuster; +Cc: mailing list for ConTeXt users

On 5-2-2010 19:21, Wolfgang Schuster wrote:
> Am 05.02.10 19:19, schrieb Hans Hagen:
>> btw, i'm sure that you've seen
>>
>> \starttexdefinition blabla #1 #2
>>
>> which like setups ignores spaces so one can have readable macros
> i was the one who requested the parameterless version
>
> \starttexdefinition commandonly

ah, seems i need a memory upgrade

Hans

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


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

* Re: defining commands
       [not found] <mailman.170.1265412781.26807.ntg-context@ntg.nl>
@ 2010-02-06 15:29 ` Wolfgang Werners-Lucchini
  0 siblings, 0 replies; 10+ messages in thread
From: Wolfgang Werners-Lucchini @ 2010-02-06 15:29 UTC (permalink / raw)
  To: ntg-context

Hallo,

> >> btw, i'm sure that you've seen
> >>
> >> \starttexdefinition blabla #1 #2
> >>
> >> which like setups ignores spaces so one can have readable
> macros
> > i was the one who requested the parameterless version
> >
> > \starttexdefinition commandonly

I experimented a little with this:

----------------------------------------
\starttexdefinition BIS #1 #2
[#1 \ldots\ #2]
\stoptexdefinition

\starttext
\BIS1 23

\BIS{10}{20}30

\BIS {10}{20}30

\BIS{10} {20}30

\BIS{10}{20} 30

\BIS {10} {20}30

\BIS{10} {20} 30

\BIS {10} {20} 30
\stoptext
----------------------------------------

and get this:

----------------------------------------
[1 ... 2]3
[102030 ...
][102030 ...
][10 ...  20]30
[1020 ... 3]0
[10 ... 20]30
[10 ... 20] 30
[10 ... 20] 30
----------------------------------------

So it seems, that the first blank between command and #1 is optional. 
But the second between #1 and #2 is NEEDED. A last blank after #2 is 
not needed and not eaten.

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
___________________________________________________________________________________


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

end of thread, other threads:[~2010-02-06 15:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-05  8:03 defining commands Marius
2010-02-05  9:29 ` Wolfgang Schuster
2010-02-05 13:57   ` Marius
2010-02-05 17:36     ` Hans Hagen
2010-02-05 17:53   ` Hans Hagen
2010-02-05 18:08     ` Wolfgang Schuster
2010-02-05 18:19       ` Hans Hagen
2010-02-05 18:21         ` Wolfgang Schuster
2010-02-05 18:29           ` Hans Hagen
     [not found] <mailman.170.1265412781.26807.ntg-context@ntg.nl>
2010-02-06 15:29 ` Wolfgang Werners-Lucchini

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