From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/68675 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: alternating items in an itemization Date: Tue, 24 May 2011 14:16:16 +0200 Message-ID: <3F5D4FFA-0854-4A8D-BA57-E15EB588F435@googlemail.com> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1306239423 5504 80.91.229.12 (24 May 2011 12:17:03 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 24 May 2011 12:17:03 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue May 24 14:16:58 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 1QOqXf-0001kE-GJ for gctc-ntg-context-518@m.gmane.org; Tue, 24 May 2011 14:16:55 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 5468ECAD3E; Tue, 24 May 2011 14:16:54 +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 s+MMSj60L-9T; Tue, 24 May 2011 14:16:51 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 586ADCAD33; Tue, 24 May 2011 14:16:51 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id C6F47CAD33 for ; Tue, 24 May 2011 14:16:50 +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 C3UbE5OkEZDP for ; Tue, 24 May 2011 14:16:39 +0200 (CEST) Original-Received: from filter2-til.mf.surf.net (filter2-til.mf.surf.net [194.171.167.218]) by balder.ntg.nl (Postfix) with ESMTP id 71A2BCAD30 for ; Tue, 24 May 2011 14:16:39 +0200 (CEST) Original-Received: from mail-fx0-f41.google.com (mail-fx0-f41.google.com [209.85.161.41]) by filter2-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p4OCGcpY018107 for ; Tue, 24 May 2011 14:16:39 +0200 Original-Received: by fxm18 with SMTP id 18so6391873fxm.14 for ; Tue, 24 May 2011 05:16:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:content-type:mime-version:subject:from :in-reply-to:date:content-transfer-encoding:message-id:references:to :x-mailer; bh=RPHF8910eNXEEUcSr3FrIBhwRDS855k6kIk+7w1kIgw=; b=UTnb6dLK4E9A6aoO0avb0VA7+iD0dDjgDt9jrzQd6Ve1f2weaXbEmwR7sOyhLvcvjf ExieCFSy5e6sTlV9pxPW1QHd6E8mDEbQ6SjdIwS1TOcuGqttOOhV7fCa7PZiQ/A1aFgR +rHxgnRovFv8yyiss6RwxbrZpdRT7bIbNjcfQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; b=MZIf5dCA25jenXWWE/6bamiAWbIpbNkboUkB//0gxEh3SPPbnihxlMLbS9KrgJhS8j uczXAljrKHVZm0KeVwOYTll6D4a+Fz5QaErLq9QSCsaPkBjAEpxk/Zcniogiy1xggh1j IvxJKYWzRHaKfdS3DuQwFwTYMLKQEhuHSlizQ= Original-Received: by 10.223.79.151 with SMTP id p23mr3608199fak.78.1306239379510; Tue, 24 May 2011 05:16:19 -0700 (PDT) Original-Received: from [192.168.2.34] (p5B294589.dip.t-dialin.net [91.41.69.137]) by mx.google.com with ESMTPS id b17sm2712116fab.23.2011.05.24.05.16.17 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 May 2011 05:16:18 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.1084) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.161.41; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0bELogCjn - dea607c4af2b - 20110524 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.218 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:68675 Archived-At: 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 Wolfgang ___________________________________________________________________________________ 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 ___________________________________________________________________________________