For didactic purposes I would like to build a underbrace that is diagonal as in the drawing below. How could I do this?

Diagonal Underbrace.

  • 1
    If you load mathdots package x^{x^{\iddots^{\raisebox{-.4ex}{$\scriptscriptstyle x$}}}} gives you the expression without the brace. It seems to me that TikZ type of way is the easiest to go. But n-1 times text is too long and big to be fit in the exponent. I would suggest exp() notation.
    – percusse
    Oct 25, 2013 at 13:44
  • 1
    @percusse Very good your solution. Simple and elegant. I accept this answer as a solution to my problem. Oct 25, 2013 at 14:23

4 Answers 4


Another TikZ variant, with a variable number of things stacked into the exponent:





\newcommand{\veryhigh}[3]% base, exponent, text
{   \begin{tikzpicture}
        \node (tempnode-0) at (0,0) {$#1$};
        \foreach \mytext [count=\c] in {#2}
        { \pgfmathtruncatemacro{\b}{\c-1}
            \node[above right,font=\tiny,inner sep=3pt] (tempnode-\c) at (tempnode-\b) {$\mytext$};
        \draw [decoration={brace,amplitude=4pt,mirror,raise=2pt},decorate] ($(tempnode-1.south east)+(-0.13,0.13)$) -- node[below right=1mm,font=\tiny] {#3} ($(tempnode-\maxexp.south east)+(-0.13,0.13)$);

\veryhigh{x}{x,{\rotatebox{45}{$\cdots$}},x}{$(n-1)$ times}

\veryhigh{\pi}{a,b,c,d,e,f,g,h}{too much!}



enter image description here

  • 2
    An alternative for your problem with better spacing would be \veryhigh{x}{x,.,.,.,x}{$(n-1)$ times} Oct 26, 2013 at 12:45

This is a rough and ready answer, done mostly by eye-balling rather than by thinking through general measurements. But, for a one-off case, or series of similar ones, it should serve your purposes. (Input from more experienced people, who are doubtless rubbing their eyes at my code, is appreciated.)

\usepackage{mathptmx, mathdots, rotating}


\settowidth{\Width}{% the width of the exponent x...x

    %$x^x$ looks a bit too tight to me, needs some extra space
    %pretend the brace has no width
    %pretend the brace has no height or depth
    %give it a bit of space
    %oddly, 45 degree rotation doesn't look right
    %make the brace a bit small than the exponent
    %raise the dots and the following x 
    %here are the dots
    %raise the x even more
    %here's the x, with a bit of extra space
    %reduce space between x^{x...x} and n-1
    %raise n-1 a bit
{\scriptsize $n-1$ times}% 


enter image description here


This is my try with Tikz. Since the command has some code in it, I made a \newcommand. Here you can see the result.

I fixed the code in order to make the characters stay "horizontal", borrowing the code from morbusg's answer.

diagonal brace




\node[rotate=45] at (0,0) (text1) {\rotatebox{-40}{#1}};
\draw [decorate,decoration={brace,amplitude=4pt,mirror,raise=2pt}]
(text1.west) -- (text1.east) node [right,midway,xshift=1mm, yshift=-2mm,liltext] {#2};



    $X$\diagbrace{${x^{\rddots x}} $}{$n-1$ times}

  • @Alenanno In this case had the drawback that the 'x' characters were also rotated. Oct 25, 2013 at 14:21
  • @Elias I fixed the code. :)
    – Alenanno
    Oct 25, 2013 at 15:05

It's not exactly easy to use, but it is adjustable.


\draw (0,0) node[rotate=45]{$\underbrace{\rule{#1}{0pt}}$};





  • Harbour's solution came out after I started but before I finished. Oct 25, 2013 at 15:12

You must log in to answer this question.

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