summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-12-09 22:53:03 +0000
committerKarl Berry <karl@freefriends.org>2016-12-09 22:53:03 +0000
commit509826c1ca2d20abd0c31f25bd1aee0930889f9a (patch)
treecd3cdf4ffcf705f208846ba793836080ab3debba
parent7759590b9ba24ac01b618e199c10f4b4ee2e99a7 (diff)
polynom (9dec16)
git-svn-id: svn://tug.org/texlive/trunk@42664 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/polynom/README2
-rw-r--r--Master/texmf-dist/doc/latex/polynom/polydemo.pdfbin85750 -> 146225 bytes
-rw-r--r--Master/texmf-dist/doc/latex/polynom/polydemo.tex3
-rw-r--r--Master/texmf-dist/doc/latex/polynom/polynom.pdfbin187477 -> 338024 bytes
-rw-r--r--Master/texmf-dist/source/latex/polynom/polynom.dtx73
-rw-r--r--Master/texmf-dist/tex/latex/polynom/polynom.sty56
6 files changed, 90 insertions, 44 deletions
diff --git a/Master/texmf-dist/doc/latex/polynom/README b/Master/texmf-dist/doc/latex/polynom/README
index 088d00097c5..eb4c001e842 100644
--- a/Master/texmf-dist/doc/latex/polynom/README
+++ b/Master/texmf-dist/doc/latex/polynom/README
@@ -1,5 +1,5 @@
Polynom package
-Copyright 2000-2006 Carsten Heinz, Hendri Adriaens
+Copyright 2000-2016 Carsten Heinz, Hendri Adriaens
Released under the LaTeX Project Public License 1.3 or later
The polynom package implements macros for manipulating
diff --git a/Master/texmf-dist/doc/latex/polynom/polydemo.pdf b/Master/texmf-dist/doc/latex/polynom/polydemo.pdf
index b0df672e563..c979775598f 100644
--- a/Master/texmf-dist/doc/latex/polynom/polydemo.pdf
+++ b/Master/texmf-dist/doc/latex/polynom/polydemo.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/polynom/polydemo.tex b/Master/texmf-dist/doc/latex/polynom/polydemo.tex
index 476495bc350..972fc768c76 100644
--- a/Master/texmf-dist/doc/latex/polynom/polydemo.tex
+++ b/Master/texmf-dist/doc/latex/polynom/polydemo.tex
@@ -86,6 +86,9 @@
\dopolylongdiv{Polynomial long division -- Stages 1 to 11}{1}{11}
{style=C}
+\dopolylongdiv{Polynomial long division -- Stages 1 to 11}{1}{11}
+ {style=D}
+
\dopolyhornerscheme{Horner's scheme -- Stages 1 to 8}{1}{8}
{}
diff --git a/Master/texmf-dist/doc/latex/polynom/polynom.pdf b/Master/texmf-dist/doc/latex/polynom/polynom.pdf
index 2bcffb9bf0c..16d18e6b743 100644
--- a/Master/texmf-dist/doc/latex/polynom/polynom.pdf
+++ b/Master/texmf-dist/doc/latex/polynom/polynom.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/polynom/polynom.dtx b/Master/texmf-dist/source/latex/polynom/polynom.dtx
index e87ca6f918f..c2b2943f67d 100644
--- a/Master/texmf-dist/source/latex/polynom/polynom.dtx
+++ b/Master/texmf-dist/source/latex/polynom/polynom.dtx
@@ -3,7 +3,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-2016 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
@@ -57,20 +57,20 @@
% \end{abstract}}
%
% \title{The \packagename{Polynom} Package}
-% \author{Copyright 2000--2006\\ Carsten Heinz \texttt{<\,cheinz@gmx.de\,>}, Hendri Adriaens}
-% \date{2006/04/20\enspace Version 0.17\\ \box\abstractbox}
+% \author{Copyright 2000--2016\\ Carsten Heinz \texttt{<\,cheinz@gmx.de\,>}, Hendri Adriaens}
+% \date{2016/12/09\enspace Version 0.18\\ \box\abstractbox}
% \maketitle
-%
% \section{Preface}
%
%Because Carsten Heinz could not be reached anymore for a long time,
%this package has been taken over according to the LPPL for
-%maintenance by Hendri Adriaens 2006/04/20. This package was using and
+%maintenance by Hendri Adriaens. This package was using and
%redefining internals of the \packagename{keyval} package and hence
%it was incompatible with \packagename{xkeyval}. This problem has
%been solved and the processing of the \texttt{vars} key has been
%simplified. All following text is the original by Carsten Heinz.
-%\hfill\emph{Hendri Adriaens, 2006/04/20}
+%\hfill\emph{Hendri Adriaens, 2006/04/20}\\
+%We thank Walter Daems for providing the \texttt D style.\hfill\emph{2016/12/09}
%
% \section{Introduction}
%
@@ -226,7 +226,7 @@
% \texttt{stage=}\meta{number}
% & print long division up to stage \meta{number} (starting with 1)\\
% &\\
-% \texttt{style=}\texttt{A$\vert$B$\vert$C}
+% \texttt{style=}\texttt{A$\vert$B$\vert$C$\vert$D}
% & define output scheme for long division, refer \href{polydemo.pdf}{polydemo.pdf}\\
% &\\
% \texttt{div=}\meta{token}
@@ -510,7 +510,7 @@
\define@key{pld}{style}
{\@ifundefined{pld@style#1}%
{\PackageError{polynom}{Unknown style `#1'}%
- {Arguments can be `A' or `B' or `C'.}}%
+ {Arguments can be `A' or `B' or `C' or `D'.}}%
{\let\pld@style=#1%
\@nameuse{pld@style#1}}}
% \end{macrocode}
@@ -519,6 +519,7 @@
\def\pld@styleA{\let\pld@iftopresult\iftrue}
\def\pld@styleB{\let\pld@iftopresult\iffalse}
\let\pld@styleC\pld@styleB
+\let\pld@styleD\pld@styleB
% \end{macrocode}
% \begin{macrocode}
\polyset{style=A}
@@ -2066,6 +2067,7 @@
\let\pld@pattern\@empty \let\pld@lastline\@empty
\let\pld@subline\@empty \let\pld@currentline\@empty
\let\pld@allines\@empty \let\pld@maxcol\z@
+ \let\pld@maxcolplustwo\z@ \let\pld@linepos\z@
\pld@true \pld@DivPoly#1#2%
\pld@ArrangeResult#1}
% \end{macrocode}
@@ -2427,7 +2429,11 @@
% \begin{macrocode}
\ifnum\pld@firstcol>\@tempcnta \edef\pld@firstcol{\the\@tempcnta}\fi
\ifnum\pld@lastcol<\@tempcnta \edef\pld@lastcol{\the\@tempcnta}\fi
- \ifnum\pld@maxcol<\@tempcnta \edef\pld@maxcol{\the\@tempcnta}\fi
+ \ifnum\pld@maxcol<\@tempcnta
+ \edef\pld@maxcol{\the\@tempcnta}
+ \@tempcntb\pld@maxcol\relax\advance\@tempcntb\tw@
+ \edef\pld@maxcolplustwo{\the\@tempcntb}
+ \fi
% \end{macrocode}
% Finally we insert the arguments.
% \begin{macrocode}
@@ -2546,8 +2552,8 @@
\def\pld@lastline{\pld@PrintPoly\pld@divisor\bigr)&}%
\else
\let\pld@lastline\@empty
- \ifx B\pld@style\else
- \def\pld@lastline{\pld@leftdelim\strut\pld@rightxdelim&}%
+ \ifx C\pld@style
+ \def\pld@lastline{\pld@leftdelim\strut\pld@rightxdelim&}%
\fi
\fi
% \end{macrocode}
@@ -2583,6 +2589,9 @@
\@tempcnta-\@tempcnta
\advance\@tempcnta\pld@maxcol\relax \advance\@tempcnta\@ne
\edef\pld@span{\the\@tempcnta}%
+ \@tempcntb\pld@maxcol\relax\advance\@tempcntb\pld@span%
+ \advance\@tempcntb\@ne%
+ \edef\pld@linepos{\the\@tempcntb}%
% \end{macrocode}
% Then we can add divisor, quotient, and remainder. First we go for style B.
% \begin{macrocode}
@@ -2603,20 +2612,34 @@
% \end{macrocode}
% And now for style C. Note that we `smash' the depth of the fraction.
% \begin{macrocode}
- \pld@AddTo\pld@lastline{%
- &\multispan\pld@span$\pld@leftxdelim\strut\pld@rightdelim
- \pld@div
- \pld@PrintPolyWithDelims\pld@divisor=
- \pld@PrintPolyShadow
- \ifx\pld@remainder\@empty\else
- +{}%
- \setbox\z@=\hbox{$\displaystyle
- \frac{\let\strut\@empty\pld@firsttrue \expandafter
- \pld@PrintRemain\expandafter{\pld@remainder}}%
- {\let\strut\@empty\pld@PrintPoly\pld@divisor}$}%
- \dp\z@=\z@\box\z@
- \fi
- $}%
+ \if C\pld@style
+ \pld@AddTo\pld@lastline{%
+ &\multispan\pld@span$\pld@leftxdelim\strut\pld@rightdelim
+ \pld@div
+ \pld@PrintPolyWithDelims\pld@divisor=
+ \pld@PrintPolyShadow
+ \ifx\pld@remainder\@empty\else
+ +{}%
+ \setbox\z@=\hbox{$\displaystyle
+ \frac{\let\strut\@empty\pld@firsttrue \expandafter
+ \pld@PrintRemain\expandafter{\pld@remainder}}%
+ {\let\strut\@empty\pld@PrintPoly\pld@divisor}$}%
+ \dp\z@=\z@\box\z@
+ \fi
+ $}%
+ \else
+% \end{macrocode}
+% Finally, style D.
+% \begin{macrocode}
+ \pld@AddTo\pld@lastline{%
+ \cr%
+ \noalign{\vskip-\normalbaselineskip}%
+ \multispan\pld@maxcol~&~&\multispan\pld@span${}\vrule~%
+ \pld@PrintPoly\pld@divisor\hfil\hfil$\cr%
+ \cline{\pld@maxcolplustwo-\pld@linepos}%
+ \multispan\pld@maxcol~&~&\multispan\pld@span${}\vrule height
+ 2.25ex~\pld@PrintPolyShadow$\hfil\cr\noalign{\vskip-2\normalbaselineskip}}%
+ \fi
\fi
\fi
% \end{macrocode}
diff --git a/Master/texmf-dist/tex/latex/polynom/polynom.sty b/Master/texmf-dist/tex/latex/polynom/polynom.sty
index ca61d9eb5bf..95d49465ab0 100644
--- a/Master/texmf-dist/tex/latex/polynom/polynom.sty
+++ b/Master/texmf-dist/tex/latex/polynom/polynom.sty
@@ -62,12 +62,13 @@
\define@key{pld}{style}
{\@ifundefined{pld@style#1}%
{\PackageError{polynom}{Unknown style `#1'}%
- {Arguments can be `A' or `B' or `C'.}}%
+ {Arguments can be `A' or `B' or `C' or `D'.}}%
{\let\pld@style=#1%
\@nameuse{pld@style#1}}}
\def\pld@styleA{\let\pld@iftopresult\iftrue}
\def\pld@styleB{\let\pld@iftopresult\iffalse}
\let\pld@styleC\pld@styleB
+\let\pld@styleD\pld@styleB
\polyset{style=A}
\define@key{pld}{delims}
{\@ifnextchar[\pld@delims
@@ -713,6 +714,7 @@
\let\pld@pattern\@empty \let\pld@lastline\@empty
\let\pld@subline\@empty \let\pld@currentline\@empty
\let\pld@allines\@empty \let\pld@maxcol\z@
+ \let\pld@maxcolplustwo\z@ \let\pld@linepos\z@
\pld@true \pld@DivPoly#1#2%
\pld@ArrangeResult#1}
\def\pld@DivPoly#1#2{%
@@ -900,7 +902,11 @@
\expandafter\pld@InsertItems@find\pld@pattern\relax&%
\ifnum\pld@firstcol>\@tempcnta \edef\pld@firstcol{\the\@tempcnta}\fi
\ifnum\pld@lastcol<\@tempcnta \edef\pld@lastcol{\the\@tempcnta}\fi
- \ifnum\pld@maxcol<\@tempcnta \edef\pld@maxcol{\the\@tempcnta}\fi
+ \ifnum\pld@maxcol<\@tempcnta
+ \edef\pld@maxcol{\the\@tempcnta}
+ \@tempcntb\pld@maxcol\relax\advance\@tempcntb\tw@
+ \edef\pld@maxcolplustwo{\the\@tempcntb}
+ \fi
\pld@InsertItems@do\pld@lastline{\pld@PLD{#3}}%
\pld@InsertItems@do\pld@subline{\pld@PLD{#2}}%
\pld@InsertItems@do\pld@currentline{\pld@PLD{#1}}}
@@ -967,8 +973,8 @@
\def\pld@lastline{\pld@PrintPoly\pld@divisor\bigr)&}%
\else
\let\pld@lastline\@empty
- \ifx B\pld@style\else
- \def\pld@lastline{\pld@leftdelim\strut\pld@rightxdelim&}%
+ \ifx C\pld@style
+ \def\pld@lastline{\pld@leftdelim\strut\pld@rightxdelim&}%
\fi
\fi
\expandafter\pld@AR@col\expandafter\pld@PLD
@@ -990,6 +996,9 @@
\@tempcnta-\@tempcnta
\advance\@tempcnta\pld@maxcol\relax \advance\@tempcnta\@ne
\edef\pld@span{\the\@tempcnta}%
+ \@tempcntb\pld@maxcol\relax\advance\@tempcntb\pld@span%
+ \advance\@tempcntb\@ne%
+ \edef\pld@linepos{\the\@tempcntb}%
\ifx B\pld@style
\pld@AddTo\pld@lastline{%
&\multispan\pld@span${}=%
@@ -1004,20 +1013,31 @@
\pld@firstfalse
\expandafter\pld@PrintRemain\expandafter{\pld@remainder}$}%
\else
- \pld@AddTo\pld@lastline{%
- &\multispan\pld@span$\pld@leftxdelim\strut\pld@rightdelim
- \pld@div
- \pld@PrintPolyWithDelims\pld@divisor=
- \pld@PrintPolyShadow
- \ifx\pld@remainder\@empty\else
- +{}%
- \setbox\z@=\hbox{$\displaystyle
- \frac{\let\strut\@empty\pld@firsttrue \expandafter
- \pld@PrintRemain\expandafter{\pld@remainder}}%
- {\let\strut\@empty\pld@PrintPoly\pld@divisor}$}%
- \dp\z@=\z@\box\z@
- \fi
- $}%
+ \if C\pld@style
+ \pld@AddTo\pld@lastline{%
+ &\multispan\pld@span$\pld@leftxdelim\strut\pld@rightdelim
+ \pld@div
+ \pld@PrintPolyWithDelims\pld@divisor=
+ \pld@PrintPolyShadow
+ \ifx\pld@remainder\@empty\else
+ +{}%
+ \setbox\z@=\hbox{$\displaystyle
+ \frac{\let\strut\@empty\pld@firsttrue \expandafter
+ \pld@PrintRemain\expandafter{\pld@remainder}}%
+ {\let\strut\@empty\pld@PrintPoly\pld@divisor}$}%
+ \dp\z@=\z@\box\z@
+ \fi
+ $}%
+ \else
+ \pld@AddTo\pld@lastline{%
+ \cr%
+ \noalign{\vskip-\normalbaselineskip}%
+ \multispan\pld@maxcol~&~&\multispan\pld@span${}\vrule~%
+ \pld@PrintPoly\pld@divisor\hfil\hfil$\cr%
+ \cline{\pld@maxcolplustwo-\pld@linepos}%
+ \multispan\pld@maxcol~&~&\multispan\pld@span${}\vrule height
+ 2.25ex~\pld@PrintPolyShadow$\hfil\cr\noalign{\vskip-2\normalbaselineskip}}%
+ \fi
\fi
\fi
\expandafter\pld@AR@\pld@allines\relax}