Is it just me or $f(x) = x^2 + 17 mod 43$ adds too much space before the mod operator?
documentclass[a4paper]{article}
usepackage{amsmath}
begin{document}
Instead of $f(x) = x^2 + 17 mod 43$, I prefer $f(x) = x^2 + 17hspace{-1mm}mod 43$.
end{document}
Why was the modulo operator defined with this apparent extra space? Is there a rationale behind it?
I'm on the brink of redefining it.
spacing amsmath
add a comment |
documentclass[a4paper]{article}
usepackage{amsmath}
begin{document}
Instead of $f(x) = x^2 + 17 mod 43$, I prefer $f(x) = x^2 + 17hspace{-1mm}mod 43$.
end{document}
Why was the modulo operator defined with this apparent extra space? Is there a rationale behind it?
I'm on the brink of redefining it.
spacing amsmath
1
Related/duplicate: Writing mod in congruence problems without leading space
– Werner
Feb 11 at 23:35
add a comment |
documentclass[a4paper]{article}
usepackage{amsmath}
begin{document}
Instead of $f(x) = x^2 + 17 mod 43$, I prefer $f(x) = x^2 + 17hspace{-1mm}mod 43$.
end{document}
Why was the modulo operator defined with this apparent extra space? Is there a rationale behind it?
I'm on the brink of redefining it.
spacing amsmath
documentclass[a4paper]{article}
usepackage{amsmath}
begin{document}
Instead of $f(x) = x^2 + 17 mod 43$, I prefer $f(x) = x^2 + 17hspace{-1mm}mod 43$.
end{document}
Why was the modulo operator defined with this apparent extra space? Is there a rationale behind it?
I'm on the brink of redefining it.
spacing amsmath
spacing amsmath
asked Feb 11 at 23:26
Joep AwinitaJoep Awinita
815
815
1
Related/duplicate: Writing mod in congruence problems without leading space
– Werner
Feb 11 at 23:35
add a comment |
1
Related/duplicate: Writing mod in congruence problems without leading space
– Werner
Feb 11 at 23:35
1
1
Related/duplicate: Writing mod in congruence problems without leading space
– Werner
Feb 11 at 23:35
Related/duplicate: Writing mod in congruence problems without leading space
– Werner
Feb 11 at 23:35
add a comment |
2 Answers
2
active
oldest
votes
First and foremost: it is not an “operator”, but a traditional way to write a particular equivalence relation. Also the correct syntax is mod{43}
.
Plain TeX only has pmod
, defined as
% plain.tex, line 1089
defpmod#1{allowbreakmkern18mu({rm mod},,#1)}
so the space is 1em (in the math symbol font), because 18mu is 1em.
In the LaTeX kernel the definition is essentially the same, namely
% latex.ltx, line 4437:
defpmod#1{%
allowbreakmkern18mu({operator@font mod},,#1)}
On the other hand, amsmath
also defines mod
and pod
. The former omits parentheses and the latter has parentheses but no “mod”.
newcommand{pod}[1]{allowbreak
if@displaymkern18muelsemkern8mufi(#1)}
renewcommand{pmod}[1]{pod{{operator@font mod}mkern6mu#1}}
newcommand{mod}[1]{allowbreakif@displaymkern18mu
elsemkern12mufi{operator@font mod},,#1}
The definition of pmod
is in terms of pod
; you can see that aequiv bpod{n}
will have, after b, 1em of space in display style or 8/18em in other styles, followed by (n). With pmod
the spacing before the parenthesis is the same, but after the parentheses “mod” and a space of 6/18em will precede n.
With mod
the spacing is essentially the same, but 12/18em would be used instead of 8/18em in text style or below. Note that ,,
is the same as mkern 6mu
.
So it's just you. ;-)
Of course you're free to change the spacing by redefining pod
and mod
.
It's great that you prove your comments by showing the original definitions.
– Joep Awinita
Feb 13 at 18:07
add a comment |
The even spaced version is bmod
as in Sebastiano's now deleted answer which has the spacing you seem to want but is the wrong thing here as it would mean x^2 + (17 mod 43) which is the wrong interpretation. You want the bigger space before mod to separate it from the 17 and make it clear that it's a side condition applying to the equality which is to be interpreted as a congruence mod 43.
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%2f474433%2fis-it-just-me-or-fx-x2-17-mod-43-adds-too-much-space-before-the-mod-op%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
First and foremost: it is not an “operator”, but a traditional way to write a particular equivalence relation. Also the correct syntax is mod{43}
.
Plain TeX only has pmod
, defined as
% plain.tex, line 1089
defpmod#1{allowbreakmkern18mu({rm mod},,#1)}
so the space is 1em (in the math symbol font), because 18mu is 1em.
In the LaTeX kernel the definition is essentially the same, namely
% latex.ltx, line 4437:
defpmod#1{%
allowbreakmkern18mu({operator@font mod},,#1)}
On the other hand, amsmath
also defines mod
and pod
. The former omits parentheses and the latter has parentheses but no “mod”.
newcommand{pod}[1]{allowbreak
if@displaymkern18muelsemkern8mufi(#1)}
renewcommand{pmod}[1]{pod{{operator@font mod}mkern6mu#1}}
newcommand{mod}[1]{allowbreakif@displaymkern18mu
elsemkern12mufi{operator@font mod},,#1}
The definition of pmod
is in terms of pod
; you can see that aequiv bpod{n}
will have, after b, 1em of space in display style or 8/18em in other styles, followed by (n). With pmod
the spacing before the parenthesis is the same, but after the parentheses “mod” and a space of 6/18em will precede n.
With mod
the spacing is essentially the same, but 12/18em would be used instead of 8/18em in text style or below. Note that ,,
is the same as mkern 6mu
.
So it's just you. ;-)
Of course you're free to change the spacing by redefining pod
and mod
.
It's great that you prove your comments by showing the original definitions.
– Joep Awinita
Feb 13 at 18:07
add a comment |
First and foremost: it is not an “operator”, but a traditional way to write a particular equivalence relation. Also the correct syntax is mod{43}
.
Plain TeX only has pmod
, defined as
% plain.tex, line 1089
defpmod#1{allowbreakmkern18mu({rm mod},,#1)}
so the space is 1em (in the math symbol font), because 18mu is 1em.
In the LaTeX kernel the definition is essentially the same, namely
% latex.ltx, line 4437:
defpmod#1{%
allowbreakmkern18mu({operator@font mod},,#1)}
On the other hand, amsmath
also defines mod
and pod
. The former omits parentheses and the latter has parentheses but no “mod”.
newcommand{pod}[1]{allowbreak
if@displaymkern18muelsemkern8mufi(#1)}
renewcommand{pmod}[1]{pod{{operator@font mod}mkern6mu#1}}
newcommand{mod}[1]{allowbreakif@displaymkern18mu
elsemkern12mufi{operator@font mod},,#1}
The definition of pmod
is in terms of pod
; you can see that aequiv bpod{n}
will have, after b, 1em of space in display style or 8/18em in other styles, followed by (n). With pmod
the spacing before the parenthesis is the same, but after the parentheses “mod” and a space of 6/18em will precede n.
With mod
the spacing is essentially the same, but 12/18em would be used instead of 8/18em in text style or below. Note that ,,
is the same as mkern 6mu
.
So it's just you. ;-)
Of course you're free to change the spacing by redefining pod
and mod
.
It's great that you prove your comments by showing the original definitions.
– Joep Awinita
Feb 13 at 18:07
add a comment |
First and foremost: it is not an “operator”, but a traditional way to write a particular equivalence relation. Also the correct syntax is mod{43}
.
Plain TeX only has pmod
, defined as
% plain.tex, line 1089
defpmod#1{allowbreakmkern18mu({rm mod},,#1)}
so the space is 1em (in the math symbol font), because 18mu is 1em.
In the LaTeX kernel the definition is essentially the same, namely
% latex.ltx, line 4437:
defpmod#1{%
allowbreakmkern18mu({operator@font mod},,#1)}
On the other hand, amsmath
also defines mod
and pod
. The former omits parentheses and the latter has parentheses but no “mod”.
newcommand{pod}[1]{allowbreak
if@displaymkern18muelsemkern8mufi(#1)}
renewcommand{pmod}[1]{pod{{operator@font mod}mkern6mu#1}}
newcommand{mod}[1]{allowbreakif@displaymkern18mu
elsemkern12mufi{operator@font mod},,#1}
The definition of pmod
is in terms of pod
; you can see that aequiv bpod{n}
will have, after b, 1em of space in display style or 8/18em in other styles, followed by (n). With pmod
the spacing before the parenthesis is the same, but after the parentheses “mod” and a space of 6/18em will precede n.
With mod
the spacing is essentially the same, but 12/18em would be used instead of 8/18em in text style or below. Note that ,,
is the same as mkern 6mu
.
So it's just you. ;-)
Of course you're free to change the spacing by redefining pod
and mod
.
First and foremost: it is not an “operator”, but a traditional way to write a particular equivalence relation. Also the correct syntax is mod{43}
.
Plain TeX only has pmod
, defined as
% plain.tex, line 1089
defpmod#1{allowbreakmkern18mu({rm mod},,#1)}
so the space is 1em (in the math symbol font), because 18mu is 1em.
In the LaTeX kernel the definition is essentially the same, namely
% latex.ltx, line 4437:
defpmod#1{%
allowbreakmkern18mu({operator@font mod},,#1)}
On the other hand, amsmath
also defines mod
and pod
. The former omits parentheses and the latter has parentheses but no “mod”.
newcommand{pod}[1]{allowbreak
if@displaymkern18muelsemkern8mufi(#1)}
renewcommand{pmod}[1]{pod{{operator@font mod}mkern6mu#1}}
newcommand{mod}[1]{allowbreakif@displaymkern18mu
elsemkern12mufi{operator@font mod},,#1}
The definition of pmod
is in terms of pod
; you can see that aequiv bpod{n}
will have, after b, 1em of space in display style or 8/18em in other styles, followed by (n). With pmod
the spacing before the parenthesis is the same, but after the parentheses “mod” and a space of 6/18em will precede n.
With mod
the spacing is essentially the same, but 12/18em would be used instead of 8/18em in text style or below. Note that ,,
is the same as mkern 6mu
.
So it's just you. ;-)
Of course you're free to change the spacing by redefining pod
and mod
.
answered Feb 11 at 23:41
egregegreg
720k8719093208
720k8719093208
It's great that you prove your comments by showing the original definitions.
– Joep Awinita
Feb 13 at 18:07
add a comment |
It's great that you prove your comments by showing the original definitions.
– Joep Awinita
Feb 13 at 18:07
It's great that you prove your comments by showing the original definitions.
– Joep Awinita
Feb 13 at 18:07
It's great that you prove your comments by showing the original definitions.
– Joep Awinita
Feb 13 at 18:07
add a comment |
The even spaced version is bmod
as in Sebastiano's now deleted answer which has the spacing you seem to want but is the wrong thing here as it would mean x^2 + (17 mod 43) which is the wrong interpretation. You want the bigger space before mod to separate it from the 17 and make it clear that it's a side condition applying to the equality which is to be interpreted as a congruence mod 43.
add a comment |
The even spaced version is bmod
as in Sebastiano's now deleted answer which has the spacing you seem to want but is the wrong thing here as it would mean x^2 + (17 mod 43) which is the wrong interpretation. You want the bigger space before mod to separate it from the 17 and make it clear that it's a side condition applying to the equality which is to be interpreted as a congruence mod 43.
add a comment |
The even spaced version is bmod
as in Sebastiano's now deleted answer which has the spacing you seem to want but is the wrong thing here as it would mean x^2 + (17 mod 43) which is the wrong interpretation. You want the bigger space before mod to separate it from the 17 and make it clear that it's a side condition applying to the equality which is to be interpreted as a congruence mod 43.
The even spaced version is bmod
as in Sebastiano's now deleted answer which has the spacing you seem to want but is the wrong thing here as it would mean x^2 + (17 mod 43) which is the wrong interpretation. You want the bigger space before mod to separate it from the 17 and make it clear that it's a side condition applying to the equality which is to be interpreted as a congruence mod 43.
answered Feb 12 at 1:01
David CarlisleDavid Carlisle
491k4111341883
491k4111341883
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.
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%2f474433%2fis-it-just-me-or-fx-x2-17-mod-43-adds-too-much-space-before-the-mod-op%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
1
Related/duplicate: Writing mod in congruence problems without leading space
– Werner
Feb 11 at 23:35