[NTG-context] Registers and getparameters

Hans Hagen pragma at wxs.nl
Tue Jan 23 10:19:05 CET 2018


On 1/22/2018 8:26 PM, Wolfgang Schuster wrote:
> 
>> Otared Kavian <mailto:otared at gmail.com>
>> 22. Januar 2018 um 19:53
>> Hi all,
>>
>> I have a list of speakers (and abstracts of their talk) in a rather 
>> long document, and the name of each speaker is written to a register 
>> named speakers.
>> Then with the command \getparameters[Talk] I get the name of each 
>> speaker and try to write it to the register with
>>
>> \speakers{\TalkSpeakerName}
> 
> You have to add \expanded, i.e. \expanded{\speakers{...}}.

or maybe try the 'expanded' option

\setupregister
   [speakers]
   [style=sansbold,
    n=2,
    expansion=yes]


>> Indeed this does not work to obtain the result I am looking for: the 
>> sorting is indeed under the letter « t », and most importantly the 
>> register gets only the last name in the list instead of getting each 
>> speaker name.
>>
>> The following is a (not so minimal…) example. Can anyone help me in 
>> this matter?
> 
> When you replace \getparameters with \setvariables you can set a command
> which is applied each time when you set new values.
> 
> 
> \defineregister[speakers]
> 
> \setupregister
>    [speakers]
>    [style=sansbold,
>     n=2]
> 
> \startbuffer[pagetalk]
>    \doflushatpar
>      {\expanded{\speakers{\getvariable{talk}{speakername}}}%
>       \expanded{\pagereference[talk:\getvariable{talk}{speakername}]}}%
>    \starttabulate[|f{\bi}l|p|]
>    \NC Speaker \EQ \getvariable{talk}{speakername} \NC\NR
>    \NC Title   \EQ \getvariable{talk}{title}       \NC\NR
>    \NC Time    \EQ \getvariable{talk}{time}        \NC\NR
>    \NC Room    \EQ \getvariable{talk}{room}        \NC\NR
>    \HL
>    \stoptabulate
> \stopbuffer
> 
> \setvariable{talk}{set}{\getbuffer[pagetalk]}
> 
> \showframe[text][text]
> 
> \starttext
> 
> \setvariables
>    [talk]
>    [speakername={Gauss},
>     title={Remarks on Number Theory},
>     time={10:30},
>     room={A}]
> 
> The talk about Gauss was on \at{page}[talk:Gauss].
> 
> \completeregister[speakers]
> 
> \stoptext
> 
> 
> Wolfgang
> 
> 
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context at ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________
> 


-- 

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the ntg-context mailing list