DeclareMathOperator adds spaces after the periods contained in its second argument (name text)

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
6
down vote

favorite












The following MCE points out that DeclareMathOperator, if its second argument (name text) contains periods, adds spaces after those periods:



documentclassarticle
usepackageamsmath
%
DeclareMathOperatorlimonel.i.m.
newcommandlimtwomathopmathrml.i.m.
%
begindocument
beginalign*
A_t & =limone A_n,t \
A_t & =limtwo A_n,t \
A_t & =textl.i.m. A_n,t
endalign*
enddocument


enter image description here



Do you know why and how to get rid of these spaces?










share|improve this question





















  • DeclareMathOperatorlimonel.i.m. Note that while the l.i.m. will still line up with your text case, there will be a gap following the last ., because l.i.m. is now an operator, whereas textl.i.m. is a math atom.
    – Steven B. Segletes
    Sep 19 at 19:48











  • Using . ? Untested, it just makes the dot an ord. Which math operator is that? Never seen one with punctuation in it before
    – daleif
    Sep 19 at 19:50










  • @daleif . works nicely indeed. Concerning the operator, some authors use it for denoting the convergence in the mean square sense. I agree it is quite strange :)
    – Denis Bitouzé
    Sep 19 at 19:56














up vote
6
down vote

favorite












The following MCE points out that DeclareMathOperator, if its second argument (name text) contains periods, adds spaces after those periods:



documentclassarticle
usepackageamsmath
%
DeclareMathOperatorlimonel.i.m.
newcommandlimtwomathopmathrml.i.m.
%
begindocument
beginalign*
A_t & =limone A_n,t \
A_t & =limtwo A_n,t \
A_t & =textl.i.m. A_n,t
endalign*
enddocument


enter image description here



Do you know why and how to get rid of these spaces?










share|improve this question





















  • DeclareMathOperatorlimonel.i.m. Note that while the l.i.m. will still line up with your text case, there will be a gap following the last ., because l.i.m. is now an operator, whereas textl.i.m. is a math atom.
    – Steven B. Segletes
    Sep 19 at 19:48











  • Using . ? Untested, it just makes the dot an ord. Which math operator is that? Never seen one with punctuation in it before
    – daleif
    Sep 19 at 19:50










  • @daleif . works nicely indeed. Concerning the operator, some authors use it for denoting the convergence in the mean square sense. I agree it is quite strange :)
    – Denis Bitouzé
    Sep 19 at 19:56












up vote
6
down vote

favorite









up vote
6
down vote

favorite











The following MCE points out that DeclareMathOperator, if its second argument (name text) contains periods, adds spaces after those periods:



documentclassarticle
usepackageamsmath
%
DeclareMathOperatorlimonel.i.m.
newcommandlimtwomathopmathrml.i.m.
%
begindocument
beginalign*
A_t & =limone A_n,t \
A_t & =limtwo A_n,t \
A_t & =textl.i.m. A_n,t
endalign*
enddocument


enter image description here



Do you know why and how to get rid of these spaces?










share|improve this question













The following MCE points out that DeclareMathOperator, if its second argument (name text) contains periods, adds spaces after those periods:



documentclassarticle
usepackageamsmath
%
DeclareMathOperatorlimonel.i.m.
newcommandlimtwomathopmathrml.i.m.
%
begindocument
beginalign*
A_t & =limone A_n,t \
A_t & =limtwo A_n,t \
A_t & =textl.i.m. A_n,t
endalign*
enddocument


enter image description here



Do you know why and how to get rid of these spaces?







spacing amsmath math-operators operator-space






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Sep 19 at 19:42









Denis Bitouzé

3,49111345




3,49111345











  • DeclareMathOperatorlimonel.i.m. Note that while the l.i.m. will still line up with your text case, there will be a gap following the last ., because l.i.m. is now an operator, whereas textl.i.m. is a math atom.
    – Steven B. Segletes
    Sep 19 at 19:48











  • Using . ? Untested, it just makes the dot an ord. Which math operator is that? Never seen one with punctuation in it before
    – daleif
    Sep 19 at 19:50










  • @daleif . works nicely indeed. Concerning the operator, some authors use it for denoting the convergence in the mean square sense. I agree it is quite strange :)
    – Denis Bitouzé
    Sep 19 at 19:56
















  • DeclareMathOperatorlimonel.i.m. Note that while the l.i.m. will still line up with your text case, there will be a gap following the last ., because l.i.m. is now an operator, whereas textl.i.m. is a math atom.
    – Steven B. Segletes
    Sep 19 at 19:48











  • Using . ? Untested, it just makes the dot an ord. Which math operator is that? Never seen one with punctuation in it before
    – daleif
    Sep 19 at 19:50










  • @daleif . works nicely indeed. Concerning the operator, some authors use it for denoting the convergence in the mean square sense. I agree it is quite strange :)
    – Denis Bitouzé
    Sep 19 at 19:56















