summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/actuarialsymbol/actuarialsymbol.dtx
blob: 7677572f8606c49361cc6d3a8d43e79054623bfa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
% \iffalse meta-comment
%
% Copyright (C) 2019 David Beauchemin, Vincent Goulet
%
% This file may be distributed and/or modified under the conditions
% of the LaTeX Project Public License, either version 1.3c of this
% license or (at your option) any later version. The latest version
% of this license is in:
%
%   http://www.latex-project.org/lppl.txt
%
% and version 1.3c or later is part of all distributions of LaTeX
% version 2006/05/20 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is Vincent Goulet
% <vincent.goulet@act.ulaval.ca>.
%
% This work consists of actuarialsymbol.dtx and the derived
% files.
%
% \fi
%
% \iffalse
%<*dtx>
          \ProvidesFile{actuarialsymbol.dtx}
%</dtx>
%<package>\NeedsTeXFormat{LaTeX2e}[2009/09/24]
%<package>\ProvidesPackage{actuarialsymbol}[2019/06/13 v1.1 Actuarial symbols]
%<*batchfile>
\begingroup
\input docstrip.tex
\keepsilent
\askforoverwritefalse

\preamble

This is a generated file.

Copyright (C) 2019 David Beauchemin, Vincent Goulet

This file may be distributed and/or modified under the conditions
of the LaTeX Project Public License, either version 1.3c of this
license or (at your option) any later version. The latest version
of this license is in:

   http://www.latex-project.org/lppl.txt

and version 1.3c or later is part of all distributions of LaTeX
version 2006/05/20 or later.

