Open main menu

Changes

1,433 bytes added ,  03:04, 22 May 2021
m
no edit summary
In = Overview = This page describes a few ways to create speech bubbles. == LMTX == Using ConTeXt it is possible LMTX, the following code generates a dependency-free speech bubble: <context source=yes>\startuseMPgraphic{TextBubble}{side} z1 = (0, 0) ; z2 = (OverlayWidth, 0) ; z3 = (OverlayWidth, OverlayHeight) ; z4 = (0, OverlayHeight) ;  offset := 1 ; tail := 1 ;  if \MPvar{side} = 1: offset := 5 ; tail := -1 ; fi  (offset/6)[x1,x2] = x8 + 1cm * tail = x7 + .5cm = x9 - .5cm ; y7 = 0cm ; y8 = -1cm ; y9 = 0cm ;  path p ; p = (z1--z7--z8--z9--z2--z3--z4--cycle) cornered .25cm ; draw p withpen pencircle scaled 0.5 ;  setbounds currentpicture to use OverlayBox ;\stopuseMPgraphic % Receive text (left-facing).\defineoverlay[TextBubbleRxOverlay][\useMPgraphic{TextBubble}{side=0}]\defineframedtext[TextBubbleRxFrame][ frame=off, background=TextBubbleRxOverlay, width=fit, offset=.75em, location=left, after={\blank[1.25cm]},] % Send text (right-facing).\defineoverlay[TextBubbleTxOverlay][\useMPgraphic{TextBubble}{side=1}]\defineframedtext[TextBubbleTxFrame][ frame=off, background=TextBubbleTxOverlay, width=fit, offset=.75em, location=right, after={\blank[1.25cm]},] \starttext \startTextBubbleRxFrame \input weisman \stopTextBubbleRxFrame  \startTextBubbleTxFrame \input ward \stopTextBubbleTxFrame  \input knuth\stoptext</context> == Tikz Module == Use the Tikz module to create « speech bubbles ». Here are two ways of doing this: the first one works under mkii and mkiv, while the second one needs the Annotation module written by Wofgang Schuster who wrapped the Tikz commands in ConTeXt macros in the code below.
<texcode>
</texcode>
to get other bubble shapes.
 
[[Category:Graphics]]
419

edits