I want to encapsulate text in a sort of inline "dialogue bubble". To do this I defined

% overline text 

as seen here, and defined my dialogue box as

% dialogue box

which ends up looking like this:

dialogue box attempt

I was wondering how to match the under- and overlines to the encapsulating parentheses, and how to extend the lines a bit to overlap more with the parentheses. I looked into using the soul package but couldn't get it to work correctly :/

ADDITION: How can I have it wrap text automatically?



there are probably easier ways to do this, but here's a possibility.




  \smash{\text{``Test text''}}}}$}\bigr)$

\textbubble{Sample text}


output of example code

i've used amsmath and \text here instead of \mbox because \mbox forces the space for the argument to be both higher and deeper. \mathstrut is defined to be exactly the height of a parenthesis.

this won't break across lines.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.