Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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!

share|improve this question
5  
Welcome to TeX.SX! Can you point to some resource where the symbol can be seen? –  egreg Jun 3 '13 at 20:13
    
One can see the symbol at mathworld.wolfram.com/Factorial.html –  Nickolas Jun 3 '13 at 20:21
add comment

3 Answers

up vote 16 down vote accepted

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

share|improve this answer
    
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 '13 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 '13 at 22:00
add comment

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

share|improve this answer
    
Thanks very much for the quick reply. This does the trick for me. –  Nickolas Jun 3 '13 at 21:52
add comment

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

share|improve this answer
    
The two lines do not meet in the corner. Is that the intended behaviour? –  Gonzalo Medina Jun 3 '13 at 21:21
    
Well, I thought about lowering \lvert, then decided it would not be robust... –  Boris Jun 3 '13 at 21:34
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.