DeclareMathOperatorlimonel.i.m. Note that while the l.i.m. will still line up with your text case, there will be a gap following the last ., because l.i.m. is now an operator, whereas textl.i.m. is a math atom.
– Steven B. Segletes
Sep 19 at 19:48





DeclareMathOperatorlimonel.i.m. Note that while the l.i.m. will still line up with your text case, there will be a gap following the last ., because l.i.m. is now an operator, whereas textl.i.m. is a math atom.
– Steven B. Segletes
Sep 19 at 19:48













Using . ? Untested, it just makes the dot an ord. Which math operator is that? Never seen one with punctuation in it before
– daleif
Sep 19 at 19:50




Using . ? Untested, it just makes the dot an ord. Which math operator is that? Never seen one with punctuation in it before
– daleif
Sep 19 at 19:50












@daleif . works nicely indeed. Concerning the operator, some authors use it for denoting the convergence in the mean square sense. I agree it is quite strange :)
– Denis Bitouzé
Sep 19 at 19:56




@daleif . works nicely indeed. Concerning the operator, some authors use it for denoting the convergence in the mean square sense. I agree it is quite strange :)
– Denis Bitouzé
Sep 19 at 19:56










2 Answers
2






active

oldest

votes

















up vote
3
down vote



accepted










Compare with



$lmathpunct.imathpunct.m$


Indeed, your limone gives qopname newmcodes@ ol.i.m. and newmcodes assigns mathpunct category to the dot (which will be taken in letters font, not operators...). Another strangeness of newmcodes@.



newmcodes@ ->mathcode `'39mathcode `*42mathcode `."613Aifnum mathcode 
`-=45 else mathchardef std@minus mathcode `-relax fi mathcode `-45ma
thcode `/47mathcode `:"603Arelax


You will have same mathpunct spacing with :. enter image description here



What to do? You can always define your own newmcodes@ to replace above definition.






share|improve this answer
















  • 1




    Define my own newmcodes@?! Are you kidding me? :)
    – Denis Bitouzé
    Sep 19 at 20:20






  • 1




    @DenisBitouzé I knew that would keep you busy while I went to watch cartoons on replay-tv ;-). Try letnewmcodes@relax or ok if you want it more politically correct, copy above (beware linebreaks) removing the 6 in "613A"
    – jfbu
    Sep 19 at 21:03






  • 1




    I guess that when the code for qopname was being developed by Spivak and the AMS (it went essentially unchanged into amsmath.sty from amstex.tex) the use cases dictated that the period had to be considered as punctuation in an operator name.
    – egreg
    Sep 19 at 21:37











  • @egreg you are right, surely. I wonder what kind of use cases, and why one would treat an operator name like a piece of text.
    – jfbu
    Sep 20 at 8:38

















up vote
4
down vote













DeclareMathOperatorlimonel.i.m. will fix the excess space in row 1, making it like row 2. Note that while the l.i.m. will still line up with your text case, there will be a gap following the last ., because l.i.m. (in the form of limone or limtwo) is now an operator, whereas textl.i.m. is a math atom.



documentclassarticle
usepackageamsmath
%
DeclareMathOperatorlimonel.i.m.
newcommandlimtwomathopmathrml.i.m.
%
begindocument
beginalign*
A_t & =limone A_n,t \
A_t & =limtwo A_n,t \
A_t & =textl.i.m. A_n,t
endalign*
enddocument


enter image description here






