From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/68642 Path: news.gmane.org!not-for-mail From: Jesse Alama Newsgroups: gmane.comp.tex.context Subject: alternating items in an itemization Date: Mon, 23 May 2011 22:08:23 +0200 Message-ID: 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 1306181339 22691 80.91.229.12 (23 May 2011 20:08:59 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 23 May 2011 20:08:59 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Mon May 23 22:08:54 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 1QObQs-0000Ou-4M for gctc-ntg-context-518@m.gmane.org; Mon, 23 May 2011 22:08:54 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 2F260CAD60; Mon, 23 May 2011 22:08:53 +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 gLVuug1FqNYc; Mon, 23 May 2011 22:08:50 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 974C4CAD5A; Mon, 23 May 2011 22:08:50 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id C092CCAD5A for ; Mon, 23 May 2011 22:08:48 +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 BiXS7Nm6bG5a for ; Mon, 23 May 2011 22:08:37 +0200 (CEST) Original-Received: from filter3-til.mf.surf.net (filter3-til.mf.surf.net [194.171.167.219]) by balder.ntg.nl (Postfix) with ESMTP id CF0D7CAD55 for ; Mon, 23 May 2011 22:08:37 +0200 (CEST) Original-Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by filter3-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p4NK8aUh030621 for ; Mon, 23 May 2011 22:08:36 +0200 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QObQZ-0000ET-NK for ntg-context@ntg.nl; Mon, 23 May 2011 22:08:35 +0200 Original-Received: from 86.93.35.187 ([86.93.35.187]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 23 May 2011 22:08:35 +0200 Original-Received: from jesse.alama by 86.93.35.187 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 23 May 2011 22:08:35 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 63 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 86.93.35.187 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: 0eEL88Aml - 7aa36cf876ab - 20110523 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.219 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:68642 Archived-At: 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). I've tried doing this using \defineparagraphs, \defineframedtext, and \defineenumerations, but I can't quite get the right effect; \setupcolors[state=start] \definetextbackground[john-background][backgroundcolor=green] \definetextbackground[mary-background][backgroundcolor=red] \definestartstop[dialogue] \defineparagraphs[john][before={\starttextbackground[john-background]},after={\stoptextbackground}] \defineparagraphs[mary][before={\starttextbackground[mary-background]},after={\stoptextbackground}] Putting this before the above \start/stopdialogue snippet (suitably enclosed in \start/stoptext) gives me an error about a missing "}"; I suppose I'm overlooking something. An enumeration-based solution would be along these lines: \defineenumeration [chat] \setupenumerations [chat] [joinedup,packed] \define[0]\john{\item John: } \define[0]\may{\item Mary: } I can't figure out how to get the textbackgrounds to work here, and there's a bullet symbol at the beginning of every "dialogue paragraph", which I'd rather get rid of (and I don't want the indent between the bullet and the beginning of the text). A framed-text solution starts to come close: \defineframedtext[john][frame=off,background=color,backgroundcolor=magenta] \defineframedtext[mary][frame=off,background=color,backgroundcolor=lightred] But then the boxed paragraphs are separated from each other by some vertical whitespace. Another idea would be to use tables, but I haven't explored that yet. Any suggestions for how to render "dialogues" as above in ConTeXt? Thanks, Jesse ___________________________________________________________________________________ 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 ___________________________________________________________________________________