This work has the LPPL maintenance status `maintained'.

The Current Maintainer of this work is Vincent Goulet
<vincent.goulet@act.ulaval.ca>.

This work consists of actuarialsymbol.dtx and the derived files.

\endpreamble
\generate{\file{actuarialsymbol.sty}{\from{actuarialsymbol.dtx}{package}}}
\endgroup
%</batchfile>
%<*driver>
\documentclass[11pt,x11names]{ltxdoc}
  \usepackage[utf8]{inputenc}
  \usepackage[T1]{fontenc}
  \usepackage{natbib}
  \usepackage{microtype}
  \usepackage[scaled=0.90]{helvet}
  \usepackage[scaled=1.02]{inconsolata}
  \usepackage[sc]{mathpazo}
  \usepackage{rsfso}            % \mathcal variants
  \usepackage{actuarialsymbol}[2017/04/10]
  \usepackage{framed}           % environment snugshade*
  \usepackage{metalogo}         % XeTeX logo
  \usepackage{graphicx}
  \usepackage{longtable,booktabs}
  \DisableCrossrefs
  \CodelineNumbered
  \RecordChanges
  \GlossaryPrologue{\section*{Version history}%
    \addcontentsline{toc}{section}{Version history}}

  %% colors
  \usepackage{xcolor}
  \definecolor{link}{rgb}{0,0.4,0.6}   % ~dvips RoyalBlue
  \definecolor{url}{rgb}{0.6,0,0}      % dark red
  \definecolor{citation}{rgb}{0,0.5,0} % dark green
  \colorlet{shadecolor}{LightYellow1}  % code background

  %% left aligned description list
  \usepackage{enumitem}
  \setlist[description]{leftmargin=*,align=left}

  %% environment for remarks
  \usepackage{amsthm}
  \theoremstyle{definition}
  \newtheorem*{rem}{Remark}

  %% single entry for symbol and shortcut lists
  %% https://tex.stackexchange.com/a/128441
  \usepackage{xparse}
  \ExplSyntaxOn
  \NewDocumentCommand{\showcase}{v} { \tl_rescan:nn { } { $#1$ } & \texttt{#1} }
  \NewDocumentCommand{\rshowcase}{v} { \texttt{#1} & \tl_rescan:nn { } { $#1$ } }
  \ExplSyntaxOff

  %% environment for displayed sample code; hybrid between
  %% environments snugshade* and leftbar of framed.sty
  \makeatletter
  \newenvironment{snugshadebar}{%
    \setlength{\topsep}{1pt}
    \def\FrameCommand##1{\hskip\@totalleftmargin
       \vrule width 2pt\colorbox{shadecolor}{\hspace{3pt}##1}%
      % There is no \@totalrightmargin, so:
      \hskip-\linewidth \hskip-\@totalleftmargin \hskip\columnwidth}%
    \MakeFramed {\advance\hsize-\width
      \@totalleftmargin\z@ \linewidth\hsize
      \advance\labelsep\fboxsep
      \@setminipage}%
  }{\par\unskip\@minipagefalse\endMakeFramed}
  \makeatother

  %% environments for demo code; 'texample' mostly lifted from
  %% documentation of amsmath
  \newenvironment{demo}{\begin{trivlist}\item}{\end{trivlist}}
  \newenvironment{texample}[1][0.5]{%
    \noindent\begin{minipage}{#1\linewidth}\begin{snugshadebar}%
      \def\producing{\end{snugshadebar}\end{minipage}\hfill\begin{minipage}{\dimexpr0.97\linewidth-#1\linewidth}%
        \hbox\bgroup\kern-.2pt%
        \vbox\bgroup\parindent0pt\relax
        % The 3pt is to cancel the -\lineskip from \displ@y
        \abovedisplayskip3pt \abovedisplayshortskip\abovedisplayskip
        \belowdisplayskip0pt \belowdisplayshortskip\belowdisplayskip
        \noindent}%
    }{%
      \par
      % Ensure that a lonely \[\] structure doesn't take up width less than
      % \hsize.
      \hrule height0pt width\hsize
      \egroup\kern-.2pt\egroup
    \end{minipage}%
    \par
  }

  %% utility macro
  \newcommand{\pkg}[1]{\textsf{#1}}

  %% increase row height in tables
  \renewcommand{\arraystretch}{1.2}

  %% hyperlinks
  \usepackage{hyperref}
  \hypersetup{%
    pdftitle={actuarialsymbol User Guide},
    pdfauthor={David Beauchemin, Vincent Goulet},
    colorlinks = true,
    linktocpage = true,
    urlcolor = {url},
    linkcolor = {link},
    citecolor = {citation},
    pdfpagemode = {UseOutlines},
    pdfstartview = {Fit}}

  %% autoref labels
  \let\subsectionautorefname\sectionautorefname
  \let\subsubsectionautorefname\sectionautorefname

\begin{document}
  \DocInput{actuarialsymbol.dtx}
\end{document}
%</driver>
% \fi
% \CheckSum{520}
% \changes{1.0}{2017-04-11}{Initial release.}
% \changes{1.1}{2019-01-08}{Various improvements to the code
%   contributed by Ruixi Zhang.}
% \changes{1.1}{2019-06-13}{Code samples displayed in a box with a
%   left bar.}
%
% \GetFileInfo{actuarialsymbol.sty}
%
% \title{Actuarial symbols of life contingencies \\
%   and financial mathematics^^A
%   \thanks{This document corresponds to
%   \pkg{actuarialsymbol}~\fileversion, dated~\filedate.}}
% \author{David Beauchemin \\
%   \url{david.beauchemin.5@ulaval.ca}
%   \and
%   Vincent Goulet\thanks{^^A
%     École d'actuariat, Université Laval} \\
%   \url{vincent.goulet@act.ulaval.ca}}
% \maketitle
%
% \begin{abstract}
%   The package \pkg{actuarialsymbol} provides facilities to compose
%   actuarial symbols of life contingencies and financial mathematics
%   characterized by subscripts and superscripts on both sides of a
%   principal symbol. The package also features commands to easily and
%   consistently position precedence numbers above or below statuses
%   in symbols for multiple lives contracts.
%
%   Since actuarial notation can get quite involved, the package
%   defines a number of shortcut macros to ease entry of the most
%   common elements. \autoref{sec:comprehensive} lists the commands to
%   typeset a large selection of life contingencies symbols.
% \end{abstract}
%
% \tableofcontents
%
% \section{Introduction}
% \label{sec:introduction}
%
% Actuaries denote various quantities of life contingencies like
% present values of life insurances and life annuities, annual
% premiums, or reserves using a whole array of symbols. The highly
% descriptive, yet compact, notation was standardized as far back as
% in 1898 \citep{Wolthuis:notation:2004}. \autoref{fig:mosaic} shows a
% creative use of the notation by the graduating class of 1972 in
% Actuarial Science at Université Laval.
%
% \begin{figure}[t]
%   \centering
%   \includegraphics[width=\linewidth]{mosaic}
%   \caption{``Actuariat'' (French for Actuarial Science) written
%     using actuarial symbols on the 1972 graduating class mosaic at
%     Université Laval}
%   \label{fig:mosaic}
% \end{figure}
%
% \citet[Appendix~4]{Bowers:2e:1997} offer an excellent overview of
% the composition rules for symbols of actuarial functions. In a
% nutshell, a principal symbol, say $S$, is combined with auxiliary
% symbols positioned in subscript or in superscript, to the left or to
% the right. Schematically, we thus have:
% \begin{equation}
%   \label{schema1}
%   \actsymb[\fbox{\scriptsize I}\!\;][\fbox{\scriptsize II}\!\;]^^A
%      {\framebox[5ex]{$S$}}{\,\fbox{\scriptsize III}}^^A
%      [\,\fbox{\scriptsize IV}]
% \end{equation}
%
% The principal symbol is in general a single letter. The letter may
% be ``accented'' with a bar ($\bar{A}$), double dots ($\ddot{a}$) or
% a circle ($\mathring{e}$). When the principal symbol consists of two
% letters, they are grouped between parentheses, as in $\IA$ or
% $\DA*$. Most commonly, there are alphanumeric statuses in the
% lower-right position \fbox{\small III}\,. Numerals can be placed above
% or below the individual statuses to show the order of failure; we
% will refer to these numerals as \emph{precedence numbers}. Otherwise,
% auxiliary symbols appear lower-left \fbox{\small I}\,, upper-left
% \fbox{\small II}\, and upper-right \fbox{\small IV}\,, in that order of
% frequency.
%
% Symbols for benefit premiums ($P$), reserves ($V$) and amount of
% reduced paid-up insurance ($W$), are combined with
% benefit symbols unless the benefit is a level unit insurance payable
% at the end of the year of death. In such cases, we have the
% following symbol structure (replace $P$ by $V$ or $W$ as needed):
% \begin{equation}
%   \label{schema2}
%   \actsymb[\fbox{\scriptsize I}\!\;][\fbox{\scriptsize II}\!\;]^^A
%      {\framebox[5ex]{$P$}}{}[\,\fbox{\scriptsize IV}]^^A
%   \bigl(\actsymb{\framebox[5ex]{$S$}}{\,\fbox{\scriptsize III}}\bigr)
% \end{equation}
%
% Perhaps the most commonly used auxiliary symbol not readily
% available in {\LaTeX} is the ``angle'' denoting a duration $n$, as
% in $\angln$. The package \pkg{actuarialangle} \citep{actuarialangle}
% provides commands to create this symbol, as well as an overhead
% angle bracket\footnote{Starting with version 2.0 dated 2017/04/10.}
% (or ``roof'') used to emphasize the joint status when ambiguity is
% possible: $\group{xy}$. This package is imported at load time by
% \pkg{actuarialsymbol}.
%
% The package \pkg{actuarialsymbol} provides a generic command to position
% all subscripts and superscripts easily and consistently around a
% principal symbol; a command to create two-letter symbols; and two
% commands to position precedence numbers above and below statuses.
% Since entering actuarial symbols can get quite involved, the package
% also defines a number of shortcuts to create the most common
% actuarial functions of financial mathematics and life contingencies.
%
% \section{For the impatient}
% \label{sec:actuarialsymbol:quickstart}
%
% The hurried reader may jump to \autoref{sec:shortcuts} for tables of
% shortcut macros defined by the package, and to
% \autoref{sec:comprehensive} for a comprehensive list of symbols of
% life contingencies along with the {\LaTeX} code to compose them with
% \pkg{actuarialsymbol} loaded. That said, in our highly biased view,
% it remains worth reading along the fine documentation below.
%
% \section{Package features}
% \label{sec:features}
%
% This section describes the generic commands provided by the package
% to compose actuarial symbols. On a daily basis, one should use the
% shortcuts of \autoref{sec:shortcuts} to ease entry of symbols.
%
% \subsection{Actuarial symbol}
% \label{sec:features:actsymb}
%
% \begin{DescribeMacro}{\actsymb}
%   The generic command \cmd{\actsymb} typesets a principal symbol with
%   surrounding subscripts and superscripts. Its syntax is somewhat
%   unusual for {\LaTeX}, but it serves well the natural order of the
%   building blocks of a symbol and their relative prevalence:
%   \begin{quote}
%     \cmd{\actsymb}\oarg{ll}\oarg{ul}\marg{symbol}\marg{lr}\oarg{ur}
%   \end{quote}
%   Above, \meta{ll} identifies the auxiliary symbol in the lower left
%   subscript position \fbox{\small I}\, (following the notation in the
%   schematic representation \eqref{schema1}); \meta{ul} is the upper
%   left superscript \fbox{\small II}\,; \meta{symbol} is the principal
%   symbol $S$; \meta{lr} is the lower right subscript \fbox{\small
%   III}\,; \meta{ur} is the upper right superscript \fbox{\small IV}\,.
%   The principal symbol and the right subscript are required, the
%   other arguments are optional.
%   \begin{demo}
%     \begin{texample}
%       |\actsymb{A}{x}|
%       \producing
%       $\actsymb{A}{x}$
%     \end{texample}
%     \begin{texample}
%       |\actsymb[n]{A}{x}|
%       \producing
%       $\actsymb[n]{A}{x}$
%     \end{texample}
%     \begin{texample}
%       |\actsymb[n][2]{A}{x}|
%       \producing
%       $\actsymb[n][2]{A}{x}$
%     \end{texample}
%     \begin{texample}
%       |\actsymb[n][2]{A}{x}[(m)]|
%       \producing
%       $\actsymb[n][2]{A}{x}[(m)]$
%     \end{texample}
%   \end{demo}
%
%   The command actually supports one more optional argument, for composing
%   symbols for premiums, reserves and paid-up insurance. The extended
%   command
%   \begin{quote}
%     \cmd{\actsymb}\oarg{ll}\oarg{ul}\oarg{P}\marg{symbol}\marg{lr}\oarg{ur}
%   \end{quote}
%   puts symbol \meta{P} outside the parentheses in the
%   schematic representation \eqref{schema2}.
%   \begin{demo}
%     \begin{texample}[0.7]
%       |\actsymb[][][P]{\bar{A}}{x:\angln}|
%       \producing
%       $\actsymb[][][P]{\bar{A}}{x:\angln}$
%     \end{texample}
%     \begin{texample}[0.7]
%       |\actsymb[k][][V]{\bar{A}}{x}[\{1\}]|
%       \producing
%       $\actsymb[k][][V]{\bar{A}}{x}[\{1\}]$
%     \end{texample}
%     \begin{texample}[0.7]
%       |\actsymb[k][][\bar{W}]{\bar{A}}{x}|
%       \producing
%       $\actsymb[k][][\bar{W}]{\bar{A}}{x}$
%     \end{texample}
%   \end{demo}
% \end{DescribeMacro}
%
% \begin{rem}
%   {\TeX} adjusts the position of a subscript downward when a
%   superscript is present:
%   \begin{displaymath}
%     A_x \quad A_x^2.
%   \end{displaymath}
%   The package maintains this behaviour. Therefore, entering the
%   symbols above using the standard operators |^| and |_| or with
%   \cmd{\actsymb} yields the same result.
%   \begin{demo}
%     \begin{texample}[0.7]
%       |A_x \quad A_x^2|
%       \producing
%       $A_x \quad A_x^2$
%     \end{texample}
%     \begin{texample}[0.7]
%       |\actsymb{A}{x} \quad \actsymb{A}{x}[2]|
%       \producing
%       $\actsymb{A}{x} \quad \actsymb{A}{x}[2]$
%     \end{texample}
%   \end{demo}
%   Furthermore, the package ensures that the left and right
%   subscripts, when both present, are at the same level, something
%   common ad~hoc constructions do not provide.
%   \begin{demo}
%     \begin{texample}[0.7]
%       |{}_tA_x \quad {}_tA_x^2|
%       \producing
%       ${}_tA_x \quad {}_tA_x^2$
%     \end{texample}
%     \begin{texample}[0.7]
%       |\actsymb[t]{A}{x} \quad \actsymb[t]{A}{x}[2]|
%       \producing
%       $\actsymb[t]{A}{x} \quad \actsymb[t]{A}{x}[2]$
%     \end{texample}
%   \end{demo}
%   In symbols for premiums, reserves and paid-up insurance,
%   subscripts and superscripts are aligned only around
%   symbol \meta{P}. Authors who would prefer a uniform subscript position
%   \emph{throughout their document} can load the package
%   \pkg{subdepth} \citep{subdepth}.
% \end{rem}
%
% \subsection{Two-letter principal symbols}
% \label{sec:features:twoletsymb}
%
% \begin{DescribeMacro}{\twoletsymb}
%   Entering two-letter principal symbols like $\DA$ as |$(DA)$| results in
%   letters that are too distant from one another: $(DA)$. To unify
%   presentation, the package provides the command
%   \begin{quote}
%     \cmd{\twoletsymb}\oarg{length}\marg{symbol\_1}\marg{symbol\_2}
%   \end{quote}
%   to group \meta{symbol\_1} and \meta{symbol\_2} between parentheses
%   with kerning\footnote{Spacing adjustment between the characters.}
%   reduced by length \cmd{\twoletkern} (see below). One can also
%   reduce spacing by \meta{length} for a specific symbol.
%   \begin{demo}
%     \begin{texample}
%       |\twoletsymb{\bar{D}}{\bar{A}}|
%       \producing
%       $\twoletsymb{\bar{D}}{\bar{A}}$
%     \end{texample}
%     \begin{texample}
%       |\twoletsymb{I}{\ddot{a}}|
%       \producing
%       $\twoletsymb{I}{\ddot{a}}$
%     \end{texample}
%     \begin{texample}
%       |\twoletsymb[0.8pt]{I}{\ddot{a}}|
%       \producing
%       $\twoletsymb[0.8pt]{I}{\ddot{a}}$
%     \end{texample}
%   \end{demo}
%
%   We expect authors to use \cmd{\twoletsymb} to define commands, not
%   directly in equations. The package already defines a number of
%   shortcuts for the main two-letter actuarial symbols; see
%   \autoref{sec:shortcuts}.
% \end{DescribeMacro}
%
% \begin{DescribeMacro}{\twoletkern}
%   The standard kerning between mathematical symbols defined with
%   \cmd{\twoletsymb} is \emph{reduced} by the length
%   \cmd{\twoletkern}, by default 0.1em. This value can be
%   changed as usual using \cmd{\setlength}.
% \end{DescribeMacro}
%
% \subsection{Precedence numbers}
% \label{sec:features:precedence}
%
% \begin{DescribeMacro}{\nthtop}
% \begin{DescribeMacro}{\nthtop*}
%   Precedence numbers appear above or below individual statuses in
%   the right subscript \fbox{\small III}\, of a symbol. The commands
%   \begin{quote}
%     \cmd{\nthtop}\oarg{length}\marg{number}\marg{status} \\
%     \cmd{\nthtop*}\oarg{length}\marg{number}\marg{status}
%   \end{quote}
%   put a precedence \meta{number} above a \meta{status}, smashed so
%   that the apparent height of the status is its normal height. With
%   \cmd{\nthtop}, the spacing between the precedence number and the
%   status is a constant \cmd{\nthtopsep} (see below). This can result
%   in precedence numbers placed at different heights if one status
%   contains a horizontal rule.
%   \begin{demo}
%     \begin{texample}[0.85]
%       |\actsymb{A}{\nthtop{1}{x}:\angln}|
%       \producing
%       \rule{0pt}{12pt}$\actsymb{A}{\nthtop{1}{x}:\angln}$
%     \end{texample}
%     \begin{texample}[0.85]
%       |\actsymb{A}{x:\nthtop{1}{\angln}}|
%       \producing
%       \rule{0pt}{12pt}$\actsymb{A}{x:\nthtop{1}{\angln}}$
%     \end{texample}
%     \begin{texample}[0.85]
%       |\actsymb{A}{\nthtop{1}{x}y:\nthtop{2}{\angln}}|
%       \producing
%       \rule{0pt}{12pt}$\actsymb{A}{\nthtop{1}{x}y:\nthtop{2}{\angln}}$
%     \end{texample}
%   \end{demo}
%   Conversely, \cmd{\nthtop*} always leaves enough space
%   \cmd{\nthtopskip} for intervening horizontal rules, resulting
%   in vertically aligned precedence numbers.
%   \begin{demo}
%     \begin{texample}[0.85]
%       |\actsymb{A}{\nthtop*{1}{x}:\angln}|
%       \producing
%       \rule{0pt}{12pt}$\actsymb{A}{\nthtop*{1}{x}:\angln}$
%     \end{texample}
%     \begin{texample}[0.85]
%       |\actsymb{A}{x:\nthtop*{1}{\angln}}|
%       \producing
%       \rule{0pt}{12pt}$\actsymb{A}{x:\nthtop*{1}{\angln}}$
%     \end{texample}
%     \begin{texample}[0.85]
%       |\actsymb{A}{\nthtop*{1}{x}y:\nthtop*{2}{\angln}}|
%       \producing
%       \rule{0pt}{12pt}$\actsymb{A}{\nthtop*{1}{x}y:\nthtop*{2}{\angln}}$
%     \end{texample}
%   \end{demo}
%   The optional argument \meta{length} changes the default spacing
%   for one symbol. The package also defines shortcuts for first,
%   second and third top precedence; see \autoref{sec:shortcuts}.
% \end{DescribeMacro}
% \end{DescribeMacro}
%
% \begin{DescribeMacro}{\nthbottom}
% \begin{DescribeMacro}{\nthbottom*}
%   In the same vein as the above two commands,
%   \begin{quote}
%     \cmd{\nthbottom}\oarg{length}\marg{number}\marg{status} \\
%     \cmd{\nthbottom*}\oarg{length}\marg{number}\marg{status}
%   \end{quote}
%   put a precedence \meta{number} below a \meta{status}. With
%   \cmd{\nthbottom} the spacing between the status and the number is
%   a constant \cmd{\nthbottomsep}, whereas with \cmd{\nthbottom*}
%   enough spacing \cmd{\nthbottomskip} is left to bottom align the
%   precedence numbers. The |*| variant is most useful in cases
%   involving more than one bottom precedence numbers and statuses
%   with descenders.
%   \begin{demo}
%     \begin{texample}[0.85]
%       |\actsymb{A}{\nthtop{3}{x}%| \\
%       |            \nthbottom{1}{y}\nthbottom{2}{z}}|
%       \producing
%       \rule{0pt}{12pt}$\actsymb{A}{\nthtop{3}{x}\nthbottom{1}{y}\nthbottom{2}{z}}$
%     \end{texample}
%     \begin{texample}[0.85]
%       |\actsymb{A}{\nthtop{3}{x}%| \\
%       |            \nthbottom*{1}{y}\nthbottom*{2}{z}}|
%       \producing
%       \rule{0pt}{12pt}$\actsymb{A}{\nthtop{3}{x}\nthbottom*{1}{y}\nthbottom*{2}{z}}$
%     \end{texample}
%   \end{demo}
%   The optional argument \meta{length} changes the default spacing
%   for one symbol. The package also defines shortcuts for first,
%   second and third bottom precedence; see \autoref{sec:shortcuts}.
% \end{DescribeMacro}
% \end{DescribeMacro}
%
% \begin{rem}
%   The fact that top precedence numbers have zero height means they
%   will clash with a right superscript \fbox{\small IV}\,:
%   \begin{demo}
%     \begin{texample}[0.7]
%       |\actsymb{A}{\nthtop{1}{x}:\angln}[(m)]|
%       \producing
%       $\actsymb{A}{\nthtop{1}{x}:\angln}[(m)]$
%     \end{texample}
%   \end{demo}
%   In such rare circumstances, one needs to insert a \emph{strut} (an
%   invisible vertical rule) in the subscript to push it downward as
%   needed:
%   \begin{demo}
%     \begin{texample}[0.7]
%       |\actsymb{A}{\rule{0pt}{2.3ex}%| \\
%       |            \nthtop{1}{x}:\angln}[(m)]|
%       \producing
%       $\actsymb{A}{\rule{0pt}{2.3ex}\nthtop{1}{x}:\angln}[(m)]$
%     \end{texample}
%   \end{demo}
%   This remark also applies to bottom precedence numbers in inline
%   formulas or multiline equations.
% \end{rem}
%
% \begin{DescribeMacro}{\nthtopsep}
% \begin{DescribeMacro}{\nthtopskip}
% \begin{DescribeMacro}{\nthbottomsep}
% \begin{DescribeMacro}{\nthbottomskip}
%   The constant spacing between a top precedence number and the status
%   underneath when using \cmd{\nthtop} is \cmd{\nthtopsep}, by
%   default 0.18em. The constant height of top precedence
%   numbers when using \cmd{\nthtop*} is achieved by setting the
%   baseline skip to \cmd{\nthtopskip}, by default
%   0.64em.
%
%   Similarly, the constant spacing between a bottom precedence number
%   and the status above when using \cmd{\nthbottom} is
%   \cmd{\nthbottomsep}, by default 0.18em, and the
%   constant height of bottom precedence numbers when using
%   \cmd{\nthbottom*} is achieved by setting the baseline skip to
%   \cmd{\nthbottomskip}, by default 0.82em.
%
%   These values can be changed as usual using \cmd{\setlength}.
% \end{DescribeMacro}
% \end{DescribeMacro}
% \end{DescribeMacro}
% \end{DescribeMacro}
%
% \section{Shortcuts}
% \label{sec:shortcuts}
%
% Composing actuarial symbols from scratch using \cmd{\actsymb} can
% easily get quite involved. For this reason, the package defines a
% large number of shortcut macros to ease entry of the most common
% symbols. We encourage authors to define their own shortcuts for
% cases we did not consider. The package provides powerful facilities
% to define shortcuts.
%
% \subsection{Basic symbols of life tables, insurance and annuities}
% \label{sec:shortcuts:principal}
%
% \autoref{tab:principal} lists shortcuts to compose complete symbols
% of life tables and benefits of insurance and annuities. For space
% considerations only the mandatory arguments are given, but it should
% be noted that all commands of \autoref*{tab:principal} accept the
% optional arguments \meta{ll}, \meta{ul} and \meta{ur} of
% \cmd{\actsymb}.
%
% \begin{table}[t]
%   \centering
%   \caption{Shortcuts for life table, insurance and annuity
%     symbols. All commands accept the optional arguments
%     \meta{ll}, \meta{ul} and \meta{ur} of \cmd{\actsymb}.}
%   \label{tab:principal}
%   \begin{tabular}{lll}
%       \toprule
%       Definition & Example & Output \\
%       \midrule
%       \cmd{\lx}\marg{age} & \rshowcase{\lx{x}} \\
%       \cmd{\Lx}\marg{age} & \rshowcase{\Lx{x}}$^\dagger$ \\
%       \cmd{\dx}\marg{age} & \rshowcase{\dx[n]{x}} \\
%       \cmd{\Dx}\marg{age} & \rshowcase{\Dx[n]{x}}$^\dagger$ \\
%       \cmd{\px}\marg{age} & \rshowcase{\px[t]{x}} \\
%       \cmd{\qx}\marg{age} & \rshowcase{\qx[t]{x}} \\
%       \cmd{\eringx}\marg{lr} & \rshowcase{\eringx{x:\angln}} \\
%       \addlinespace
%       \cmd{\Ax}\marg{lr}   & \rshowcase{\Ax{x:\angln}} \\
%       \cmd{\Ax*}\marg{lr}  & \rshowcase{\Ax*{x:\angln}} \\
%       \cmd{\Ex}\marg{lr}   & \rshowcase{\Ex[n]{x}} \\
%       \addlinespace
%       \cmd{\ax}\marg{lr}   & \rshowcase{\ax{x:\angln}} \\
%       \cmd{\ax*}\marg{lr}  & \rshowcase{\ax*{x:\angln}} \\
%       \cmd{\ax**}\marg{lr} & \rshowcase{\ax**{x:\angln}} \\
%       \cmd{\sx}\marg{lr}   & \rshowcase{\sx{x:\angln}} \\
%       \cmd{\sx*}\marg{lr}  & \rshowcase{\sx*{x:\angln}} \\
%       \cmd{\sx**}\marg{lr} & \rshowcase{\sx**{x:\angln}} \\
%       \cmd{\aringx}\marg{lr} & \rshowcase{\aringx{x:\angln}} \\
%       \bottomrule
%   \end{tabular} \\
%     \raggedright
%     \hspace*{1em}{\footnotesize $^\dagger$ Calligraphic letters
%     obtained using \cmd{\mathcal}. These specific versions of
%     $\mathcal{L}$ and $\mathcal{D}$ require the package \pkg{rsfso}
%     \citep{rsfso}. Standard versions are
%     $\text{\usefont{OMS}{zplm}{m}{n} L}$ and
%     $\text{\usefont{OMS}{zplm}{m}{n} D}$.\par}
% \end{table}
%
% One will note that shortcuts for insurance benefits come in two
% variants: one for the benefit payable at the end of the year of
% death (standard shortcut) and one for the benefit payable at the
% time of death (|*| variant). Shortcuts for annuity benefits have
% three variants: payable at the end of the period (standard),
% continuously (|*| variant) and at the beginning of the period (|**|
% variant).
%
% \begin{DescribeMacro}{\@actinssc}
% \begin{DescribeMacro}{\@actannsc}
% \begin{DescribeMacro}{\@actothersc}
%   One may define additional shortcut macros similar to those of
%   \autoref{tab:principal} using the internal commands
%   \begin{quote}
%     |\@actinssc|\marg{symbol} \\
%     |\@actannsc|\marg{symbol} \\
%     |\@actothersc|\marg{symbol}
%   \end{quote}
%   Command |\@actinssc| automatically provides the two shortcuts for
%   insurance benefits, command |\@actannsc| provides the three
%   shortcuts for annuity benefits and command |\@actothersc|
%   provides a single shortcut for \meta{symbol}.
%
%   For example, the package defines the shortcut \cmd{\px} with the
%   equivalent of ^^A
%   ^^A below we abuse the texample environment to avoid defining
%   ^^A another environment just for this purpose
%   \begin{demo}
%     \begin{texample}[1]
%       |\newcommand{\px}{\@actothersc{p}}| \producing
%     \end{texample}
%   \end{demo}
%   shortcuts \cmd{\Ax} and \cmd{\Ax*} with
%   \begin{demo}
%     \begin{texample}[1]
%       |\newcommand{\Ax}{\@actinssc{A}}| \producing
%     \end{texample}
%   \end{demo}
%   and shortcuts \cmd{\ax}, \cmd{\ax*} and \cmd{\ax**} with
%   \begin{demo}
%     \begin{texample}[1]
%       |\newcommand{\ax}{\@actannsc{a}}| \producing
%     \end{texample}
%   \end{demo}
% \end{DescribeMacro}
% \end{DescribeMacro}
% \end{DescribeMacro}
%
% \begin{rem}
%   When used in the preamble of a document, the above commands need
%   to be protected by a |\makeatletter| \dots\ |\makeatother| pair
%   since they make use of the reserved character |@|. Therefore, to
%   define shortcuts, say, \cmd{\Bx} and \cmd{\Bx*} to the imaginary
%   benefits $B$ and $\bar{B}$, one would write in the preamble
%   \begin{demo}
%     \begin{texample}[1]
%       |\makeatletter| \\
%       |\newcommand{\Bx}{\@actinssc{B}}| \\
%       |\makeatother| \producing
%     \end{texample}
%   \end{demo}
% \end{rem}
%
% \subsection{Symbols for premiums, reserves and paid-up insurance}
% \label{sec:shortcuts:premres}
%
% Symbols for premiums, reserves and paid-up insurance come in two
% main variants: without an explicit benefit between parentheses for
% insurances payable at the end of the year of death, and with the
% type of benefit specified for all other insurances and annuities.
%
% \autoref{tab:premres} lists two sets of shortcuts to compose symbols
% for premiums, reserves and paid-up insurance. Shortcuts from the
% first set take in mandatory argument the content of the \meta{lr}
% subscript of actuarial symbols. Those from the second set require a
% complete benefit symbol in argument. One may use the shortcuts of
% \autoref{tab:principal} to this effect. Again, only the mandatory
% arguments are given in the table, but all commands accept the
% optional arguments \meta{ll}, \meta{ul} and \meta{ur} of
% \cmd{\actsymb}.
%
% \begin{table}[t]
%   \centering
%   \caption{Shortcuts for premiums, reserves and paid-up insurance. All
%     commands accept the optional arguments \meta{ll},
%     \meta{ul} and \meta{ur} of \cmd{\actsymb}.}
%   \label{tab:premres}
%   \begin{tabular*}{1.0\linewidth}{lll}
%       \toprule
%       Definition & Example & Output \\
%       \midrule
%       \cmd{\Px}\marg{lr}  & \rshowcase{\Px[h]{x}} \\
%       \cmd{\Vx}\marg{lr}  & \rshowcase{\Vx[k]{x}} \\
%       \cmd{\Wx}\marg{lr}  & \rshowcase{\Wx[k]{x}} \\
%       \addlinespace
%       \cmd{\premium}\marg{benefit}  & \rshowcase{\premium[t]{\Ax*{x}}} \\
%       \cmd{\premium*}\marg{benefit} & \rshowcase{\premium*[t]{\Ax*{x:\angln}}} \\
%       \cmd{\reserve}\marg{benefit}  & \rshowcase{\reserve[t]{\ax**{x}}} \\
%       \cmd{\reserve*}\marg{benefit} & \rshowcase{\reserve*[t]{\ax*{x}}} \\
%       \cmd{\paidup}\marg{benefit}   & \rshowcase{\paidup[k]{\Ax*{x}}} \\
%       \cmd{\paidup*}\marg{benefit}  & \rshowcase{\paidup*[k][h]{\Ax*{x}}} \\
%       \bottomrule
%   \end{tabular*}
% \end{table}
%
% \begin{DescribeMacro}{\@actpremres}
%   The package eases definition of additional shortcut macros similar
%   to the second set of \autoref{tab:premres} using the internal
%   command
%   \begin{quote}
%     |\@actpremres|\marg{P}
%   \end{quote}
%   It defines shortcuts for discrete (default) or continuous (|*|
%   variant) premiums, reserves and paid-up insurance. For example,
%   the package defines shortcuts \cmd{\premium} and \cmd{\premium*}
%   with the equivalent of
%   \begin{demo}
%     \begin{texample}[1]
%       |\newcommand{\premium}{\@actpremres{P}}| \producing
%     \end{texample}
%   \end{demo}
%   The remark at the end of \autoref{sec:shortcuts:principal} also
%   applies here.
% \end{DescribeMacro}
%
% \subsection{Auxiliary symbols}
% \label{sec:shortcuts:aux}
%
% \autoref{tab:aux} lists shortcuts for a few common auxiliary symbols
% used in the lower right subscript \fbox{\small III}\,.
%
% \begin{table}
%   \centering
%   \caption{Shortcuts for auxiliary symbols}
%   \label{tab:aux}
%   \begin{tabular*}{1.0\linewidth}{lll}
%       \toprule
%       Definition & Example & Output \\
%       \midrule
%       \cmd{\term}\marg{age}\marg{duration}      & \rshowcase{\Ax{\term{x}{n}}} \\
%       \cmd{\termxn}                             & \rshowcase{\Ax{\termxn}} \\
%       \cmd{\pureendow}\marg{age}\marg{duration} & \rshowcase{\Ax{\pureendow{x}{n}}} \\
%       \cmd{\pureendowxn}                        & \rshowcase{\Ax{\pureendowxn}} \\
%       \cmd{\endow}\marg{age}\marg{duration}     & \rshowcase{\ax**{\endow{x}{n}}} \\
%       \cmd{\endowxn}                            & \rshowcase{\ax**{\endowxn}} \\
%       \cmd{\joint}\marg{ages}$^\dagger$         & \rshowcase{\Ax*{\joint{xy}z}} \\
%       \bottomrule
%   \end{tabular*} \\
%   \raggedright
%   \hspace*{1em}{\footnotesize $^\dagger$ Alias for \cmd{\overline}.\par}
% \end{table}
%
% \subsection{Symbols for varying benefit insurance and annuities}
% \label{sec:shortcuts:twoletsymb}
%
% \autoref{tab:twoletsymb} lists shortcuts for common two-letter
% symbols of varying benefit insurance and annuities. These shortcuts
% can be used as principal symbol in \cmd{\actsymb} or in the commands
% of \autoref{tab:principal}.
%
% \begin{table}
%   \centering
%   \caption{Shortcuts for varying benefit insurance and annuities}
%   \label{tab:twoletsymb}
%   \begin{tabular}{ll@{\hspace{15mm}}ll}
%       \toprule
%       Definition & Output & Definition & Output \\
%       \midrule
%       \cmd{\IA}   & $\IA$   & \cmd{\DA}   & $\DA$ \\
%       \cmd{\IA*}  & $\IA*$  & \cmd{\DA*}  & $\DA*$ \\
%       \addlinespace[6pt]
%       \cmd{\IbA}   & $\IbA$   & \cmd{\DbA}   & $\DbA$ \\
%       \cmd{\IbA*}  & $\IbA*$  & \cmd{\DbA*}  & $\DbA*$ \\
%       \addlinespace[6pt]
%       \cmd{\ImA}   & $\ImA$   & \cmd{\DmA}   & $\DmA$ \\
%       \cmd{\ImA*}  & $\ImA*$  & \cmd{\DmA*}  & $\DmA*$ \\
%       \addlinespace[6pt]
%       \cmd{\Ia}   & $\Ia$   & \cmd{\Da}   & $\Da$ \\
%       \cmd{\Ia*}  & $\Ia*$  & \cmd{\Da*}  & $\Da*$ \\
%       \cmd{\Ia**} & $\Ia**$ & \cmd{\Da**} & $\Da**$ \\
%       \addlinespace[6pt]
%       \cmd{\Is}   & $\Is$   & \cmd{\Ds}   & $\Ds$ \\
%       \cmd{\Is*}  & $\Is*$  & \cmd{\Ds*}  & $\Ds*$ \\
%       \cmd{\Is**} & $\Is**$ & \cmd{\Ds**} & $\Ds**$ \\
%       \bottomrule
%   \end{tabular}
% \end{table}
%
% \begin{DescribeMacro}{\@twoletinssc}
% \begin{DescribeMacro}{\@twoletannsc}
%   One may define additional shortcuts for two-letter insurance and
%   annuity benefit symbols using the internal commands
%   \begin{quote}
%     |\@twoletinssc|\oarg{length}\marg{symbol\_1}\marg{symbol\_2} \\
%     |\@twoletannsc|\oarg{length}\marg{symbol\_1}\marg{symbol\_2}
%   \end{quote}
%   These commands are similar to those of
%   \autoref{sec:shortcuts:principal}: |\@twoletinssc| provides two
%   shortcuts (standard and |*| variant), whereas |\@twoletannsc|
%   provides three (standard, |*| and |**| variants).
% \end{DescribeMacro}
% \end{DescribeMacro}
%
% \subsection{First, second and third precedence}
% \label{sec:shortcuts:preced}
%
% \autoref{tab:preced} lists shortcuts and aliases for the first,
% second and third precedence numbers, top and bottom. These shortcuts
% can be used in auxiliary symbols in \cmd{\actsymb} or in the
% commands of \autoref{tab:principal}.
%
% \begin{table}[t]
%   \centering
%   \caption{Shortcuts and aliases for precedence numbers}
%   \label{tab:preced}
%   \begin{tabular}{lll}
%       \toprule
%       Definition & Alias & Output \\
%       \midrule
%       \cmd{\firsttop}\marg{status}  & \cmd{\itop}\marg{status}   & $\Ax{\itop{x}:\angln}$ \\
%       \cmd{\secondtop}\marg{status} & \cmd{\iitop}\marg{status}  & $\Ax{x\iitop{y}z}$ \\
%       \cmd{\thirdtop}\marg{status}  & \cmd{\iiitop}\marg{status} & $\Ax{xy\iiitop{z}}$ \\
%       \addlinespace[6pt]
%       \cmd{\firsttop*}\marg{status}  & \cmd{\itop*}\marg{status}   & $\Ax{\itop*{x}:\angln}$ \\
%       \cmd{\secondtop*}\marg{status} & \cmd{\iitop*}\marg{status}  & $\Ax{x\iitop*{y}z}$ \\
%       \cmd{\thirdtop*}\marg{status}  & \cmd{\iiitop*}\marg{status} & $\Ax{xy\iiitop*{z}}$ \\
%       \addlinespace[6pt]
%       \cmd{\firstbottom}\marg{status}  & \cmd{\ibottom}\marg{status}   & $\Ax{\ibottom{x}yz}$ \\
%       \addlinespace[3pt]
%       \cmd{\secondbottom}\marg{status} & \cmd{\iibottom}\marg{status}  & $\Ax{\iibottom{x}yz}$ \\
%       \addlinespace[3pt]
%       \cmd{\thirdbottom}\marg{status}  & \cmd{\iiibottom}\marg{status} & $\Ax{xy\iiibottom{z}}$ \\
%       \addlinespace[6pt]
%       \cmd{\firstbottom*}\marg{status}  & \cmd{\ibottom*}\marg{status}   & $\Ax{\ibottom*{x}yz}$ \\
%       \addlinespace[3pt]
%       \cmd{\secondbottom*}\marg{status} & \cmd{\iibottom*}\marg{status}  & $\Ax{\iibottom*{x}yz}$ \\
%       \addlinespace[3pt]
%       \cmd{\thirdbottom*}\marg{status}  & \cmd{\iiibottom*}\marg{status} & $\Ax{xy\iiibottom*{z}}$ \\
%       \addlinespace[6pt]
%       \bottomrule
%   \end{tabular}
% \end{table}
%
% \section{Package options}
% \label{sec:options}
%
% The package offers two options to control the placement of
% precedence numbers:
% \begin{description}
% \item[\mdseries\ttfamily alignpreced] always align top and bottom
%   precedence numbers; makes \cmd{\nthtop} and \cmd{\nthbottom}
%   equivalent to \cmd{\nthtop*} and \cmd{\nthbottom*},
%   respectively;
% \item[\mdseries\ttfamily compactpreced] always put precedence
%   numbers close to the corresponding statuses; makes \cmd{\nthtop*}
%   and \cmd{\nthbottom*} equivalent to \cmd{\nthtop} and
%   \cmd{\nthbottom}, respectively.
% \end{description}
% Option |alignpreced| can be useful to simplify entry of uniformly
% positioned precedence numbers. On the other hand, option
% |compactpreced| is merely included as a complement to |alignpreced|.
% We do not recommended --- nor see a reason --- to use it as it
% basically renders inoperative commands \cmd{\nthtop*} and
% \cmd{\nthbottom*}.
%
% \appendix
%
% \newpage
% \section{Comprehensive life contingencies symbol list}
% \label{sec:comprehensive}
%
% This appendix was inspired by \citet{Trivedi:lifecon:2004}. The
% title is a nod to the immensely useful \emph{Comprehensive
% {\LaTeX} Symbol List} of \citet{comprehensive}.
%
% The table below contains all the life contingencies symbols listed
% in Appendix~3 of \citet{Bowers:2e:1997} along with the code to
% compose them with \pkg{actuarialsymbol} (and therefore
% \pkg{actuarialangle}) loaded. Often times there are various ways to
% obtain a symbol; we tried to always present the most compact and
% legible option. Not all symbols require features of
% \pkg{actuarialsymbol}.
%
% Calligraphic letters are typeset using \cmd{\mathcal}. The specific
% versions of $\mathcal{L}$ and $\mathcal{D}$ that appear in this
% table require the package \pkg{rsfso} \citep{rsfso}, which is \emph{not}
% loaded by \pkg{actuarialsymbol}. Standard versions of the
% calligraphic letters are $\text{\usefont{OMS}{zplm}{m}{n} L}$ and
% $\text{\usefont{OMS}{zplm}{m}{n} D}$. See Table~299 of
% \citet{comprehensive} for other options.
%
% \begingroup
% \catcode`\|=12 ^^A to use | in math, disable as verbatim delimiter
% \begin{longtable}{ll}
%   \toprule
%   Symbol & Code to compose the symbol \\
%   \midrule
%   \endfirsthead
%   \toprule
%   Symbol & Code to compose the symbol \\
%   \midrule
%   \endhead
%   \midrule
%   \endfoot
%   \bottomrule
%   \endlastfoot
%   \showcase{a} \\
%   \showcase{a(x)} \\
%   \showcase{a_x} \\
%   \showcase{\ax{\angl{K}}} \\
%   \showcase{\ax*{\angln}} \\
%   \showcase{\ax*{P_t}} \\
%   \showcase{\ax*{\angl{T}}} \\
%   \showcase{\ax*{x}} \\
%   \showcase{\ax*{r}[h]} \\
%   \showcase{\ax*{x + t}[i]} \\
%   \showcase{\ax*{x + t}[r]} \\
%   \showcase{\ax**{\angl{K + 1}}} \\
%   \showcase{\ax**{x}[(m)]} \\
%   \showcase{\aringx{x}[(m)]} \\
%   \showcase{\ax**{x}[\{m\}]} \\
%   \showcase{\ax**[j]{x}} \\
%   \showcase{\ax**[*]{x}} \\
%   \showcase{\ax{\endowxn}} \\
%   \showcase{\ax*{\endowxn}} \\
%   \showcase{\ax**{\endowxn}} \\
%   \showcase{\ax**{\endowxn}[(m)]} \\
%   \showcase{\aringx{\endowxn}[(m)]} \\
%   \showcase{\ax**{\endowxn}[\{m\}]} \\
%   \showcase{\ax*{\joint\endowxn}} \\
%   \showcase{\ax*[][2]{\endowxn}} \\
%   \showcase{\ax[n|]{x}} \\
%   \showcase{\ax*[n|]{x}} \\
%   \showcase{\ax**[n|]{x}} \\
%   \showcase{\ax**[n|]{x}[(m)]} \\
%   \showcase{\ax*{xy|z}[1]} \\
%   \showcase{\ax**{xy}[(m)]} \\
%   \showcase{\ax**{xy:\angln}} \\
%   \showcase{\ax**[][2]{xy:\angln}} \\
%   \showcase{\ax*{x|y}} \\
%   \showcase{\ax*{\joint{x_1 x_2 x_3}}} \\
%   \showcase{\twoletsymb[0.6pt]{a}{A}(x)} \\
%   \showcase{\twoletsymb[0.6pt]{a}{A}_t} \\
%   \showcase{\twoletsymb[0.3pt]{a}{C}_t} \\
%   \showcase{\twoletsymb[0.6pt]{a}{F}_t} \\
%   \showcase{\twoletsymb[0.6pt]{a}{U}_t} \\
%   \showcase{\twoletsymb[0.6pt]{a}{V}(x)} \\
%   \showcase{\twoletsymb[0.6pt]{a}{V}_t} \\
%   \showcase{A(h)} \\
%   \showcase{A_t} \\
%   \showcase{\Ax{x}} \\
%   \showcase{\Ax*{x}} \\
%   \showcase{\Ax{x}[(m)]} \\
%   \showcase{\Ax*{x}[\text{PR}]} \\
%   \showcase{\Ax{\termxn}} \\
%   \showcase{\Ax{\endowxn}} \\
%   \showcase{\Ax*{\endowxn}} \\
%   \showcase{\Ax{\pureendowxn}} \\
%   \showcase{\Ax[j]{x}} \\
%   \showcase{\Ax[*]{x}} \\
%   \showcase{\Ax*{\termxn}} \\
%   \showcase{\actsymb{\tilde{A}}{\termxn}} \\
%   \showcase{\Ax[][2]{\pureendowxn}} \\
%   \showcase{\Ax[][2]{\termxn}} \\
%   \showcase{\Ax*[m|]{x}} \\
%   \showcase{\Ax*[m|n]{x}} \\
%   \showcase{\Ax{xy}} \\
%   \showcase{\Ax{\joint{xy}}} \\
%   \showcase{\Ax{xy}[(m)]} \\
%   \showcase{\Ax*{x\iitop{y}}} \\
%   \showcase{\Ax*{\itop{x}y}} \\
%   \showcase{\Ax{xy:\angln}} \\
%   \showcase{\Ax*{\itop{\joint{xy}}:\angln}} \\
%   \showcase{\Ax[][2]{xy:\angln}} \\
%   \showcase{\Ax*{wx\iitop{y}}} \\
%   \showcase{\Ax*{\joint{x_1 x_2 x_3}}} \\
%   \showcase{\actsymb[k]{\mathit{AS}}{}} \\
%   \showcase{\actsymb[k]{\widehat{\mathit{AS}}}{}} \\
%   \showcase{\twoletsymb[0pt]{A}{S}_{x + h}} \\
%   \showcase{(\mathit{AAI})} \\
%   \addlinespace
%   \showcase{\beta} \\
%   \showcase{\bar{\beta}} \\
%   \showcase{\Gamma(\alpha)} \\
%   \showcase{b(u)} \\
%   \showcase{b_j} \\
%   \showcase{b_t} \\
%   \showcase{b_f(t)} \\
%   \showcase{B_t} \\
%   \showcase{\hat{B}_{x + k}} \\
%   \showcase{\hat{B}_{x + t}^{(3)}} \\
%   \showcase{\hat{B}_{x + t}^{(j)}} \\
%   \showcase{\actsymb[h]{\mathit{BP}}{}} \\
%   \addlinespace
%   \showcase{c} \\
%   \showcase{c_k} \\
%   \showcase{\hat{c}_k} \\
%   \showcase{c(t)} \\
%   \showcase{C_1} \\
%   \showcase{C_2} \\
%   \showcase{C_3} \\
%   \showcase{C_h} \\
%   \showcase{\actsymb[k]{\mathit{CV}}{}} \\
%   \addlinespace
%   \showcase{\dx{x}[(j)]} \\
%   \showcase{\dx[n]{x}} \\
%   \showcase{\dx[n]{x}[(j)]} \\
%   \showcase{\dx[n]{x}[(\tau)]} \\
%   \showcase{\actsymb[t]{D}{j}} \\
%   \showcase{\actsymb[k + 1]{D}{}} \\
%   \showcase{\DA_{\termxn}} \\
%   \showcase{\DA*_{\termxn}} \\
%   \showcase{\Dx[n]{x}} \\
%   \showcase{\Dx[n]{x}[(j)]} \\
%   \showcase{\Dx[n]{x}[(\tau)]} \\
%   \addlinespace
%   \showcase{e} \\
%   \showcase{e_{h - 1}} \\
%   \showcase{e_x} \\
%   \showcase{\eringx{x}} \\
%   \showcase{\hat{e}_k} \\
%   \showcase{\eringx{\endowxn}} \\
%   \showcase{e_{xy}} \\
%   \showcase{e_{\joint{xy}}} \\
%   \showcase{\mathrm{E}} \\
%   \showcase{E} \\
%   \showcase{E_0} \\
%   \showcase{\Ex[n]{x}} \\
%   \showcase{\twoletsymb[0.6pt]{E}{S}_{x + h + t}} \\
%   \showcase{\mathit{ELRA}} \\
%   \addlinespace
%   \showcase{f} \\
%   \showcase{f(u, t)} \\
%   \showcase{f_S(s)} \\
%   \showcase{F_X(x)} \\
%   \showcase{F_t} \\
%   \showcase{F^{(k)}} \\
%   \showcase{F_S(s)} \\
%   \showcase{\actsymb[k]{F}{}} \\
%   \addlinespace
%   \showcase{G} \\
%   \showcase{\hat{G}} \\
%   \showcase{G(b)} \\
%   \showcase{G(b)} \\
%   \showcase{G(x; \alpha, \beta)} \\
%   \addlinespace
%   \showcase{h(x)} \\
%   \showcase{H(r)} \\
%   \showcase{H(x; \alpha, \beta, x_0)} \\
%   \showcase{\actsymb[u]{\twoletsymb{h}{p}}{x + t}[(\tau)]} \\
%   \showcase{\actsymb{\twoletsymb{h}{\mu}}{x + t}[(j)](u)} \\
%   \addlinespace
%   \showcase{i'_{k + 1}} \\
%   \showcase{\hat{\imath}_{k + 1}} \\
%   \showcase{i(s, s + t)} \\
%   \showcase{I_k} \\
%   \showcase{I_d} \\
%   \showcase{I_d(x)} \\
%   \showcase{\actsymb[j]{i}{k}} \\
%   \showcase{\IA_x} \\
%   \showcase{\IA*_x} \\
%   \showcase{\IbA*_x} \\
%   \showcase{\ImA*_x} \\
%   \showcase{\IA_{\termxn}} \\
%   \addlinespace
%   \showcase{J} \\
%   \showcase{j(s, s + t, s + u)} \\
%   \addlinespace
%   \showcase{\actsymb[t]{\bar{k}}{x}} \\
%   \showcase{K} \\
%   \showcase{K(x)} \\
%   \showcase{K(xy)} \\
%   \showcase{K(\joint{xy})} \\
%   \addlinespace
%   \showcase{\lx{x}} \\
%   \showcase{\lx{[x] + k}} \\
%   \showcase{\lx{x}[(\tau)]} \\
%   \showcase{l(x, u)} \\
%   \showcase{l_f(x, u)} \\
%   \showcase{L} \\
%   \showcase{L_1} \\
%   \showcase{L_x} \\
%   \showcase{L(h)} \\
%   \showcase{\actsymb[t]{L}{}} \\
%   \showcase{\actsymb[t]{L}{}[\underline{2}]} \\
%   \showcase{\actsymb[t]{L}{e}} \\
%   \showcase{\actsymb[t]{L}{e}[\underline{2}]} \\
%   \showcase{\mathcal{L}(x)} \\
%   \showcase{\Lx{x}[(\tau)]} \\
%   \addlinespace
%   \showcase{m(x)} \\
%   \showcase{m_x} \\
%   \showcase{m_x^{(j)}} \\
%   \showcase{m_x^{(\tau)}} \\
%   \showcase{m_x^{\prime (j)}} \\
%   \showcase{\mathrm{M}_X(t)} \\
%   \showcase{M(x)} \\
%   \addlinespace
%   \showcase{n(u)} \\
%   \showcase{N} \\
%   \showcase{N(t)} \\
%   \addlinespace
%   \showcase{p(j)} \\
%   \showcase{p(x)} \\
%   \showcase{p_k} \\
%   \showcase{\px{[x] + r}} \\
%   \showcase{p^{*n}(x)} \\
%   \showcase{\px[t]{x}} \\
%   \showcase{\px[t]{x}[(\tau)]} \\
%   \showcase{\px[t]{x}[\prime (j)]} \\
%   \showcase{\px[t]{xy}} \\
%   \showcase{\px[t]{\joint{xy}}} \\
%   \showcase{\px[u]{\joint{xy} + t}} \\
%   \showcase{\px[t]{\joint{x_1 x_2}\nthtop{k}{\joint{x_3}}}} \\
%   \showcase{P(x)} \\
%   \showcase{P(s, t)} \\
%   \showcase{P_t} \\
%   \showcase{\actsymb[][T]{P}{t}} \\
%   \showcase{P^a} \\
%   \showcase{P_x} \\
%   \showcase{\Px[j]{x}} \\
%   \showcase{\Px[*]{x}} \\
%   \showcase{\Px{\endowxn}[A]} \\
%   \showcase{\Px{\endowxn}} \\
%   \showcase{\Px{\joint{xy}}} \\
%   \showcase{\Px{\:\termxn}} \\
%   \showcase{\Px{\pureendowxn}} \\
%   \showcase{P^{*n}(x)} \\
%   \showcase{\Px[h]{x}} \\
%   \showcase{\Px[h]{\endowxn}} \\
%   \showcase{\twoletsymb[0.6pt]{P}{a}(x)} \\
%   \showcase{\twoletsymb[0.6pt]{P}{a}_t} \\
%   \showcase{\premium{\Ax*{\endowxn}}} \\
%   \showcase{\premium{\ax**[n|]{x}}} \\
%   \showcase{\premium{\ax*[n|]{x}}} \\
%   \showcase{\premium{\Ax*{x}}[(m)]} \\
%   \showcase{\premium{\Ax*{x}}[\{m\}]} \\
%   \showcase{\premium{\Ax*{x}[\text{PR}]}} \\
%   \showcase{\premium*{\Ax*{\endowxn}}} \\
%   \showcase{\premium*{\Ax*{\termxn}}} \\
%   \showcase{\premium*{\Ax*{\pureendowxn}}} \\
%   \showcase{\premium{\Ax*{\endowxn}}[(m)]} \\
%   \showcase{\premium{\Ax*{\termxn}}[(m)]} \\
%   \showcase{\premium*[h]{\Ax*{x}}} \\
%   \showcase{\premium*[h]{\Ax*{\endowxn}}} \\
%   \showcase{\premium[h]{\Ax*{x}}[(m)]} \\
%   \showcase{\premium[h]{\Ax*{\endowxn}}[(m)]} \\
%   \showcase{\premium[h]{\Ax*{\endowxn}}[\{m\}]} \\
%   \addlinespace[3pt]
%   \showcase{\premium{\Ax*{\joint{xy}\iitop{\joint{z}}}}} \\
%   \showcase{\premium{\Ax*{\ibottom{x}\iitop{y}z}}} \\
%   \addlinespace[3pt]
%   \showcase{\tilde{P}_{\:\termxn}} \\
%   \addlinespace
%   \showcase{\qx{[x] + r}} \\
%   \showcase{\qx{x}[(d)]} \\
%   \showcase{\qx{x}[(i)]} \\
%   \showcase{\qx{x}[(r)]} \\
%   \showcase{\qx{x}[(w)]} \\
%   \showcase{\actsymb{\hat{q}}{x + k}[(j)]} \\
%   \showcase{\qx{xy}} \\
%   \showcase{\qx[k|]{x}} \\
%   \showcase{\qx[t]{x}} \\
%   \showcase{\qx[t]{x}[(j)]} \\
%   \showcase{\qx[t]{x}[(\tau)]} \\
%   \showcase{\qx[t]{x}[\prime (j)]} \\
%   \showcase{\qx[t|u]{x}} \\
%   \showcase{\qx[n]{\itop{x}y}} \\
%   \showcase{\qx[n]{x\iitop{y}}} \\
%   \showcase{\qx[k|]{xy}} \\
%   \addlinespace[3pt]
%   \showcase{\qx[n]{\ibottom{x}\iitop{y}z}} \\
%   \addlinespace[3pt]
%   \showcase{\qx[\infty]{\ibottom*{x}\iibottom*{y}\iiitop{z}}} \\
%   \addlinespace
%   \showcase{r} \\
%   \showcase{r_C} \\
%   \showcase{r_F} \\
%   \showcase{r_N} \\
%   \showcase{\twoletsymb[0.6pt]{r}{A}_t} \\
%   \showcase{\twoletsymb[0.6pt]{r}{F}_t} \\
%   \showcase{\twoletsymb[0.6pt]{r}{V}_t} \\
%   \showcase{R} \\
%   \showcase{\tilde{R}} \\
%   \showcase{R(x, h, y)} \\
%   \addlinespace
%   \showcase{s(x)} \\
%   \showcase{\sx**{\angln}} \\
%   \showcase{s(x,u)} \\
%   \showcase{\sx*{\endowxn}} \\
%   \showcase{\sx**{\endowxn}} \\
%   \showcase{S} \\
%   \showcase{S(t)} \\
%   \showcase{S_y} \\
%   \showcase{\actsymb[k]{\mathit{SC}}{}} \\
%   \addlinespace
%   \showcase{T} \\
%   \showcase{\tilde{T}} \\
%   \showcase{T_x} \\
%   \showcase{T_{xy}} \\
%   \showcase{T_{\joint{xy}}} \\
%   \addlinespace
%   \showcase{U(t)} \\
%   \showcase{U_t} \\
%   \showcase{\hat{U}{t}} \\
%   \addlinespace
%   \showcase{v_t} \\
%   \showcase{\tilde{v}_n} \\
%   \showcase{V_i} \\
%   \showcase{V_t} \\
%   \showcase{\Vx[k]{x}} \\
%   \showcase{\Vx[k]{\endowxn}} \\
%   \showcase{\Vx[k]{\:\termxn}} \\
%   \showcase{\Vx[k]{\pureendowxn}} \\
%   \showcase{\Vx[k]{x}[\text{FPT}]} \\
%   \showcase{\Vx[t]{\itop{\group{xy}}:\angln}} \\
%   \showcase{\Vx[k][h]{x}} \\
%   \showcase{\Vx[k][h]{\endowxn}} \\
%   \showcase{\Vx[k][h]{\endowxn}[(m)]} \\
%   \showcase{\Vx[k][h]{\endowxn}[\text{Mod}]} \\
%   \showcase{\reserve[k]{\ax**[n|]{x}}} \\
%   \showcase{\reserve*[t]{\ax*[n|]{x}}} \\
%   \showcase{\reserve*[t]{\Ax*{x}}} \\
%   \showcase{\reserve*[t]{\Ax*{\endowxn}}} \\
%   \showcase{\reserve*[t]{\Ax*{\termxn}}} \\
%   \showcase{\reserve*[t]{\Ax*{\pureendowxn}}} \\
%   \showcase{\reserve*[t]{\Ax*{x}}^{\text{Mod}}} \\
%   \showcase{\reserve[t]{\Ax*{\joint{xy}}}} \\
%   \showcase{\reserve[t]{\Ax*{x}}[\{1\}]} \\
%   \showcase{\reserve[k]{\Ax*{x}[\text{PR}]}} \\
%   \showcase{\reserve[k][h]{\Ax{\termxn}}} \\
%   \showcase{\reserve*[t][h]{\Ax*{x}}} \\
%   \showcase{\reserve*[t][h]{\Ax*{\endowxn}}} \\
%   \showcase{\reserve*[t][h]{\Ax*{\endowxn}}[(m)]} \\
%   \addlinespace
%   \showcase{w(x)} \\
%   \showcase{W_i} \\
%   \showcase{W_t} \\
%   \showcase{\Wx[k]{}} \\
%   \showcase{\Wx[k]{x}} \\
%   \showcase{\Wx[k]{\endowxn}} \\
%   \showcase{\Wx[k][h]{x}} \\
%   \showcase{\twoletsymb{W}{a}_t} \\
%   \showcase{\paidup*[k]{\Ax{x}}} \\
%   \showcase{\paidup*[k]{\Ax{\endowxn}}} \\
%   \showcase{\paidup*[k][h]{\Ax{x}}} \\
%   \addlinespace
%   \showcase{(x)} \\
%   \showcase{(x_1 x_2 \dotsm x_m)} \\
%   \showcase{(\joint{x_1 x_2 \dotsm x_m})} \\
%   \addlinespace[9pt]
%   \showcase{\joint{x_1x_2 \dotsm}\nthtop{k}{\joint{x_m}}} \\
%   \addlinespace[9pt]
%   \showcase{\joint{x_1x_2 \dotsm}\nthtop{[k]}{\joint{x_m}}} \\
%   \showcase{X_i} \\
%   \showcase{X(\theta)} \\
%   \addlinespace
%   \showcase{Y} \\
%   \showcase{y(s, s + m)} \\
%   \showcase{Y(t, n)} \\
%   \addlinespace
%   \showcase{z_t}\\
%   \showcase{Z}\\
%   \showcase{\actsymb[m]{Z}{t}}\\
%   \addlinespace
%   \showcase{\alpha} \\
%   \showcase{\alpha(m)} \\
%   \showcase{\bar{\alpha}} \\
%   \showcase{\alpha^{\text{CRVM}}} \\
%   \addlinespace
%   \showcase{\beta} \\
%   \showcase{\beta(m)} \\
%   \showcase{\bar{\beta}} \\
%   \showcase{\beta^{\text{CRVM}}} \\
%   \showcase{\beta(x, u)} \\
%   \addlinespace
%   \showcase{\Gamma(\alpha)} \\
%   \addlinespace
%   \showcase{\delta} \\
%   \showcase{\delta_t} \\
%   \addlinespace
%   \showcase{\theta} \\
%   \addlinespace
%   \showcase{\lambda(t)} \\
%   \showcase{\lambda(t, n)} \\
%   \showcase{\Lambda} \\
%   \showcase{\Lambda_h} \\
%   \addlinespace
%   \showcase{\mu(x)} \\
%   \showcase{\mu_x(t)} \\
%   \showcase{\mu_x^{(d)}}\\
%   \showcase{\mu_x^{(i)}}\\
%   \showcase{\mu_x^{(w)}}\\
%   \showcase{\mu_x^{(j)}(t)}\\
%   \showcase{\mu_x^{(\tau)}(t)}\\
%   \showcase{\mu_{xy}(t)}\\
%   \showcase{\mu_{\joint{xy}}(t)} \\
%   \showcase{\mu(x, u)} \\
%   \addlinespace
%   \showcase{\pi_h} \\
%   \showcase{\pi_t} \\
%   \addlinespace
%   \showcase{\rho} \\
%   \addlinespace
%   \showcase{\tau} \\
%   \addlinespace
%   \showcase{\phi(x)} \\
%   \showcase{\phi(x, u)} \\
%   \addlinespace
%   \showcase{\Psi(u)} \\
%   \showcase{\tilde{\Psi}(u)} \\
%   \showcase{\Psi(u, t)} \\
%   \showcase{\Psi(u; w)} \\
%   \showcase{\tilde{\Psi}(u; w)} \\
%   \addlinespace
%   \showcase{\omega}\\
% \end{longtable}
% \endgroup
%
% \StopEventually{
% \newpage
% \begin{thebibliography}{9}
%   \addcontentsline{toc}{section}{References}
%   \bibitem[{A}merican~{M}athematical {S}ociety(2002)]{amsmath}
%     {A}merican~{M}athematical {S}ociety.
%     \newblock \emph{User's Guide for the amsmath Package}, 2002.
%     \newblock URL \url{https://www.ctan.org/pkg/amsmath/}.
%
%   \bibitem[Bowers et~al.(1997)Bowers, Gerber, Hickman, Jones, and
%     Nesbitt]{Bowers:2e:1997}
%     N.~L. Bowers, H.~U. Gerber, J.~C. Hickman, D.~A. Jones, and C.~J. Nesbitt.
%     \newblock \emph{Actuarial Mathematics}.
%     \newblock Society of Actuaries, Shaumburg, IL, second edition, 1997.
%     \newblock ISBN 0-9389594-6-8.
%
%   \bibitem[Goulet(2017)]{actuarialangle}
%     V. Goulet.
%     \newblock \emph{Actuarial angle symbol for life contingencies and financial
%       mathematics}, 2017.
%     \newblock URL \url{https://www.ctan.org/pkg/actuarialangle/}.
%
%   \bibitem[Høgholm and Madsen(2015)]{mathtools}
%     M. Høgholm and L. Madsen.
%     \newblock \emph{The mathtools package}, 2015.
%     \newblock URL \url{https://www.ctan.org/pkg/mathtools/}.
%
%   \bibitem[Pakin(2015)]{comprehensive}
%     S. Pakin.
%     \newblock \emph{The Comprehensive {\LaTeX} Symbol List}, 2015.
%     \newblock URL \url{https://www.ctan.org/pkg/comprehensive/}.
%
%   \bibitem[Robertson(2007)]{subdepth}
%     W. Robertson.
%     \newblock \emph{Unify subscript depths}, 2007.
%     \newblock URL \url{https://www.ctan.org/pkg/subdepth/}.
%
%   \bibitem[Sharpe(2015)]{rsfso}
%     M. Sharpe.
%     \newblock \emph{An acute script font based on {rsfs}}, 2015.
%     \newblock URL \url{https://www.ctan.org/pkg/rsfso/}.
%
%   \bibitem[Trivedi(2004)]{Trivedi:lifecon:2004}
%     E. Trivedi.
%     \newblock \emph{Life Contingencies' Symbols}, 2004.
%     \newblock \texttt{lifecon} 2.1 User Guide.
%
%   \bibitem[Wolthuis(2004)]{Wolthuis:notation:2004}
%     H. Wolthuis.
%     \newblock International actuarial notation.
%     \newblock In Jozef Teugels and Bj{\o}rn Sundt, editors, \emph{Encyclopedia of
%     Actuarial Science}. Wiley, 2004.
%     \newblock ISBN 978-0-47001250-5.
%     \newblock URL \url{https://onlinelibrary.wiley.com/book/10.1002/9780470012505}.
%   \end{thebibliography}
%   \PrintChanges
% }
%
% \newpage
% \section{Implementation}
% \label{sec:implementation}
%
% This appendix contains the annotated source code of the package.
% Most readers can stop reading here.
%\iffalse
%<*package>
%\fi
%
% \subsection{Required packages}
% \label{sec:implementation:packages}
%
% \begin{macro}{\RequirePackage}
%   The package depends on packages \pkg{amsmath} \citep{amsmath} and
%   \pkg{actuarialangle} \citep{actuarialangle}.
%    \begin{macrocode}
\RequirePackage{amsmath}
\RequirePackage{actuarialangle}
%    \end{macrocode}
% \end{macro}
%
% \subsection{Package options}
% \label{sec:implementation:options}
%
% \begin{macro}{\ifacts@alignpreced}
% \begin{macro}{\ifacts@compactpreced}
%   We define two flags to keep track of the type of alignment for
%   precedence numbers. Both are false by default.
%    \begin{macrocode}
\newif\ifacts@alignpreced   \acts@alignprecedfalse
\newif\ifacts@compactpreced \acts@compactprecedfalse
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \begin{macro}{\DeclareOption}
%   Declaration of the package options and processing.
%    \begin{macrocode}
\DeclareOption{alignpreced}{\acts@alignprecedtrue}
\DeclareOption{compactpreced}{\acts@compactprecedtrue}
\ProcessOptions
%    \end{macrocode}
% \end{macro}
%
% \subsection{Actuarial symbol}
% \label{sec:implementation:actsymb}
%
% We face three main challenges when trying to compose actuarial
% symbols: position a subscript and a superscipt to the left of a main
% symbol; ensure that the left and right subscripts and superscripts
% are vertically aligned; maintain consistency with the placement of
% subscripts and superscripts elsewhere in the document.
%
% \subsubsection{User level and parsing commands}
% \label{sec:implementation:actsymb:user}
%
% \begin{macro}{\actsymb}
%   We first define the user level command.
%    \begin{macrocode}
\DeclareRobustCommand{\actsymb}{\acts@actsymb}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\acts@actsymb}
% \begin{macro}{\acts@@actsymb}
% \begin{macro}{\acts@@@actsymb}
% \begin{macro}{\acts@@@@actsymb}
%   With its unusual syntax, \cmd{\actsymb} requires four parsing
%   macros to pass the arguments to the actual workhorse
%   \cmd{\@actsymbol}.
%   \changes{1.1}{2019-01-08}{Use \pkg{amsmath}'s \cmd{\new@ifnextchar}.}
%    \begin{macrocode}
\newcommand*\acts@actsymb{%
  \new@ifnextchar[{\acts@@actsymb}%
                  {\acts@@actsymb[]}}
\newcommand*\acts@@actsymb{}
\def\acts@@actsymb[#1]{%
  \new@ifnextchar[{\acts@@@actsymb[#1]}%
                  {\acts@@@actsymb[#1][]}}
\newcommand*\acts@@@actsymb{}
\def\acts@@@actsymb[#1][#2]{%
  \new@ifnextchar[{\acts@@@@actsymb[#1][#2]}%
                  {\acts@@@@actsymb[#1][#2][]}}
\newcommand*\acts@@@@actsymb{}
\def\acts@@@@actsymb[#1][#2][#3]#4#5{%
  \new@ifnextchar[{\@actsymbol[#1][#2][#3]{#4}{#5}}%
                  {\@actsymbol[#1][#2][#3]{#4}{#5}[]}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \subsubsection{Symbol construction}
% \label{sec:implementation:actsymb:workhorse}
%
% \begin{macro}{\@actsymbol}
%   We now define the workhorse to compose an actuarial symbol
%   allowing for auxiliary symbols on all four corners around a
%   principal symbol. The macro \cmd{\@actsymbol} has the following
%   six arguments, using the notation from of the schematics
%   representations \eqref{schema1} and \eqref{schema2}:
%   \begin{enumerate}[nosep]
%   \item lower left subscript \fbox{\small I}\,; may be empty;
%   \item upper left superscript \fbox{\small II}\,; may be empty;
%   \item symbol $P$; when empty a standard symbol is
%     typeset;
%   \item principal symbol $S$; assumed present;
%   \item lower right subscript \fbox{\small III}\,; assumed present;
%   \item upper right superscript \fbox{\small IV}\,; may be empty.
%   \end{enumerate}
%   The definition below is heavily inspired by the code of
%   \cmd{\prescript} from the package \pkg{mathtools} \citep{mathtools}
%   which, as reported by the author, is itself based on a posting to
%   |comp.text.tex| by Michael J.~Downes. Some of the comments below
%   are still his.
%    \begin{macrocode}
\newcommand*\@actsymbol{}
\def\@actsymbol[#1][#2][#3]#4#5[#6]{%
%    \end{macrocode}
%   We put symbol $P$ and all subscripts and superscript into
%   horizontal boxes using \cmd{\@mathmeasure} of the package \pkg{amsmath}.
%   \changes{1.1}{2019-01-08}{Use local box registers.}
%    \begin{macrocode}
  \@mathmeasure\z@\displaystyle{#3}%
  \@mathmeasure\tw@\scriptstyle{#1}%
  \@mathmeasure4\scriptstyle{#2}%
  \@mathmeasure6\scriptstyle{#5}%
  \@mathmeasure8\scriptstyle{#6}%
%    \end{macrocode}
%   Do not let a preceding mathord symbol approach without any
%   intervening space.
%    \begin{macrocode}
  \mathord{}%
%    \end{macrocode}
%   Right align the left subscript and superscript (if there is a
%   superscript) by adjusting the width of their horizontal boxes.
%    \begin{macrocode}
  \ifdim \wd4>\z@ \ifdim \wd4>\wd\tw@
    \setbox\tw@\hbox to\wd4{\hfil\unhbox\tw@}%
  \else
    \setbox4\hbox to\wd\tw@{\hfil\unhbox4}%
  \fi\fi
%    \end{macrocode}
%   Bottom align the left and right subscripts by making their heights
%   equal.
%    \begin{macrocode}
  \ifdim \ht\tw@>\ht6
    \ht6=\ht\tw@
  \else
    \ht\tw@=\ht6%
  \fi
%    \end{macrocode}
%   Actual symbol construction. First the case where there is at least
%   one superscript (the nested conditionals emulate an OR condition).
%    \begin{macrocode}
  \ifnum\ifdim \wd4>\z@ 1\else\ifdim \wd8>\z@ 1\else 0\fi\fi
    =1 %
%    \end{macrocode}
%   To ensure equal spacing with the subscripts on both sides of the
%   principal symbol, make the depths of the left and right
%   supercripts equal.
%    \begin{macrocode}
    \ifdim \dp4>\dp8 \dp8=\dp4\else \dp4=\dp8\fi
%    \end{macrocode}
%   Typesetting of the left subscript and superscript. Use
%   \cmd{\mathopen} to suppress space between those and the principal
%   symbol even when the latter is not of type ord. (We use
%   |\textstyle| inside |\vphantom| to avoid bad positioning of
%   subscripts with \XeTeX; see
%   \href{https://tex.stackexchange.com/q/374771/24355}{^^A
%     the discussion} on StackExchange for details.)
%   \changes{1.0a}{2017-06-14}{Fix left subscript positioning with xetex.}
%    \begin{macrocode}
    \mathopen{\vphantom{\textstyle #4}\sp{\box4}\sb{\box\tw@}}%
%    \end{macrocode}
%   Typesetting of the principal symbol and the right subscript and
%   superscript. The principal symbol is either a principal symbol alone
%   or a premium (or reserve, or paid-up insurance) symbol and a benefit symbol
%   between parentheses. In
%   the latter case, we make sure to align the subscripts and
%   superscripts only around the premium symbol.
%    \begin{macrocode}
    \ifdim\wd\z@=\z@
      #4\sp{\box8}\sb{\box6}%
    \else
      #3\sp{\box8}\sb{\vphantom{\copy6}}(#4\sb{\box6})%
    \fi
  \else
%    \end{macrocode}
%   Same ideas as above in the simpler case without superscripts. That
%   way, {\TeX}'s default placement of subscripts and superscripts is
%   maintained.
%    \begin{macrocode}
    \mathopen{\vphantom{\textstyle #4}\sb{\box\tw@}}%
    \ifdim\wd\z@=\z@
      #4\sb{\box6}%
    \else
      #3(#4\sb{\box6})%
    \fi
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Shortcuts for basic symbols of life tables, insurance and annuities}
% \label{sec:implementation:actsymb:principalsc}
%
% \begin{macro}{\@actinssc}
% \begin{macro}{\@actannsc}
% \begin{macro}{\@actothersc}
% \begin{macro}{\acts@actsc}
% \begin{macro}{\acts@@actsc}
% \begin{macro}{\acts@@@actsc}
%   We first define the internal macros and parsing macros used to
%   define shortcuts for insurance benefits (\cmd{\@actinssc}),
%   annuity benefits (\cmd{\@actannsc}) and simple symbols
%   (\cmd{\@actothersc}).
%    \begin{macrocode}
\newcommand*\@actinssc[1]{%
  \@ifstar{\acts@actsc{\bar{#1}}}%
          {\acts@actsc{#1}}}
\newcommand*\@actannsc[1]{%
  \@ifstar{\@ifstar{\acts@actsc{\ddot{#1}}}%
                   {\acts@actsc{\bar{#1}}}}%
          {\acts@actsc{#1}}}
\newcommand*\acts@actsc[1]{%
  \new@ifnextchar[{\acts@@actsc{#1}}%
                  {\acts@@actsc{#1}[]}}
\newcommand*\@actothersc{}
\let\@actothersc\acts@actsc
\newcommand*\acts@@actsc{}
\def\acts@@actsc#1[#2]{%
  \new@ifnextchar[{\acts@@@actsc{#1}[#2]}%
                  {\acts@@@actsc{#1}[#2][]}}
\newcommand*\acts@@@actsc{}
\def\acts@@@actsc#1[#2][#3]#4{%
  \new@ifnextchar[{\@actsymbol[#2][#3][]{#1}{#4}}%
                  {\@actsymbol[#2][#3][]{#1}{#4}[]}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \begin{macro}{\DeclareRobustCommand}
%   We can now define all the shortcuts of \autoref{tab:principal}.
%    \begin{macrocode}
\DeclareRobustCommand{\lx}{\@actothersc\ell}
\DeclareRobustCommand{\Lx}{\@actothersc{\mathcal{L}}}
\DeclareRobustCommand{\dx}{\@actothersc d}
\DeclareRobustCommand{\Dx}{\@actothersc{\mathcal{D}}}
\DeclareRobustCommand{\px}{\@actothersc p}
\DeclareRobustCommand{\qx}{\@actothersc q}
\DeclareRobustCommand{\Ax}{\@actinssc A}
\DeclareRobustCommand{\Ex}{\@actinssc E}
\DeclareRobustCommand{\ax}{\@actannsc a}
\DeclareRobustCommand{\sx}{\@actannsc s}
\DeclareRobustCommand{\aringx}{\@actothersc{\mathring{a}}}
\DeclareRobustCommand{\eringx}{\@actothersc{\mathring{e}}}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Shortcuts for premiums, reserves and paid-up insurance}
% \label{sec:implementation:actsymb:premressc}
%
% \begin{macro}{\@actpremres}
% \begin{macro}{\acts@actpremres}
% \begin{macro}{\acts@@actpremres}
% \begin{macro}{\acts@@@actpremres}
%   Not unlike above, we first define the internal and parsing macros
%   used to create shortcut for premiums, reserves and paid-up insurance
%   symbols.
%    \begin{macrocode}
\newcommand*\@actpremres[1]{%
  \@ifstar{\acts@actpremres{\bar{#1}}}%
          {\acts@actpremres{#1}}}
\newcommand*\acts@actpremres[1]{%
  \new@ifnextchar[{\acts@@actpremres{#1}}%
                  {\acts@@actpremres{#1}[]}}
\newcommand*\acts@@actpremres{}
\def\acts@@actpremres#1[#2]{%
  \new@ifnextchar[{\acts@@@actpremres{#1}[#2]}%
                  {\acts@@@actpremres{#1}[#2][]}}
\newcommand*\acts@@@actpremres{}
\def\acts@@@actpremres#1[#2][#3]#4{%
  \new@ifnextchar[{\@actsymbol[#2][#3][#1]{{#4}}{}}%
                  {\@actsymbol[#2][#3][#1]{{#4}}{}[]}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \begin{macro}{\DeclareRobustCommand}
%   Then we can define the shortcuts of \autoref{tab:premres}.
%    \begin{macrocode}
\DeclareRobustCommand{\Px}{\@actothersc P}
\DeclareRobustCommand{\Vx}{\@actothersc V}
\DeclareRobustCommand{\Wx}{\@actothersc W}
\DeclareRobustCommand{\premium}{\@actpremres P}
\DeclareRobustCommand{\reserve}{\@actpremres V}
\DeclareRobustCommand{\paidup}{\@actpremres W}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Shortcuts for auxiliary symbols}
% \label{sec:implementation:actsymb:auxsc}
%
% \begin{macro}{\DeclareRobustCommand}
%   Here we define the shortcuts for common auxiliary symbols listed in
%   \autoref{tab:aux}. Command \cmd{\joint} is simply defined as an
%   alias of \cmd{\overline}.
%   \changes{1.1}{2019-01-08}{The colons used here are not \cmd{\mathrel}'s.}
%    \begin{macrocode}
\DeclareRobustCommand{\term}[2]{\itop{#1}{:}\angl{#2}}
\DeclareRobustCommand{\termxn}{{\itop{x}{:}\angln}}
\DeclareRobustCommand{\pureendow}[2]{#1{:}\itop{\angl{#2}}}
\DeclareRobustCommand{\pureendowxn}{{x{:}\itop{\angln}}}
\DeclareRobustCommand{\endow}[2]{#1{:}\angl{#2}}
\DeclareRobustCommand{\endowxn}{{x{:}\angln}}
\let\joint\overline
%    \end{macrocode}
% \end{macro}
%
% \subsection{Two-letter symbols}
% \label{sec:implementation:twoletsymb}
%
% \begin{macro}{\twoletkern}
% \begin{macro}{\twoletsymb}
%   The definition of the user level command \cmd{\twoletsymb} is
%   pretty straighforward.
%   \changes{1.1}{2019-01-08}{Use relative length.}
%    \begin{macrocode}
\newlength{\twoletkern}
\setlength{\twoletkern}{0.1em}
\DeclareRobustCommand{\twoletsymb}[3][\twoletkern]{(#2\kern-#1#3)}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \begin{macro}{\@twoletinssc}
% \begin{macro}{\@twoletannsc}
%   Following the same lines as above, we define two internal macros
%   to create shortcuts for two-letter insurance and annuity benefit
%   symbols.
%    \begin{macrocode}
\newcommand*\@twoletinssc[3][\twoletkern]{%
  \@ifstar{\twoletsymb[#1]{#2}{\bar{#3}}}%
          {\twoletsymb[#1]{#2}{#3}}}
\newcommand*\@twoletannsc[3][\twoletkern]{%
  \@ifstar{\@ifstar{\twoletsymb[#1]{#2}{\ddot{#3}}}%
                   {\twoletsymb[#1]{#2}{\bar{#3}}}}%
          {\twoletsymb[#1]{#2}{#3}}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \begin{macro}{\newcommand*}
%   Follow the shortcuts of \autoref{tab:twoletsymb}. Note that we
%   used a smaller negative kerning adjustment for symbols annuity
%   symbols.
%    \begin{macrocode}
\newcommand*{\IA}{\@twoletinssc IA}
\newcommand*{\IbA}{\@twoletinssc{\bar{I}}A}
\newcommand*{\ImA}{\@twoletinssc{I^{(m)}}A}
\newcommand*{\DA}{\@twoletinssc DA}
\newcommand*{\DbA}{\@twoletinssc{\bar{D}}A}
\newcommand*{\DmA}{\@twoletinssc{D^{(m)}}A}
\newcommand*{\Ia}{\@twoletannsc[0.5\twoletkern]Ia}
\newcommand*{\Is}{\@twoletannsc[0.5\twoletkern]Is}
\newcommand*{\Da}{\@twoletannsc[0.5\twoletkern]Da}
\newcommand*{\Ds}{\@twoletannsc[0.5\twoletkern]Ds}
%    \end{macrocode}
% \end{macro}
%
% \subsection{Precedence numbers}
% \label{sec:implementation:preced}
%
% The system of precedence numbers builds on a backbone that used to
% be part of the package \pkg{actuarialangle}. The original author of the code is
% unknown. Some of the comments on \cmd{\@precedence}, below, are his
% or hers.
%
% \subsubsection{User level lengths and commands}
% \label{sec:implementation:preced:user}
%
% \begin{macro}{\nthtopsep}
% \begin{macro}{\nthtopskip}
% \begin{macro}{\nthbottomsep}
% \begin{macro}{\nthbottomskip}
%   Let us start by defining the lengths needed to position the
%   precedence numbers above or below the statuses.
%   \changes{1.1}{2019-01-08}{Use relative lengths.}
%    \begin{macrocode}
\newlength{\nthtopsep}
\setlength{\nthtopsep}{0.18em}
\newlength{\nthtopskip}
\setlength{\nthtopskip}{0.64em}
\newlength{\nthbottomsep}
\setlength{\nthbottomsep}{0.18em}
\newlength{\nthbottomskip}
\setlength{\nthbottomskip}{0.82em}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \begin{macro}{\nthtop}
% \begin{macro}{\nthbottom}
%   Next up are the two user level commands and the internal commands
%   that call the workhorse \cmd{\@precedence}.
%    \begin{macrocode}
\DeclareRobustCommand{\nthtop}{\@ifstar\@varnthtop\@nthtop}
\DeclareRobustCommand{\nthbottom}{\@ifstar\@varnthbottom\@nthbottom}
\newcommand*{\@nthtop}[3][\nthtopsep]{%
  \mathpalette{\@precedence t\z@{#1}{#2}}{#3}}
\newcommand*{\@varnthtop}[3][\nthtopskip]{%
  \mathpalette{\@precedence t{#1}\z@{#2}}{#3}}
\newcommand*{\@nthbottom}[3][\nthbottomsep]{%
  \mathpalette{\@precedence b\z@{#1}{#2}}{#3}}
\newcommand*{\@varnthbottom}[3][\nthbottomskip]{%
  \mathpalette{\@precedence b{#1}\z@{#2}}{#3}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\@nthtop}
% \begin{macro}{\@nthbottom}
%   With the internal commands defined we can now process the package
%   options. Option |alignpreced| makes the internal macros
%   \cmd{\@nthtop} and \cmd{\@nthbottom} equivalent to
%   \cmd{\@varnthtop} and \cmd{\@varnthbottom}, respectively.
%    \begin{macrocode}
\ifacts@alignpreced
  \let\@nthtop\@varnthtop
  \let\@nthbottom\@varnthbottom
\fi
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \begin{macro}{\@varnthtop}
% \begin{macro}{\@varnthbottom}
%   Option |compactpreced| does the opposite.
%   \changes{1.1}{2019-01-08}{Add missing \texttt{@}'s in macro names.}
%    \begin{macrocode}
\ifacts@compactpreced
  \let\@varnthtop\@nthtop
  \let\@varnthbottom\@nthbottom
\fi
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \subsubsection{Number and status positioning}
% \label{sec:implementation:preced:workhorse}
%
% \begin{macro}{\@precedence}
%   We now define the workhorse to position precedence numbers above
%   or below statuses, smashed so that the height of the auxiliary
%   symbol containing the call remains unaffected. The macro
%   \cmd{\@precedence} has the following six arguments:
%   \begin{enumerate}[nosep]
%   \item |t| for top or |b| for bottom;
%   \item baseline skip between the top and bottom symbols;
%   \item spacing between the top and bottom symbols;
%   \item first argument from the user;
%   \item one of math style selecting commands (\cmd{\displaystyle},
%     \cmd{\textstyle}, \cmd{\scriptstyle}, \cmd{\scriptscriptstyle})
%     from \cmd{\mathpalette};
%   \item second argument given by the user.
%   \end{enumerate}
%   This peculiar ordering of the arguments is done to work around the
%   restriction of \cmd{\mathpalette} that it only reads two
%   arguments.
%    \begin{macrocode}
\newcommand*\@precedence[6]{%
  \setbox\tw@\hbox{$\m@th#5#4$}%
  \setbox\z@\hbox{$\m@th#5#6$}%
  \dimen@\wd\z@
  \vbox to\ht\z@{%
    \baselineskip=#2%
    \lineskip=#3%
    \lineskiplimit\lineskip
    \if b#1\relax\box\z@\else\vss\fi
    \hbox to\dimen@{\hss\unhbox\tw@\hss}%
    \if t#1\relax\box\z@\else\vss\fi
  }%
}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Shortcuts and aliases}
% \label{sec:implementation:preced:shortcuts}
%
% \begin{macro}{\DeclareRobustCommand}
%   We finish off by defining the shortcuts and aliases of
%   \autoref{tab:preced}.
%    \begin{macrocode}
\DeclareRobustCommand{\firsttop}{%
  \@ifstar{\@varnthtop{1}}{\@nthtop{1}}}
\DeclareRobustCommand{\secondtop}{%
  \@ifstar{\@varnthtop{2}}{\@nthtop{2}}}
\DeclareRobustCommand{\thirdtop}{%
  \@ifstar{\@varnthtop{3}}{\@nthtop{3}}}
\DeclareRobustCommand{\firstbottom}{%
  \@ifstar{\@varnthbottom{1}}{\@nthbottom{1}}}
\DeclareRobustCommand{\secondbottom}{%
  \@ifstar{\@varnthbottom{2}}{\@nthbottom{2}}}
\DeclareRobustCommand{\thirdbottom}{%
  \@ifstar{\@varnthbottom{3}}{\@nthbottom{3}}}
\let\itop\firsttop
\let\iitop\secondtop
\let\iiitop\thirdtop
\let\ibottom\firstbottom
\let\iibottom\secondbottom
\let\iiibottom\thirdbottom
%    \end{macrocode}
% \end{macro}
% \iffalse
%</package>
%\fi
%
% \Finale
% \obeyspaces
% \typeout{*************************************************************}
% \typeout{*                                                           *}
% \typeout{* To finish the installation you have to move the following *}
% \typeout{* file into a directory searched by TeX:                    *}
% \typeout{*                                                           *}
% \typeout{*  actuarialsymbol.sty                                      *}
% \typeout{*                                                           *}
% \typeout{* To produce the documentation, run actuarialsymbol.dtx     *}
% \typeout{* through LaTeX.                                            *}
% \typeout{*                                                           *}
% \typeout{* Happy actuarial TeXing!                                   *}
% \typeout{*                                                           *}
% \typeout{*************************************************************}
%
% ^^A Local Variables:
% ^^A mode: doctex
% ^^A TeX-master: t
% ^^A End:
\endinput