From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/88834 Path: news.gmane.org!not-for-mail From: Rik Kabel Newsgroups: gmane.comp.tex.context Subject: Generate Authorlist example fails, was Re: authors in the toc Date: Fri, 03 Oct 2014 15:09:00 -0400 Message-ID: <542EF44C.8020907@rik.users.panix.com> References: <7157117C-6049-46B1-8B35-D8C86357D78E@gmail.com> <542D8E83.6020103@rik.users.panix.com> <870B890A-91DB-4822-9DBE-9A07BC016358@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1755119988==" X-Trace: ger.gmane.org 1412363398 11354 80.91.229.3 (3 Oct 2014 19:09:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 3 Oct 2014 19:09:58 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Fri Oct 03 21:09:54 2014 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Xa8Eg-0002fL-CY for gctc-ntg-context-518@m.gmane.org; Fri, 03 Oct 2014 21:09:50 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id C779510238 for ; Fri, 3 Oct 2014 21:09:49 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id hpWXucjTJAXD for ; Fri, 3 Oct 2014 21:09:48 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 0063E1024E for ; Fri, 3 Oct 2014 21:09:12 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 97D7410213 for ; Fri, 3 Oct 2014 21:09:07 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id kxzXwhOPXYvi for ; Fri, 3 Oct 2014 21:09:05 +0200 (CEST) Original-Received: from filter3-ams.mf.surf.net (filter3-ams.mf.surf.net [192.87.102.71]) by balder.ntg.nl (Postfix) with ESMTP id 74402101E8 for ; Fri, 3 Oct 2014 21:09:05 +0200 (CEST) Original-Received: from mailbackend.panix.com (mailbackend.panix.com [166.84.1.89]) by filter3-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id s93J93rU031829 for ; Fri, 3 Oct 2014 21:09:04 +0200 Original-Received: from [192.168.201.10] (cpe-67-240-55-150.nycap.res.rr.com [67.240.55.150]) by mailbackend.panix.com (Postfix) with ESMTP id 796792EB22 for ; Fri, 3 Oct 2014 15:09:01 -0400 (EDT) User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 In-Reply-To: <870B890A-91DB-4822-9DBE-9A07BC016358@gmail.com> X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=166.84.1.89; country=US; region=New York; city=New York; latitude=40.7553; longitude=-73.9924; http://maps.google.com/maps?q=40.7553,-73.9924&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 03MWH934P - 2f92c7424b5e - 20141003 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.71 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:88834 Archived-At: This is a multi-part message in MIME format. --===============1755119988== Content-Type: multipart/alternative; boundary="------------050701080102010307080805" This is a multi-part message in MIME format. --------------050701080102010307080805 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable On 2014-10-02 15:22, Wolfgang Schuster wrote: > > Am 02.10.2014 um 19:42 schrieb Rik Kabel >: > >> On 2014-10-02 05:18, Wolfgang Schuster wrote: >>> There is a example on the wiki. You have to set your own values with=20 >>> the second argument of the \startchapter etc. command, to display=20 >>> the entry in the roc you have to write your own layout where you=20 >>> access it with the \structurelistuservariable command. >>> >>> http://wiki.contextgarden.net/Generate_Authorlist_from_Head_Content >>> >>> Wolfgang >>> >> This example fails for me using the current (2014-09-27) standalone=20 >> beta and with TL14. The failure is that the list of authors is=20 >> presented as a grid without contents. >> >> Changing any of the lines in the example that construct the table=20 >> cells, such as >> >> \bTD \structureuservariable{author} \eTD >> >> to >> >> \bTD xx \structureuservariable{author} \eTD >> >> results in a table with the new text, but no user variable text,=20 >> showing that the \structureuservariable commands are not returning=20 >> any text in this example. >> >> Has something relevant changed since the example was prepared=20 >> (2010-11 or earlier)? >> >> (A pointer to useful descriptions of \structureuservariable and=20 >> \structurelistuservariable would also be welcome. In the wiki, the=20 >> startsection command description describes the former, but I have=20 >> come across no comprehensive description for either in the=20 >> documentation.) > > First you have to make a distinction between the values which are set=20 > with the first and second argument of \startchapter, \startsection=20 > etc. While the first argument takes only certain keys, e.g. title,=20 > bookmark etc. you=E2=80=99re free to choose your own keys for the secon= d=20 > argument because they are considered userdata. The point of this=20 > userdata is to give users a way to specify information which are=20 > printed in the table of content or in the header, to access these=20 > values context provides two commands. When you create a new layout=20 > for the table of contents you can use the \structurelistuservariable=20 > command which takes the name of the key with the information as=20 > argument and when you create a new header layout you can use the=20 > \structureuservariable command. > > > \define[3]\ChapterListCommand > {\starttabulate > \NC Number \NC #1 \NC\NR > \NC Title \NC #2 \NC\NR > \NC Page \NC #3 \NC\NR > \TB[medium] > \NC File \NC \structurelistuservariable{file} \NC\NR > \stoptabulate} > > \setuplist[chapter][alternative=3Dcommand,command=3D\ChapterListCommand= ] > > \define[2]\ChapterHeadCommand > {\startframed[align=3Dflushleft,strut=3Dno] > \starttabulate[before=3D,after=3D] > \NC Number \NC #1 \NC\NR > \NC Title \NC #2 \NC\NR > \TB[medium] > \NC File \NC \structureuservariable{file} \NC\NR > \stoptabulate > \stopframed} > > \setuphead[chapter][command=3D\ChapterHeadCommand] > > \starttext > > \completecontent > > \startchapter[title=3DKnuth example][file=3Dknuth.tex] > \input knuth > \stopchapter > > \startchapter[title=3DZapf example][file=3Dzapf.tex] > \input zapf > \stopchapter > > \stoptext > > Wolfgang > Thank you, Wolfgang, for that explanation. Can you suggest what might be wrong with the example at=20 http://wiki.contextgarden.net/Generate_Authorlist_from_Head_Content? The list of authors is created, so the user variable 'author' is set at=20 for \doifsomething. When the index for the author list is set to a=20 constant, only one row is generated, but when it is the user variable=20 'name' the right number of rows is created, so 'name' is also set when=20 it is referenced as the key in the author list sorting macro. Each line=20 of the table is empty, suggesting that within the scope of the table the=20 user variables are reset to nil. The same problem exists when=20 \starttabulate is used instead of \bTABLE. --=20 Rik --------------050701080102010307080805 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
On 2014-10-02 15:22, Wolfgang Schuster wrote:

Am 02.10.2014 um 19:42 schrieb Rik Kabel <context@rik.users= .panix.com>:

On 2014-10-02 05:18, Wolfgang Schuster wrote:
There is a example on the wiki. You have to set your own values with the second argument of the \startchapter etc. command, to display the entry in the roc you have to write your own layout where you access it with the=C2=A0\structurelistuservariable command.


Wolfgang

This example fails for me using the current (2014-09-27) standalone beta and with TL14. The failure is that the list of authors is presented as a grid without contents.

Changing any of the lines in the example that construct the table cells, such as
\bTD \structureuservariable{author} \eTD=
to
\bTD xx \structureuservariable{author} \eTD
results in a table with the new text, but no user variable text, showing that the \structureuservariable commands are not returning any text in this example.

Has something relevant changed since the example was prepared (2010-11 or earlier)?

(A pointer to useful descriptions of \structureuservariable and \structurelistuservariable would also be welcome. In the wiki, the startsection command description describes the former, but I have come across no comprehensive description for either in the documentation.)

First you have to make a distinction between the values which are set with the first and second argument of \startchapter, \startsection etc. =C2=A0While the first argument takes only cert= ain keys, e.g. title, bookmark etc. you=E2=80=99re free to choose you= r own keys for the second argument because they are considered userdata. =C2=A0The point of this userdata is to give users a way= to specify information which are printed in the table of content or in the header, to access these values context provides two commands. =C2=A0When you create a new layout for the table of contents you can use the \structurelistuservariable command which takes the name of the key with the information as argument and when you create a new header layout you can use the \structureuservariable command.


\define[3]\ChapterListCommand
=C2=A0 {\starttabulate
=C2=A0 =C2=A0\NC Number \NC #1 \NC\NR
=C2=A0 =C2=A0\NC Title =C2=A0\NC #2 \NC\NR
=C2=A0 =C2=A0\NC Page =C2=A0 \NC #3 \NC\NR
=C2=A0 =C2=A0\TB[medium]
=C2=A0 =C2=A0\NC File =C2=A0 \NC \structurelistuservariable{= file} \NC\NR
=C2=A0 =C2=A0\stoptabulate}

\setuplist[chapter][alternative=3Dcommand,command=3D\Chapter= ListCommand]

\define[2]\ChapterHeadCommand
=C2=A0 {\startframed[align=3Dflushleft,strut=3Dno]
=C2=A0 =C2=A0 =C2=A0\starttabulate[before=3D,after=3D]
=C2=A0 =C2=A0 =C2=A0\NC Number \NC #1 \NC\NR
=C2=A0 =C2=A0 =C2=A0\NC Title =C2=A0\NC #2 \NC\NR
=C2=A0 =C2=A0 =C2=A0\TB[medium]
=C2=A0 =C2=A0 =C2=A0\NC File =C2=A0 \NC \structureuservariab= le{file} \NC\NR
=C2=A0 =C2=A0 =C2=A0\stoptabulate
=C2=A0 =C2=A0\stopframed}

\setuphead[chapter][command=3D\ChapterHeadCommand]

\starttext

\completecontent

\startchapter[title=3DKnuth example][file=3Dknuth.tex]
\input knuth
\stopchapter

\startchapter[title=3DZapf example][file=3Dzapf.tex]
\input zapf
\stopchapter

\stoptext

Wolfgang

Thank you, Wolfgang, for that explanation.

Can you suggest what might be wrong with the example at
http://wiki.contextgarden.net/Generate_Authorlist_from_Head_Content?

The list of authors is created, so the user variable 'author' is set at for \doifsomething. When the index for the author list is set to a constant, only one row is generated, but when it is the user variable 'name' the right number of rows is created, so 'name' is also set when it is referenced as the key in the author list sorting macro. Each line of the table is empty, suggesting that within the scope of the table the user variables are reset to nil. The same problem exists when \starttabulate is used instead of \bTABLE.

--
Rik

--------------050701080102010307080805-- --===============1755119988== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly90ZXguYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHA6Ly9mb3VuZHJ5LnN1cGVsZWMu ZnIvcHJvamVjdHMvY29udGV4dHJldi8Kd2lraSAgICAgOiBodHRwOi8vY29udGV4dGdhcmRlbi5u ZXQKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX18= --===============1755119988==--