From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/100753 Path: news.gmane.org!.POSTED!not-for-mail From: Henning Hraban Ramm Newsgroups: gmane.comp.tex.context Subject: ToC as itemize Date: Thu, 3 May 2018 16:13:30 +0200 Message-ID: <24EAEB87-E083-43D0-AF6D-9E4A775BE735@fiee.net> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_003F36F8-7BFF-4878-9C3C-EA8D1ADE52CC" X-Trace: blaine.gmane.org 1525356725 11709 195.159.176.226 (3 May 2018 14:12:05 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 3 May 2018 14:12:05 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu May 03 16:12:01 2018 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 blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fEExk-0002wX-V2 for gctc-ntg-context-518@m.gmane.org; Thu, 03 May 2018 16:12:01 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id F24F2464BD9; Thu, 3 May 2018 16:13:49 +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 1OOpGKvU1gUd; Thu, 3 May 2018 16:13:48 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 98C31464AFB; Thu, 3 May 2018 16:13:48 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id A0249464AF8 for ; Thu, 3 May 2018 16:13:47 +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 qvadlsukm_-3 for ; Thu, 3 May 2018 16:13:42 +0200 (CEST) Original-Received: from fiee.net (feronia.fiee.net [46.163.112.221]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 56539464AF7 for ; Thu, 3 May 2018 16:13:32 +0200 (CEST) Original-Received: from [192.168.178.36] (p508714D8.dip0.t-ipconnect.de [80.135.20.216]) by mail.fiee.net (Postfix) with ESMTPSA id 9B03F8005E for ; Thu, 3 May 2018 16:13:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fiee.net; s=default; t=1525356811; bh=w551zUzd8R8Ja8qeUFce+G+d/vHtV+ODH/U0qiDG5mY=; l=3258; h=From:Subject:To; b=AJ2F5+mHrb8lL7Ryoa7SLhmbcKniCY1PGBwT3WgUMCYMHgotaJT8dXDBKOGhud9SW +FjcFOvkdeh+TclMjCFm2m+nmXaiprNynl/k5xrFlVgvJYus9FTuuwcHe7VFagPFzY ySv7h8Wuy0cNh1tZ+l9c9CskF8Bc2EnOccqbbgrE= Authentication-Results: feronia.fiee.net; spf=pass (sender IP is 80.135.20.216) smtp.mailfrom=texml@fiee.net smtp.helo=[192.168.178.36] Received-SPF: pass (feronia.fiee.net: connection is authenticated) X-Mailer: Apple Mail (2.1878.6) 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:100753 Archived-At: --Apple-Mail=_003F36F8-7BFF-4878-9C3C-EA8D1ADE52CC Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 Hi again, Alan Bowen invented this interesting setup where the table of contents = is to be included in an itemize. E.g. Foreword ........ I 1. Smth unrelated .. II 2. Author: Title ... 1 3. Author: Title ... 5 etc. Only 2. and 3. come from a "list" of chapters, other entries are added = manually. The attached not-really-minimal working example also handles the author = setup =96 IRL we use a lot of user variables for metadata that needs = different representation in ToC and titling. This is the core code: \define[1]\ChapterTocEntry{% \startitem \structurelistuservariable{author}: #1\leaderfill\currentlistentrypagenumber \stopitem } \definelist[chapter][% alternative=3Db, interaction=3Dall, criterium=3Dall, textcommand=3D\ChapterTocEntry, pagecommand=3D\gobbleoneargument, ] \startContentsList %\sym{}Preface\leaderfill\at{Preface} % Preface unnumbered \startitem Test entry\leaderfill 123 \stopitem \placelist[chapter][criterium=3Dall] \stopContentsList The actual problem: The chapter list entries don=92t adhere to the formatting of the = itemize. I guess there=92s some expansion problem, due to the \startitem inside = if the textcommand? Greetlings, Hraban --- https://www.fiee.net http://wiki.contextgarden.net GPG Key ID 1C9B22FD --Apple-Mail=_003F36F8-7BFF-4878-9C3C-EA8D1ADE52CC Content-Disposition: attachment; filename=toctest.tex Content-Type: application/octet-stream; name="toctest.tex" Content-Transfer-Encoding: 7bit % \def\leaderfill{\leaders\hbox to 1em{\hss. \hss}\hfill} \defineitemgroup[ContentsList] \setupitemgroup[ContentsList][each] [broad,packed,autointro,repeat][] \setupitemgroup[ContentsList][1][n][margin=1pc] \define[2]\ChapterTitle{% % simplified \reference[\namedstructurevariable{chapter}{reference}]{\strut}% \structurevariable{title} {\tfx by \structureuservariable{author}} } \define[1]\ChapterTocEntry{% #1 is not used \startitem[continue,packed,joinedup]% % simplified, IRL we use several user variables \structurelistuservariable{author}: #1%\namedstructurelistvariable{chapter}{title}?? \leaderfill\color[blue]{\currentlistentrypagenumber} \stopitem% } \setuphead[chapter][ style=\rm, command=\ChapterTitle, ] \definelist[chapter][% alternative=b, interaction=all, criterium=all, textcommand=\ChapterTocEntry, numbercommand=\gobbleoneargument, pagecommand=\gobbleoneargument, ] \starttext \startContentsList %\sym{}Preface\leaderfill\at{Preface} % Preface unnumbered \startitem Test entry\leaderfill 123 \stopitem \startitem Test entry\leaderfill 124 \stopitem \placelist[chapter][criterium=all] \stopContentsList \startchapter[title=First,reference=tufte1][author=Edward Tufte] \input tufte \stopchapter \startchapter[title=Second,reference=knuth][author=Donald Knuth] \input knuth \stopchapter \startchapter[title=Third,reference=tufte2][author=Edward Tufte] \input tufte \stopchapter \stoptext --Apple-Mail=_003F36F8-7BFF-4878-9C3C-EA8D1ADE52CC Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f --Apple-Mail=_003F36F8-7BFF-4878-9C3C-EA8D1ADE52CC--