Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

How can I draw a horizontal round parenthesis above some text? How do I specify a round parenthesis below some text? explains how to do it below text.

share|improve this question
add comment

1 Answer

up vote 8 down vote accepted

The abraces package under the overload package option provides this when using \overbrace[L1R] or \underbrace[l1r]:

enter image description here

\documentclass{article}
\usepackage[overload]{abraces}% http://ctan.org/pkg/abraces
\begin{document}
$\overbrace[L1R]{\textrm{The quick brown fox jumped over the lazy dog}}$ \par \medskip
$\underbrace[l1r]{\textrm{The quick brown fox jumped over the lazy dog}}$ \par
\end{document}

Original answer:

Here is a modified version of \overbrace in the form of \overfence, which should provide what you're after.

enter image description here

\documentclass{article}
\usepackage{mathtools}% http://ctan.org/pkg/mathtools
\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox

% \overfence definition
\let\overfence\overbrace % \overfence is similar to \overbrace
\let\downfencefill\downbracefill % match components of \overbrace
\patchcmd{\overfence}{\downbracefill}{\downfencefill}{}{}% patch \overfence...
\patchcmd{\downfencefill}{\braceru \bracelu}{}{}{}%... and \downfencefill

% \underfence definition
\let\underfence\underbrace % \underfence is similar to \underbrace
\let\upfencefill\upbracefill % match components of \underbrace
\patchcmd{\underfence}{\upbracefill}{\upfencefill}{}{}% patch \underfence...
\patchcmd{\upfencefill}{\bracerd \braceld}{}{}{}%... and \upfencefill

\begin{document}
$\overbracket{\textrm{The quick brown fox jumped over the lazy dog}}$ \par
$\overbrace{\textrm{The quick brown fox jumped over the lazy dog}}$ \par
$\overfence{\textrm{The quick brown fox jumped over the lazy dog}}$ \par \medskip
$\underbracket{\textrm{The quick brown fox jumped over the lazy dog}}$ \par
$\underbrace{\textrm{The quick brown fox jumped over the lazy dog}}$ \par
$\underfence{\textrm{The quick brown fox jumped over the lazy dog}}$
\end{document}

In fact, since \overfence duplicates the behaviour of \overbrace, you can even add stuff to it since it's typeset as a \mathop with \limits. For example:

enter image description here

$\overfence{\textrm{The quick brown fox jumped over the lazy dog}}^{\mbox{\scriptsize Because the dog is really lazy.}}$
share|improve this answer
    
Excellent! Thank you so much! –  Dejan Dec 28 '11 at 6:02
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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