From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/88827 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: authors in the toc Date: Thu, 2 Oct 2014 21:22:35 +0200 Message-ID: <870B890A-91DB-4822-9DBE-9A07BC016358@gmail.com> References: <7157117C-6049-46B1-8B35-D8C86357D78E@gmail.com> <542D8E83.6020103@rik.users.panix.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Content-Type: multipart/mixed; boundary="===============0374023628==" X-Trace: ger.gmane.org 1412277798 15632 80.91.229.3 (2 Oct 2014 19:23:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 2 Oct 2014 19:23:18 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Oct 02 21:23:13 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 1XZly5-0000cE-NP for gctc-ntg-context-518@m.gmane.org; Thu, 02 Oct 2014 21:23:13 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 422AE10245 for ; Thu, 2 Oct 2014 21:23:13 +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 Ys56KcxG6POw for ; Thu, 2 Oct 2014 21:23:12 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id B629C10247 for ; Thu, 2 Oct 2014 21:22:44 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 7147D1020C for ; Thu, 2 Oct 2014 21:22:40 +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 u2QcttzXM20L for ; Thu, 2 Oct 2014 21:22:39 +0200 (CEST) Original-Received: from filter1-utr.mf.surf.net (filter1-utr.mf.surf.net [195.169.124.152]) by balder.ntg.nl (Postfix) with ESMTP id 67DE010209 for ; Thu, 2 Oct 2014 21:22:39 +0200 (CEST) Original-Received: from mail-wi0-x232.google.com (mail-wi0-x232.google.com [IPv6:2a00:1450:400c:c05::232]) by filter1-utr.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id s92JMTPS030429 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Thu, 2 Oct 2014 21:22:29 +0200 Original-Received: by mail-wi0-f178.google.com with SMTP id cc10so5132430wib.17 for ; Thu, 02 Oct 2014 12:22:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:message-id:mime-version:subject:date:references :to:in-reply-to; bh=AbkbNN6XNLPW852a4EIIBx+BcOAZOonP+iiVELp1SbQ=; b=HjRSjzmxki1pyKc7iLQCSUBRGR0ugPHPqgh2TE4o0TBUWsB0+lfJXk8Yis1AwbFjMu KGhd2OGJYJPzF2uJ6cgUfG7oeeELWtKLFO/u7ccA94TquxT/S/QrnapmaUgZrIpM+60b jOICIHRc5L3AXyhA+WgkSddLbMVIPESDwbjpdYCC+VhQPIAJKwuxRWeHtFou+Ff0lx9E 3hi7zJSlQfp8pgsbTyYoW3MLeCuZ5W2gnzzFamCcoowteS3PAHly/GeaR7OQrRqLxy0T +ZgqtFRYIZcXgnW/PF1ncUrFG9ZcOwo4Va4H1XlZPggVE2MWUoWYIfzlNSKkKSoN3H8W 6IDg== X-Received: by 10.180.101.129 with SMTP id fg1mr6698056wib.20.1412277758488; Thu, 02 Oct 2014 12:22:38 -0700 (PDT) Original-Received: from keima.localdomain (x2f290af.dyn.telefonica.de. [2.242.144.175]) by mx.google.com with ESMTPSA id hu3sm5557820wjb.17.2014.10.02.12.22.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 02 Oct 2014 12:22:37 -0700 (PDT) In-Reply-To: <542D8E83.6020103@rik.users.panix.com> X-Mailer: Apple Mail (2.1878.6) X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=2a00:1450:400c:c05::232; country=IE X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 07MWjmtQF - fce767ee2814 - 20141002 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) 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:88827 Archived-At: --===============0374023628== Content-Type: multipart/alternative; boundary="Apple-Mail=_7F8ABE16-D170-4071-BBAE-40C2B05EA166" --Apple-Mail=_7F8ABE16-D170-4071-BBAE-40C2B05EA166 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 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 = 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 \structurelistuservariable command. >>=20 >> http://wiki.contextgarden.net/Generate_Authorlist_from_Head_Content >>=20 >> Wolfgang >>=20 > 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. >=20 > 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. >=20 > Has something relevant changed since the example was prepared (2010-11 = or earlier)? >=20 > (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. = While the first argument takes only certain keys, e.g. title, bookmark = etc. you=92re free to choose your own keys for the second argument = because they are considered userdata. The 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. When 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 {\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 --Apple-Mail=_7F8ABE16-D170-4071-BBAE-40C2B05EA166 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=windows-1252
Am 02.10.2014 um 19:42 schrieb Rik = Kabel <context@rik.users.panix.com>:

=20 =20
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 \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.  While the = first argument takes only certain keys, e.g. title, bookmark etc. you=92re= free to choose your own keys for the second argument because they are = considered userdata.  The 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. =  When 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]\ChapterLi= stCommand
  {\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][alternat= ive=3Dcommand,command=3D\ChapterListCommand]

\def= ine[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=3DKn= uth example][file=3Dknuth.tex]
\input = knuth
\stopchapter

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

\stoptext
<= br>
Wolfgang

= --Apple-Mail=_7F8ABE16-D170-4071-BBAE-40C2B05EA166-- --===============0374023628== 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= --===============0374023628==--