Typesetting annuity and life-insurance symbols in ConTeXt

How do I typeset annuity and life-insurance symbols, actuarial notation in ConTeXt. I see there are packages available but not for ConTeXt.

Thanks

• It would be nice to have an example of how they look like. I don't know those symbols. – Marco Oct 22 '13 at 10:51
• From what I recall having seen some of the actuarial study material, there's nothing that can't be done using standard maths notation. I think you'll need left sub- and superscripts, and some accents not normally used (\urcorner as an accent on a subscript) – Chris H Oct 22 '13 at 10:58
• for examples, see actuaries.org.uk/research-and-resources/documents/… try starting at p33. – Chris H Oct 22 '13 at 11:00
• In the source code of the Wikipedia page on actuarial notation, the symbol is typeset as follows: a_{\overline{n|}i}. – jub0bs Oct 22 '13 at 12:03
• although unicode recognizes the "actuarial bend" as a character, I doubt it can be easily produced as a single symbol in a font. it certainly isn't acceptably represented by the upper right "quine corner" (\urcorner). – barbara beeton Oct 22 '13 at 12:15

This is Plain TeX, but I guess it can do for ConTeXt. Experts can improve it.

\def\actuarial#1{%
\vbox{
\offinterlineskip
\tabskip=0pt
\mathsurround=0pt
\halign{##&\vrule##\cr
\noalign{\hrule}%
&height 1pt\cr
$\scriptstyle#1$&\cr
}%
}%
}

$a_{\actuarial{n}}$

\bye


• I normally avoid using an explicit \subscriptstyle. It may be better to use \mathpallet to get automatic scaling of the argument. – Aditya Oct 22 '13 at 23:46
• @Aditya I don't know whether ConTeXt has \mathpalette. ;-). However I don't think this symbol is ever used in subscripts. – egreg Oct 23 '13 at 7:18
• ConTeXt has almost all commands defined in plain TeX, so yes it has mathpalette, although the current practice is to use setmathstyle instead (basically assume that over etc will not be used so that the math style is predictable) – Aditya Oct 23 '13 at 14:03

Based on Barbara Beeton's comment, you just need to pick a font that includes the actuarial bend symbol. For example, using XITS fonts you get:

% Use a math font that has the actuarial bend symbol
\usemodule[simplefonts]
\setmathfont[XITS]

\Umathchardef\actuarial "0 "0 "20E7

\starttext

$a_{n \actuarial}$

\stoptext


If someone can tell what is the right mathclass and tex name for this glyph, I can send in a request to add this to char-def.lua so that it works out of the box in ConTeXt.

• The spacing seems wrong. The horizontal bar should not touch the preceding letters. – Marco Oct 22 '13 at 22:28
• @Marco: Tell that to the glyph designer :) (But it could also be something due to incorrect scaling in subscripts) – Aditya Oct 22 '13 at 23:43
• The scaling of the subscripts is correct. This looks OK if a wider glyph is used. – Aditya Oct 22 '13 at 23:51
• so the basic glyph really should be narrower, and horizontally extendable. i'll forward that comment for consideration. – barbara beeton Oct 23 '13 at 7:22

Here's something to get you going, you may want to tweak the raisebox dimension, and the negative spaces, and maybe the size of the \urcorner.

\documentclass{article}

\usepackage{amsmath,amssymb}
\newcommand{\bend}[1]{\smash{#1\!\!\!{\raisebox{-0.2em}{\big\urcorner}}}}
\begin{document}
This is horrible:

$a_{\overline{n|}i}$

This isn't great, but is much better:

$a_{\bend{n} i}$
\end{document}


No doubt someone can propose a cleaner way of doing the adjustments, I can update for comments.

Also it will need testing in ConTeXt - I don't use it, though from what I've read it should work.