14

So, I've just seen a video about a method of notation called "Triangle of Power", which simplifies things when it comes down to exponents, logarithms, etc. It was originally introduced in this post on Math.Stackexchange: https://math.stackexchange.com/questions/30046/alternative-notation-for-exponents-logs-and-roots/165225#165225

I wanted to use it in my LaTeX documents, but couldn't figure out a way to actually write it easily; my knowledge of custom commands and positioning of symbols is not enough.

So, what I want to do is this:

Triangle of Power And it needs to have some nice way of not providing one of the values (really, see the video if you're interested). Moreover, it should more-or-less fit in line with other notation, so it shouldn't be too big nor sticking out, though it probably will look okay if the values themselves stick out a little.

How can I implement this?

  • 4
    In that post from the math site, alex.jordan uses \stackrel{y}{_x\triangle_{z}}. You could make a simple macro as \newcommand\PowerTriangle[3]{\stackrel{#2}{_{#1}\triangle_{#3}}}, and use it as $\PowerTriangle{x}{y}{z}. There is room for improvement though, probably someone can make a better version. – Torbjørn T. May 4 '16 at 10:45
17

Working from Akiiino's answer I came up with this, which also works in display mode

 \documentclass[a4paper]{article}
 \usepackage{amsmath}

\newcommand{\dotriangle}[1]{%
  \raisebox{-.7ex}{$\vcenter{#1\kern.2ex\hbox{$\triangle$}\kern.2ex}$}%
}

\newcommand{\tripow}[3]{% Syntax: \tripow{#1}{#2}{#3} gives you #1 ^ {#2} = #3
   \mathop{% We want it to an operator
      \mathchoice% We want different functionality in text and display mode
         {% DISPLAY MODE
            \vphantom{\dotriangle\LARGE}% \vphantom off-set: places the bottom entries.
            \rule[-1.4ex]{0.1em}{0pt}% Syntax: [<vetical drop #1>]{<left margin>}{<Should be 0>}
            _{\scriptstyle #1}% style of #1 entry
            {\overset{\scriptstyle #2}% style of #2 entry
            {\dotriangle\LARGE}}% Size of the displayed operator - should match the \vphantom off-set.
            \rule[-1.4ex]{0em}{0pt}% Syntax: [<vetical drop #3>]{<Should be 0>}{<Should be 0>} 
            _{\scriptstyle #3}% style of #3 entry
            \rule[0ex]{0.1em}{0pt}% Syntax: [<Should be 0>]{<right margin>}{<Should be 0>}
          }%
        {% TEXT MODE
            \vphantom{\dotriangle\normalsize}%
            \rule[-1.05ex]{-0.7ex}{0pt}%
            _{#1}% 
            \overset{#2}% 
            {\dotriangle\normalsize}% size in text mode
            \rule[-1.05ex]{0pt}{0pt}%
            _{#3}%
            \rule[0ex]{-0.2em}{0pt}%
          }%
        {% SCRIPT MODE
            \vphantom{\dotriangle\normalsize}%
            \rule[-1.05ex]{-0.8ex}{0pt}%
            _{\scriptstyle #1}%
            {\overset{\scriptstyle #2}%
            {\dotriangle\normalsize}}% size in script mode
            \rule[-1.05ex]{0pt}{0pt}%
            _{\scriptstyle #3}%
            \rule[0ex]{-0.3em}{0pt}%
         }%
        {}% SCRIPTSCRIPT MODE
   }%
}

Compiling this code

\begin{document}
Here we see some fundamental relations:
\begin{align}
    \tripow{x}{a+b}{}&=\tripow{x}{a}{}\cdot\tripow{x}{b}{}
    \\
    \tripow{x}{}{ab}&=\tripow{x}{}{a}+\tripow{x}{}{b}
    \\
    \tripow{x}{1/y}{}&=\tripow{}{y}{x}
    \\
    \tripow{x}{\tripow{x}{}{z}}{}&=z
        \qquad\qquad\qquad\qquad
    \text{or}& \tripow{x}{\tripow{x}{}{z}}{z}
    \\
    \tripow{x}{}{\tripow{x}{y}{}}&=y
        \qquad\qquad\qquad\qquad
    \text{or}& \tripow{x}{y}{\tripow{x}{y}{}}
    \\
    \tripow{}{y}{\tripow{x}{y}{}}&=x
        \qquad\qquad\qquad\qquad
    \text{or}& \tripow{x}{y}{\tripow{x}{y}{}}
    \\
    \tripow{\tripow{}{y}{z}}{y}{}&=z
        \qquad\qquad\qquad\qquad
    \text{or}& \tripow{\tripow{}{y}{z}}{y}{z}
\end{align}
This is a line of text. This text says alot of interesting stuff and 
does not intersect.
Here is some more in-line text followed by $\tripow{x}{y}{z}$ which is
the same as saying $x^y=z$. The text on the this line does not 
intersect either.
\end{document}

gives you example

  • 1
    Very nice! Can you make a MathJax version that has similar behavior? You'd have to swap out \rule for \Rule and maybe \raisebox for \raise. If you get something that works, I'd employ it at the math.se post and cross-post back here. All the newcommmand definition stuff could go into MathJax math delimiters early in the post. – alex.jordan May 14 '16 at 1:16
  • Could you release that under a license compatible with TeX? – Nowhere man Dec 15 '17 at 11:04
6

After some tinkering with the variants, I've come up with this:

\newcommand{\PowerTriangle}[3]{ \mathop{\vphantom{\triangle}}_{#1}\hspace{-0.17em}{\stackrel{#2}{\triangle}}_{#3}}

enter image description here

The subscripts are a bit lower than in the original post and it looks better in my opinion.

3

I've attempted to create a command which will typeset the "Triangle of Power" in a nice way. My best effort so far is the following:

\newcommand{\tripow}[3]{ _{#1}{\stackrel{#2}{\triangle}}_{#3}}
$\tripow{x}{y}{z}$

The only issue is that the right subscript appears a little low. But it does allow nesting fairly well.

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.