Changing the definition of “mod” in spanish impossible?











up vote
7
down vote

favorite












I'm writing a math text in spanish and want to change the definition of the "mod" command. However, this seems impossible, as the following MWE shows:



documentclass{article}

usepackage[utf8]{inputenc}
usepackage[spanish]{babel}
usepackage[T1]{fontenc}
usepackage{amsmath}

renewcommand{mod}{operatorname{changed}}

begin{document}
$a equiv b mod c$
end{document}


This produces the following output:



enter image description here



However, if I comment the line



usepackage[spanish]{babel}


in the above code, the result I get is



enter image description here



as I would expect.



The same phenomenon happens with other math operators that carry accents in spanish, like for example "max" or "lim", but it works for such that don't have accents, like "sin".










share|improve this question


















  • 2




    Move the redefinition behind begin document
    – Ulrike Fischer
    2 days ago






  • 1




    Is your aim to avoid the accent in the operator names?
    – egreg
    2 days ago










  • @UlrikeFischer thanks, your suggestion precisely solves my problem. If you post it as an answer y can accept it.
    – Michael Fütterer
    2 days ago















up vote
7
down vote

favorite












I'm writing a math text in spanish and want to change the definition of the "mod" command. However, this seems impossible, as the following MWE shows:



documentclass{article}

usepackage[utf8]{inputenc}
usepackage[spanish]{babel}
usepackage[T1]{fontenc}
usepackage{amsmath}

renewcommand{mod}{operatorname{changed}}

begin{document}
$a equiv b mod c$
end{document}


This produces the following output:



enter image description here



However, if I comment the line



usepackage[spanish]{babel}


in the above code, the result I get is



enter image description here



as I would expect.



The same phenomenon happens with other math operators that carry accents in spanish, like for example "max" or "lim", but it works for such that don't have accents, like "sin".










share|improve this question


















  • 2




    Move the redefinition behind begin document
    – Ulrike Fischer
    2 days ago






  • 1




    Is your aim to avoid the accent in the operator names?
    – egreg
    2 days ago










  • @UlrikeFischer thanks, your suggestion precisely solves my problem. If you post it as an answer y can accept it.
    – Michael Fütterer
    2 days ago













up vote
7
down vote

favorite









up vote
7
down vote

favorite











I'm writing a math text in spanish and want to change the definition of the "mod" command. However, this seems impossible, as the following MWE shows:



documentclass{article}

usepackage[utf8]{inputenc}
usepackage[spanish]{babel}
usepackage[T1]{fontenc}
usepackage{amsmath}

renewcommand{mod}{operatorname{changed}}

begin{document}
$a equiv b mod c$
end{document}


This produces the following output:



enter image description here



However, if I comment the line



usepackage[spanish]{babel}


in the above code, the result I get is



enter image description here



as I would expect.



The same phenomenon happens with other math operators that carry accents in spanish, like for example "max" or "lim", but it works for such that don't have accents, like "sin".










share|improve this question













I'm writing a math text in spanish and want to change the definition of the "mod" command. However, this seems impossible, as the following MWE shows:



documentclass{article}

usepackage[utf8]{inputenc}
usepackage[spanish]{babel}
usepackage[T1]{fontenc}
usepackage{amsmath}

renewcommand{mod}{operatorname{changed}}

begin{document}
$a equiv b mod c$
end{document}


This produces the following output:



enter image description here



However, if I comment the line



usepackage[spanish]{babel}


in the above code, the result I get is



enter image description here



as I would expect.



The same phenomenon happens with other math operators that carry accents in spanish, like for example "max" or "lim", but it works for such that don't have accents, like "sin".







spanish






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 2 days ago









Michael Fütterer

23015




23015








  • 2




    Move the redefinition behind begin document
    – Ulrike Fischer
    2 days ago






  • 1




    Is your aim to avoid the accent in the operator names?
    – egreg
    2 days ago










  • @UlrikeFischer thanks, your suggestion precisely solves my problem. If you post it as an answer y can accept it.
    – Michael Fütterer
    2 days ago














  • 2




    Move the redefinition behind begin document
    – Ulrike Fischer
    2 days ago






  • 1




    Is your aim to avoid the accent in the operator names?
    – egreg
    2 days ago










  • @UlrikeFischer thanks, your suggestion precisely solves my problem. If you post it as an answer y can accept it.
    – Michael Fütterer
    2 days ago








