ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \setvariables and database module
@ 2018-01-30 14:44 Otared Kavian
  2018-01-30 14:54 ` Wolfgang Schuster
  0 siblings, 1 reply; 13+ messages in thread
From: Otared Kavian @ 2018-01-30 14:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi all,

I need to create a document using a database and the \setvariables command (which I understood thanks to Wolfgang Schuster). Everything works fine except that using the approach below I need to change the entries in the database by enclosing each entry between a pair of braces {}, because otherwise the macro I have imagined does not work as expected. In the example below the first line of entries is treated correctly, while the second one is understood wrongly by my macro \maketalk defined below in the minimal example.

It is indeed possible, in theory, to change the database file so that each entry is enclosed in a pair of braces, but I would like to avoid that mainly because I am not the one who produces nor maintains that file and I want to avoid modifying a copy of that file myself.

How can I change my approach to this problem in order to achieve what is needed?
Many thanks for any hint.
Best regards: OK

% begin database-command.tex
\usemodule[database]

\starttext
\startbuffer[pagetalk]
	\starttabulate[|f{\bi}l|p|][before=]%
	\NC Speaker \EQ 
	\goto{{\sc \getvariable{talk}{speakername}}}[fig:\getvariable{talk}{speakername}]
	 \NC\NR
	\NC Title   \EQ \getvariable{talk}{title}    \NC\NR
	\stoptabulate
	\startplacefigure[number=no]
		\externalfigure[\getvariable{talk}{picture}]
	\stopplacefigure
	\page
\stopbuffer

\setvariable{talk}{set}{\getbuffer[pagetalk]}

\define[3]\maketalk{%
	\setvariables[talk]%
		[speakername={#1},
		title={#2},
		picture={#3},
		]}

\defineseparatedlist[seplisttalk]
	[separator={;},
	first=\maketalk
	]

\startseplisttalk
{Hacker} ; {Up to date hacking} ; {hacker.jpg} % this works fine
Hacker ; Up to date hacking ; hacker.jpg % this does not work: the macro takes only the three characters H a c
\stopseplisttalk

\stoptext
% end database-command.tex
___________________________________________________________________________________
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
___________________________________________________________________________________

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

end of thread, other threads:[~2018-02-02  0:47 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-30 14:44 \setvariables and database module Otared Kavian
2018-01-30 14:54 ` Wolfgang Schuster
2018-01-30 15:28   ` Otared Kavian
2018-01-30 15:53     ` Otared Kavian
2018-01-30 16:37       ` Wolfgang Schuster
2018-01-30 17:56         ` Otared Kavian
2018-01-30 18:05           ` Wolfgang Schuster
2018-01-30 18:18             ` Otared Kavian
2018-01-31 16:40       ` Wolfgang Schuster
2018-01-31 16:58         ` Otared Kavian
2018-01-31 17:11           ` Wolfgang Schuster
2018-01-31 21:20             ` Otared Kavian
2018-02-02  0:47               ` luigi scarso

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