0

Below fraction is my source input. i want to short horizontal rule. Can anyone please advise. I have attached both input and expecting output images:

enter image description here

and the tex source code is:

\[\frac{\overbrace{A}^{\text{detector area}}}{\underbrace{4\pi}_{\text{unit solid angle}}}\]

An expected output is:

enter image description here

6
  • 3
    Load mathtools and use \mathclap{\text{....}} instead of \text{...}
    – daleif
    Commented May 22 at 14:21
  • Have you tried having the over/under brace outside of the fraction?
    – Teepeemm
    Commented May 22 at 14:22
  • @daleif i will check and get back. Thanks
    – KGSR
    Commented May 22 at 14:27
  • @Teepeemm Sorry. i am not clear. Can you please give me some sample code?
    – KGSR
    Commented May 22 at 14:28
  • @daleif - Wow It's amazing. I got expected output. Thanks for the coding. \documentclass{book} \usepackage{mathtools} \begin{document} \[\frac{\overbrace{A}^{\mathclap{\text{detector area}}}}{\underbrace{4\pi}_{\mathclap{\text{unit solid angle}}}}\] \end{document}
    – KGSR
    Commented May 22 at 14:35

2 Answers 2

5

@daleif - suggested result:

enter image description here

The tex code is:

\documentclass{book}
\usepackage{mathtools}

\begin{document}

\[\frac{\overbrace{A}^{\mathclap{\text{detector area}}}}{\underbrace{4\pi}_{\mathclap{\text{unit solid angle}}}}\]

\end{document}
2
  • 1
    You can just use \clap{...} without a need of mathtools and \mathclap{\text{...}}
    – antshar
    Commented May 22 at 17:31
  • 1
    This works only if the fraction is the only item in the display. If it's part of an expression, you'd get overlaps.
    – egreg
    Commented May 22 at 17:37
0

I have tried an another way and got the same output. But i used \rule command with some manual work:

\[
{\begin{array}{@{}c@{}}
{\overbrace{A}^{\text{detector area}}}\\[-6pt]
\rule{13pt}{0.25pt}\\[-1.5pt]{\underbrace{4\pi}_{\text{unit solid angle}}}
\end{array}}
\]

Output is:

enter image description here

Finally, @daleif suggested code is great one (automatically output came). I Thanks once again both @daleif & @Teepeemm for spending times with me.

You must log in to answer this question.

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