summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/polexpr
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-04-30 17:03:34 +0000
committerKarl Berry <karl@freefriends.org>2018-04-30 17:03:34 +0000
commitdacf576055f59aefcd2c687d90bc7145338738b9 (patch)
treee3698dba100b22a4af37d0bfc62af308e01b92b4 /Master/texmf-dist/tex/latex/polexpr
parent69d6cfb227dab23c7931e9728682733b6b9a1eb7 (diff)
polexpr (23apr18)
git-svn-id: svn://tug.org/texlive/trunk@47509 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/polexpr')
-rw-r--r--Master/texmf-dist/tex/latex/polexpr/polexpr.sty25
1 files changed, 23 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/latex/polexpr/polexpr.sty b/Master/texmf-dist/tex/latex/polexpr/polexpr.sty
index 02d3ecdec76..e5e2acd6922 100644
--- a/Master/texmf-dist/tex/latex/polexpr/polexpr.sty
+++ b/Master/texmf-dist/tex/latex/polexpr/polexpr.sty
@@ -1,12 +1,30 @@
% author: Jean-François Burnol
% License: LPPL 1.3c (author-maintained)
\ProvidesPackage{polexpr}%
- [2018/04/08 v0.5 Polynomial expressions with rational coefficients (JFB)]%
+ [2018/04/22 v0.5.1 Polynomial expressions with rational coefficients (JFB)]%
\RequirePackage{xintexpr}[2018/03/01]% xint 1.3
\edef\POL@restorecatcodes
- {\catcode`\noexpand\_ \the\catcode`\_ \catcode0 \the\catcode0\relax}%
+ {\catcode`\noexpand\_ \the\catcode`\_ %
+ \catcode`\noexpand\! \the\catcode`\! %
+ \catcode0 \the\catcode0\relax}%
\catcode`\_ 11 \catcode0 12
+%% PATCH xintexpr TO AUTHORIZE ' IN NAMES (0.5.1)
+\catcode`\! 11
+\def\POL@XINT_expr_scanfunc_b #1%
+{%
+ \ifx !#1\xint_dothis{(_}\fi
+ \ifcat \relax#1\xint_dothis{(_}\fi
+ \if (#1\xint_dothis{\xint_firstoftwo{(`}}\fi
+ \if '#1\xint_dothis \XINT_expr_scanfunc_a \fi
+ \if @#1\xint_dothis \XINT_expr_scanfunc_a \fi
+ \if _#1\xint_dothis \XINT_expr_scanfunc_a \fi
+ \ifnum \xint_c_ix<1\string#1 \xint_dothis \XINT_expr_scanfunc_a \fi
+ \ifcat a#1\xint_dothis \XINT_expr_scanfunc_a \fi
+ \xint_orthat {(_}%
+ #1%
+}%
+
%% AUXILIARIES
\newcount\POL@count
\newif\ifPOL@pol
@@ -47,9 +65,12 @@
\POL@restoresemicolon
\edef\POL@tmp{\ifxintverbose1\else0\fi}%
\unless\ifxintveryverbose\xintverbosefalse\fi
+ \let\POL@originalXINT_expr_scanfunc_b\XINT_expr_scanfunc_b
+ \let\XINT_expr_scanfunc_b\POL@XINT_expr_scanfunc_b
\xintdeffunc __pol(#2):=0+(#4);% force conversion to raw if a constant
\if1\POL@tmp\xintverbosetrue\fi
\edef\POL@polname{\xint_zapspaces #1 \xint_gobble_i}%
+ \let\XINT_expr_scanfunc_b\POL@originalXINT_expr_scanfunc_b
\begingroup
\setbox0\hbox{%
\let\xintScalarAdd\xintAdd