From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/65821 Path: news.gmane.org!not-for-mail From: Ian Lawrence Newsgroups: gmane.comp.tex.context Subject: Re: Speech bubbles Date: Thu, 3 Feb 2011 15:09:32 +0000 Message-ID: References: <19573160-2D86-4494-BC67-318959776684@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1296746999 28001 80.91.229.12 (3 Feb 2011 15:29:59 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 3 Feb 2011 15:29:59 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Feb 03 16:29:53 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 1Pl184-0004N8-Us for gctc-ntg-context-518@m.gmane.org; Thu, 03 Feb 2011 16:29:53 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 60860CAABE; Thu, 3 Feb 2011 16:29:52 +0100 (CET) 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 QRy1fbS6WGaD; Thu, 3 Feb 2011 16:29:49 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 7078ACAAB7; Thu, 3 Feb 2011 16:29:49 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 0B16BCAAB7 for ; Thu, 3 Feb 2011 16:29:48 +0100 (CET) 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 FSwlGZ+3FQ9I for ; Thu, 3 Feb 2011 16:29:36 +0100 (CET) Original-Received: from filter4-ams.mf.surf.net (filter4-ams.mf.surf.net [192.87.102.72]) by balder.ntg.nl (Postfix) with ESMTP id 0B25DCAAB2 for ; Thu, 3 Feb 2011 16:29:36 +0100 (CET) Original-Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com [74.125.82.45]) by filter4-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p13FTXMv020383 for ; Thu, 3 Feb 2011 16:29:34 +0100 Original-Received: by wwb29 with SMTP id 29so1260895wwb.2 for ; Thu, 03 Feb 2011 07:29:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.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=A4QsxCX68+vayJphIxpgQHlBl3gwgMEJC483CJKu9iE=; b=EP+o0Vc4MlU3nPO1tS7VfJEPsHMUTXoyNQitTeM9LJtUZYPZfJRH8M0hxKNOH1cjOj wAEMHr0OylHgQyOUjcDvW2vGDPbcQn2hNXwvSOp1WFgr4kH9kvLJptcXF4RmiAV5wnGL IO+1LJv5sgUNlbPbMde7cpARaY2A7KYRYKXCo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; b=Un//d7I3e1/ZsbtNK//wdO/MqaX8Wl6u4CEnugr6dxaYXjgV+KgsfFsEgLFZmQQdsY 2NW29UJ9MtBZ0vfJ4O73j8FJN/3JNJt14gz36f9nCH2zF34wpjZfXw29L7xOQSehcjf+ lw3dkC1ZdV8NOF0Xh80jDOhuuimRIYGyEWT7A= Original-Received: by 10.227.141.71 with SMTP id l7mr10675767wbu.119.1296745801445; Thu, 03 Feb 2011 07:10:01 -0800 (PST) Original-Received: from [192.168.1.2] (250.107.112.87.dyn.plus.net [87.112.107.250]) by mx.google.com with ESMTPS id h39sm486834wes.5.2011.02.03.07.09.59 (version=SSLv3 cipher=RC4-MD5); Thu, 03 Feb 2011 07:10:00 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.1082) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=74.125.82.45; 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: 03E3rtxP7 - 30091c656ea2 - 20110203 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.72 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:65821 Archived-At: Thanks Wolfgang.. In case there are any others who are in need.. Here is one with curvy speech bubbles, left and right, and wrapped up so they don't overhang any text. __ \startuseMPgraphic{speechL} z1 = (0.25cm,0) ; z2=(1 cm,0) ; z3 = (0,-1cm) ; z4 = (2cm,0);z5 = (OverlayWidth-0.25cm,0) ; z6 = (OverlayWidth,0.25cm) ; z7 = (OverlayWidth,OverlayHeight-0.25cm) ; z8 = (OverlayWidth-0.25cm,OverlayHeight) ; z9 = (0.25 cm,OverlayHeight);z10=(0,OverlayHeight-0.25cm) ; z11=(0,0.25cm) ; path p ; p = z1--z2{down}..{dir 270}z3{dir 30}..{dir 70}z4--z5{right}..{up}z6--z7{up}..{left}z8--z9{left}..{down}z10--z11{down}..{right}z1--cycle ; fill p withcolor blue ; draw p withpen pencircle scaled 1 ; setbounds currentpicture to OverlayBox ; \stopuseMPgraphic \startuseMPgraphic{speechR} z1 = (0.25cm,0) ; z2=(5 cm,0) ; z3 = (7cm,-1cm) ; z4 = (6cm,0);z5 = (OverlayWidth-0.25cm,0) ; z6 = (OverlayWidth,0.25cm) ; z7 = (OverlayWidth,OverlayHeight-0.25cm) ; z8 = (OverlayWidth-0.25cm,OverlayHeight) ; z9 = (0.25 cm,OverlayHeight);z10=(0,OverlayHeight-0.25cm) ; z11=(0,0.25cm) ; path p ; p = z1{left}..{up}z11--z10{up}..{right}z9--z8{right}..{down}z7--z6{down}..{left}z5--z4{down}..{dir 270}z3{dir 150}..{dir 110}z2--cycle ; fill p withcolor blue ; draw p withpen pencircle scaled 1 ; setbounds currentpicture to OverlayBox ; \stopuseMPgraphic \defineoverlay[speechL][\useMPgraphic{speechL}] \define [1] \speechbubbleL {\blank \framedtext[frame=off,background=speechL, width=7cm]{#1} \blank[1 cm]}] \defineoverlay[speechR][\useMPgraphic{speechR}] \define [1] \speechbubbleR {\blank \framedtext[frame=off,background=speechR, width=7cm]{#1} \blank[1 cm]}] \starttext Some text \speechbubbleL {'Who needs highlighter pens, anyway?'} If all three are satisfied then then sound radiates from the source to the detector. The source-medium-detector model was central to the model of sound. The vibrations, because of their nature, travel as variations in physical density, so rely on a medium made of particles connecting the source to the detector. Other vibrations, very similar in nature, could still travel out from the source, but not be detected. \speechbubbleR {They could be above or below the frequency we can hear, so called infra-sound or ultra-sound, or the amplitude could be just too small: so not enough power in the radiating pathway for the detector to respond.} More and more dog latin for beginners.. And so on...... And so on \stoptext __ Sorry the metapost is not parameterised...I should have variables in to set up the offsets and curvature of the corners. But I have not go that far yet...my floor is only a little higher, thanks to Wolfgang. On 3 Feb 2011, at 08:39, Wolfgang Schuster wrote: > > Am 02.02.2011 um 18:12 schrieb Ian Lawrence: > >> Evening all: >> >> Has anyone got a nicer \speechbubble definition up their sleeve? >> >> Here is not-nice one, so you know the floor: >> >> \define [1] \speechBubble >> {\blank >> \framed [width=.6\textwidth ,autowidth=force,align={flushleft}, background=color, backgroundcolor=darkblue, >> foreground=color, foregroundcolor=white, >> frame=off,corner=0,backgroundoffset=5pt,] {#1} >> ~~~ \tfd \startcolor[darkblue]{'} \stopcolor \tfa >> \blank} >> >> >> Called with things like: >> >> \speechBubble {They could be above or below the frequency we can hear, so called infra-sound or ultra-sound, or the amplitude could be just too small: so not enough power in the radiating pathway for the detector to respond.} >> >> >> I guess there are some people with xs metapost skills out there... But is there as simple way to get a nice curved pointer left or right from the bottom of that rounded rectangle frame? > > \startuseMPgraphic{speechbubble} > z1 = (0,0) ; z2 = (OverlayWidth,0) ; z3 = (OverlayWidth,OverlayHeight) ; z4 = (0,OverlayHeight) ; > 1/2[x1,x2] = x8 + 2cm = x7 + 1cm = x9 - 1cm ; y7 = y9 = 0cm ; y8 = -2cm ; > path p ; p = z1--z7--z8--z9--z2--z3--z4--cycle ; > fill p withcolor blue ; > draw p withpen pencircle scaled 5 ; > setbounds currentpicture to OverlayBox ; > \stopuseMPgraphic > > \defineoverlay[speechbubble][\useMPgraphic{speechbubble}] > > \starttext > > \framedtext[frame=off,background=speechbubble]{\input ward } > > \blank[4cm] > > \framedtext[frame=off,background=speechbubble,width=6cm]{\input ward } > > \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 > ___________________________________________________________________________________ ___________________________________________________________________________________ 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 ___________________________________________________________________________________