2




2




Move the redefinition behind begin document
– Ulrike Fischer
2 days ago




Move the redefinition behind begin document
– Ulrike Fischer
2 days ago




1




1




Is your aim to avoid the accent in the operator names?
– egreg
2 days ago




Is your aim to avoid the accent in the operator names?
– egreg
2 days ago












@UlrikeFischer thanks, your suggestion precisely solves my problem. If you post it as an answer y can accept it.
– Michael Fütterer
2 days ago




@UlrikeFischer thanks, your suggestion precisely solves my problem. If you post it as an answer y can accept it.
– Michael Fütterer
2 days ago










1 Answer
1






active

oldest

votes

















up vote
12
down vote



accepted










I guess that your aim is to use the standard unaccented operator names.



The trick is explained it the manual for babel-spanish, section 5.5.



documentclass{article}

usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage[spanish]{babel}
usepackage{amsmath}

% no accents in math operators
unaccentedoperators

begin{document}

$a equiv b mod{c}$

$lim_{xto c}f(x)$

$arcsin t$

$max A-min A$

end{document}


enter image description here



Beware that mod is not defined with operatorname and your proposed redefinition would be bad anyway.



Anyway, here's a correct way to proceed:



documentclass{article}

usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage[spanish]{babel}
usepackage{amsmath}

%unaccentedoperators

makeatletter
addtomathspanish{renewcommand{mod}{operatorname{mes@op@ac od}}}
makeatother

begin{document}

$a equiv b mod c$

end{document}


enter image description here



If you don't want the accent irrespective of accentedoperators or unaccentedoperators, remove the es@op@ac command.



In general, I don't recommend redefining some standard command to do different things (apart from printing just a different symbol). Better defining omod or whatever name you prefer.






share|improve this answer



















  • 2




    +1: Is unaccentedoperators part of babel then?
    – Dr. Manuel Kuehner
    2 days ago






  • 1




    @Dr.ManuelKuehner Yes, see babel-manual.pdf section 27 (which is about the Spanish language options).
    – alephzero
    2 days ago










  • Actually I do want to use the accented versions because they seem to be quite standard in spanish math texts, and I do want mod to behave like an operator (as this fits my mathematical needs better). For the same reason I want to redefine lim to denote categorical limits instead of analytic ones, so in any case this wouldn't solve my issue.
    – Michael Fütterer
    2 days ago












  • @MichaelFütterer I added a different version. I'm not sure where categorical limit notation is different from analytic notation.
    – egreg
    2 days ago












  • Thanks, with that I'll be able to solve the problem! For the categorical limit I just realized that a solution is already described here tex.stackexchange.com/questions/342037/…
    – Michael Fütterer
    2 days ago











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',
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
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f461371%2fchanging-the-definition-of-mod-in-spanish-impossible%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
12
down vote



accepted










I guess that your aim is to use the standard unaccented operator names.



The trick is explained it the manual for babel-spanish, section 5.5.



documentclass{article}

usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage[spanish]{babel}
usepackage{amsmath}

% no accents in math operators
unaccentedoperators

begin{document}

$a equiv b mod{c}$

$lim_{xto c}f(x)$

$arcsin t$

$max A-min A$

end{document}


enter image description here



Beware that mod is not defined with operatorname and your proposed redefinition would be bad anyway.



Anyway, here's a correct way to proceed:



documentclass{article}

usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage[spanish]{babel}
usepackage{amsmath}

%unaccentedoperators

makeatletter
addtomathspanish{renewcommand{mod}{operatorname{mes@op@ac od}}}
makeatother

begin{document}

$a equiv b mod c$

end{document}


enter image description here



If you don't want the accent irrespective of accentedoperators or unaccentedoperators, remove the es@op@ac command.



In general, I don't recommend redefining some standard command to do different things (apart from printing just a different symbol). Better defining omod or whatever name you prefer.






