17

I would like to typeset an old fashioned factorial symbol and was wondering whether there was an elegant way of doing this that scales with font size. Ideally what I would like is to invoke

\oldfact{\frac{1}{2}n(n+1)}

in mathematics mode and get as an output the contents surrounded by a box frame with only two sides, the left and the bottom.

The output would look something like |__ with the contents nestling inside the L-shaped corner.

enter image description here

I've looked through different packages but couldn't find anything appropriate. So I've solved the problem for the time being with basic underlines and rules with appropriate spaces but my solution doesn't scale all that well and is certainly quite ugly code!

2

3 Answers 3

18

An implementation with "newschool" tikz:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\newcommand{\oldfactorial}[1]{%
\tikz[baseline]{\node[anchor=base,inner sep=0.3ex](mynode){\ensuremath{#1}};\draw(mynode.north west)--(mynode.south west)--(mynode.south east);\path[use as bounding box]($(mynode.south west)+(-0.3ex,-0.3ex)$)rectangle($(mynode.north east)+(0.3ex,0.3ex)$);}
}
\begin{document}
This is the old notation for the factorial $\oldfactorial{n}$. Some other text
in order to wrap the line and see what happens with interline spacing
below the symbol. It also works in subscripts
\[
X=\sum_{0\le i\le\oldfactorial{n}}A_i+\left(\oldfactorial{x^2}\right)
\]
Here's a big version:

{\Huge$\oldfactorial{n}$}
\end{document}

enter image description here

2
  • Thanks for this. I was wondering whether there was a tikz way of doing this but I haven't yet invested enough time to really get to grips with it. I think this might be a project for me next month!
    – Nickolas
    Jun 3, 2013 at 21:53
  • 1
    Just a tip: You could replace (mynode.north west)--(mynode.south west)--(mynode.south east) with (mynode.north west)|-(mynode.south east)
    – Tobi
    Jun 3, 2013 at 22:00
24

An implementation with old school tricks:

\documentclass{article}

\newcommand{\oldfactorial}[1]{\mathpalette\oldfactorialaux{#1}}
\newcommand{\oldfactorialaux}[2]{%
  {#1\mkern1mu\oalign{\vrule\,$#1#2\mathstrut$\,\cr\noalign{\hrule}}}}

\begin{document}
This is the old notation for the factorial $\oldfactorial{n}$. Some other text
in order to wrap the line and see what happens with interline spacing
below the symbol. It also works in subscripts
\[
X=\sum_{0\le i\le\oldfactorial{n}}A_i
\]
Here's a big version:

{\Huge$\oldfactorial{n}$}
\end{document}

enter image description here

1
  • Thanks very much for the quick reply. This does the trick for me.
    – Nickolas
    Jun 3, 2013 at 21:52
3

This works for me

\documentclass{article}
\usepackage{amsmath}
\newcommand{\oldfact}[1]{\underline{\!\left\lvert #1\right.}}
\begin{document}
\[
 \oldfact{\frac{1}{2} n(n+1)}
\]
\end{document}][1]

enter image description here

2
  • The two lines do not meet in the corner. Is that the intended behaviour? Jun 3, 2013 at 21:21
  • Well, I thought about lowering \lvert, then decided it would not be robust...
    – Boris
    Jun 3, 2013 at 21:34

You must log in to answer this question.

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