From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/94453 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Assigning a variable to the list argument in \setupsection Date: Thu, 14 Apr 2016 19:15:14 +0200 Message-ID: <570FD022.1070402@gmail.com> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2247087448788728773==" X-Trace: ger.gmane.org 1460654153 25176 80.91.229.3 (14 Apr 2016 17:15:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 14 Apr 2016 17:15:53 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Apr 14 19:15:42 2016 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aqkrm-0002zA-56 for gctc-ntg-context-518@m.gmane.org; Thu, 14 Apr 2016 19:15:42 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 0DB33A4C7; Thu, 14 Apr 2016 19:15:31 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id r1ENO_syFoex; Thu, 14 Apr 2016 19:15:29 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id EBE8CA4BB; Thu, 14 Apr 2016 19:15:29 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 280D3A4BB for ; Thu, 14 Apr 2016 19:15:28 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9_x9u46ExEbq for ; Thu, 14 Apr 2016 19:15:27 +0200 (CEST) Original-Received: from mail-wm0-f50.google.com (mail-wm0-f50.google.com [74.125.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 96466A4BA for ; Thu, 14 Apr 2016 19:15:17 +0200 (CEST) Original-Received: by mail-wm0-f50.google.com with SMTP id u206so135610299wme.1 for ; Thu, 14 Apr 2016 10:15:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to; bh=2wNdLm17xpfHZKMpGyBktt2ojKHKhSN3HMoCN0lUVc4=; b=OZtVBa1Guhma/6LAMPNKT1OJHvMPZfEvqeYDbh2aVajd5mA7DakowwvTd9GkEj+ARY KFS2+ti8RbKsHpyvZGnyGwQHRZS0rIKLWaNRukotAmV7eBfQyPRcJQpxyWtPJ8ivp/RL vs4TiEiKbjm5lZQxZDY7KfnRzwggvIF25731Jrkd1SnNvGf8hJED7EZqEJAPZsIGyBFL xnnIGhSl7Uzm1u3/17MaTW7uuTWxPYz4bh3jYCuhs3172ZUxyUH7GsaHWSY5FE1kl3hh HRHK7BhOyb6PwyO5eZobC89MVbNZ8Q8uJHki1+5UctDaNj9E8IGA3ZhMtUoDcrc1vA6S B/0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to; bh=2wNdLm17xpfHZKMpGyBktt2ojKHKhSN3HMoCN0lUVc4=; b=RQd22cpHkrWmj/3MnvKypyMtEAcC83S+czjJWAqF5NDfriDpKsl2PO3QsRhmrKwsOc 1Wh3ESHbfGgyi1APXhoJPP+SJYU7ExojiEQhK7OhcIMOaxKob4DrGkxM+L5NaI3Ebfd9 59Zn4BCiO1Q5PzAhMBIuRjL/i43y3EoG1NzoIpD5zLfYJAuBg9A8TdpwT9yhd6hANS6Y dPvM1tB36b/E6bWh0rI/9ywiyLyJr5ijOrIcIuBEV8Q7z0us5OTcao3gjNJwFY/rzgm8 qTd9PVtMfUxK8pRdzxw66ezxOVL2mlHTBgCgDBRXCTpIsOEC8WrRQJ1p9QSYRc3U37C7 SLpQ== X-Gm-Message-State: AOPr4FVnp4HcEdy2nBVxNy4S6P9/8mIRN1jS0HMbFwo7HK7CasSm+JEStdV60Vha0nTbpQ== X-Received: by 10.194.109.36 with SMTP id hp4mr16889316wjb.117.1460654117193; Thu, 14 Apr 2016 10:15:17 -0700 (PDT) Original-Received: from keima.localdomain (x2f25bdd.dyn.telefonica.de. [2.242.91.221]) by smtp.gmail.com with ESMTPSA id d131sm7510480wmd.12.2016.04.14.10.15.16 for (version=TLSv1/SSLv3 cipher=OTHER); Thu, 14 Apr 2016 10:15:16 -0700 (PDT) User-Agent: Postbox 4.0.8 (Macintosh/20151105) In-Reply-To: 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:94453 Archived-At: This is a multi-part message in MIME format. --===============2247087448788728773== Content-Type: multipart/alternative; boundary="------------040905020100030103090304" This is a multi-part message in MIME format. --------------040905020100030103090304 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable > Michael Guravage > 14. April 2016 um 09:46 > Greetings, > > I would like to use a variable for the value of the list argument in,=20 > e.g., the \startsection command. If you compile my little example you=20 > will see that the first 'literal' assignment works, while the second=20 > 'variable' assignment does not. What am I missing here? > ConTeXt saves by default the list entries without expanding them which means you get "\getvariable{TOC}{list}" as entry in the table of contents for your section section entry but at this moment you haven=E2=80=99t set a value for this variable. To get the content of the variable in the list entry you have to expand the argument of the list key, one way is the use of the \expanded command as shown by Marco but you also let ConTeXt do this for you (no need for \expanded{=E2=80=A6}) when you add \setuphead[section][expansion=3Dyes] at the begin of your document. Wolfgang --------------040905020100030103090304 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
14= .=20 April 2016 um 09:46
Greetings,

I woul= d like to use a variable for the value of the list argument in, e.g., the \startsection command. If you compile my little example you will see=20 that the first 'literal' assignment works, while the second 'variable'=20 assignment does not. What am I missing here?

ConTeXt saves by default the list entries without expanding them
which means you get "\getvariable{TOC}{list}" as entry in the table
of contents for your section section entry but at this moment you
haven=E2=80=99t set a value for this variable.

To get the content of the variable in the list entry you have to expand the argument of the list key, one way is the use of the \expanded
command as shown by Marco but you also let ConTeXt do this for
you (no need for \expanded{=E2=80=A6}) when you add

=C2=A0=C2=A0=C2=A0 \setuphead[section][expansion=3Dyes]

at the begin of your document.

Wolfgang
--------------040905020100030103090304-- --===============2247087448788728773== 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= --===============2247087448788728773==--