share|improve this answer



















  • 2




    +1: Is unaccentedoperators part of babel then?
    – Dr. Manuel Kuehner
    2 days ago






  • 1




    @Dr.ManuelKuehner Yes, see babel-manual.pdf section 27 (which is about the Spanish language options).
    – alephzero
    2 days ago










  • Actually I do want to use the accented versions because they seem to be quite standard in spanish math texts, and I do want mod to behave like an operator (as this fits my mathematical needs better). For the same reason I want to redefine lim to denote categorical limits instead of analytic ones, so in any case this wouldn't solve my issue.
    – Michael Fütterer
    2 days ago












  • @MichaelFütterer I added a different version. I'm not sure where categorical limit notation is different from analytic notation.
    – egreg
    2 days ago












  • Thanks, with that I'll be able to solve the problem! For the categorical limit I just realized that a solution is already described here tex.stackexchange.com/questions/342037/…
    – Michael Fütterer
    2 days ago















up vote
12
down vote



accepted










I guess that your aim is to use the standard unaccented operator names.



The trick is explained it the manual for babel-spanish, section 5.5.



documentclass{article}

usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage[spanish]{babel}
usepackage{amsmath}

% no accents in math operators
unaccentedoperators

begin{document}

$a equiv b mod{c}$

$lim_{xto c}f(x)$

$arcsin t$

$max A-min A$

end{document}


enter image description here



Beware that mod is not defined with operatorname and your proposed redefinition would be bad anyway.



Anyway, here's a correct way to proceed:



documentclass{article}

usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage[spanish]{babel}
usepackage{amsmath}

%unaccentedoperators

makeatletter
addtomathspanish{renewcommand{mod}{operatorname{mes@op@ac od}}}
makeatother

begin{document}

$a equiv b mod c$

end{document}


enter image description here



If you don't want the accent irrespective of accentedoperators or unaccentedoperators, remove the es@op@ac command.



In general, I don't recommend redefining some standard command to do different things (apart from printing just a different symbol). Better defining omod or whatever name you prefer.






share|improve this answer



















  • 2




    +1: Is unaccentedoperators part of babel then?
    – Dr. Manuel Kuehner
    2 days ago






  • 1




    @Dr.ManuelKuehner Yes, see babel-manual.pdf section 27 (which is about the Spanish language options).
    – alephzero
    2 days ago










  • Actually I do want to use the accented versions because they seem to be quite standard in spanish math texts, and I do want mod to behave like an operator (as this fits my mathematical needs better). For the same reason I want to redefine lim to denote categorical limits instead of analytic ones, so in any case this wouldn't solve my issue.
    – Michael Fütterer
    2 days ago












  • @MichaelFütterer I added a different version. I'm not sure where categorical limit notation is different from analytic notation.
    – egreg
    2 days ago












  • Thanks, with that I'll be able to solve the problem! For the categorical limit I just realized that a solution is already described here tex.stackexchange.com/questions/342037/…
    – Michael Fütterer
    2 days ago













up vote
12
down vote



accepted







up vote
12
down vote



accepted






I guess that your aim is to use the standard unaccented operator names.



The trick is explained it the manual for babel-spanish, section 5.5.



documentclass{article}

usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage[spanish]{babel}
usepackage{amsmath}

% no accents in math operators
unaccentedoperators

begin{document}

$a equiv b mod{c}$

$lim_{xto c}f(x)$

$arcsin t$

$max A-min A$

end{document}


enter image description here



Beware that mod is not defined with operatorname and your proposed redefinition would be bad anyway.



Anyway, here's a correct way to proceed:



documentclass{article}

usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage[spanish]{babel}
usepackage{amsmath}

%unaccentedoperators

makeatletter
addtomathspanish{renewcommand{mod}{operatorname{mes@op@ac od}}}
makeatother

begin{document}

$a equiv b mod c$

end{document}


enter image description here



If you don't want the accent irrespective of accentedoperators or unaccentedoperators, remove the es@op@ac command.



In general, I don't recommend redefining some standard command to do different things (apart from printing just a different symbol). Better defining omod or whatever name you prefer.






share|improve this answer














I guess that your aim is to use the standard unaccented operator names.



The trick is explained it the manual for babel-spanish, section 5.5.



documentclass{article}

usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage[spanish]{babel}
usepackage{amsmath}

% no accents in math operators
unaccentedoperators

begin{document}

$a equiv b mod{c}$

$lim_{xto c}f(x)$

$arcsin t$

$max A-min A$

end{document}


enter image description here



Beware that mod is not defined with operatorname and your proposed redefinition would be bad anyway.



Anyway, here's a correct way to proceed:



documentclass{article}

usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage[spanish]{babel}
usepackage{amsmath}

%unaccentedoperators

makeatletter
addtomathspanish{renewcommand{mod}{operatorname{mes@op@ac od}}}
makeatother

