summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/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/tex/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/tex/latex/polynom')
-rw-r--r--Master/texmf-dist/tex/latex/polynom/polynom.sty56
1 files changed, 38 insertions, 18 deletions
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}