texlive[51376] Master/texmf-dist: actuarialangle (14jun19)

commits+karl at tug.org commits+karl at tug.org
Fri Jun 14 23:06:16 CEST 2019


Revision: 51376
          http://tug.org/svn/texlive?view=revision&revision=51376
Author:   karl
Date:     2019-06-14 23:06:16 +0200 (Fri, 14 Jun 2019)
Log Message:
-----------
actuarialangle (14jun19)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/actuarialangle/README.md
    trunk/Master/texmf-dist/doc/latex/actuarialangle/actuarialangle.pdf
    trunk/Master/texmf-dist/source/latex/actuarialangle/actuarialangle.dtx
    trunk/Master/texmf-dist/tex/latex/actuarialangle/actuarialangle.sty

Modified: trunk/Master/texmf-dist/doc/latex/actuarialangle/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/actuarialangle/README.md	2019-06-13 23:38:19 UTC (rev 51375)
+++ trunk/Master/texmf-dist/doc/latex/actuarialangle/README.md	2019-06-14 21:06:16 UTC (rev 51376)
@@ -1,12 +1,12 @@
 # actuarialangle
 
-Package `actuarialangle` provides commands to typeset the "angle"
+Package **actuarialangle** provides commands to typeset the "angle"
 symbol denoting a duration in actuarial notation, such as in symbols
-for the present value of certain or life annuities and an overhead
-square bracket used to emphasize joint status in symbols of life
+for the present value of certain or life annuities, and an over
+angle bracket used to emphasize joint status in symbols of life
 contingencies.
 
-## Licence
+## License
 
 LaTeX Project Public License, version 1.3c or (at your option) any
 later version.
@@ -13,7 +13,7 @@
 
 ## Version
 
-2.0 (2017-04-10)
+2.1 (2019-06-13)
 
 ## Author
 

Modified: trunk/Master/texmf-dist/doc/latex/actuarialangle/actuarialangle.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/actuarialangle/actuarialangle.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/actuarialangle/actuarialangle.dtx	2019-06-13 23:38:19 UTC (rev 51375)
+++ trunk/Master/texmf-dist/source/latex/actuarialangle/actuarialangle.dtx	2019-06-14 21:06:16 UTC (rev 51376)
@@ -1,6 +1,6 @@
 % \iffalse meta-comment
 %
-% Copyright (C) 2017 Vincent Goulet
+% Copyright (C) 2019 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
@@ -28,7 +28,7 @@
           \ProvidesFile{actuarialangle.dtx}
 %</dtx>
 %<package>\NeedsTeXFormat{LaTeX2e}[2009/09/24]
-%<package>\ProvidesPackage{actuarialangle}[2017/04/10 v2.0 Actuarial angle]
+%<package>\ProvidesPackage{actuarialangle}[2019/06/13 v2.1 Actuarial angle]
 %<*batchfile>
 \begingroup
 \input docstrip.tex
@@ -39,7 +39,7 @@
 
 This is a generated file.
 
-Copyright (C) 2017 Vincent Goulet
+Copyright (C) 2019 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
@@ -91,18 +91,34 @@
   \usepackage{enumitem}
   \setlist[description]{leftmargin=*,align=left}
 
