I saw question about terms being partially ovarlapped in an equation but I don't want them to be partially overlapped, I just want one particular term to have have an underbrace and overbrace. I am new to LaTeX so I just want some simple line that I can copy and paste.
1 Answer
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\underbrace{\overbrace{a+b+c}^{\mathrm{over}}}_{\mathrm{under}}
\]
\end{document}
-
Thank you. What does that mathrm do? Can it be applied in any other situation?– DavidDec 10, 2016 at 22:45
-
1@David really any latex tutorial will show
\mathrm
it's best to start with some basic tutorials rather than just copy answers all the time otherwise you'll be asking hundreds of questions, but\mathrm
makes text in a roman font designed for words. Never set words in the default math italic font as it is designed to make adjacent letters look like a product of variables. Dec 10, 2016 at 22:47 -
1@David: I suggest that you have a look at the
\text
command as well: see section 6 of the User’s Guide for theamsmath
Package (typetexdoc amsmath
on the command line to show it).\mathrm
and\text
are somewhat intercheangeable in their functionality, but differ in some important details. Basically, I’d recommend using\mathrm
for words, or word chunks, that should look the same in all contexts, like “sin”, and\text
for words, or phrases, that, contrarily, should change their font to match the font of the surrounding text.– GuMDec 11, 2016 at 2:22 -
@DavidCarlisle Is there any idea how to avoid unequal length braces when the length of term in
overbrace
is a lot larger than the length of the term inunderbrace
?– ado sarNov 11 at 20:41 -
@adosar I can not guess what you mean, you probably should ask a new question with an example over/under brace is as wide as the term so by design they will have different lengths if the terms have different lengths Nov 11 at 20:47
\underbrace{\overbrace{x+y}^{over}}_{under}
?