begin{document}

$a equiv b mod c$

end{document}


enter image description here



If you don't want the accent irrespective of accentedoperators or unaccentedoperators, remove the es@op@ac command.



In general, I don't recommend redefining some standard command to do different things (apart from printing just a different symbol). Better defining omod or whatever name you prefer.







share|improve this answer














share|improve this answer



share|improve this answer








edited 2 days ago

























answered 2 days ago









egreg

699k8518613133




699k8518613133








  • 2




    +1: Is unaccentedoperators part of babel then?
    – Dr. Manuel Kuehner
    2 days ago






  • 1




    @Dr.ManuelKuehner Yes, see babel-manual.pdf section 27 (which is about the Spanish language options).
    – alephzero
    2 days ago










  • Actually I do want to use the accented versions because they seem to be quite standard in spanish math texts, and I do want mod to behave like an operator (as this fits my mathematical needs better). For the same reason I want to redefine lim to denote categorical limits instead of analytic ones, so in any case this wouldn't solve my issue.
    – Michael Fütterer
    2 days ago












  • @MichaelFütterer I added a different version. I'm not sure where categorical limit notation is different from analytic notation.
    – egreg
    2 days ago












  • Thanks, with that I'll be able to solve the problem! For the categorical limit I just realized that a solution is already described here tex.stackexchange.com/questions/342037/…
    – Michael Fütterer
    2 days ago














  • 2




    +1: Is unaccentedoperators part of babel then?
    – Dr. Manuel Kuehner
    2 days ago






  • 1




    @Dr.ManuelKuehner Yes, see babel-manual.pdf section 27 (which is about the Spanish language options).
    – alephzero
    2 days ago










  • Actually I do want to use the accented versions because they seem to be quite standard in spanish math texts, and I do want mod to behave like an operator (as this fits my mathematical needs better). For the same reason I want to redefine lim to denote categorical limits instead of analytic ones, so in any case this wouldn't solve my issue.
    – Michael Fütterer
    2 days ago












  • @MichaelFütterer I added a different version. I'm not sure where categorical limit notation is different from analytic notation.
    – egreg
    2 days ago












  • Thanks, with that I'll be able to solve the problem! For the categorical limit I just realized that a solution is already described here tex.stackexchange.com/questions/342037/…
    – Michael Fütterer
    2 days ago








2




2




+1: Is unaccentedoperators part of babel then?
– Dr. Manuel Kuehner
2 days ago




+1: Is unaccentedoperators part of babel then?
– Dr. Manuel Kuehner
2 days ago




1




1




@Dr.ManuelKuehner Yes, see babel-manual.pdf section 27 (which is about the Spanish language options).
– alephzero
2 days ago




@Dr.ManuelKuehner Yes, see babel-manual.pdf section 27 (which is about the Spanish language options).
– alephzero
2 days ago












Actually I do want to use the accented versions because they seem to be quite standard in spanish math texts, and I do want mod to behave like an operator (as this fits my mathematical needs better). For the same reason I want to redefine lim to denote categorical limits instead of analytic ones, so in any case this wouldn't solve my issue.
– Michael Fütterer
2 days ago






Actually I do want to use the accented versions because they seem to be quite standard in spanish math texts, and I do want mod to behave like an operator (as this fits my mathematical needs better). For the same reason I want to redefine lim to denote categorical limits instead of analytic ones, so in any case this wouldn't solve my issue.
– Michael Fütterer
2 days ago














@MichaelFütterer I added a different version. I'm not sure where categorical limit notation is different from analytic notation.
– egreg
2 days ago






@MichaelFütterer I added a different version. I'm not sure where categorical limit notation is different from analytic notation.
– egreg
2 days ago














Thanks, with that I'll be able to solve the problem! For the categorical limit I just realized that a solution is already described here tex.stackexchange.com/questions/342037/…
– Michael Fütterer
2 days ago




Thanks, with that I'll be able to solve the problem! For the categorical limit I just realized that a solution is already described here tex.stackexchange.com/questions/342037/…
– Michael Fütterer
2 days ago


















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f461371%2fchanging-the-definition-of-mod-in-spanish-impossible%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

If I really need a card on my start hand, how many mulligans make sense? [duplicate]

Alcedinidae

Can an atomic nucleus contain both particles and antiparticles? [duplicate]