share|improve this answer






















  • It does the trick, indeed. But why this behaviour without the braces? And agree with your note (I added the text example in order to show the spaces with DeclareMathOperator didn't come from a possible underlying "text" mode).
    – Denis Bitouzé
    Sep 19 at 19:59







  • 1




    @DenisBitouzé Not sure, but it may be related to this: gdefnewmcodes@mathcode`'39mathcode``*42mathcode``."613A% mathcode``-45mathcode``/47mathcode``:"603Arelax, declared in amstex.sty.
    – Steven B. Segletes
    Sep 19 at 20:09











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: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
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%2f451591%2fdeclaremathoperator-adds-spaces-after-the-periods-contained-in-its-second-argum%23new-answer', 'question_page');

);

Post as a guest






























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
3
down vote



accepted










Compare with



$lmathpunct.imathpunct.m$


Indeed, your limone gives qopname newmcodes@ ol.i.m. and newmcodes assigns mathpunct category to the dot (which will be taken in letters font, not operators...). Another strangeness of newmcodes@.



newmcodes@ ->mathcode `'39mathcode `*42mathcode `."613Aifnum mathcode 
`-=45 else mathchardef std@minus mathcode `-relax fi mathcode `-45ma
thcode `/47mathcode `:"603Arelax


You will have same mathpunct spacing with :. enter image description here



What to do? You can always define your own newmcodes@ to replace above definition.






share|improve this answer
















  • 1




    Define my own newmcodes@?! Are you kidding me? :)
    – Denis Bitouzé
    Sep 19 at 20:20






  • 1




    @DenisBitouzé I knew that would keep you busy while I went to watch cartoons on replay-tv ;-). Try letnewmcodes@relax or ok if you want it more politically correct, copy above (beware linebreaks) removing the 6 in "613A"
    – jfbu
    Sep 19 at 21:03






  • 1




    I guess that when the code for qopname was being developed by Spivak and the AMS (it went essentially unchanged into amsmath.sty from amstex.tex) the use cases dictated that the period had to be considered as punctuation in an operator name.
    – egreg
    Sep 19 at 21:37











  • @egreg you are right, surely. I wonder what kind of use cases, and why one would treat an operator name like a piece of text.
    – jfbu
    Sep 20 at 8:38














up vote
3
down vote



accepted










Compare with



$lmathpunct.imathpunct.m$


Indeed, your limone gives qopname newmcodes@ ol.i.m. and newmcodes assigns mathpunct category to the dot (which will be taken in letters font, not operators...). Another strangeness of newmcodes@.



newmcodes@ ->mathcode `'39mathcode `*42mathcode `."613Aifnum mathcode 
`-=45 else mathchardef std@minus mathcode `-relax fi mathcode `-45ma
thcode `/47mathcode `:"603Arelax


You will have same mathpunct spacing with :. enter image description here



What to do? You can always define your own newmcodes@ to replace above definition.






share|improve this answer
















  • 1




    Define my own newmcodes@?! Are you kidding me? :)
    – Denis Bitouzé
    Sep 19 at 20:20






  • 1




    @DenisBitouzé I knew that would keep you busy while I went to watch cartoons on replay-tv ;-). Try letnewmcodes@relax or ok if you want it more politically correct, copy above (beware linebreaks) removing the 6 in "613A"
    – jfbu
    Sep 19 at 21:03






  • 1




    I guess that when the code for qopname was being developed by Spivak and the AMS (it went essentially unchanged into amsmath.sty from amstex.tex) the use cases dictated that the period had to be considered as punctuation in an operator name.
    – egreg
    Sep 19 at 21:37











  • @egreg you are right, surely. I wonder what kind of use cases, and why one would treat an operator name like a piece of text.
    – jfbu
    Sep 20 at 8:38












up vote
3
down vote



accepted







up vote
3
down vote



accepted






Compare with



$lmathpunct.imathpunct.m$


Indeed, your limone gives qopname newmcodes@ ol.i.m. and newmcodes assigns mathpunct category to the dot (which will be taken in letters font, not operators...). Another strangeness of newmcodes@.



newmcodes@ ->mathcode `'39mathcode `*42mathcode `."613Aifnum mathcode 
`-=45 else mathchardef std@minus mathcode `-relax fi mathcode `-45ma
thcode `/47mathcode `:"603Arelax


You will have same mathpunct spacing with :. enter image description here



What to do? You can always define your own newmcodes@ to replace above definition.






share|improve this answer












Compare with



$lmathpunct.imathpunct.m$


Indeed, your limone gives qopname newmcodes@ ol.i.m. and newmcodes assigns mathpunct category to the dot (which will be taken in letters font, not operators...). Another strangeness of newmcodes@.



newmcodes@ ->mathcode `'39mathcode `*42mathcode `."613Aifnum mathcode 
`-=45 else mathchardef std@minus mathcode `-relax fi mathcode `-45ma
thcode `/47mathcode `:"603Arelax


You will have same mathpunct spacing with :. enter image description here



What to do? You can always define your own newmcodes@ to replace above definition.







share|improve this answer












share|improve this answer



share|improve this answer










answered Sep 19 at 20:10









jfbu

42.6k64138




42.6k64138







  • 1




    Define my own newmcodes@?! Are you kidding me? :)
    – Denis Bitouzé
    Sep 19 at 20:20






  • 1




    @DenisBitouzé I knew that would keep you busy while I went to watch cartoons on replay-tv ;-). Try letnewmcodes@relax or ok if you want it more politically correct, copy above (beware linebreaks) removing the 6 in "613A"
    – jfbu
    Sep 19 at 21:03






  • 1




    I guess that when the code for qopname was being developed by Spivak and the AMS (it went essentially unchanged into amsmath.sty from amstex.tex) the use cases dictated that the period had to be considered as punctuation in an operator name.
    – egreg
    Sep 19 at 21:37











  • @egreg you are right, surely. I wonder what kind of use cases, and why one would treat an operator name like a piece of text.
    – jfbu
    Sep 20 at 8:38












  • 1




    Define my own newmcodes@?! Are you kidding me? :)
    – Denis Bitouzé
    Sep 19 at 20:20






  • 1




    @DenisBitouzé I knew that would keep you busy while I went to watch cartoons on replay-tv ;-). Try letnewmcodes@relax or ok if you want it more politically correct, copy above (beware linebreaks) removing the 6 in "613A"
    – jfbu
    Sep 19 at 21:03






  • 1




    I guess that when the code for qopname was being developed by Spivak and the AMS (it went essentially unchanged into amsmath.sty from amstex.tex) the use cases dictated that the period had to be considered as punctuation in an operator name.
    – egreg
    Sep 19 at 21:37











  • @egreg you are right, surely. I wonder what kind of use cases, and why one would treat an operator name like a piece of text.
    – jfbu
    Sep 20 at 8:38







1




1




Define my own newmcodes@?! Are you kidding me? :)
– Denis Bitouzé
Sep 19 at 20:20




Define my own newmcodes@?! Are you kidding me? :)
– Denis Bitouzé
Sep 19 at 20:20




1




1




@DenisBitouzé I knew that would keep you busy while I went to watch cartoons on replay-tv ;-). Try letnewmcodes@relax or ok if you want it more politically correct, copy above (beware linebreaks) removing the 6 in "613A"
– jfbu
Sep 19 at 21:03




@DenisBitouzé I knew that would keep you busy while I went to watch cartoons on replay-tv ;-). Try letnewmcodes@relax or ok if you want it more politically correct, copy above (beware linebreaks) removing the 6 in "613A"
– jfbu
Sep 19 at 21:03




1




1




I guess that when the code for qopname was being developed by Spivak and the AMS (it went essentially unchanged into amsmath.sty from amstex.tex) the use cases dictated that the period had to be considered as punctuation in an operator name.
– egreg
Sep 19 at 21:37





I guess that when the code for qopname was being developed by Spivak and the AMS (it went essentially unchanged into amsmath.sty from amstex.tex) the use cases dictated that the period had to be considered as punctuation in an operator name.
– egreg
Sep 19 at 21:37













@egreg you are right, surely. I wonder what kind of use cases, and why one would treat an operator name like a piece of text.
– jfbu
Sep 20 at 8:38




@egreg you are right, surely. I wonder what kind of use cases, and why one would treat an operator name like a piece of text.
– jfbu
Sep 20 at 8:38










up vote
4
down vote













DeclareMathOperatorlimonel.i.m. will fix the excess space in row 1, making it like row 2. Note that while the l.i.m. will still line up with your text case, there will be a gap following the last ., because l.i.m. (in the form of limone or limtwo) is now an operator, whereas textl.i.m. is a math atom.



documentclassarticle
usepackageamsmath
%
DeclareMathOperatorlimonel.i.m.
newcommandlimtwomathopmathrml.i.m.
%
begindocument
beginalign*
A_t & =limone A_n,t \
A_t & =limtwo A_n,t \
A_t & =textl.i.m. A_n,t
endalign*
enddocument


enter image description here






share|improve this answer






















  • It does the trick, indeed. But why this behaviour without the braces? And agree with your note (I added the text example in order to show the spaces with DeclareMathOperator didn't come from a possible underlying "text" mode).
    – Denis Bitouzé
    Sep 19 at 19:59







  • 1




    @DenisBitouzé Not sure, but it may be related to this: gdefnewmcodes@mathcode`'39mathcode``*42mathcode``."613A% mathcode``-45mathcode``/47mathcode``:"603Arelax, declared in amstex.sty.
    – Steven B. Segletes
    Sep 19 at 20:09















up vote
4
down vote













DeclareMathOperatorlimonel.i.m. will fix the excess space in row 1, making it like row 2. Note that while the l.i.m. will still line up with your text case, there will be a gap following the last ., because l.i.m. (in the form of limone or limtwo) is now an operator, whereas textl.i.m. is a math atom.



documentclassarticle
usepackageamsmath
%
DeclareMathOperatorlimonel.i.m.
newcommandlimtwomathopmathrml.i.m.
%
begindocument
beginalign*
A_t & =limone A_n,t \
A_t & =limtwo A_n,t \
A_t & =textl.i.m. A_n,t
endalign*
enddocument


enter image description here






share|improve this answer






















  • It does the trick, indeed. But why this behaviour without the braces? And agree with your note (I added the text example in order to show the spaces with DeclareMathOperator didn't come from a possible underlying "text" mode).
    – Denis Bitouzé
    Sep 19 at 19:59







  • 1




    @DenisBitouzé Not sure, but it may be related to this: gdefnewmcodes@mathcode`'39mathcode``*42mathcode``."613A% mathcode``-45mathcode``/47mathcode``:"603Arelax, declared in amstex.sty.
    – Steven B. Segletes
    Sep 19 at 20:09













up vote
4
down vote










up vote
4
down vote









DeclareMathOperatorlimonel.i.m. will fix the excess space in row 1, making it like row 2. Note that while the l.i.m. will still line up with your text case, there will be a gap following the last ., because l.i.m. (in the form of limone or limtwo) is now an operator, whereas textl.i.m. is a math atom.



documentclassarticle
usepackageamsmath
%
DeclareMathOperatorlimonel.i.m.
newcommandlimtwomathopmathrml.i.m.
%
begindocument
beginalign*
A_t & =limone A_n,t \
A_t & =limtwo A_n,t \
A_t & =textl.i.m. A_n,t
endalign*
enddocument


enter image description here






share|improve this answer














DeclareMathOperatorlimonel.i.m. will fix the excess space in row 1, making it like row 2. Note that while the l.i.m. will still line up with your text case, there will be a gap following the last ., because l.i.m. (in the form of limone or limtwo) is now an operator, whereas textl.i.m. is a math atom.



documentclassarticle
usepackageamsmath
%
DeclareMathOperatorlimonel.i.m.
newcommandlimtwomathopmathrml.i.m.
%
begindocument
beginalign*
A_t & =limone A_n,t \
A_t & =limtwo A_n,t \
A_t & =textl.i.m. A_n,t
endalign*
enddocument


enter image description here







share|improve this answer














share|improve this answer



share|improve this answer








edited Sep 19 at 19:58

























answered Sep 19 at 19:51









Steven B. Segletes

148k9186390




148k9186390











  • It does the trick, indeed. But why this behaviour without the braces? And agree with your note (I added the text example in order to show the spaces with DeclareMathOperator didn't come from a possible underlying "text" mode).
    – Denis Bitouzé
    Sep 19 at 19:59







  • 1




    @DenisBitouzé Not sure, but it may be related to this: gdefnewmcodes@mathcode`'39mathcode``*42mathcode``."613A% mathcode``-45mathcode``/47mathcode``:"603Arelax, declared in amstex.sty.
    – Steven B. Segletes
    Sep 19 at 20:09

















  • It does the trick, indeed. But why this behaviour without the braces? And agree with your note (I added the text example in order to show the spaces with DeclareMathOperator didn't come from a possible underlying "text" mode).
    – Denis Bitouzé
    Sep 19 at 19:59







  • 1




    @DenisBitouzé Not sure, but it may be related to this: gdefnewmcodes@mathcode`'39mathcode``*42mathcode``."613A% mathcode``-45mathcode``/47mathcode``:"603Arelax, declared in amstex.sty.
    – Steven B. Segletes
    Sep 19 at 20:09
















It does the trick, indeed. But why this behaviour without the braces? And agree with your note (I added the text example in order to show the spaces with DeclareMathOperator didn't come from a possible underlying "text" mode).
– Denis Bitouzé
Sep 19 at 19:59





It does the trick, indeed. But why this behaviour without the braces? And agree with your note (I added the text example in order to show the spaces with DeclareMathOperator didn't come from a possible underlying "text" mode).
– Denis Bitouzé
Sep 19 at 19:59





1




1




@DenisBitouzé Not sure, but it may be related to this: gdefnewmcodes@mathcode`'39mathcode``*42mathcode``."613A% mathcode``-45mathcode``/47mathcode``:"603Arelax, declared in amstex.sty.
– Steven B. Segletes
Sep 19 at 20:09





@DenisBitouzé Not sure, but it may be related to this: gdefnewmcodes@mathcode`'39mathcode``*42mathcode``."613A% mathcode``-45mathcode``/47mathcode``:"603Arelax, declared in amstex.sty.
– Steven B. Segletes
Sep 19 at 20:09


















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f451591%2fdeclaremathoperator-adds-spaces-after-the-periods-contained-in-its-second-argum%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?