X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil] ["4670" "Mon" "20" "December" "1999" "20:30:29" "+0100" "Javier Bezos" "jbezos@ARRAKIS.ES" nil "154" "TOC templates (part 2 of part 2)" "^Date:" nil nil "12" nil nil nil nil nil] nil) Return-Path: Received: via tmail-4.1(11) (invoked by user schoepf) for schoepf; Mon, 20 Dec 1999 20:32:17 +0100 (MET) Received: from mail.Uni-Mainz.DE (trudi.zdv.Uni-Mainz.DE [134.93.8.159]) by mailserver2.zdv.Uni-Mainz.DE (8.9.1b+Sun/8.9.1) with ESMTP id UAA05044 for ; Mon, 20 Dec 1999 20:32:17 +0100 (MET) Received: from mail.listserv.gmd.de (mail.listserv.gmd.de [192.88.97.5]) by mail.Uni-Mainz.DE (8.9.3/8.9.3) with ESMTP id UAA26494 for ; Mon, 20 Dec 1999 20:32:15 +0100 (MET) Received: from mail.listserv.gmd.de (192.88.97.5) by mail.listserv.gmd.de (LSMTP for OpenVMS v1.1a) with SMTP id <9.C0CDD3AE@mail.listserv.gmd.de>; Mon, 20 Dec 1999 20:32:09 +0100 Received: from RELAY.URZ.UNI-HEIDELBERG.DE by RELAY.URZ.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 1.8b) with spool id 446731 for LATEX-L@RELAY.URZ.UNI-HEIDELBERG.DE; Mon, 20 Dec 1999 20:31:23 +0100 Received: from relay.uni-heidelberg.de (relay.uni-heidelberg.de [129.206.100.212]) by relay.urz.uni-heidelberg.de (8.8.8/8.8.8) with ESMTP id UAA02953 for ; Mon, 20 Dec 1999 20:30:42 +0100 (MET) Received: from ssmtp01.arrakis.isp ([212.59.199.83]) by relay.uni-heidelberg.de (8.9.1b+Sun/8.9.1) with ESMTP id UAA13296 for ; Mon, 20 Dec 1999 20:31:22 +0100 (MET) Received: from [195.5.71.197] ([195.5.71.197]) by ssmtp01.arrakis.isp (Netscape Messaging Server 4.1 Nov 19 1999 19:47:43) with SMTP id FN20US02.P0S for ; Mon, 20 Dec 1999 20:30:28 +0100 x-sender: jbezos@pop.arrakis.es x-mailer: Claris Emailer 2.0, March 15, 1997 Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Message-ID: <199912201931.UAA13296@relay.uni-heidelberg.de> Reply-To: Mailing list for the LaTeX3 project Date: Mon, 20 Dec 1999 20:30:29 +0100 From: Javier Bezos Sender: Mailing list for the LaTeX3 project To: Multiple recipients of list LATEX-L Subject: TOC templates (part 2 of part 2) Status: R X-Status: X-Keywords: X-UID: 3474 \ExecuteOptions{leftlabels,nodotinlabels} \ProcessOptions % [...] \def\ttl@toctop{-1000} %[...] \@tempskipa\@pnumwidth \edef\@pnumwidth{\the\@tempskipa} \advance\@tempskipa-\@tocrmarg \edef\ttl@corr{-\the\@tempskipa} % Now the templates: \IgnoreWhiteSpace \newdimen\@tempdimd \newdimen\@tempdime \DeclareTemplateType{contentsobject}{7} \DeclareTemplateType{processcontents}{0} \def\comma{,} \DeclareTemplate{contentsobject}{JB1}{7}{ pre-action =f0 [] \COpre@action, post-action =f0 [] \COpost@action, decls =f0 [] \COobject@decl, left-margin =l [15pt] \@tempdimd, right-margin =l [\@pnumwidth] \@tempdime, right-adjust =l [\ttl@corr] \@tempdimb, label-format =f0 [\thecontentslabel] \COnumber@format, label-width =l [15pt] \@tempdima, title-format =f1 [#1] \COtitle@format, title-format-nolabel =f1 [\COtitle@format{#1}] \COtitle@format@nolbl, page-format =f1 [#1] \COpnum@format, leaders-text =f0 [.] \COleaders@action, leaders-width =l [1pc] \@tempdimc } {\IfNoValueTF{#4} {\let\thecontentslabel\@empty \ttl@numsecfalse} {\gdef\thecontentslabel{#4} \ttl@numsectrue} \gdef\thecontentspage{#7} \DoParameterAssignments \ttl@tocentry {\@ne} {#3} {\@tempdimd} {\contentsmargin[\@tempdimb]{\@tempdime} \COpre@action \COobject@decl} { {\contentslabel[\COnumber@format]{\@tempdima}\COtitle@format} {\hspace*{-\@tempdima}\COtitle@format@nolbl} } {\titlerule*[\@tempdimc]{\COleaders@action} \contentspage[\COpnum@format{\thecontentspage}]} {\COpost@action} {#5} {}} \DeclareTemplate{contentsobject}{JB2}{7}{ pre-action =f0 [] \COpre@action, post-action =f0 [] \COpost@action, decls =f0 [] \COobject@decl, left-margin =l [15pt] \@tempdimd, right-margin =l [\@pnumwidth] \@tempdime, label-format =f0 [\thecontentslabel.\ ] \COnumber@format, title-format =f1 [#1] \COtitle@format, title-format-nolabel =f1 [\COtitle@format{#1}] \COtitle@format@nolbl, page-format =f1 [{,~#1}] \COpnum@format, punct-sep =f0 [;\ ] \COpunct@sep, punct-end =f0 [.] \COpunct@end, punct-sup =f0 [;\ ] \COpunct@sup, punct-sup-sup =f0 [;\ ] \COpunct@supsup, punct-sub =f0 [;\ ] \COpunct@sub } {\IfNoValueTF{#4} {\let\thecontentslabel\@empty \ttl@numsecfalse} {\gdef\thecontentslabel{#4} \ttl@numsectrue} \gdef\thecontentspage{#7} \DoParameterAssignments \expandafter\protected@xdef\csname ttle@#3\endcsname{\COpunct@end} \ttl@tocentry {\z@} {#3} {\@tempdimd} {\contentsmargin[\@tempdimb]{\@tempdime} \COpre@action \COobject@decl} { {\COnumber@format\COtitle@format} {\COtitle@format@nolbl} } {\COpnum@format{\thecontentspage}} {\protect\contentsafter{\COpunct@sub}{\COpunct@sep} {\COpunct@sup}{\COpunct@supsup}} {#5} {}} \DeclareTemplate{processcontents}{JK}{0}{ start-action =f0 [\relax] \COstart@action, end-action =f0 [\relax] \COend@action, file-name =n [\jobname] \COfile@name, file-extension =n \COextension, contents-depth =c [2] \c@tocdepth, collection-id =n [] \COcollection@id, heading =f0 [\section*]\COheading, %actully use some instance name =n [\contentsname] \COname, header-format =f0 [\MakeUpperCase] \COheader@format } { \DoParameterAssignments \COheading{\COname \@mkboth{\CO@header@format\COname}{\CO@header@format\COname}} \begingroup \UseCollection{contentsobject}{\COcollection@id} %Is this wrong? \makeatletter \COstart@action \@input{\COfile@name.\COextension} \if@filesw \expandafter\newwrite\csname tf@\COextension\endcsname \immediate\openout \csname tf@\COextension\endcsname \COfile@name.\COextension\relax \fi \@nobreakfalse \endgroup } \DeclareInstance{processcontents}{tableofcontents}{JK}{ file-extension = toc } \DeclareDocumentCommand{\contentsobject}{mmmmmmm} {\UseInstance{contentsobject}{#3}{#1}{#2}{#3}{#4}{#5}{#6}{#7}} \DeclareDocumentCommand{\JKtableofcontents}{}{ \UseInstance{processcontents}{tableofcontents} } \newcounter{contentscounter} \DeclareDocumentCommand{\addcontentsobject}{mmmm}{ \stepcounter{contentscounter} %or refstep? \addtocontents{toc}{ \contentsobject{\number\c@contentscounter}{#1}{#2}{#3}{#4}{}{\thepage}}} \endinput ============================== xtitletoc.sty ends