10

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.

2
  • 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

12

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

Code

\documentclass{scrartcl}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing,calc}
\usepackage{graphicx}

%\documentclass[tikz,border=2mm]{standalone}

\begin{document}

\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$};
            \xdef\maxexp{\c}
        }
        \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)$);
    \end{tikzpicture}
}

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

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

\end{document}

Output

enter image description here

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

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.)

\documentclass[12pt]{report}
\usepackage{mathptmx, mathdots, rotating}

\begin{document}

\newlength{\Width}
\settowidth{\Width}{% the width of the exponent x...x
    ${}^{\,\,x%
    \hbox{\raisebox{.8ex}{%
     $\iddots$\raisebox{1.3ex}{${\,}^x$}}}}$}

$x^{\,\,x% 
    %$x^x$ looks a bit too tight to me, needs some extra space
    %
\makebox[0pt][l]{% 
    %pretend the brace has no width
    %
\raisebox{0ex}[0pt][0pt]{%
    %pretend the brace has no height or depth
    %
\hspace{.2em}% 
    %give it a bit of space
    %
\rotatebox{40}{% 
    %oddly, 45 degree rotation doesn't look right
    %
$\underbrace{\hspace{.9\Width}}$}}}% 
    %make the brace a bit small than the exponent
    %
\hbox{\raisebox{.8ex}% 
    %raise the dots and the following x 
    %
{$\iddots$% 
    %here are the dots
    %
\raisebox{1.3ex}% 
    %raise the x even more
    %
{${\,}^x$}}}}$% 
    %here's the x, with a bit of extra space
    %
\kern-.2em%
    %reduce space between x^{x...x} and n-1
    %
\raisebox{.35ex}% 
    %raise n-1 a bit
    %
{\scriptsize $n-1$ times}% 

\end{document}

enter image description here

7

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

\documentclass{article}
\usepackage{tikz}
\usepackage{rotating}

\usetikzlibrary{decorations.pathreplacing} 

\tikzset{liltext/.style={font=\tiny}}


\newcommand{\diagbrace}[2]{
\textsuperscript{
\hspace*{-6mm}\raisebox{-1mm}{
\begin{tikzpicture}
\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};
\end{tikzpicture}}}}

\def\rddots#1{\cdot^{\cdot^{\cdot^{#1}}}}

\begin{document}

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

\end{document}
2
  • @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
5

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

\documentclass{article}
\usepackage{mathtools}
\usepackage{mathdots}
\usepackage{tikz}

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

\begin{document}

\[
x^{x^{\iddots^x}}
 \raisebox{-5pt}[0pt][0pt]{\hspace*{-20pt}\dbrace{10pt}}
 \raisebox{2pt}[0pt][0pt]{\hspace*{-10pt}\scriptstyle{n-1}}
\]

\end{document}

x^x^x

1
  • 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 .