I looking for a way to do that with TikZ :

enter image description here

But I have no idea how to do this quote style.

\begin{sballoonquote}{\linewidth}{r}{color}{Donald Knuth}
An algorithm must be seen to be believed.

Produce a ragged-right rounded quote, a sballoonquote* do the same but non-rounded. How can I do this. Someone have a solution ?

  • 3
  • Welcome to TeX.SE. If the linked question does not provide an adequate solution, please edit the question to add an explanation. Jul 3, 2012 at 17:54
  • I don't really know how to make the shape and make a final environment. And I found the linked question not very useful for my own case.
    – David
    Jul 3, 2012 at 20:36
  • @David sorry for suggesting the duplicate to quickly. It's not so trivial to adapt the linked question to your problem, although the ideas are similar. The question has now been reopened.
    – Alan Munn
    Jul 4, 2012 at 12:14
  • Thanks for your solutions guys :) But the idea in my mind is like that : link. Can work on the right and left sides. For conversation style or for even-odd pages. @Alan : How can I use differents colors like on the Tom's solution ? I found the way for the rounded boxes.
    – David
    Jul 4, 2012 at 15:40

3 Answers 3


Here's a solution that is based almost completely on the great answer by percusse posted here.

Simple speech bubbles, arrows or balloon like shapes in beamer

I've only implemented this as a command with the arrow pointing in one direction, but this should be enough to get you going.

\usepackage{kantlipsum} % for dummy text
% First we measure the height of the quote
% Then add the offset for the author
% The callout height is used to position to callout
% The quote height is used to reserve enough space within
% the text.  This code base almost entirely on percusse's
% answer here: https://tex.stackexchange.com/a/38872/2693
  \tikz[remember picture]{
        \node [anchor=base,inner sep=0,outer sep=0,
        text width=#1,align=center] (#2) {#2};
    \node[anchor=base,overlay,rectangle callout,
        callout relative pointer={(-0.3cm,-0.7cm)},
        fill=blue!30,text width=#1,align=justify]
        at ($(#2.north)+(0,\calloutheight)$) {#3};}

Some text.
\calloutquote{Immanuel didn't really say this}{\kant[1]}

This is some text.
\calloutquote[.5\textwidth]{And he didn't say this either}{\kant[2]}

output of code


I prefer to use pgfkeys because it's more easy to list the arguments and to add some options.


    width/.code                   =  {\def\calloutquotewidth{#1}},
    position/.code                =  {\def\calloutquotepos{#1}}, 
    author/.code                  =  {\def\calloutquoteauthor{#1}},
    /calloutquote/.unknown/.code   =  {\let\searchname=\pgfkeyscurrentname

         width               = 5cm,
         position            = {(0,-1)},
         author              = {}}
  \node [rectangle callout,callout relative pointer={\calloutquotepos},text width=\calloutquotewidth,/calloutquote/.cd,
     #1] (tmpcall) at (0,0) {#2};
  \node at (tmpcall.pointer){\calloutquoteauthor};    

\calloutquote[author=D. Knuth,width=3cm,position={(1,-1)},fill=red!30,rounded corners]{An algorithm must be seen to be believed.}

\calloutquote[author=D. Knuth,width=0.5*\linewidth,position={(0,-1)},fill=green!30,rounded corners]{An algorithm must be seen to be believed.}

\calloutquote[author=D. Knuth,width=5cm,position={(-1,-1)},fill=blue!30,ultra thick,draw,inner sep=12pt]{An algorithm must be seen to be believed.}

enter image description here

  • Thanks! This is a very nice example of how to use pgfkeys.
    – Alan Munn
    Jul 4, 2012 at 17:33

How about this:


\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}

\newcommand{\bubble}[6]% name, content, color, align, inner sep, width
{   \ifthenelse{\equal{r}{#4}\OR\equal{c}{#4}}{\hfill}{}
        \node[text width=\the\textwidth*#6, below right](#1){#2};
            \node[fit=(#1),inner sep=#5,rectangle callout,rounded corners=3pt,draw,fill=#3,overlay] {};









enter image description here

  • Mine are all stacked/overlapped
    – CutePoison
    Aug 17, 2020 at 11:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .