summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/polynom
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 /Master/texmf-dist/source/latex/polynom
parent7759590b9ba24ac01b618e199c10f4b4ee2e99a7 (diff)
polynom (9dec16)
git-svn-id: svn://tug.org/texlive/trunk@42664 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/polynom')
-rw-r--r--Master/texmf-dist/source/latex/polynom/polynom.dtx73
1 files changed, 48 insertions, 25 deletions
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}