+  %% 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{snugshade*}%
-      \def\producing{\end{snugshade*}\end{minipage}\hfill\begin{minipage}{\dimexpr0.97\linewidth-#1\linewidth}%
+    \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 at y
         \abovedisplayskip3pt \abovedisplayshortskip\abovedisplayskip
         \belowdisplayskip0pt \belowdisplayshortskip\belowdisplayskip
-        \noindent}
+        \noindent}%
     }{%
       \par
       % Ensure that a lonely \[\] structure doesn't take up width less than
@@ -133,26 +149,28 @@
 \end{document}
 %</driver>
 % \fi
-% \CheckSum{126}
+% \CheckSum{281}
 % \changes{v1.0}{2012-10-16}{Initial release.}
-% \changes{v1.1}{2017-02-01}{Various improvements to the README
+% \changes{v1.0a}{2017-02-01}{Various improvements to the README
 %   file, including conversion to markdown format after the project was
 %   moved to GitHub.}
 % \changes{v2.0}{2017-04-09}{Complete new documentation.}
+% \changes{v2.1}{2019-06-13}{Variable extra space, rule thickness and
+%   vertical gap; contributed by Ruixi Zhang.}
 %
 % \GetFileInfo{actuarialangle.sty}
 %
 % \title{Actuarial angle symbol for life contingencies \\
-%   and financial mathematics%
+%   and financial mathematics^^A
 %   \thanks{This document corresponds to
 %   \pkg{actuarialangle}~\fileversion, dated~\filedate.}}
-% \author{Vincent Goulet\thanks{%
+% \author{Vincent Goulet\thanks{^^A
 %   École d'actuariat, Université Laval.} \\
 %   \url{vincent.goulet at act.ulaval.ca}}
 % \maketitle
 %
 % \begin{abstract}
-%   Package \pkg{actuarialangle} provides commands to typeset the
+%   The package \pkg{actuarialangle} provides commands to typeset the
 %   ``angle'' symbol denoting a duration $n$ in actuarial notation, as
 %   in $\angln$, and an overhead angle bracket, as in $\group{xy}$.
 % \end{abstract}
@@ -166,7 +184,7 @@
 % angle bracket (or ``roof'') used to emphasize joint status when
 % ambiguity is possible: $\group{xy}$. The bracket is normally used
 % with a precedence number above. Facilities to position such numbers
-% are provided by package \pkg{actuarialsymbol}
+% are provided by the package \pkg{actuarialsymbol}
 % \citep{actuarialsymbol}.
 %
 % For additional details on actuarial notation for life contingencies,
@@ -184,10 +202,10 @@
 %   between the material under the angle and the right descender; this
 %   was the value used in versions of the package prior to 2.0;
 % \item[\mdseries\ttfamily nobracket] do not define command
-%   \cmd{\overanglebracket}; this option also prevents loading of
-%   package \pkg{pict2e}.
+%   \cmd{\overanglebracket} and its alias \cmd{\group}; this option
+%   also prevents loading of package \pkg{pict2e}.
 % \end{description}
-% We provide option |nobracket| in case the bracket symbol is not
+% We provide the option |nobracket| in case the bracket symbol is not
 % needed and \pkg{pict2e} \citep{pict2e} interferes with other
 % packages. Loading the package with
 % \begin{quote}
@@ -207,7 +225,7 @@
 %   composes an angle symbol around \meta{duration}. This is the
 %   ``raw'' command that does not insert any space between
 %   \meta{duration} and the right descender of the angle. The symbol
-%   scales gracefully if the command is ever used outside of a
+%   scales gracefully if the command is used outside of a
 %   first-level subscript.
 %   \begin{demo}
 %     \begin{texample}
@@ -229,7 +247,7 @@
 %   \end{quote}
 %   In contrast to \cmd{\actuarialangle}, this command inserts some
 %   thin space (by default or with package option |thinspace|) or
-%   thick space (with package option |thinkspace|) between
+%   thick space (with package option |thickspace|) between
 %   \marg{duration} and the right descender.
 %   \begin{demo}
 %     \begin{texample}
@@ -239,7 +257,7 @@
 %       $\angl{n} \quad a_{\angl{n}}$
 %     \end{texample}
 %     \begin{texample}
-%       |% with option thickspace| \\
+%       |% with option thickspace:| \\
 %       |\angl{n} \quad a_{\angl{n}}|
 %       \producing
 %       $\angl{n\mkern1mu} \quad a_{\angl{n\mkern1mu}}$
@@ -261,7 +279,7 @@
 %   \end{quote}
 %   composes an angle bracket (``roof'') above \meta{statuses}. The
 %   rule thickness and spacing relative to the statuses match those of
-%   the angle symbol. Command \cmd{\group} is a convenient alias for
+%   the angle symbol. The command \cmd{\group} is a convenient alias for
 %   \cmd{\overanglebracket}.
 %   \begin{demo}
 %     \begin{texample}
@@ -296,7 +314,7 @@
 %   D.~Beauchemin and V.~Goulet.
 %   \newblock \emph{Actuarial symbols of life contingencies and financial
 %     mathematics}, 2017.
-%   \newblock URL \url{http://www.ctan.org/pkg/actuarialsymbol/}.
+%   \newblock URL \url{https://www.ctan.org/pkg/actuarialsymbol/}.
 %
 %   \bibitem[Bowers et~al.(1997)Bowers, Gerber, Hickman, Jones, and
 %     Nesbitt]{Bowers:2e:1997}
@@ -308,7 +326,7 @@
 %   \bibitem[Gä{\ss}lein et~al.(2016)Gä{\ss}lein, Niepraschk, and Tkadlec]{pict2e}
 %   H.~Gä{\ss}lein, R.~Niepraschk, and J.~Tkadlec.
 %   \newblock \emph{The pict2e package}, 2016.
-%   \newblock URL \url{http://www.ctan.org/pkg/pict2e/}.
+%   \newblock URL \url{https://www.ctan.org/pkg/pict2e/}.
 %   \end{thebibliography}
 %   \PrintChanges
 % }
@@ -356,12 +374,124 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \subsection{Variable extra space, rule thickness and vertical gap}
+%
+% \begin{macro}{\acta at overbarkern@fontdimen}
+% \begin{macro}{\acta at overbarkern@family}
+% \begin{macro}{\acta at overbarrule@fontdimen}
+% \begin{macro}{\acta at overbarrule@family}
+% \begin{macro}{\acta at overbarvgap@fontdimen}
+% \begin{macro}{\acta at overbarvgap@family}
+%   \changes{v2.1}{2019-01-11}{Define fontdimen and family parameters.}
+%   We first deal with Type~1 math fonts. We define the |\fontdimen|'s
+%   and families used for the thickness of the |\overline| rule and the
+%   amount of vertical gap between the rule and the content, as well as
+%   the extra white space above the rule.
+%    \begin{macrocode}
+\def\acta at overbarkern@fontdimen{8}
+\def\acta at overbarkern@family{\thr@@}
+\def\acta at overbarrule@fontdimen{8}
+\def\acta at overbarrule@family{\thr@@}
+\def\acta at overbarvgap@fontdimen{8}
+\def\acta at overbarvgap@family{\thr@@}
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\acta at overbarkern}
+%   \changes{v2.1}{2019-01-11}{Define usable extra space.}
+%   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.
+%    \begin{macrocode}
+\def\acta at overbarkern#1{%
+  \fontdimen\acta at overbarkern@fontdimen
+  \ifx#1\displaystyle
+    \textfont
+  \else
+    \ifx#1\textstyle
+      \textfont
+    \else
+      \ifx#1\scriptstyle
+        \scriptfont
+      \else
+        \scriptscriptfont
+      \fi
+    \fi
+  \fi
+  \acta at overbarkern@family
+}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\acta at overbarrule}
+%   \changes{v2.1}{2019-01-06}{Define usable rule thickness.}
+%   The |\acta at 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.
+%    \begin{macrocode}
+\def\acta at overbarrule#1{%
+  \fontdimen\acta at overbarrule@fontdimen
+  \ifx#1\displaystyle
+    \textfont
+  \else
+    \ifx#1\textstyle
+      \textfont
+    \else
+      \ifx#1\scriptstyle
+        \scriptfont
+      \else
+        \scriptscriptfont
+      \fi
+    \fi
+  \fi
+  \acta at overbarrule@family
+}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\acta at overbarvgap}
+%   \changes{v2.1}{2019-01-06}{Define usable vertical gap.}
+%   The |\acta at overbarvgap| macro is similar. When |\acta at overbarrule@fontdimen|
+%   and |\acta at overbarvgap@fontdimen| coincide, we use three times the
+%   rule thickness as the vertical gap; otherwise we use the different
+%   |\fontdimen| specified by the latter.
+%    \begin{macrocode}
+\def\acta at overbarvgap#1{%
+  \ifx\acta at overbarrule@fontdimen\acta at overbarvgap@fontdimen
+    \thr@@
+  \fi
+  \fontdimen\acta at overbarvgap@fontdimen
+  \ifx#1\displaystyle
+    \textfont
+  \else
+    \ifx#1\textstyle
+      \textfont
+    \else
+      \ifx#1\scriptstyle
+        \scriptfont
+      \else
+        \scriptscriptfont
+      \fi
+    \fi
+  \fi
+  \acta at overbarvgap@family
+}
+%    \end{macrocode}
+% \end{macro}
+%
 % \subsection{Actuarial angle}
 % \label{sec:implementation:actuarialangle}
 %
-% The original author of macros \cmd{\actuarialangle} and
-% |\acta at angle| is unknown. Some of the comments below are his or
-% hers.
+% The code for \cmd{\actuarialangle}, |\acta at angle|,
+% \cs{angl} and the underlying macros were given to the present
+% author by a colleague many years ago. The original author is
+% unknown. Some of the comments below are his or hers.
 %
 % \begin{macro}{\actuarialangle}
 %   We first define the ``raw'' user level command.
@@ -378,32 +508,48 @@
 \def\acta at angle#1#2{%
   \mathord{%
 %    \end{macrocode}
-% Add a bit of preceding space.
+%   Add a bit of preceding space.
+%   \changes{v2.1}{2019-01-02}{Added missing \texttt\%.}
 %    \begin{macrocode}
-    \mkern1mu
+    \mkern1mu%
 %    \end{macrocode}
 %   We need many nested boxes here: first a vbox to stack the horizontal
-%   rule of the angle and the symbol; second an hbox position the symbol
+%   rule (with some extra space on top) of the angle and the symbol;
+%   second an hbox to position the symbol
 %   and the right descender of the angle side-to-side; third a vbox to
 %   insert spacing between the horizontal rule and the symbol.
+%   \changes{v2.1}{2019-01-11}{Variable extra space.}
+%   \changes{v2.1}{2019-01-06}{Variable thickness.}
 %    \begin{macrocode}
-    \vbox{\hrule \hbox{%
+    \vbox{%
+      \kern\acta at overbarkern#1%
+      \hrule \@height\acta at overbarrule#1%
+      \hbox{%
         \vbox{%
 %    \end{macrocode}
-%   The amount of vertical space below is the normal space for
-%   \cmd{\overline} in a subscript.
+%   The amount of vertical gap is the normal space for |\overline|.
+%   \changes{v2.1}{2019-01-06}{Variable gap.}
+%   \changes{v2.1}{2019-01-02}{Moved \cmd{\m at th} in front.}
 %    \begin{macrocode}
-          \kern3\fontdimen8\scriptfont\thr@@
-          \hbox{$#1#2\m at th$}}%
+          \kern\acta at overbarvgap#1%
+          \hbox{$\m at th#1#2$}%
+        }%
 %    \end{macrocode}
-%   Make the right-hand rule extend down to the depth of a parenthesis
+%   Make the right-hand rule extending down to the depth of a parenthesis
 %   even if the symbol under the angle does not have a descender.
+%   \changes{v2.1}{2019-01-06}{Use \cmd{\mathstrut}.}
+%   \changes{v2.1}{2019-01-06}{Variable thickness.}
 %    \begin{macrocode}
-        \setbox\z@\hbox{$#1()$}\vrule depth\dp\z@}}%
+        \setbox\z@\hbox{$#1\mathstrut$}%
+        \vrule \@width\acta at overbarrule#1\@depth\dp\z@
+      }%
+    }%
 %    \end{macrocode}
 %   Finishing touch is a bit of following space.
 %    \begin{macrocode}
-    \mkern1mu}}
+    \mkern1mu%
+  }%
+}
 %    \end{macrocode}
 % \end{macro}
 %
@@ -414,15 +560,17 @@
 %   \changes{v2.0}{2017-04-07}{Added an \cmd{\anglk} shortcut.} %
 %   Finally, we define the main user level function \cmd{\angl} and
 %   shortcuts for common cases.
+%   \changes{v2.1}{2019-01-02}{Use \cmd{\newcommand*} instead of \cmd{\def}.}
+%   \changes{v2.1}{2019-01-02}{No need for extra braces around \texttt{\#1}.}
 %    \begin{macrocode}
 \ifacta at thinspace
-  \def\angl#1{{\actuarialangle{{#1}\mkern1mu}}}
+  \newcommand*\angl[1]{{\actuarialangle{#1\mkern1mu}}}
 \else
-  \def\angl#1{{\actuarialangle{{#1}\mkern2mu}}}
+  \newcommand*\angl[1]{{\actuarialangle{#1\mkern2mu}}}
 \fi
-\def\angln{{\angl n}}
-\def\anglr{{\angl r}}
-\def\anglk{{\angl k}}
+\newcommand*\angln{{\angl n}}
+\newcommand*\anglr{{\angl r}}
+\newcommand*\anglk{{\angl k}}
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
@@ -429,7 +577,7 @@
 % \end{macro}
 % \end{macro}
 %
-% \section{Over angle bracket}
+% \subsection{Over angle bracket}
 % \label{sec:implementation:overanglebracket}
 %
 % The code of this section is executed only if |\acta at bracket| is
@@ -461,50 +609,80 @@
 %    \begin{macrocode}
   \def\acta at anglebracket#1#2{%
 %    \end{macrocode}
+%   \changes{v2.1}{2019-01-06}{Improved construction.}
+%   We construct the whole symbol in the same style as |\acta at angle|,
+%   i.e., a bit of preceding and following space, to prevent clashing
+%   into the trailing colon.
+%    \begin{macrocode}
+    \mathord{%
+      \mkern1mu%
+%    \end{macrocode}
+%   \changes{v2.1}{2019-01-06}{Variable thickness.}
+%   We setup the rule thickness here.
+%    \begin{macrocode}
+      \linethickness{\acta at overbarrule#1}%
+%    \end{macrocode}
 %   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. Hence we store these values.
+%   height, the length of the descenders of the bracket.
+%   Hence we store these values.
+%   \changes{v2.1}{2019-01-02}{Added missing \texttt\%.}
+%   \changes{v2.1}{2019-01-02}{Use local dimen registers.}
 %    \begin{macrocode}
-    \setbox\z@\hbox{$\m at th#1#2$}
-    \dimen0\wd\z@ \dimen1\ht\z@
+      \setbox\z@\hbox{$\m at th#1#2$}%
+      \dimen\z@\wd\z@ \dimen\tw@\ht\z@
 %    \end{macrocode}
 %   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 |\dimen1|, above, whereas the central part is
-%   expressed relative |\dimen0|.
+%   dimension relative to |\dimen2| whereas the central part is
+%   expressed relative to |\dimen0|.
+%   \changes{v2.1}{2019-01-02}{Added missing \texttt\%.}
 %    \begin{macrocode}
-    \setbox\tw@\hbox{%
-      \setlength{\unitlength}{\dimen1}%
-      \begin{picture}(0.4,0)
-        \polyline(0.4001,0)(0.4,0)(0,-0.8)
-      \end{picture}%
-      \setlength{\unitlength}{\dimen0}%
-      \begin{picture}(1,0)
-        \put(0,0){\line(1,0){1}}
-      \end{picture}%
-      \setlength{\unitlength}{\dimen1}%
-      \begin{picture}(0.4,0)
-        \polyline(-0.0001,0)(0,0)(0.4,-0.8)
-      \end{picture}}
+      \setbox\tw@\hbox{%
+        \unitlength\dimen\tw@
+        \begin{picture}(0.4,0)
+          \polyline(0.4001,0)(0.4,0)(0,-0.8)
+        \end{picture}%
+        \unitlength\dimen\z@
+        \begin{picture}(1,0)
+          \put(0,0){\line(1,0){1}}
+        \end{picture}%
+        \unitlength\dimen\tw@
+        \begin{picture}(0.4,0)
+          \polyline(-0.0001,0)(0,0)(0.4,-0.8)
+        \end{picture}%
+      }%
 %    \end{macrocode}
-%   We store the width of the total width of the backet to center the
-%   material under it, below.
+%   We store the total width of the whole bracket to center the
+%   material under it, as follows.
 %    \begin{macrocode}
-    \dimen@\wd\tw@
+      \dimen@\wd\tw@
 %    \end{macrocode}
-%   Box containing the whole symbol. The lineskip between the bracket
+%   The box containing the whole symbol. The lineskip between the bracket
 %   and the statuses is the same as in |\acta at angle|, plus half the
-%   default rule thickness.
+%   rule thickness |\@halfwidth|.
+%   \changes{v2.1}{2019-01-06}{Variable gap.}
 %    \begin{macrocode}
-    \vbox to\dimen1{%
-      \baselineskip\z@
-      \lineskip3\fontdimen8\scriptfont\thr@@
-      \advance\lineskip by 0.2pt
-      \lineskiplimit\lineskip
-      \vss
-      \box\tw@%
-      \hbox to\dimen@{\hss\unhbox\z@\hss}
-    }
+      \vbox{%
+        \baselineskip\z@
+        \lineskip\acta at overbarvgap#1%
+        \advance\lineskip\@halfwidth
+        \lineskiplimit\lineskip
+%    \end{macrocode}
+%   \changes{v2.1}{2019-01-11}{Variable extra space.}
+%   The extra space is the same as in |\acta at angle|, plus half the
+%   rule thickness |\@halfwidth|.
+%    \begin{macrocode}
+        \kern\acta at overbarkern#1%
+        \kern\@halfwidth
+        \box\tw@
+        \hbox to\dimen@{\hss\unhbox\z@\hss}%
+      }%
+%    \end{macrocode}
+%   Finish with a bit of following space.
+%    \begin{macrocode}
+      \mkern1mu%
+    }%
   }
 %    \end{macrocode}
 % \end{macro}
@@ -517,6 +695,61 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \subsection{Compatibility with \pkg{unicode-math} and OpenType math fonts}
+%
+% \begin{macro}{\AtBeginDocument}
+%   \changes{v2.1}{2019-01-06}{Compatibility with \pkg{unicode-math}.}
+%   The \pkg{unicode-math} package is to be loaded \emph{after} other math
+%   setup packages, e.g., \pkg{amsmath} and \pkg{mathtools}. This usually
+%   implies that \pkg{unicode-math} is loaded after \pkg{actuarialangle}.
+%   So we delay the adjustments for \pkg{unicode-math}.
+%    \begin{macrocode}
+\AtBeginDocument{%
+  \@ifpackageloaded{unicode-math}{%
+%    \end{macrocode}
+%   When the \pkg{unicode-math} package is loaded, OpenType math font will
+%   be used and the compile engine must be either LuaTeX or XeTeX. We test
+%   against the XeTeX primitive |\XeTeXcharclass| to find out which engine
+%   is used.
+%    \begin{macrocode}
+    \ifx\XeTeXcharclass\@undefined
+%    \end{macrocode}
+%   In this case the engine is LuaTeX. We redefine |\acta at overbarkern|,
+%   |\acta at overbarrule| and |\acta at overbarvgap| to be the LuaTeX primitives
+%   |\Umathoverbarkern|, |\Umathoverbarrule| and |\Umathoverbarvgap|,
+%   respectively. We also undefine the fontdimen and family parameters.
+%    \begin{macrocode}
+      \global\let\acta at overbarkern\Umathoverbarkern
+      \global\let\acta at overbarrule\Umathoverbarrule
+      \global\let\acta at overbarvgap\Umathoverbarvgap
+      \global\let\acta at overbarkern@fontdimen\@undefined
+      \global\let\acta at overbarkern@family\@undefined
+      \global\let\acta at overbarrule@fontdimen\@undefined
+      \global\let\acta at overbarrule@family\@undefined
+      \global\let\acta at overbarvgap@fontdimen\@undefined
+      \global\let\acta at overbarvgap@family\@undefined
+    \else
+%    \end{macrocode}
+%   Otherwise the engine is XeTeX. We use |\fontdimen54\<X>font2| for the
+%   rule thickness. We should use |\fontdimen53| and |\fontdimen55|
+%   for the vertical gap and the extra space, respectively,
+%   but XeTeX seems to have made a mistake here (see \href{^^A
+%   https://tex.stackexchange.com/q/468496}{the discussion} on StackExchange).
+%   So, for the vertical gap, we fallback to three times the rule thickness.
+%   For the extra space, we fallback to the rule thickness.
+%    \begin{macrocode}
+      \gdef\acta at overbarkern@fontdimen{54}% XeTeX mistake? Use 55?
+      \gdef\acta at overbarkern@family{\tw@}%
+      \gdef\acta at overbarrule@fontdimen{54}%
+      \gdef\acta at overbarrule@family{\tw@}%
+      \gdef\acta at overbarvgap@fontdimen{54}% XeTeX mistake? Use 53?
+      \gdef\acta at overbarvgap@family{\tw@}%
+    \fi
+  }{}%
+}
+%    \end{macrocode}
+% \end{macro}
+%
 %\iffalse
 %</package>
 %\fi

Modified: trunk/Master/texmf-dist/tex/latex/actuarialangle/actuarialangle.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/actuarialangle/actuarialangle.sty	2019-06-13 23:38:19 UTC (rev 51375)
+++ trunk/Master/texmf-dist/tex/latex/actuarialangle/actuarialangle.sty	2019-06-14 21:06:16 UTC (rev 51376)
@@ -8,7 +8,7 @@
 %% 
 %% This is a generated file.
 %% 
-%% Copyright (C) 2017 Vincent Goulet
+%% Copyright (C) 2019 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
@@ -29,7 +29,7 @@
 %% actuarialangle.ins and the derived files listed in the README.md file.
 %% 
 \NeedsTeXFormat{LaTeX2e}[2009/09/24]
-\ProvidesPackage{actuarialangle}[2017/04/10 v2.0 Actuarial angle]
+\ProvidesPackage{actuarialangle}[2019/06/13 v2.1 Actuarial angle]
 \newif\ifacta at thinspace \acta at thinspacetrue
 \newif\ifacta at bracket   \acta at brackettrue
 \DeclareOption{thinspace}{\acta at thinspacetrue}
@@ -36,57 +36,155 @@
 \DeclareOption{thickspace}{\acta at thinspacefalse}
 \DeclareOption{nobracket}{\acta at bracketfalse}
 \ProcessOptions
+\def\acta at overbarkern@fontdimen{8}
+\def\acta at overbarkern@family{\thr@@}
+\def\acta at overbarrule@fontdimen{8}
+\def\acta at overbarrule@family{\thr@@}
+\def\acta at overbarvgap@fontdimen{8}
+\def\acta at overbarvgap@family{\thr@@}
+\def\acta at overbarkern#1{%
+  \fontdimen\acta at overbarkern@fontdimen
+  \ifx#1\displaystyle
+    \textfont
+  \else
+    \ifx#1\textstyle
+      \textfont
+    \else
+      \ifx#1\scriptstyle
+        \scriptfont
+      \else
+        \scriptscriptfont
+      \fi
+    \fi
+  \fi
+  \acta at overbarkern@family
+}
+\def\acta at overbarrule#1{%
+  \fontdimen\acta at overbarrule@fontdimen
+  \ifx#1\displaystyle
+    \textfont
+  \else
+    \ifx#1\textstyle
+      \textfont
+    \else
+      \ifx#1\scriptstyle
+        \scriptfont
+      \else
+        \scriptscriptfont
+      \fi
+    \fi
+  \fi
+  \acta at overbarrule@family
+}
+\def\acta at overbarvgap#1{%
+  \ifx\acta at overbarrule@fontdimen\acta at overbarvgap@fontdimen
+    \thr@@
+  \fi
+  \fontdimen\acta at overbarvgap@fontdimen
+  \ifx#1\displaystyle
+    \textfont
+  \else
+    \ifx#1\textstyle
+      \textfont
+    \else
+      \ifx#1\scriptstyle
+        \scriptfont
+      \else
+        \scriptscriptfont
+      \fi
+    \fi
+  \fi
+  \acta at overbarvgap@family
+}
 \DeclareRobustCommand{\actuarialangle}{\mathpalette\acta at angle}
 \def\acta at angle#1#2{%
   \mathord{%
-    \mkern1mu
-    \vbox{\hrule \hbox{%
+    \mkern1mu%
+    \vbox{%
+      \kern\acta at overbarkern#1%
+      \hrule \@height\acta at overbarrule#1%
+      \hbox{%
         \vbox{%
-          \kern3\fontdimen8\scriptfont\thr@@
-          \hbox{$#1#2\m at th$}}%
-        \setbox\z@\hbox{$#1()$}\vrule depth\dp\z@}}%
-    \mkern1mu}}
+          \kern\acta at overbarvgap#1%
+          \hbox{$\m at th#1#2$}%
+        }%
+        \setbox\z@\hbox{$#1\mathstrut$}%
+        \vrule \@width\acta at overbarrule#1\@depth\dp\z@
+      }%
+    }%
+    \mkern1mu%
+  }%
+}
 \ifacta at thinspace
-  \def\angl#1{{\actuarialangle{{#1}\mkern1mu}}}
+  \newcommand*\angl[1]{{\actuarialangle{#1\mkern1mu}}}
 \else
-  \def\angl#1{{\actuarialangle{{#1}\mkern2mu}}}
+  \newcommand*\angl[1]{{\actuarialangle{#1\mkern2mu}}}
 \fi
-\def\angln{{\angl n}}
-\def\anglr{{\angl r}}
-\def\anglk{{\angl k}}
+\newcommand*\angln{{\angl n}}
+\newcommand*\anglr{{\angl r}}
+\newcommand*\anglk{{\angl k}}
 \ifacta at bracket
   \RequirePackage{pict2e}
   \DeclareRobustCommand{\overanglebracket}{%
     \mathpalette\acta at anglebracket}
   \def\acta at anglebracket#1#2{%
-    \setbox\z@\hbox{$\m at th#1#2$}
-    \dimen0\wd\z@ \dimen1\ht\z@
-    \setbox\tw@\hbox{%
-      \setlength{\unitlength}{\dimen1}%
-      \begin{picture}(0.4,0)
-        \polyline(0.4001,0)(0.4,0)(0,-0.8)
-      \end{picture}%
-      \setlength{\unitlength}{\dimen0}%
-      \begin{picture}(1,0)
-        \put(0,0){\line(1,0){1}}
-      \end{picture}%
-      \setlength{\unitlength}{\dimen1}%
-      \begin{picture}(0.4,0)
-        \polyline(-0.0001,0)(0,0)(0.4,-0.8)
-      \end{picture}}
-    \dimen@\wd\tw@
-    \vbox to\dimen1{%
-      \baselineskip\z@
-      \lineskip3\fontdimen8\scriptfont\thr@@
-      \advance\lineskip by 0.2pt
-      \lineskiplimit\lineskip
-      \vss
-      \box\tw@%
-      \hbox to\dimen@{\hss\unhbox\z@\hss}
-    }
+    \mathord{%
+      \mkern1mu%
+      \linethickness{\acta at overbarrule#1}%
+      \setbox\z@\hbox{$\m at th#1#2$}%
+      \dimen\z@\wd\z@ \dimen\tw@\ht\z@
+      \setbox\tw@\hbox{%
+        \unitlength\dimen\tw@
+        \begin{picture}(0.4,0)
+          \polyline(0.4001,0)(0.4,0)(0,-0.8)
+        \end{picture}%
+        \unitlength\dimen\z@
+        \begin{picture}(1,0)
+          \put(0,0){\line(1,0){1}}
+        \end{picture}%
+        \unitlength\dimen\tw@
+        \begin{picture}(0.4,0)
+          \polyline(-0.0001,0)(0,0)(0.4,-0.8)
+        \end{picture}%
+      }%
+      \dimen@\wd\tw@
+      \vbox{%
+        \baselineskip\z@
+        \lineskip\acta at overbarvgap#1%
+        \advance\lineskip\@halfwidth
+        \lineskiplimit\lineskip
+        \kern\acta at overbarkern#1%
+        \kern\@halfwidth
+        \box\tw@
+        \hbox to\dimen@{\hss\unhbox\z@\hss}%
+      }%
+      \mkern1mu%
+    }%
   }
   \let\group\overanglebracket
 \fi
+\AtBeginDocument{%
+  \@ifpackageloaded{unicode-math}{%
+    \ifx\XeTeXcharclass\@undefined
+      \global\let\acta at overbarkern\Umathoverbarkern
+      \global\let\acta at overbarrule\Umathoverbarrule
+      \global\let\acta at overbarvgap\Umathoverbarvgap
+      \global\let\acta at overbarkern@fontdimen\@undefined
+      \global\let\acta at overbarkern@family\@undefined
+      \global\let\acta at overbarrule@fontdimen\@undefined
+      \global\let\acta at overbarrule@family\@undefined
+      \global\let\acta at overbarvgap@fontdimen\@undefined
+      \global\let\acta at overbarvgap@family\@undefined
+    \else
+      \gdef\acta at overbarkern@fontdimen{54}% XeTeX mistake? Use 55?
+      \gdef\acta at overbarkern@family{\tw@}%
+      \gdef\acta at overbarrule@fontdimen{54}%
+      \gdef\acta at overbarrule@family{\tw@}%
+      \gdef\acta at overbarvgap@fontdimen{54}% XeTeX mistake? Use 53?
+      \gdef\acta at overbarvgap@family{\tw@}%
+    \fi
+  }{}%
+}
 \endinput
 %%
 %% End of file `actuarialangle.sty'.



More information about the tex-live-commits mailing list