From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/21253 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: enumerated lists Date: Fri, 08 Jul 2005 10:05:00 +0200 Message-ID: <42CE33AC.5030505@wxs.nl> References: <427530A1.4050108@online-resourcen.de> <42CCDA63.8000204@online-resourcen.de> <42CD9142.2070801@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1120810035 31436 80.91.229.2 (8 Jul 2005 08:07:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 8 Jul 2005 08:07:15 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Fri Jul 08 10:07:14 2005 Return-path: Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1DqnsY-0000tS-GU for gctc-ntg-context-518@m.gmane.org; Fri, 08 Jul 2005 10:06:34 +0200 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 3BA6412848; Fri, 8 Jul 2005 10:06:34 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 01223-02; Fri, 8 Jul 2005 10:06:34 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 6CB4C1283C; Fri, 8 Jul 2005 10:04:39 +0200 (CEST) Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id AD05D1283C for ; Fri, 8 Jul 2005 10:04:37 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 01223-01 for ; Fri, 8 Jul 2005 10:04:36 +0200 (CEST) Original-Received: from mailrelay02.solcon.nl (maillb.solcon.nl [212.45.32.200]) by ronja.ntg.nl (Postfix) with ESMTP id 4F39412835 for ; Fri, 8 Jul 2005 10:04:34 +0200 (CEST) Original-Received: from server-1.pragma-net.nl (dsl-212-84-128-085.solcon.nl [212.84.128.85]) by mailrelay02.solcon.nl (8.12.11/SQL-8.12.11-5/8.12.11) with ESMTP id j6884WMf022035 for ; Fri, 8 Jul 2005 10:04:32 +0200 Original-Received: by server-1.pragma-net.nl (Postfix, from userid 65534) id 44EC231212; Fri, 8 Jul 2005 09:28:36 +0200 (CEST) Original-Received: from [10.100.1.53] (unknown [10.100.1.53]) by server-1.pragma-net.nl (Postfix) with ESMTP id A579B18EF3 for ; Fri, 8 Jul 2005 07:28:34 +0000 (UTC) User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en Original-To: mailing list for ConTeXt users In-Reply-To: <42CD9142.2070801@gmail.com> X-Virus-Scanned: ClamAV version 0.85.1, clamav-milter version 0.85 on mailrelay02 X-Virus-Status: Clean X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on smtp.ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:21253 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:21253 Mojca Miklavec wrote: > Frank Grieshaber wrote: > >> Hello all (esp. the ConTeXt-Developers), >> >> some time ago I sent the following email to this list and got no reply >> so I'm resending it. >> >> Is there any possibility that this feature will be part of the >> next/one of the next ConTeXt-versions? >> >> Frank > > > I'm affraid that despite the huge amount of features that "itemize" > offers, it should be rewritten one day. Sometimes it doesn't really work > as expected (some comments can be found in my post > "\setupitemize[packed,paragraph]") and the features you are mentioning > here are missing, although they would be sensible. > >>> Dear all, >>> I have a manuscript with long nested numbered enumerations and I want >>> the numbers of all levels to be printed automatically like: >>> >>> 1. one >>> 1.1 one-one >>> 1.2 one-two >>> 2. two >>> 2.1 two-one >>> 2.2.1 two-two-one >>> ... >>> >>> Using the following prints only the current level's number, not all >>> levels: >>> >>> \startitemize[n,packed] >>> \item >>> \item >>> \startitemize[m,packed] >>> \item >>> \item >>> \stopitemize >>> \item >>> \item >>> \stopitemize > PS: But once again - If anyone will be reading this post in the mail > archive: please, don't use this trick!!! Please check first if this > feature has been added in the meantime. sorry for being mean again ... % copy this into cont-new.tex \unprotect \def\dododosetupitemgroupconstant[#1][#2#3#4]% * permits [2] {\processaction [#2#3#4] [ \v!packed*=>\packitems, \v!intro*=>\itemintrotrue, \v!autointro*=>\autoitemintrotrue, \v!broad*=>\setitemparameter{#1}\c!factor{1}, #2#3*\v!broad*=>\setitemparameter{#1}\c!factor{#2#3}, #2*\v!broad*=>\setitemparameter{#1}\c!factor{#2}, \v!text*=>\textitemstrue \settrue\inlinelistitem \dosetuppackeditemgroup{#1}% \packitems, \v!columns*=>\packitems, \v!margin*=>\setitemparameter{#1}\c!width{-2em}, % signal \v!inmargin*=>\setitemparameter{#1}\c!width{-2em}, % signal \v!atmargin*=>\doifnot{#1}{1}{\setitemparameter{#1}\c!width{0em}}, % signal \v!intext*=>\settrue\inlinelistitem, % new \v!loose*=>\optimizeitemsfalse, \v!paragraph*=>\paragraphitemstrue \packitems, \v!joinedup*=>\dosetuppackeditemgroup{#1}% \packitems, \v!serried*=>\setitemparameter{#1}\c!factor{-1}, #2#3*\v!serried*=>\setitemparameter{#1}\c!factor{-#2#3}, #2*\v!serried*=>\setitemparameter{#1}\c!factor{-#2}, \v!stopper*=>\setitemparameter{#1}\c!placestopper\v!yes, \v!unpacked*=>\packeditemsfalse, \v!repeat*=>\settrue\repeatlistitem, % new \v!standard*=>\dosetupstandarditemgroup{#1}]} \def\dolistitem % evt aantal items opslaan per niveau, scheelt zoeken {\iftextitems % begin of item \else \par \fi \ignorespaces \increment\noflistelements \ifnum\itemcolumndepth=\zerocount \ifoptimizeitems \ifnum\noflistelements=\plusone % tgv bv kolommen/nesting \findtwopassdata\s!list{\noflists:}% % wordt soms de volgorde \fi % verstoord, vandaar \find \iftwopassdatafound \ifcase0\twopassdata\relax \twopassdatafoundfalse \fi \fi \iftwopassdatafound \ifnum\twopassdata=3 \ifnum\noflistelements>1 \doitembreak\itemnobreak \fi \else\ifnum\twopassdata>3 \ifnum\noflistelements=2 \ifitemintro \doitembreak\nobreak \else \doitembreak\itemnobreak \fi \else\ifnum\twopassdata=\noflistelements\relax \doitembreak\itemnobreak \else\ifnum\noflistelements>2 \doitembreak\itembreak \else \ifitemintro\else\doitembreak\itembreak\fi \fi\fi\fi \fi\fi \fi \fi\fi \noindent \setbox8\hbox {\ifheaditem \doitemattributes\itemlevel\c!headstyle\c!headcolor{\listitem}% \else\ifsymbolitem \symsymbol \else \doitemattributes\itemlevel\c!style\c!color{\listitem}% \fi\fi}% \doifsomething\somdestination {\setbox8\hbox{\goto{\box8}[\somdestination]}}% \globallet\somdestination\empty \dimen2=\getitemparameter\itemlevel\c!width\relax % new, prevents loops when symbol is (not yet found) graphic \ht8=\strutheight \dp8=\strutdepth % so that content differs per run (esp mp graphics afterwards) \checkforrepeatedlistitem \ifdim\dimen2<\zeropoint\relax \llap{\ifsubitem\llap{+}\fi\box8\hskip\leftmargindistance}% \else \ifdim\dimen2=\zeropoint\relax \calculatelistwidth1{\dimen0}% \else \calculatelistwidth\itemlevel{\dimen0}% \fi \iftextitems \hbox{\ifsubitem+\fi\box8\hskip\fontdimen2\font}\nobreak \else \ifconditional\inlinelistitem \hbox to \dimen0{\ifsubitem\llap{+}\fi\box8\hfill}% \else % todo: align+marge binnen de hbox \llap{\hbox to \dimen0{\ifsubitem\llap{+}\fi\box8\hfill}}% \fi \fi \fi \forceunexpanded % needed for m conversion (\os) / i need to look into this \setevalue{\@@currentitemsymbol\itemlevel}% {\getvalue{\@@localitemsymbol\itemlevel}}% still problems with \uchar ? %{\noexpand\getvalue{\@@localitemsymbol\itemlevel}}% no, spoils subrefs \resetunexpanded \headitemfalse \subitemfalse \symbolitemfalse \EveryPar{\ignorespaces}% \ignorespaces} \newconditional\repeatlistitem \def\checkforrepeatedlistitem {\ifnum\itemlevel=\plusone \ifnum\itemlevel=\plusone \initializeboxstack{item}% \fi \fi \ifconditional\repeatlistitem \savebox{item}{\itemlevel}{\hbox{\ifnum\itemlevel>\plusone \copy8\else\fi}}% \setbox8\hbox {\setbox\scratchbox\hbox{\foundbox{item}{\itemlevel}}% \ifnum\itemlevel>\plusone \hskip-\wd\scratchbox \ifnum\countervalue{\@@itemcounter\itemlevel}>\plusone \llap{\box\scratchbox}% \fi \fi \box8}% \fi} \protect % end of copy \starttext \startitemize[n,packed] \item test \item \startitemize[m,packed,repeat] \item test \item test \stopitemize \item test \item \startitemize[m,packed] \item test \item test \stopitemize \stopitemize \stoptext Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------