Long division spacing
Original thread. I want to make the long division represented with floating point, but i have strange results. The numbers are not aligned (with yellow). And some numbers are far away(red).
documentclass{article}
usepackage[TABcline]{tabstackengine}
TABstackMath
renewcommandstackalignment{l}
newcommandlminus{llap{$-$}}
{catcode`-=active
gdef -{lminus}}
newcommandminusactive{phantom{-}catcode`-=active}
setstacktabbedgap{3pt}
begin{document}
begin{tabular}{ll@{hspace{10ex}}c}
$
minusactive
tabbedShortunderstack[r]{
&7,&6&2&4&:4=1,815\
-&4&& &&&\
TABcline{2,3}
& &3&2&&&&\
&-&3&2&&&&\
TABcline{3,4}
& & & &6& &&\
& & &-&4& &&\
TABcline{5}
& & & & 2&0&\
& & & -& 2&0&\
TABcline{5}
& & & &0&
}
$
end{tabular}
end{document}
math-mode
add a comment |
Original thread. I want to make the long division represented with floating point, but i have strange results. The numbers are not aligned (with yellow). And some numbers are far away(red).
documentclass{article}
usepackage[TABcline]{tabstackengine}
TABstackMath
renewcommandstackalignment{l}
newcommandlminus{llap{$-$}}
{catcode`-=active
gdef -{lminus}}
newcommandminusactive{phantom{-}catcode`-=active}
setstacktabbedgap{3pt}
begin{document}
begin{tabular}{ll@{hspace{10ex}}c}
$
minusactive
tabbedShortunderstack[r]{
&7,&6&2&4&:4=1,815\
-&4&& &&&\
TABcline{2,3}
& &3&2&&&&\
&-&3&2&&&&\
TABcline{3,4}
& & & &6& &&\
& & &-&4& &&\
TABcline{5}
& & & & 2&0&\
& & & -& 2&0&\
TABcline{5}
& & & &0&
}
$
end{tabular}
end{document}
math-mode
Just out of curiosity -- Why did you set the result of the division to 1815 rather 1906?
– Mico
Dec 30 '18 at 23:48
You are right. The number is 7,26 not 7,246... Again making mistake for fast MEW.
– Simeon Simeonov
Dec 31 '18 at 1:10
add a comment |
Original thread. I want to make the long division represented with floating point, but i have strange results. The numbers are not aligned (with yellow). And some numbers are far away(red).
documentclass{article}
usepackage[TABcline]{tabstackengine}
TABstackMath
renewcommandstackalignment{l}
newcommandlminus{llap{$-$}}
{catcode`-=active
gdef -{lminus}}
newcommandminusactive{phantom{-}catcode`-=active}
setstacktabbedgap{3pt}
begin{document}
begin{tabular}{ll@{hspace{10ex}}c}
$
minusactive
tabbedShortunderstack[r]{
&7,&6&2&4&:4=1,815\
-&4&& &&&\
TABcline{2,3}
& &3&2&&&&\
&-&3&2&&&&\
TABcline{3,4}
& & & &6& &&\
& & &-&4& &&\
TABcline{5}
& & & & 2&0&\
& & & -& 2&0&\
TABcline{5}
& & & &0&
}
$
end{tabular}
end{document}
math-mode
Original thread. I want to make the long division represented with floating point, but i have strange results. The numbers are not aligned (with yellow). And some numbers are far away(red).
documentclass{article}
usepackage[TABcline]{tabstackengine}
TABstackMath
renewcommandstackalignment{l}
newcommandlminus{llap{$-$}}
{catcode`-=active
gdef -{lminus}}
newcommandminusactive{phantom{-}catcode`-=active}
setstacktabbedgap{3pt}
begin{document}
begin{tabular}{ll@{hspace{10ex}}c}
$
minusactive
tabbedShortunderstack[r]{
&7,&6&2&4&:4=1,815\
-&4&& &&&\
TABcline{2,3}
& &3&2&&&&\
&-&3&2&&&&\
TABcline{3,4}
& & & &6& &&\
& & &-&4& &&\
TABcline{5}
& & & & 2&0&\
& & & -& 2&0&\
TABcline{5}
& & & &0&
}
$
end{tabular}
end{document}
math-mode
math-mode
asked Dec 30 '18 at 23:08
Simeon SimeonovSimeon Simeonov
4847
4847
Just out of curiosity -- Why did you set the result of the division to 1815 rather 1906?
– Mico
Dec 30 '18 at 23:48
You are right. The number is 7,26 not 7,246... Again making mistake for fast MEW.
– Simeon Simeonov
Dec 31 '18 at 1:10
add a comment |
Just out of curiosity -- Why did you set the result of the division to 1815 rather 1906?
– Mico
Dec 30 '18 at 23:48
You are right. The number is 7,26 not 7,246... Again making mistake for fast MEW.
– Simeon Simeonov
Dec 31 '18 at 1:10
Just out of curiosity -- Why did you set the result of the division to 1815 rather 1906?
– Mico
Dec 30 '18 at 23:48
Just out of curiosity -- Why did you set the result of the division to 1815 rather 1906?
– Mico
Dec 30 '18 at 23:48
You are right. The number is 7,26 not 7,246... Again making mistake for fast MEW.
– Simeon Simeonov
Dec 31 '18 at 1:10
You are right. The number is 7,26 not 7,246... Again making mistake for fast MEW.
– Simeon Simeonov
Dec 31 '18 at 1:10
add a comment |
2 Answers
2
active
oldest
votes
Like this?
documentclass{article}
usepackage[TABcline]{tabstackengine}
TABstackMath
renewcommandstackalignment{l}
newcommandlminus{llap{$-$}}
{catcode`-=active
gdef -{lminus}}
newcommandminusactive{phantom{-}catcode`-=active}
setstacktabbedgap{3pt}
begin{document}
begin{tabular}{ll@{hspace{10ex}}c}
$
minusactive
tabbedShortunderstack[r]{
&7rlap{,}&6&2&4&:4=1,815\
-&4&& &&&\
TABcline{2,3}
& &3&2&&&&\
&-&3&2&&&&\
TABcline{3,4}
& & & &6& &&\
& & &-&4& &&\
TABcline{5}
& & & & 2rlap{$; 0 $}&&\
& & & -& 2rlap{$; 0 $}&&\
TABcline{5}
& & & &0&
}
$
end{tabular}
end{document}
add a comment |
If you don't need to show the thousands-separator symbol (here: ,
), the layout becomes much easier, and the typographic problem can be solved using just an array
environment.
documentclass{article}
usepackage{array} % for 'newcolumntype' macro
newcolumntype{C}{>{{}}c<{{}}}
usepackage{mathtools} % for 'mathllap' macro
begin{document}
[
setlengtharraycolsep{0.5pt} % default: 5pt
begin{array}[t]{@{} C @{} *{4}{c} CcC *{4}{c} @{}}
&7&6&2&4 &:&4&=& 1&9&0&6\
-&4 \ cline{2-2}
&3&6 \
-&3&6 \ cline{2-3}
& &0&2 \
& &mathllap{-}&0 \ cline{4-4}
& & &2&4\
& &mathllap{-}&2&4\ cline{4-5}
& & & &0rlap{.} % "rlap{.}" is optional
\ cline{5-5} % optional
end{array}
qquad
begin{array}[t]{@{} C @{} *{4}{c} CcC *{4}{c} @{}}
&7&2&6&0 &:&4&=& 1&8&1&5\
-&4 \ cline{2-2}
&3&2 \
-&3&2 \ cline{2-3}
& &0&6 \
& &mathllap{-}&4 \ cline{4-4}
& & &2&0\
& &mathllap{-}&2&0\ cline{4-5}
& & & &0rlap{.} % "rlap{.}" is optional
\ cline{5-5} % optional
end{array}
]
end{document}
1
The comma may have had the meaning of a decimal point, conventions vary.
– Carsten S
Dec 31 '18 at 10:54
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%2f467968%2flong-division-spacing%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
Like this?
documentclass{article}
usepackage[TABcline]{tabstackengine}
TABstackMath
renewcommandstackalignment{l}
newcommandlminus{llap{$-$}}
{catcode`-=active
gdef -{lminus}}
newcommandminusactive{phantom{-}catcode`-=active}
setstacktabbedgap{3pt}
begin{document}
begin{tabular}{ll@{hspace{10ex}}c}
$
minusactive
tabbedShortunderstack[r]{
&7rlap{,}&6&2&4&:4=1,815\
-&4&& &&&\
TABcline{2,3}
& &3&2&&&&\
&-&3&2&&&&\
TABcline{3,4}
& & & &6& &&\
& & &-&4& &&\
TABcline{5}
& & & & 2rlap{$; 0 $}&&\
& & & -& 2rlap{$; 0 $}&&\
TABcline{5}
& & & &0&
}
$
end{tabular}
end{document}
add a comment |
Like this?
documentclass{article}
usepackage[TABcline]{tabstackengine}
TABstackMath
renewcommandstackalignment{l}
newcommandlminus{llap{$-$}}
{catcode`-=active
gdef -{lminus}}
newcommandminusactive{phantom{-}catcode`-=active}
setstacktabbedgap{3pt}
begin{document}
begin{tabular}{ll@{hspace{10ex}}c}
$
minusactive
tabbedShortunderstack[r]{
&7rlap{,}&6&2&4&:4=1,815\
-&4&& &&&\
TABcline{2,3}
& &3&2&&&&\
&-&3&2&&&&\
TABcline{3,4}
& & & &6& &&\
& & &-&4& &&\
TABcline{5}
& & & & 2rlap{$; 0 $}&&\
& & & -& 2rlap{$; 0 $}&&\
TABcline{5}
& & & &0&
}
$
end{tabular}
end{document}
add a comment |
Like this?
documentclass{article}
usepackage[TABcline]{tabstackengine}
TABstackMath
renewcommandstackalignment{l}
newcommandlminus{llap{$-$}}
{catcode`-=active
gdef -{lminus}}
newcommandminusactive{phantom{-}catcode`-=active}
setstacktabbedgap{3pt}
begin{document}
begin{tabular}{ll@{hspace{10ex}}c}
$
minusactive
tabbedShortunderstack[r]{
&7rlap{,}&6&2&4&:4=1,815\
-&4&& &&&\
TABcline{2,3}
& &3&2&&&&\
&-&3&2&&&&\
TABcline{3,4}
& & & &6& &&\
& & &-&4& &&\
TABcline{5}
& & & & 2rlap{$; 0 $}&&\
& & & -& 2rlap{$; 0 $}&&\
TABcline{5}
& & & &0&
}
$
end{tabular}
end{document}
Like this?
documentclass{article}
usepackage[TABcline]{tabstackengine}
TABstackMath
renewcommandstackalignment{l}
newcommandlminus{llap{$-$}}
{catcode`-=active
gdef -{lminus}}
newcommandminusactive{phantom{-}catcode`-=active}
setstacktabbedgap{3pt}
begin{document}
begin{tabular}{ll@{hspace{10ex}}c}
$
minusactive
tabbedShortunderstack[r]{
&7rlap{,}&6&2&4&:4=1,815\
-&4&& &&&\
TABcline{2,3}
& &3&2&&&&\
&-&3&2&&&&\
TABcline{3,4}
& & & &6& &&\
& & &-&4& &&\
TABcline{5}
& & & & 2rlap{$; 0 $}&&\
& & & -& 2rlap{$; 0 $}&&\
TABcline{5}
& & & &0&
}
$
end{tabular}
end{document}
answered Dec 30 '18 at 23:24
BernardBernard
177k779211
177k779211
add a comment |
add a comment |
If you don't need to show the thousands-separator symbol (here: ,
), the layout becomes much easier, and the typographic problem can be solved using just an array
environment.
documentclass{article}
usepackage{array} % for 'newcolumntype' macro
newcolumntype{C}{>{{}}c<{{}}}
usepackage{mathtools} % for 'mathllap' macro
begin{document}
[
setlengtharraycolsep{0.5pt} % default: 5pt
begin{array}[t]{@{} C @{} *{4}{c} CcC *{4}{c} @{}}
&7&6&2&4 &:&4&=& 1&9&0&6\
-&4 \ cline{2-2}
&3&6 \
-&3&6 \ cline{2-3}
& &0&2 \
& &mathllap{-}&0 \ cline{4-4}
& & &2&4\
& &mathllap{-}&2&4\ cline{4-5}
& & & &0rlap{.} % "rlap{.}" is optional
\ cline{5-5} % optional
end{array}
qquad
begin{array}[t]{@{} C @{} *{4}{c} CcC *{4}{c} @{}}
&7&2&6&0 &:&4&=& 1&8&1&5\
-&4 \ cline{2-2}
&3&2 \
-&3&2 \ cline{2-3}
& &0&6 \
& &mathllap{-}&4 \ cline{4-4}
& & &2&0\
& &mathllap{-}&2&0\ cline{4-5}
& & & &0rlap{.} % "rlap{.}" is optional
\ cline{5-5} % optional
end{array}
]
end{document}
1
The comma may have had the meaning of a decimal point, conventions vary.
– Carsten S
Dec 31 '18 at 10:54
add a comment |
If you don't need to show the thousands-separator symbol (here: ,
), the layout becomes much easier, and the typographic problem can be solved using just an array
environment.
documentclass{article}
usepackage{array} % for 'newcolumntype' macro
newcolumntype{C}{>{{}}c<{{}}}
usepackage{mathtools} % for 'mathllap' macro
begin{document}
[
setlengtharraycolsep{0.5pt} % default: 5pt
begin{array}[t]{@{} C @{} *{4}{c} CcC *{4}{c} @{}}
&7&6&2&4 &:&4&=& 1&9&0&6\
-&4 \ cline{2-2}
&3&6 \
-&3&6 \ cline{2-3}
& &0&2 \
& &mathllap{-}&0 \ cline{4-4}
& & &2&4\
& &mathllap{-}&2&4\ cline{4-5}
& & & &0rlap{.} % "rlap{.}" is optional
\ cline{5-5} % optional
end{array}
qquad
begin{array}[t]{@{} C @{} *{4}{c} CcC *{4}{c} @{}}
&7&2&6&0 &:&4&=& 1&8&1&5\
-&4 \ cline{2-2}
&3&2 \
-&3&2 \ cline{2-3}
& &0&6 \
& &mathllap{-}&4 \ cline{4-4}
& & &2&0\
& &mathllap{-}&2&0\ cline{4-5}
& & & &0rlap{.} % "rlap{.}" is optional
\ cline{5-5} % optional
end{array}
]
end{document}
1
The comma may have had the meaning of a decimal point, conventions vary.
– Carsten S
Dec 31 '18 at 10:54
add a comment |
If you don't need to show the thousands-separator symbol (here: ,
), the layout becomes much easier, and the typographic problem can be solved using just an array
environment.
documentclass{article}
usepackage{array} % for 'newcolumntype' macro
newcolumntype{C}{>{{}}c<{{}}}
usepackage{mathtools} % for 'mathllap' macro
begin{document}
[
setlengtharraycolsep{0.5pt} % default: 5pt
begin{array}[t]{@{} C @{} *{4}{c} CcC *{4}{c} @{}}
&7&6&2&4 &:&4&=& 1&9&0&6\
-&4 \ cline{2-2}
&3&6 \
-&3&6 \ cline{2-3}
& &0&2 \
& &mathllap{-}&0 \ cline{4-4}
& & &2&4\
& &mathllap{-}&2&4\ cline{4-5}
& & & &0rlap{.} % "rlap{.}" is optional
\ cline{5-5} % optional
end{array}
qquad
begin{array}[t]{@{} C @{} *{4}{c} CcC *{4}{c} @{}}
&7&2&6&0 &:&4&=& 1&8&1&5\
-&4 \ cline{2-2}
&3&2 \
-&3&2 \ cline{2-3}
& &0&6 \
& &mathllap{-}&4 \ cline{4-4}
& & &2&0\
& &mathllap{-}&2&0\ cline{4-5}
& & & &0rlap{.} % "rlap{.}" is optional
\ cline{5-5} % optional
end{array}
]
end{document}
If you don't need to show the thousands-separator symbol (here: ,
), the layout becomes much easier, and the typographic problem can be solved using just an array
environment.
documentclass{article}
usepackage{array} % for 'newcolumntype' macro
newcolumntype{C}{>{{}}c<{{}}}
usepackage{mathtools} % for 'mathllap' macro
begin{document}
[
setlengtharraycolsep{0.5pt} % default: 5pt
begin{array}[t]{@{} C @{} *{4}{c} CcC *{4}{c} @{}}
&7&6&2&4 &:&4&=& 1&9&0&6\
-&4 \ cline{2-2}
&3&6 \
-&3&6 \ cline{2-3}
& &0&2 \
& &mathllap{-}&0 \ cline{4-4}
& & &2&4\
& &mathllap{-}&2&4\ cline{4-5}
& & & &0rlap{.} % "rlap{.}" is optional
\ cline{5-5} % optional
end{array}
qquad
begin{array}[t]{@{} C @{} *{4}{c} CcC *{4}{c} @{}}
&7&2&6&0 &:&4&=& 1&8&1&5\
-&4 \ cline{2-2}
&3&2 \
-&3&2 \ cline{2-3}
& &0&6 \
& &mathllap{-}&4 \ cline{4-4}
& & &2&0\
& &mathllap{-}&2&0\ cline{4-5}
& & & &0rlap{.} % "rlap{.}" is optional
\ cline{5-5} % optional
end{array}
]
end{document}
edited Dec 31 '18 at 1:03
answered Dec 31 '18 at 0:16
MicoMico
288k32394782
288k32394782
1
The comma may have had the meaning of a decimal point, conventions vary.
– Carsten S
Dec 31 '18 at 10:54
add a comment |
1
The comma may have had the meaning of a decimal point, conventions vary.
– Carsten S
Dec 31 '18 at 10:54
1
1
The comma may have had the meaning of a decimal point, conventions vary.
– Carsten S
Dec 31 '18 at 10:54
The comma may have had the meaning of a decimal point, conventions vary.
– Carsten S
Dec 31 '18 at 10:54
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.
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%2f467968%2flong-division-spacing%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
Just out of curiosity -- Why did you set the result of the division to 1815 rather 1906?
– Mico
Dec 30 '18 at 23:48
You are right. The number is 7,26 not 7,246... Again making mistake for fast MEW.
– Simeon Simeonov
Dec 31 '18 at 1:10