From dacf576055f59aefcd2c687d90bc7145338738b9 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 30 Apr 2018 17:03:34 +0000 Subject: polexpr (23apr18) git-svn-id: svn://tug.org/texlive/trunk@47509 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/polexpr/polexpr.sty | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'Master/texmf-dist/tex') 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 -- cgit v1.2.3