How to correct excessive lines at the corner and bad line spaces in `polynom.sty`?
Excessive lines at the corner
Bad line spacing
Minimal Code
History: This code was done by @localghost at the LaTeX community site. He made a modification from )
to |
.
documentclass{article}
usepackage{polynom}
makeatletter
defpld@ArrangeResult#1{%
ifxpld@remainder@empty
@tempcntapld@maxcolrelax
pld@InsertItems@dopld@lastline
{pld@firsttruepld@PLD{pld@R{0}{1}}}%
fi
ifnumpld@currstage>z@
pld@Extendpld@allines{pld@lastlinecr}%
else
pld@InsertFakepld@lastline
fi
pld@iftopresult
defpld@lastline{pld@PrintPolypld@divisor,smash{Big|}kern-2pt&}%
else
letpld@lastline@empty
ifx Bpld@styleelse
defpld@lastline{pld@leftdelimstrutpld@rightxdelim&}%
fi
fi
expandafterpld@AR@colexpandafterpld@PLD
expandafterpld@lastline#1+relax+%
pld@SplitQuotient
pld@iftopresult
letpld@currentline@empty
expandafterpld@AR@colexpandafterpld@PLD
expandafterpld@currentline
pld@quotient+relax+%
expandafterpld@AR@colexpandafterpld@XPLD
expandafterpld@currentline
pld@shadow+relax+%
edefpld@subline{%
noexpandcline{tw@-pld@maxcol}%
noalign{vskipjot}}%
pld@Extendpld@currentline{expandaftercrpld@subline}%
else
@tempcnta-@tempcnta
advance@tempcntapld@maxcolrelax advance@tempcnta@ne
edefpld@span{the@tempcnta}%
ifx Bpld@style
pld@AddTopld@lastline{%
&multispanpld@span${}=%
pld@PrintPolyWithDelimspld@divisor
expandafterpld@IfSumexpandafter{pld@divisor}{}{cdot}%
expandafterpld@IfSumexpandafter{pld@quotient}pld@true
pld@false
pld@if pld@leftdelim
pld@PrintPolyShadow
pld@rightdelim
else pld@PrintPolyShadow fi
pld@firstfalse
expandafterpld@PrintRemainexpandafter{pld@remainder}$}%
else
pld@AddTopld@lastline{%
&multispanpld@span$pld@leftxdelimstrutpld@rightdelim
pld@div
pld@PrintPolyWithDelimspld@divisor=
pld@PrintPolyShadow
ifxpld@remainder@emptyelse
+{}%
setboxz@=hbox{$displaystyle
frac{letstrut@emptypld@firsttrue expandafter
pld@PrintRemainexpandafter{pld@remainder}}%
{letstrut@emptypld@PrintPolypld@divisor}$}%
dpz@=z@boxz@
fi
$}%
fi
fi
expandafterpld@AR@pld@allinesrelax}
makeatother
begin{document}
polylongdiv[style=A]{3x^9+x^2-1}{frac{2}{5}x^4-1}
end{document}
EDIT
See my answer (based on @Herbert's info).
polynom
|
show 5 more comments
Excessive lines at the corner
Bad line spacing
Minimal Code
History: This code was done by @localghost at the LaTeX community site. He made a modification from )
to |
.
documentclass{article}
usepackage{polynom}
makeatletter
defpld@ArrangeResult#1{%
ifxpld@remainder@empty
@tempcntapld@maxcolrelax
pld@InsertItems@dopld@lastline
{pld@firsttruepld@PLD{pld@R{0}{1}}}%
fi
ifnumpld@currstage>z@
pld@Extendpld@allines{pld@lastlinecr}%
else
pld@InsertFakepld@lastline
fi
pld@iftopresult
defpld@lastline{pld@PrintPolypld@divisor,smash{Big|}kern-2pt&}%
else
letpld@lastline@empty
ifx Bpld@styleelse
defpld@lastline{pld@leftdelimstrutpld@rightxdelim&}%
fi
fi
expandafterpld@AR@colexpandafterpld@PLD
expandafterpld@lastline#1+relax+%
pld@SplitQuotient
pld@iftopresult
letpld@currentline@empty
expandafterpld@AR@colexpandafterpld@PLD
expandafterpld@currentline
pld@quotient+relax+%
expandafterpld@AR@colexpandafterpld@XPLD
expandafterpld@currentline
pld@shadow+relax+%
edefpld@subline{%
noexpandcline{tw@-pld@maxcol}%
noalign{vskipjot}}%
pld@Extendpld@currentline{expandaftercrpld@subline}%
else
@tempcnta-@tempcnta
advance@tempcntapld@maxcolrelax advance@tempcnta@ne
edefpld@span{the@tempcnta}%
ifx Bpld@style
pld@AddTopld@lastline{%
&multispanpld@span${}=%
pld@PrintPolyWithDelimspld@divisor
expandafterpld@IfSumexpandafter{pld@divisor}{}{cdot}%
expandafterpld@IfSumexpandafter{pld@quotient}pld@true
pld@false
pld@if pld@leftdelim
pld@PrintPolyShadow
pld@rightdelim
else pld@PrintPolyShadow fi
pld@firstfalse
expandafterpld@PrintRemainexpandafter{pld@remainder}$}%
else
pld@AddTopld@lastline{%
&multispanpld@span$pld@leftxdelimstrutpld@rightdelim
pld@div
pld@PrintPolyWithDelimspld@divisor=
pld@PrintPolyShadow
ifxpld@remainder@emptyelse
+{}%
setboxz@=hbox{$displaystyle
frac{letstrut@emptypld@firsttrue expandafter
pld@PrintRemainexpandafter{pld@remainder}}%
{letstrut@emptypld@PrintPolypld@divisor}$}%
dpz@=z@boxz@
fi
$}%
fi
fi
expandafterpld@AR@pld@allinesrelax}
makeatother
begin{document}
polylongdiv[style=A]{3x^9+x^2-1}{frac{2}{5}x^4-1}
end{document}
EDIT
See my answer (based on @Herbert's info).
polynom
where are those line corners are seen?
– Herbert
Jan 9 '11 at 11:51
@Herbert, if you compile the code above, view the output and zoom-in near the top right corner, you will see the excessive lines.
– xport
Jan 9 '11 at 11:58
@Herbert, 400% zoom will show the excessive.
– xport
Jan 9 '11 at 11:59
@xport: this doesn't happen with my code changes ...
– Herbert
Jan 9 '11 at 12:12
@Herbert, your solution only solves the spacing. Unfortunately, the vertical and horizontal rules now get separated using your setting. They should touch each other and make a GOOD corner. :-)
– xport
Jan 9 '11 at 12:32
|
show 5 more comments
Excessive lines at the corner
Bad line spacing
Minimal Code
History: This code was done by @localghost at the LaTeX community site. He made a modification from )
to |
.
documentclass{article}
usepackage{polynom}
makeatletter
defpld@ArrangeResult#1{%
ifxpld@remainder@empty
@tempcntapld@maxcolrelax
pld@InsertItems@dopld@lastline
{pld@firsttruepld@PLD{pld@R{0}{1}}}%
fi
ifnumpld@currstage>z@
pld@Extendpld@allines{pld@lastlinecr}%
else
pld@InsertFakepld@lastline
fi
pld@iftopresult
defpld@lastline{pld@PrintPolypld@divisor,smash{Big|}kern-2pt&}%
else
letpld@lastline@empty
ifx Bpld@styleelse
defpld@lastline{pld@leftdelimstrutpld@rightxdelim&}%
fi
fi
expandafterpld@AR@colexpandafterpld@PLD
expandafterpld@lastline#1+relax+%
pld@SplitQuotient
pld@iftopresult
letpld@currentline@empty
expandafterpld@AR@colexpandafterpld@PLD
expandafterpld@currentline
pld@quotient+relax+%
expandafterpld@AR@colexpandafterpld@XPLD
expandafterpld@currentline
pld@shadow+relax+%
edefpld@subline{%
noexpandcline{tw@-pld@maxcol}%
noalign{vskipjot}}%
pld@Extendpld@currentline{expandaftercrpld@subline}%
else
@tempcnta-@tempcnta
advance@tempcntapld@maxcolrelax advance@tempcnta@ne
edefpld@span{the@tempcnta}%
ifx Bpld@style
pld@AddTopld@lastline{%
&multispanpld@span${}=%
pld@PrintPolyWithDelimspld@divisor
expandafterpld@IfSumexpandafter{pld@divisor}{}{cdot}%
expandafterpld@IfSumexpandafter{pld@quotient}pld@true
pld@false
pld@if pld@leftdelim
pld@PrintPolyShadow
pld@rightdelim
else pld@PrintPolyShadow fi
pld@firstfalse
expandafterpld@PrintRemainexpandafter{pld@remainder}$}%
else
pld@AddTopld@lastline{%
&multispanpld@span$pld@leftxdelimstrutpld@rightdelim
pld@div
pld@PrintPolyWithDelimspld@divisor=
pld@PrintPolyShadow
ifxpld@remainder@emptyelse
+{}%
setboxz@=hbox{$displaystyle
frac{letstrut@emptypld@firsttrue expandafter
pld@PrintRemainexpandafter{pld@remainder}}%
{letstrut@emptypld@PrintPolypld@divisor}$}%
dpz@=z@boxz@
fi
$}%
fi
fi
expandafterpld@AR@pld@allinesrelax}
makeatother
begin{document}
polylongdiv[style=A]{3x^9+x^2-1}{frac{2}{5}x^4-1}
end{document}
EDIT
See my answer (based on @Herbert's info).
polynom
Excessive lines at the corner
Bad line spacing
Minimal Code
History: This code was done by @localghost at the LaTeX community site. He made a modification from )
to |
.
documentclass{article}
usepackage{polynom}
makeatletter
defpld@ArrangeResult#1{%
ifxpld@remainder@empty
@tempcntapld@maxcolrelax
pld@InsertItems@dopld@lastline
{pld@firsttruepld@PLD{pld@R{0}{1}}}%
fi
ifnumpld@currstage>z@
pld@Extendpld@allines{pld@lastlinecr}%
else
pld@InsertFakepld@lastline
fi
pld@iftopresult
defpld@lastline{pld@PrintPolypld@divisor,smash{Big|}kern-2pt&}%
else
letpld@lastline@empty
ifx Bpld@styleelse
defpld@lastline{pld@leftdelimstrutpld@rightxdelim&}%
fi
fi
expandafterpld@AR@colexpandafterpld@PLD
expandafterpld@lastline#1+relax+%
pld@SplitQuotient
pld@iftopresult
letpld@currentline@empty
expandafterpld@AR@colexpandafterpld@PLD
expandafterpld@currentline
pld@quotient+relax+%
expandafterpld@AR@colexpandafterpld@XPLD
expandafterpld@currentline
pld@shadow+relax+%
edefpld@subline{%
noexpandcline{tw@-pld@maxcol}%
noalign{vskipjot}}%
pld@Extendpld@currentline{expandaftercrpld@subline}%
else
@tempcnta-@tempcnta
advance@tempcntapld@maxcolrelax advance@tempcnta@ne
edefpld@span{the@tempcnta}%
ifx Bpld@style
pld@AddTopld@lastline{%
&multispanpld@span${}=%
pld@PrintPolyWithDelimspld@divisor
expandafterpld@IfSumexpandafter{pld@divisor}{}{cdot}%
expandafterpld@IfSumexpandafter{pld@quotient}pld@true
pld@false
pld@if pld@leftdelim
pld@PrintPolyShadow
pld@rightdelim
else pld@PrintPolyShadow fi
pld@firstfalse
expandafterpld@PrintRemainexpandafter{pld@remainder}$}%
else
pld@AddTopld@lastline{%
&multispanpld@span$pld@leftxdelimstrutpld@rightdelim
pld@div
pld@PrintPolyWithDelimspld@divisor=
pld@PrintPolyShadow
ifxpld@remainder@emptyelse
+{}%
setboxz@=hbox{$displaystyle
frac{letstrut@emptypld@firsttrue expandafter
pld@PrintRemainexpandafter{pld@remainder}}%
{letstrut@emptypld@PrintPolypld@divisor}$}%
dpz@=z@boxz@
fi
$}%
fi
fi
expandafterpld@AR@pld@allinesrelax}
makeatother
begin{document}
polylongdiv[style=A]{3x^9+x^2-1}{frac{2}{5}x^4-1}
end{document}
EDIT
See my answer (based on @Herbert's info).
polynom
polynom
edited 28 mins ago
Solomon Ucko
10718
10718
asked Jan 9 '11 at 11:28
xport
21.7k30138260
21.7k30138260
where are those line corners are seen?
– Herbert
Jan 9 '11 at 11:51
@Herbert, if you compile the code above, view the output and zoom-in near the top right corner, you will see the excessive lines.
– xport
Jan 9 '11 at 11:58
@Herbert, 400% zoom will show the excessive.
– xport
Jan 9 '11 at 11:59
@xport: this doesn't happen with my code changes ...
– Herbert
Jan 9 '11 at 12:12
@Herbert, your solution only solves the spacing. Unfortunately, the vertical and horizontal rules now get separated using your setting. They should touch each other and make a GOOD corner. :-)
– xport
Jan 9 '11 at 12:32
|
show 5 more comments
where are those line corners are seen?
– Herbert
Jan 9 '11 at 11:51
@Herbert, if you compile the code above, view the output and zoom-in near the top right corner, you will see the excessive lines.
– xport
Jan 9 '11 at 11:58
@Herbert, 400% zoom will show the excessive.
– xport
Jan 9 '11 at 11:59
@xport: this doesn't happen with my code changes ...
– Herbert
Jan 9 '11 at 12:12
@Herbert, your solution only solves the spacing. Unfortunately, the vertical and horizontal rules now get separated using your setting. They should touch each other and make a GOOD corner. :-)
– xport
Jan 9 '11 at 12:32
where are those line corners are seen?
– Herbert
Jan 9 '11 at 11:51
where are those line corners are seen?
– Herbert
Jan 9 '11 at 11:51
@Herbert, if you compile the code above, view the output and zoom-in near the top right corner, you will see the excessive lines.
– xport
Jan 9 '11 at 11:58
@Herbert, if you compile the code above, view the output and zoom-in near the top right corner, you will see the excessive lines.
– xport
Jan 9 '11 at 11:58
@Herbert, 400% zoom will show the excessive.
– xport
Jan 9 '11 at 11:59
@Herbert, 400% zoom will show the excessive.
– xport
Jan 9 '11 at 11:59
@xport: this doesn't happen with my code changes ...
– Herbert
Jan 9 '11 at 12:12
@xport: this doesn't happen with my code changes ...
– Herbert
Jan 9 '11 at 12:12
@Herbert, your solution only solves the spacing. Unfortunately, the vertical and horizontal rules now get separated using your setting. They should touch each other and make a GOOD corner. :-)
– xport
Jan 9 '11 at 12:32
@Herbert, your solution only solves the spacing. Unfortunately, the vertical and horizontal rules now get separated using your setting. They should touch each other and make a GOOD corner. :-)
– xport
Jan 9 '11 at 12:32
|
show 5 more comments
2 Answers
2
active
oldest
votes
...
begin{document}
jot=10ptdefstrut{rule[-2ex]{0pt}{3ex}}
polylongdiv[style=A]{3x^9+x^2-1}{frac{2}{5}x^4-1}
end{document}
add a comment |
Using @Herbert's info, I did some trial and error.
I changed Big|
to rule{}
. You can see the modification in the part enclosed by %===========================
documentclass{article}
usepackage{polynom,array}
usepackage[table]{xcolor}
makeatletter
defpld@ArrangeResult#1{%
ifxpld@remainder@empty
@tempcntapld@maxcolrelax
pld@InsertItems@dopld@lastline
{pld@firsttruepld@PLD{pld@R{0}{1}}}%
fi
ifnumpld@currstage>z@
pld@Extendpld@allines{pld@lastlinecr}%
else
pld@InsertFakepld@lastline
fi
pld@iftopresult
defpld@lastline{pld@PrintPolypld@divisor%
%========================================================================
quadsmash{{color{red}rule[-6pt]{arrayrulewidth}{17pt}}}%
kern-arrayrulewidth&}%
%========================================================================
else
letpld@lastline@empty
ifx Bpld@styleelse
defpld@lastline{pld@leftdelimstrutpld@rightxdelim&}%
fi
fi
expandafterpld@AR@colexpandafterpld@PLD
expandafterpld@lastline#1+relax+%
pld@SplitQuotient
pld@iftopresult
letpld@currentline@empty
expandafterpld@AR@colexpandafterpld@PLD
expandafterpld@currentline
pld@quotient+relax+%
expandafterpld@AR@colexpandafterpld@XPLD
expandafterpld@currentline
pld@shadow+relax+%
edefpld@subline{%
noexpandcline{tw@-pld@maxcol}%
noalign{vskipjot}}%
pld@Extendpld@currentline{expandaftercrpld@subline}%
else
@tempcnta-@tempcnta
advance@tempcntapld@maxcolrelax advance@tempcnta@ne
edefpld@span{the@tempcnta}%
ifx Bpld@style
pld@AddTopld@lastline{%
&multispanpld@span${}=%
pld@PrintPolyWithDelimspld@divisor
expandafterpld@IfSumexpandafter{pld@divisor}{}{cdot}%
expandafterpld@IfSumexpandafter{pld@quotient}pld@true
pld@false
pld@if pld@leftdelim
pld@PrintPolyShadow
pld@rightdelim
else pld@PrintPolyShadow fi
pld@firstfalse
expandafterpld@PrintRemainexpandafter{pld@remainder}$}%
else
pld@AddTopld@lastline{%
&multispanpld@span$pld@leftxdelimstrutpld@rightdelim
pld@div
pld@PrintPolyWithDelimspld@divisor=
pld@PrintPolyShadow
ifxpld@remainder@emptyelse
+{}%
setboxz@=hbox{$displaystyle
frac{letstrut@emptypld@firsttrue expandafter
pld@PrintRemainexpandafter{pld@remainder}}%
{letstrut@emptypld@PrintPolypld@divisor}$}%
dpz@=z@boxz@
fi
$}%
fi
fi
expandafterpld@AR@pld@allinesrelax}
makeatother
arrayrulecolor{red}
arrayrulewidth=0.8pt
defstrut{rule[-6pt]{0pt}{12pt}}
begin{document}
polylongdiv[style=A]{frac{3}{7}x^9+x^2-frac{1}{4}}{frac{9}{5}x^4-1}
vspace{1cm}
polylongdiv[style=A]{x^{30}-1}{x^8-1}
end{document}
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f8557%2fhow-to-correct-excessive-lines-at-the-corner-and-bad-line-spaces-in-polynom-sty%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
...
begin{document}
jot=10ptdefstrut{rule[-2ex]{0pt}{3ex}}
polylongdiv[style=A]{3x^9+x^2-1}{frac{2}{5}x^4-1}
end{document}
add a comment |
...
begin{document}
jot=10ptdefstrut{rule[-2ex]{0pt}{3ex}}
polylongdiv[style=A]{3x^9+x^2-1}{frac{2}{5}x^4-1}
end{document}
add a comment |
...
begin{document}
jot=10ptdefstrut{rule[-2ex]{0pt}{3ex}}
polylongdiv[style=A]{3x^9+x^2-1}{frac{2}{5}x^4-1}
end{document}
...
begin{document}
jot=10ptdefstrut{rule[-2ex]{0pt}{3ex}}
polylongdiv[style=A]{3x^9+x^2-1}{frac{2}{5}x^4-1}
end{document}
answered Jan 9 '11 at 11:41
Herbert
270k24408717
270k24408717
add a comment |
add a comment |
Using @Herbert's info, I did some trial and error.
I changed Big|
to rule{}
. You can see the modification in the part enclosed by %===========================
documentclass{article}
usepackage{polynom,array}
usepackage[table]{xcolor}
makeatletter
defpld@ArrangeResult#1{%
ifxpld@remainder@empty
@tempcntapld@maxcolrelax
pld@InsertItems@dopld@lastline
{pld@firsttruepld@PLD{pld@R{0}{1}}}%
fi
ifnumpld@currstage>z@
pld@Extendpld@allines{pld@lastlinecr}%
else
pld@InsertFakepld@lastline
fi
pld@iftopresult
defpld@lastline{pld@PrintPolypld@divisor%
%========================================================================
quadsmash{{color{red}rule[-6pt]{arrayrulewidth}{17pt}}}%
kern-arrayrulewidth&}%
%========================================================================
else
letpld@lastline@empty
ifx Bpld@styleelse
defpld@lastline{pld@leftdelimstrutpld@rightxdelim&}%
fi
fi
expandafterpld@AR@colexpandafterpld@PLD
expandafterpld@lastline#1+relax+%
pld@SplitQuotient
pld@iftopresult
letpld@currentline@empty
expandafterpld@AR@colexpandafterpld@PLD
expandafterpld@currentline
pld@quotient+relax+%
expandafterpld@AR@colexpandafterpld@XPLD
expandafterpld@currentline
pld@shadow+relax+%
edefpld@subline{%
noexpandcline{tw@-pld@maxcol}%
noalign{vskipjot}}%
pld@Extendpld@currentline{expandaftercrpld@subline}%
else
@tempcnta-@tempcnta
advance@tempcntapld@maxcolrelax advance@tempcnta@ne
edefpld@span{the@tempcnta}%
ifx Bpld@style
pld@AddTopld@lastline{%
&multispanpld@span${}=%
pld@PrintPolyWithDelimspld@divisor
expandafterpld@IfSumexpandafter{pld@divisor}{}{cdot}%
expandafterpld@IfSumexpandafter{pld@quotient}pld@true
pld@false
pld@if pld@leftdelim
pld@PrintPolyShadow
pld@rightdelim
else pld@PrintPolyShadow fi
pld@firstfalse
expandafterpld@PrintRemainexpandafter{pld@remainder}$}%
else
pld@AddTopld@lastline{%
&multispanpld@span$pld@leftxdelimstrutpld@rightdelim
pld@div
pld@PrintPolyWithDelimspld@divisor=
pld@PrintPolyShadow
ifxpld@remainder@emptyelse
+{}%
setboxz@=hbox{$displaystyle
frac{letstrut@emptypld@firsttrue expandafter
pld@PrintRemainexpandafter{pld@remainder}}%
{letstrut@emptypld@PrintPolypld@divisor}$}%
dpz@=z@boxz@
fi
$}%
fi
fi
expandafterpld@AR@pld@allinesrelax}
makeatother
arrayrulecolor{red}
arrayrulewidth=0.8pt
defstrut{rule[-6pt]{0pt}{12pt}}
begin{document}
polylongdiv[style=A]{frac{3}{7}x^9+x^2-frac{1}{4}}{frac{9}{5}x^4-1}
vspace{1cm}
polylongdiv[style=A]{x^{30}-1}{x^8-1}
end{document}
add a comment |
Using @Herbert's info, I did some trial and error.
I changed Big|
to rule{}
. You can see the modification in the part enclosed by %===========================
documentclass{article}
usepackage{polynom,array}
usepackage[table]{xcolor}
makeatletter
defpld@ArrangeResult#1{%
ifxpld@remainder@empty
@tempcntapld@maxcolrelax
pld@InsertItems@dopld@lastline
{pld@firsttruepld@PLD{pld@R{0}{1}}}%
fi
ifnumpld@currstage>z@
pld@Extendpld@allines{pld@lastlinecr}%
else
pld@InsertFakepld@lastline
fi
pld@iftopresult
defpld@lastline{pld@PrintPolypld@divisor%
%========================================================================
quadsmash{{color{red}rule[-6pt]{arrayrulewidth}{17pt}}}%
kern-arrayrulewidth&}%
%========================================================================
else
letpld@lastline@empty
ifx Bpld@styleelse
defpld@lastline{pld@leftdelimstrutpld@rightxdelim&}%
fi
fi
expandafterpld@AR@colexpandafterpld@PLD
expandafterpld@lastline#1+relax+%
pld@SplitQuotient
pld@iftopresult
letpld@currentline@empty
expandafterpld@AR@colexpandafterpld@PLD
expandafterpld@currentline
pld@quotient+relax+%
expandafterpld@AR@colexpandafterpld@XPLD
expandafterpld@currentline
pld@shadow+relax+%
edefpld@subline{%
noexpandcline{tw@-pld@maxcol}%
noalign{vskipjot}}%
pld@Extendpld@currentline{expandaftercrpld@subline}%
else
@tempcnta-@tempcnta
advance@tempcntapld@maxcolrelax advance@tempcnta@ne
edefpld@span{the@tempcnta}%
ifx Bpld@style
pld@AddTopld@lastline{%
&multispanpld@span${}=%
pld@PrintPolyWithDelimspld@divisor
expandafterpld@IfSumexpandafter{pld@divisor}{}{cdot}%
expandafterpld@IfSumexpandafter{pld@quotient}pld@true
pld@false
pld@if pld@leftdelim
pld@PrintPolyShadow
pld@rightdelim
else pld@PrintPolyShadow fi
pld@firstfalse
expandafterpld@PrintRemainexpandafter{pld@remainder}$}%
else
pld@AddTopld@lastline{%
&multispanpld@span$pld@leftxdelimstrutpld@rightdelim
pld@div
pld@PrintPolyWithDelimspld@divisor=
pld@PrintPolyShadow
ifxpld@remainder@emptyelse
+{}%
setboxz@=hbox{$displaystyle
frac{letstrut@emptypld@firsttrue expandafter
pld@PrintRemainexpandafter{pld@remainder}}%
{letstrut@emptypld@PrintPolypld@divisor}$}%
dpz@=z@boxz@
fi
$}%
fi
fi
expandafterpld@AR@pld@allinesrelax}
makeatother
arrayrulecolor{red}
arrayrulewidth=0.8pt
defstrut{rule[-6pt]{0pt}{12pt}}
begin{document}
polylongdiv[style=A]{frac{3}{7}x^9+x^2-frac{1}{4}}{frac{9}{5}x^4-1}
vspace{1cm}
polylongdiv[style=A]{x^{30}-1}{x^8-1}
end{document}
add a comment |
Using @Herbert's info, I did some trial and error.
I changed Big|
to rule{}
. You can see the modification in the part enclosed by %===========================
documentclass{article}
usepackage{polynom,array}
usepackage[table]{xcolor}
makeatletter
defpld@ArrangeResult#1{%
ifxpld@remainder@empty
@tempcntapld@maxcolrelax
pld@InsertItems@dopld@lastline
{pld@firsttruepld@PLD{pld@R{0}{1}}}%
fi
ifnumpld@currstage>z@
pld@Extendpld@allines{pld@lastlinecr}%
else
pld@InsertFakepld@lastline
fi
pld@iftopresult
defpld@lastline{pld@PrintPolypld@divisor%
%========================================================================
quadsmash{{color{red}rule[-6pt]{arrayrulewidth}{17pt}}}%
kern-arrayrulewidth&}%
%========================================================================
else
letpld@lastline@empty
ifx Bpld@styleelse
defpld@lastline{pld@leftdelimstrutpld@rightxdelim&}%
fi
fi
expandafterpld@AR@colexpandafterpld@PLD
expandafterpld@lastline#1+relax+%
pld@SplitQuotient
pld@iftopresult
letpld@currentline@empty
expandafterpld@AR@colexpandafterpld@PLD
expandafterpld@currentline
pld@quotient+relax+%
expandafterpld@AR@colexpandafterpld@XPLD
expandafterpld@currentline
pld@shadow+relax+%
edefpld@subline{%
noexpandcline{tw@-pld@maxcol}%
noalign{vskipjot}}%
pld@Extendpld@currentline{expandaftercrpld@subline}%
else
@tempcnta-@tempcnta
advance@tempcntapld@maxcolrelax advance@tempcnta@ne
edefpld@span{the@tempcnta}%
ifx Bpld@style
pld@AddTopld@lastline{%
&multispanpld@span${}=%
pld@PrintPolyWithDelimspld@divisor
expandafterpld@IfSumexpandafter{pld@divisor}{}{cdot}%
expandafterpld@IfSumexpandafter{pld@quotient}pld@true
pld@false
pld@if pld@leftdelim
pld@PrintPolyShadow
pld@rightdelim
else pld@PrintPolyShadow fi
pld@firstfalse
expandafterpld@PrintRemainexpandafter{pld@remainder}$}%
else
pld@AddTopld@lastline{%
&multispanpld@span$pld@leftxdelimstrutpld@rightdelim
pld@div
pld@PrintPolyWithDelimspld@divisor=
pld@PrintPolyShadow
ifxpld@remainder@emptyelse
+{}%
setboxz@=hbox{$displaystyle
frac{letstrut@emptypld@firsttrue expandafter
pld@PrintRemainexpandafter{pld@remainder}}%
{letstrut@emptypld@PrintPolypld@divisor}$}%
dpz@=z@boxz@
fi
$}%
fi
fi
expandafterpld@AR@pld@allinesrelax}
makeatother
arrayrulecolor{red}
arrayrulewidth=0.8pt
defstrut{rule[-6pt]{0pt}{12pt}}
begin{document}
polylongdiv[style=A]{frac{3}{7}x^9+x^2-frac{1}{4}}{frac{9}{5}x^4-1}
vspace{1cm}
polylongdiv[style=A]{x^{30}-1}{x^8-1}
end{document}
Using @Herbert's info, I did some trial and error.
I changed Big|
to rule{}
. You can see the modification in the part enclosed by %===========================
documentclass{article}
usepackage{polynom,array}
usepackage[table]{xcolor}
makeatletter
defpld@ArrangeResult#1{%
ifxpld@remainder@empty
@tempcntapld@maxcolrelax
pld@InsertItems@dopld@lastline
{pld@firsttruepld@PLD{pld@R{0}{1}}}%
fi
ifnumpld@currstage>z@
pld@Extendpld@allines{pld@lastlinecr}%
else
pld@InsertFakepld@lastline
fi
pld@iftopresult
defpld@lastline{pld@PrintPolypld@divisor%
%========================================================================
quadsmash{{color{red}rule[-6pt]{arrayrulewidth}{17pt}}}%
kern-arrayrulewidth&}%
%========================================================================
else
letpld@lastline@empty
ifx Bpld@styleelse
defpld@lastline{pld@leftdelimstrutpld@rightxdelim&}%
fi
fi
expandafterpld@AR@colexpandafterpld@PLD
expandafterpld@lastline#1+relax+%
pld@SplitQuotient
pld@iftopresult
letpld@currentline@empty
expandafterpld@AR@colexpandafterpld@PLD
expandafterpld@currentline
pld@quotient+relax+%
expandafterpld@AR@colexpandafterpld@XPLD
expandafterpld@currentline
pld@shadow+relax+%
edefpld@subline{%
noexpandcline{tw@-pld@maxcol}%
noalign{vskipjot}}%
pld@Extendpld@currentline{expandaftercrpld@subline}%
else
@tempcnta-@tempcnta
advance@tempcntapld@maxcolrelax advance@tempcnta@ne
edefpld@span{the@tempcnta}%
ifx Bpld@style
pld@AddTopld@lastline{%
&multispanpld@span${}=%
pld@PrintPolyWithDelimspld@divisor
expandafterpld@IfSumexpandafter{pld@divisor}{}{cdot}%
expandafterpld@IfSumexpandafter{pld@quotient}pld@true
pld@false
pld@if pld@leftdelim
pld@PrintPolyShadow
pld@rightdelim
else pld@PrintPolyShadow fi
pld@firstfalse
expandafterpld@PrintRemainexpandafter{pld@remainder}$}%
else
pld@AddTopld@lastline{%
&multispanpld@span$pld@leftxdelimstrutpld@rightdelim
pld@div
pld@PrintPolyWithDelimspld@divisor=
pld@PrintPolyShadow
ifxpld@remainder@emptyelse
+{}%
setboxz@=hbox{$displaystyle
frac{letstrut@emptypld@firsttrue expandafter
pld@PrintRemainexpandafter{pld@remainder}}%
{letstrut@emptypld@PrintPolypld@divisor}$}%
dpz@=z@boxz@
fi
$}%
fi
fi
expandafterpld@AR@pld@allinesrelax}
makeatother
arrayrulecolor{red}
arrayrulewidth=0.8pt
defstrut{rule[-6pt]{0pt}{12pt}}
begin{document}
polylongdiv[style=A]{frac{3}{7}x^9+x^2-frac{1}{4}}{frac{9}{5}x^4-1}
vspace{1cm}
polylongdiv[style=A]{x^{30}-1}{x^8-1}
end{document}
edited Jan 9 '11 at 15:55
answered Jan 9 '11 at 14:53
xport
21.7k30138260
21.7k30138260
add a comment |
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f8557%2fhow-to-correct-excessive-lines-at-the-corner-and-bad-line-spaces-in-polynom-sty%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
where are those line corners are seen?
– Herbert
Jan 9 '11 at 11:51
@Herbert, if you compile the code above, view the output and zoom-in near the top right corner, you will see the excessive lines.
– xport
Jan 9 '11 at 11:58
@Herbert, 400% zoom will show the excessive.
– xport
Jan 9 '11 at 11:59
@xport: this doesn't happen with my code changes ...
– Herbert
Jan 9 '11 at 12:12
@Herbert, your solution only solves the spacing. Unfortunately, the vertical and horizontal rules now get separated using your setting. They should touch each other and make a GOOD corner. :-)
– xport
Jan 9 '11 at 12:32