summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r--Master/texmf-dist/tex/latex/polynom/polynom.sty18
1 files changed, 13 insertions, 5 deletions
diff --git a/Master/texmf-dist/tex/latex/polynom/polynom.sty b/Master/texmf-dist/tex/latex/polynom/polynom.sty
index 95d49465ab0..9493f2d3d4e 100644
--- a/Master/texmf-dist/tex/latex/polynom/polynom.sty
+++ b/Master/texmf-dist/tex/latex/polynom/polynom.sty
@@ -9,7 +9,7 @@
%% The files polynom.dtx and polynom.ins and all files generated
%% from these two files are referred to as `this work'.
%%
-%% This work is copyright 2000-2006 Carsten Heinz, Hendri Adriaens.
+%% This work is copyright 2000-2017 Carsten Heinz, Hendri Adriaens.
%%
%% This work may be distributed and/or modified under the conditions
%% of the LaTeX Project Public License, either version 1.3 of this
@@ -24,7 +24,7 @@
%% The Current Maintainer of this work is Hendri Adriaens.
%%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{polynom}[2006/04/20 0.17 (CH,HA)]
+\ProvidesPackage{polynom}[2017/07/17 0.19 (CH,HA)]
\def\pld@AddTo#1#2{\expandafter\def\expandafter#1\expandafter{#1#2}}
\def\pld@Extend#1#2{%
\expandafter\pld@AddTo\expandafter#1\expandafter{#2}}
@@ -96,8 +96,9 @@
\let\polyremainder\pld@remainder
\pld@RestoreAftergroup#1\polyremainder\relax
\endgroup\ignorespaces}}
+\newif\ifpld@InsidePolylongdiv
\newcommand*\polylongdiv[1][]{%
- \begingroup
+ \begingroup\pld@InsidePolylongdivtrue
\let\pld@stage\maxdimen \polyset{#1}%
\pld@GetPoly{\pld@polya\pld@polyb}%
{\pld@LongDividePoly\pld@polya\pld@polyb
@@ -728,8 +729,12 @@
\pld@NMultiplyPoly\pld@sub\pld@divisor\pld@factor
\pld@SubtractPoly\pld@remainder\pld@sub
\expandafter\pld@DivPoly@l}%
- {}%
+ {\ifpld@InsidePolylongdiv\expandafter\pld@insert@remainder
+ \pld@last@remainder+\relax\relax\fi}%
\fi}
+\def\pld@insert@remainder#1+#2\relax{%
+ \ifx\relax#1\relax\else\pld@InsertItems\@empty\@empty{#1}\fi
+ \ifx\relax#2\relax\else\pld@insert@remainder#2\relax\fi}
\def\pld@IfNeedsDivision#1#2{%
\pld@ExpandTwo\pld@IfND{#1+\@empty}{#2+\@empty}}
\def\pld@IfND#1+#2\@empty#3+#4\@empty{%
@@ -786,6 +791,7 @@
\pld@SubtractPoly@l#2\@empty}
\def\pld@SubtractPoly@l#1+#2\@empty#3+#4\@empty{%
\ifx\relax#1\relax
+ \let\pld@last@remainder\@empty
\ifx\relax#3\relax \let\pld@next\@empty \else
\pld@AddToPoly\pld@tempoly{#3}%
\pld@if \pld@InsertItems{#3}{#3}{}\fi
@@ -815,7 +821,9 @@
}%
\fi \fi
\pld@next}
-\def\pld@SubtractPoly@r#1+\relax+\@empty{\pld@AddToPoly\pld@tempoly{#1}}
+\def\pld@SubtractPoly@r#1+\relax+\@empty{%
+ \pld@AddToPoly\pld@tempoly{#1}%
+ \def\pld@last@remainder{#1}}
\def\pld@InsertFake#1{%
\let\pld@temp\@empty
\expandafter\pld@InsertFake@l#1&\relax&}