2

Does there exist such a notation? It looks similar to old factorial notation, but its in upper right corner rather than lower left.

enter image description here

I need it as math environment or with some simple code so as to achieve:

enter image description here

These are made in ms word.

2 Answers2

5
\documentclass{article}

\usepackage{amsmath}

\makeatletter
\newcommand*{\foo}[1]{{\mathpalette\@foo{#1}}}
\newcommand*{\@foo}[2]{%
   \dimen@=\fontdimen8
       \ifx#1\displaystyle\textfont\else
       \ifx#1\textstyle\textfont\else
       \ifx#1\scriptstyle\scriptfont\else
       \scriptscriptfont\fi\fi\fi3\relax
   \hbox{%
      \vbox{%
         \hrule\@height\dimen@
         \kern2\dimen@
         \hbox{\m@th$#1#2$\kern\dimen@}%
      }%
      \vrule\@width\dimen@
   }%
}
\makeatother

\begin{document}

\[
\foo{n} \quad
a^{\foo{n}} \quad
{\scriptstyle\foo{n}} \quad
{\scriptscriptstyle\foo{n}}
\]

\end{document}

enter image description here

The scratch length \dimen@ is set up to be the fraction rule width in the current math style. That's chosen to be the rule width and the horizontal spacing on the right, while the vertical spacing is twice that value. Choose the values as you prefer.

campa
  • 31,130
4

There is a package named actuarialangle that produces your expected result. Here I have done a MWE with Cambria Math using the engine XeLaTeX.

\documentclass{article}
\usepackage{unicode-math}
\usepackage{actuarialangle}
\setmathfont{Cambria Math}
\begin{document} 
$\actuarialangle{n\,}\cdot a^{\actuarialangle{n\,}}$
\end{document}

enter image description here

Sebastiano
  • 54,118