Actuarial Angle Symbol For Life Contingencies and Financial Mathematics
Actuarial Angle Symbol For Life Contingencies and Financial Mathematics
Abstract
The package actuarialangle provides commands to typeset the
“angle” symbol denoting a duration n in actuarial notation, as in n ,
and an overhead angle bracket, as in xy .
1 Introduction
This package defines commands to typeset two symbols used in actuarial
notation for life contingencies and financial mathematics. The first is
the “angle” denoting a duration in the present value of an insurance or
annuity: n . The second is an overhead angle bracket (or “roof”) used
to emphasize joint status when ambiguity is possible: xy . The bracket
is normally used with a precedence number above. Facilities to position
such numbers are provided by the package actuarialsymbol (Beauchemin
and Goulet, 2017).
For additional details on actuarial notation for life contingencies, see
Bowers et al. (1997).
2 Package options
The package offers the following options:
∗ This document corresponds to actuarialangle v2.1, dated 2019/06/13.
† École d’actuariat, Université Laval.
1
thinspace insert a thin space of 1mu between the material under the
angle and the right descender; this is the default starting with version
2.0 of the package;
thickspace insert a thicker space of 2mu between the material under the
angle and the right descender; this was the value used in versions of the
package prior to 2.0;
We provide the option nobracket in case the bracket symbol is not needed
and pict2e (Gäßlein et al., 2016) interferes with other packages. Loading
the package with
\usepackage[thickspace,nobracket]{actuarialangle}
yields the behaviour of versions prior to 2.0, but for the defunct features
mentioned in section 4.
3 Package features
\actuarialangle In math mode, the command
\actuarialangle{hdurationi}
\actuarialangle{n} \quad
n an
a_{\actuarialangle{n}}
\angl Users are expected to typeset angle symbols with the command
\angln
\anglr \angl{hdurationi}
\anglk In contrast to \actuarialangle, this command inserts some thin space (by
default or with package option thinspace) or thick space (with package
option thickspace) between {hdurationi} and the right descender.
2
% with option thinspace:
n an
\angl{n} \quad a_{\angl{n}}
% with option thickspace:
n an
\angl{n} \quad a_{\angl{n}}
Commands \angln, \anglr and \anglk are shortcuts for the common
cases \angl{n}, \angl{r} and \angl{k}, respectively.
\overanglebracket The command
\group
\overanglebracket{hstatusesi}
composes an angle bracket (“roof”) above hstatusesi. The rule thickness
and spacing relative to the statuses match those of the angle symbol. The
command \group is a convenient alias for \overanglebracket.
\group{xy} \quad
xy A xy :n
A_{\group{xy}:\angln}
4 Defunct features
Versions prior to 2.0 of the package included the undocumented com-
mands
\topprecedence (with alias \lift)
\vartopprecedence
\bottomprecedence
\varbottomprecedence
to typeset precedence numbers above and below statuses in subscript of
an actuarial symbol. These features have been moved — and improved on
the way — to package actuarialsymbol (Beauchemin and Goulet, 2017).
A Implementation
This appendix contains the annotated source code of the package. Most
readers can stop reading here.
3
1 \newif\ifacta@thinspace \acta@thinspacetrue
2 \newif\ifacta@bracket \acta@brackettrue
\DeclareOption Declaration of the package options and processing. Defaults are thinspace
and to define the bracket.
3 \DeclareOption{thinspace}{\acta@thinspacetrue}
4 \DeclareOption{thickspace}{\acta@thinspacefalse}
5 \DeclareOption{nobracket}{\acta@bracketfalse}
6 \ProcessOptions
\acta@overbarkern We want a macro to take a math style, e.g., \displaystyle, and then to
expand into \fontdimen8\textfont3 (for Type 1 fonts). This will serve as
the extra space. The name “overbarkern” comes from the corresponding
LuaTeX primitive and OpenType Math table entry.
13 \def\acta@overbarkern#1{%
14 \fontdimen\acta@overbarkern@fontdimen
15 \ifx#1\displaystyle
16 \textfont
17 \else
18 \ifx#1\textstyle
19 \textfont
20 \else
21 \ifx#1\scriptstyle
22 \scriptfont
23 \else
24 \scriptscriptfont
25 \fi
26 \fi
27 \fi
28 \acta@overbarkern@family
4
29 }
\acta@overbarrule The \acta@overbarrule macro is similar. This will serve as the rule
thickness. The name “overbarrule” comes from the corresponding LuaTeX
primitive and OpenType Math table entry.
30 \def\acta@overbarrule#1{%
31 \fontdimen\acta@overbarrule@fontdimen
32 \ifx#1\displaystyle
33 \textfont
34 \else
35 \ifx#1\textstyle
36 \textfont
37 \else
38 \ifx#1\scriptstyle
39 \scriptfont
40 \else
41 \scriptscriptfont
42 \fi
43 \fi
44 \fi
45 \acta@overbarrule@family
46 }
5
64 \fi
65 \acta@overbarvgap@family
66 }
6
Finishing touch is a bit of following space.
83 \mkern1mu%
84 }%
85 }
\angl Finally, we define the main user level function \angl and shortcuts for
\angln common cases.
\anglr 86 \ifacta@thinspace
\anglk 87 \newcommand*\angl[1]{{\actuarialangle{#1\mkern1mu}}}
88 \else
89 \newcommand*\angl[1]{{\actuarialangle{#1\mkern2mu}}}
90 \fi
91 \newcommand*\angln{{\angl n}}
92 \newcommand*\anglr{{\angl r}}
93 \newcommand*\anglk{{\angl k}}
Drawing the angle bracket requires package pict2e (Gäßlein et al., 2016) to
get arbitrary slopes and neat line joins in paths.
95 \RequirePackage{pict2e}
7
Box zero contains the material under the bracket. The width of this box
will determine the width of the flat part of the bracket and the height, the
length of the descenders of the bracket. Hence we store these values.
102 \setbox\z@\hbox{$\m@th#1#2$}%
103 \dimen\z@\wd\z@ \dimen\tw@\ht\z@
Box two contains the bracket itself. It is drawn in three parts stitched
together; the first and third parts are expressed in a dimension relative to
\dimen2 whereas the central part is expressed relative to \dimen0.
104 \setbox\tw@\hbox{%
105 \unitlength\dimen\tw@
106 \begin{picture}(0.4,0)
107 \polyline(0.4001,0)(0.4,0)(0,-0.8)
108 \end{picture}%
109 \unitlength\dimen\z@
110 \begin{picture}(1,0)
111 \put(0,0){\line(1,0){1}}
112 \end{picture}%
113 \unitlength\dimen\tw@
114 \begin{picture}(0.4,0)
115 \polyline(-0.0001,0)(0,0)(0.4,-0.8)
116 \end{picture}%
117 }%
We store the total width of the whole bracket to center the material under
it, as follows.
118 \dimen@\wd\tw@
The box containing the whole symbol. The lineskip between the bracket
and the statuses is the same as in \acta@angle, plus half the rule thickness
\@halfwidth.
119 \vbox{%
120 \baselineskip\z@
121 \lineskip\acta@overbarvgap#1%
122 \advance\lineskip\@halfwidth
123 \lineskiplimit\lineskip
The extra space is the same as in \acta@angle, plus half the rule thickness
\@halfwidth.
124 \kern\acta@overbarkern#1%
125 \kern\@halfwidth
126 \box\tw@
127 \hbox to\dimen@{\hss\unhbox\z@\hss}%
128 }%
8
Finish with a bit of following space.
129 \mkern1mu%
130 }%
131 }
9
147 \gdef\acta@overbarkern@fontdimen{54}% XeTeX mistake? Use 55?
148 \gdef\acta@overbarkern@family{\tw@}%
149 \gdef\acta@overbarrule@fontdimen{54}%
150 \gdef\acta@overbarrule@family{\tw@}%
151 \gdef\acta@overbarvgap@fontdimen{54}% XeTeX mistake? Use 53?
152 \gdef\acta@overbarvgap@family{\tw@}%
153 \fi
154 }{}%
155 }
References
D. Beauchemin and V. Goulet. Actuarial symbols of life contingencies
and financial mathematics, 2017. URL https://www.ctan.org/pkg/
actuarialsymbol/.
Version history
10
Improved construction. . . . . . 7 \acta@overbarvgap@family:
Use local dimen registers. . . . 8 Define fontdimen and family
Variable extra space. . . . . . . . 8 parameters. . . . . . . . . . . . . 4
Variable gap. . . . . . . . . . . . . 8 \anglk: No need for extra
Variable thickness. . . . . . . . . 7 braces around #1. . . . . . . . . 7
\acta@overbarkern: Define Use \newcommand* instead of
usable extra space. . . . . ... 4 \def. . . . . . . . . . . . . . . . . . 7
\acta@overbarrule: Define General: Variable extra space,
usable rule thickness. . . ... 5 rule thickness and vertical
\acta@overbarvgap: Define gap; contributed by Ruixi
usable vertical gap. . . . . ... 5 Zhang. . . . . . . . . . . . . . . . . 1
11