0

I would like to increase the width of an \underbracetext command. Currently I have:

\begin{table}[H]
\begin{adjustwidth}{-0.15in}{-0in}
\footnotesize
\centering
\begin{tabular}{lllllllll}
\textbf{Lamotrigine} & \textbf{250mg}       & \textbf{in} & \textbf{the}        & \textbf{morning}     & \textbf{,}     & \textbf{200mg}      & \textbf{at}        & \textbf{night} \\
\multicolumn{1}{c}{\underbracetext{\textbf{Drug}}} & \multicolumn{4}{c}{\underbracetext{\textbf{Direction 1}}} & & \multicolumn{3}{c}{\underbracetext{\textbf{Direction 2}}}
 \\
\end{tabular}
\end{adjustwidth}
\end{table}

that produces:

enter image description here

But I would like to increase the length of the second and third braces so that the second one spans from 250 to morning, and the third spans 200mg to night.

i.e. when I say spans from, I mean start the underbrace where the word starts, not from the middle.

  • 3
    My LaTeX does not have an \underbracetext macro, nor could I find a package that contains it, so I dare to assume that it is a user-defined command. Could you post full and compilable example that produces the output from the picture, please, so that we can help you. – Phelype Oleinik May 14 '18 at 11:33
  • 1
    BTW: you might want to have a look at the siunitx package, there are rules as to how units (250mg) should be formatted) – daleif May 14 '18 at 11:34
  • Is this the entire table? If so you may want to try a different approach to this altogether. What exactly do you want to do? Maybe tex.stackexchange.com/q/401971/35864 or tex.stackexchange.com/q/128064/35864 can help you – moewe May 14 '18 at 11:36
1

Do you need to put it like this in the table? If not, you may just do

\documentclass{article} 
\usepackage{amsmath}
\begin{document} 
\[
\underbrace{\textbf{Lamotrigine}}_{\displaystyle\text{\textbf{Drug}}}~
\underbrace{\text{\textbf{250mg in the morning}}}_{\displaystyle\textbf{\textbf{Direction
1}}},~\underbrace{\text{\textbf{200mg at night}}}_{\displaystyle\textbf{Direction 2}}
\]
\end{document}

enter image description here

There are several other possibilities, e.g. TikZ.

  • 1
    fantastic - what environment does \[ invoke by the way? – brucezepplin May 14 '18 at 11:54
  • @brucezepplin amsmath redefines it to equation* – daleif May 14 '18 at 13:29

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.