ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <schuster.wolfgang@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Registers and getparameters
Date: Mon, 22 Jan 2018 20:26:06 +0100	[thread overview]
Message-ID: <5A663ACE.8050301@gmail.com> (raw)
In-Reply-To: <A34F05EB-AF93-4E01-8FF6-EE11AFE5DA2B@gmail.com>


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


> Otared Kavian <mailto:otared@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{...}}.

> 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

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

[-- Attachment #2: Type: text/plain, Size: 492 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2018-01-22 19:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-22 18:53 Otared Kavian
2018-01-22 19:26 ` Wolfgang Schuster [this message]
2018-01-22 20:39   ` Otared Kavian
2018-01-22 21:38     ` Wolfgang Schuster
2018-01-23  4:12       ` Otared Kavian
2018-01-23  9:19   ` Hans Hagen
2018-01-23 16:54     ` Otared Kavian

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=5A663ACE.8050301@gmail.com \
    --to=schuster.wolfgang@gmail.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).