From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/68686 Path: news.gmane.org!not-for-mail From: Jesse Alama Newsgroups: gmane.comp.tex.context Subject: Re: alternating items in an itemization Date: Tue, 24 May 2011 16:24:18 +0200 Message-ID: References: <3F5D4FFA-0854-4A8D-BA57-E15EB588F435@googlemail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1306247085 27761 80.91.229.12 (24 May 2011 14:24:45 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 24 May 2011 14:24:45 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Tue May 24 16:24:40 2011 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QOsXI-0002h0-Ib for gctc-ntg-context-518@m.gmane.org; Tue, 24 May 2011 16:24:40 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 0984DCAD6F; Tue, 24 May 2011 16:24: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 Q2v3ND+OVX1M; Tue, 24 May 2011 16:24:37 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 807FFCAD6B; Tue, 24 May 2011 16:24:37 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 4CF4ECAD6B for ; Tue, 24 May 2011 16:24:36 +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 e2doiIJKBXCi for ; Tue, 24 May 2011 16:24:34 +0200 (CEST) Original-Received: from filter1-til.mf.surf.net (filter1-til.mf.surf.net [194.171.167.217]) by balder.ntg.nl (Postfix) with ESMTP id 4AB1CCAD52 for ; Tue, 24 May 2011 16:24:34 +0200 (CEST) Original-Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by filter1-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p4OEOWIS027827 for ; Tue, 24 May 2011 16:24:33 +0200 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QOsXA-0002cl-CW for ntg-context@ntg.nl; Tue, 24 May 2011 16:24:32 +0200 Original-Received: from n138232.science.ru.nl ([131.174.138.232]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 24 May 2011 16:24:32 +0200 Original-Received: from jesse.alama by n138232.science.ru.nl with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 24 May 2011 16:24:32 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 92 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: n138232.science.ru.nl User-Agent: Unison/2.1.4 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=80.91.229.12; country=NO; latitude=62.0000; longitude=10.0000; http://maps.google.com/maps?q=62.0000,10.0000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 08ELqoxxj - f90cdb7a72e1 - 20110524 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.217 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 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 Xref: news.gmane.org gmane.comp.tex.context:68686 Archived-At: On 2011-05-24 14:16:16 +0200, Wolfgang Schuster said: > Am 23.05.2011 um 22:08 schrieb Jesse Alama: > >> I'd like to define an itemization that has two kinds of items, >> representing a dialogue between two people. (One could imagine >> extending this to more than two.) I'd like to have something like this: >> >> \startdialogue >> \john What did you have for breakfast? >> \mary I skipped breakfast today. >> \john Oh, why? >> \mary Because I wasn't hungry. I was too distraught at what had >> happened the previous night. >> \stopdialogue >> >> The \john and \mary parts would each be their own paragaphs. The >> paragraphs would be colored with different text backgrounds, and joined >> up with one another (that is, the blocks of text representing the >> paragraphs for the different speakers would be adjacent to one another). > > > Solution 1: > > \definetextbackground[john-background][frame=off,location=paragraph,backgroundcolor=green] \definetextbackground[mary-background][frame=off,location=paragraph,backgroundcolor=red] \defineenumeration > > [john] > [ text=John: , > width=3em, > number=no, > location=left, > before={\starttextbackground[john-background]}, > after=\stoptextbackground] > > \defineenumeration > [mary][john] > [ text=Mary: , > before={\starttextbackground[mary-background]}, > after=\stoptextbackground] > > \starttext > > \john What did you have for breakfast?\par > \mary I skipped breakfast today.\par > \startjohn Oh, why?\stopjohn > \startmary Because I wasn't hungry. I was too distraught at what had > happened the previous night.\stopmary > > \stoptext > > Solution 2: > > \usemodule[annotation] > > \definetextbackground[john-background][frame=off,location=paragraph,backgroundcolor=green] \definetextbackground[mary-background][frame=off,location=paragraph,backgroundcolor=red] \defineannotation > > [john] > [ text=John, > stopper=: , > inbetween=, > before={\starttextbackground[john-background]}, > after={\stoptextbackground}, > spacebefore=nowhite] > > \defineannotation > [mary][john] > [ text=Mary, > before={\starttextbackground[mary-background]}, > after={\stoptextbackground}] > > \starttext > > \john{What did you have for breakfast?} > \mary{I skipped breakfast today.} > \startjohn Oh, why?\stopjohn > \startmary Because I wasn't hungry. I was too distraught at what had > happened the previous night.\stopmary > > \stoptext Thanks! These fit the bill. (I note, though, that in the annotation-based solution, the texts "John" and "Mary" don't show up. Otherwise the annotation solution is just what I am looking for.) ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________