I'm trying to underbrace a binary numeral as follow:

    B   D

in order to show the binary-hexadecimal correspondence, but using twice the underbrace command:


I get, obviously, two different "words":

  1011 1101
  '--' '---'
    B    D

How can I solve the issue?

2 Answers 2


\underbrace is defined infontmath.ltx` (part of LaTeX kernel for math stuff) as follows (shortened):


The construct is defined as math operator (\mathop). This way the lower limit can easily be specified as subscript. But TeX will add a thin space between two \mathop atoms.

This space can be removed by adding a negative thin space \!. Or the whole underbrace construct can be put into curly braces (subformula). Then it becomes an ordinary math atom (\mathord), where TeX will not add spaces inbetween.

The following example shows the differences between the two methods:





I'd recommend using tikzmark:

enter image description here

The parameters passed to \InsertUnderBrace are:

  • [#1] tikz draw options,

  • [#2] tikz brace options,

  • {#3} name of left \tikzmark,

  • {#4} name of right \tikzmark,

  • {#5} text to be placed under the brace.


  • This does require two runs. First one to determine the locations, and the second to do the drawing.

  • This uses the \InsertUnderBrace from Asymmetric overbrace.



\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}

% Tweak these as necessary

    O{} % #1 = draw options
    O{} % #2 = optional brace options
    m   % #3 = left tikzmark
    m   % #4 = right tikzmark
    m   % #5 = text to place underbrace
    \begin{tikzpicture}[overlay,remember picture]
\draw [decoration={brace, amplitude=\BraceAmplitude, aspect=\BraceAspect, #2}, decorate, thick, draw=blue, text=black, #1]
        ($(#4)+(\HorizontalOffset,-\VerticalOffset)$) -- 
        node [below=\VerticalOffset, midway] {#5};

$\tikzmark{Left Mark} 1011 \tikzmark{Middle Mark} 1101 \tikzmark{Right Mark}$ 
\InsertUnderBrace[blue]{Left Mark}{Middle Mark}{B}%
\InsertUnderBrace[red]{Middle Mark}{Right Mark}{D}%

You must log in to answer this question.

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