DeclareMathOperator not working on some math names with a number at the end











up vote
3
down vote

favorite












I am trying to use DeclareMathOperator to make names for some Maple generated latex which uses the special function LommelS1



For some reason I can't figure out, it is not working.



documentclass[11pt]{article}
usepackage{amsmath,mathtools,amssymb}
DeclareMathOperator{LommelS1}{LommelS1}
DeclareMathOperator{LommelS2}{LommelS2}

begin{document}
[
LommelS1 x
]
end{document}


Error is



>lualatex foo.tex
This is LuaTeX, Version 1.07.0 (TeX Live 2018)
restricted system commands enabled.
(/usr/local/texlive/2018/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg)))
(/usr/local/texlive/2018/texmf-dist/tex/latex/amsfonts/umsa.fd)
(/usr/local/texlive/2018/texmf-dist/tex/latex/amsfonts/umsb.fd)
! Use of LommelS doesn't match its definition.
l.14 LommelS1
x
?


Notice it is looking for LommelS but the operator is LommelS1



It seems the number at the end of the operator is confusing it. Also when I remove the second DeclareMathOperator now it works:



documentclass[11pt]{article}
usepackage{amsmath,mathtools,amssymb}
DeclareMathOperator{LommelS1}{LommelS1}
%DeclareMathOperator{LommelS2}{LommelS2} %when commented, it works
begin{document}
[
LommelS1 x
]
end{document}


But I need to use LommelS1 and LommelS2 so the numbers at the end are important since Maple latex will contain both such names.



Is where a way around this?



TL 2018










share|improve this question


















  • 4




    Command names cannot have digits in them, only letters.
    – egreg
    Nov 18 at 23:01










  • newcommand{LommelS}[1]{operatorname{LommelS#1}} will do if LommelS is always followed by 1 or 2 (or a single digit). A slower routine is needed otherwise. Without more information it's not possible to say more.
    – egreg
    Nov 18 at 23:05










  • @egreg thanks. Yes, the commands from Maple only have 1 or 2 at the end. So I will try your suggestion above now.
    – Nasser
    Nov 18 at 23:07















up vote
3
down vote

favorite












I am trying to use DeclareMathOperator to make names for some Maple generated latex which uses the special function LommelS1



For some reason I can't figure out, it is not working.



documentclass[11pt]{article}
usepackage{amsmath,mathtools,amssymb}
DeclareMathOperator{LommelS1}{LommelS1}
DeclareMathOperator{LommelS2}{LommelS2}

begin{document}
[
LommelS1 x
]
end{document}


Error is



>lualatex foo.tex
This is LuaTeX, Version 1.07.0 (TeX Live 2018)
restricted system commands enabled.
(/usr/local/texlive/2018/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg)))
(/usr/local/texlive/2018/texmf-dist/tex/latex/amsfonts/umsa.fd)
(/usr/local/texlive/2018/texmf-dist/tex/latex/amsfonts/umsb.fd)
! Use of LommelS doesn't match its definition.
l.14 LommelS1
x
?


Notice it is looking for LommelS but the operator is LommelS1



It seems the number at the end of the operator is confusing it. Also when I remove the second DeclareMathOperator now it works:



documentclass[11pt]{article}
usepackage{amsmath,mathtools,amssymb}
DeclareMathOperator{LommelS1}{LommelS1}
%DeclareMathOperator{LommelS2}{LommelS2} %when commented, it works
begin{document}
[
LommelS1 x
]
end{document}


But I need to use LommelS1 and LommelS2 so the numbers at the end are important since Maple latex will contain both such names.



Is where a way around this?



TL 2018










share|improve this question


















  • 4




    Command names cannot have digits in them, only letters.
    – egreg
    Nov 18 at 23:01










  • newcommand{LommelS}[1]{operatorname{LommelS#1}} will do if LommelS is always followed by 1 or 2 (or a single digit). A slower routine is needed otherwise. Without more information it's not possible to say more.
    – egreg
    Nov 18 at 23:05










  • @egreg thanks. Yes, the commands from Maple only have 1 or 2 at the end. So I will try your suggestion above now.
    – Nasser
    Nov 18 at 23:07













up vote
3
down vote

favorite









up vote
3
down vote

favorite











I am trying to use DeclareMathOperator to make names for some Maple generated latex which uses the special function LommelS1



For some reason I can't figure out, it is not working.



documentclass[11pt]{article}
usepackage{amsmath,mathtools,amssymb}
DeclareMathOperator{LommelS1}{LommelS1}
DeclareMathOperator{LommelS2}{LommelS2}

begin{document}
[
LommelS1 x
]
end{document}


Error is



>lualatex foo.tex
This is LuaTeX, Version 1.07.0 (TeX Live 2018)
restricted system commands enabled.
(/usr/local/texlive/2018/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg)))
(/usr/local/texlive/2018/texmf-dist/tex/latex/amsfonts/umsa.fd)
(/usr/local/texlive/2018/texmf-dist/tex/latex/amsfonts/umsb.fd)
! Use of LommelS doesn't match its definition.
l.14 LommelS1
x
?


Notice it is looking for LommelS but the operator is LommelS1



It seems the number at the end of the operator is confusing it. Also when I remove the second DeclareMathOperator now it works:



documentclass[11pt]{article}
usepackage{amsmath,mathtools,amssymb}
DeclareMathOperator{LommelS1}{LommelS1}
%DeclareMathOperator{LommelS2}{LommelS2} %when commented, it works
begin{document}
[
LommelS1 x
]
end{document}


But I need to use LommelS1 and LommelS2 so the numbers at the end are important since Maple latex will contain both such names.



Is where a way around this?



TL 2018










share|improve this question













I am trying to use DeclareMathOperator to make names for some Maple generated latex which uses the special function LommelS1



For some reason I can't figure out, it is not working.



documentclass[11pt]{article}
usepackage{amsmath,mathtools,amssymb}
DeclareMathOperator{LommelS1}{LommelS1}
DeclareMathOperator{LommelS2}{LommelS2}

begin{document}
[
LommelS1 x
]
end{document}


Error is



>lualatex foo.tex
This is LuaTeX, Version 1.07.0 (TeX Live 2018)
restricted system commands enabled.
(/usr/local/texlive/2018/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg)))
(/usr/local/texlive/2018/texmf-dist/tex/latex/amsfonts/umsa.fd)
(/usr/local/texlive/2018/texmf-dist/tex/latex/amsfonts/umsb.fd)
! Use of LommelS doesn't match its definition.
l.14 LommelS1
x
?


Notice it is looking for LommelS but the operator is LommelS1



It seems the number at the end of the operator is confusing it. Also when I remove the second DeclareMathOperator now it works:



documentclass[11pt]{article}
usepackage{amsmath,mathtools,amssymb}
DeclareMathOperator{LommelS1}{LommelS1}
%DeclareMathOperator{LommelS2}{LommelS2} %when commented, it works
begin{document}
[
LommelS1 x
]
end{document}


But I need to use LommelS1 and LommelS2 so the numbers at the end are important since Maple latex will contain both such names.



Is where a way around this?



TL 2018







math-operators






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 18 at 22:58









Nasser

8,01153081




8,01153081








  • 4




    Command names cannot have digits in them, only letters.
    – egreg
    Nov 18 at 23:01










  • newcommand{LommelS}[1]{operatorname{LommelS#1}} will do if LommelS is always followed by 1 or 2 (or a single digit). A slower routine is needed otherwise. Without more information it's not possible to say more.
    – egreg
    Nov 18 at 23:05










  • @egreg thanks. Yes, the commands from Maple only have 1 or 2 at the end. So I will try your suggestion above now.
    – Nasser
    Nov 18 at 23:07














  • 4




    Command names cannot have digits in them, only letters.
    – egreg
    Nov 18 at 23:01










  • newcommand{LommelS}[1]{operatorname{LommelS#1}} will do if LommelS is always followed by 1 or 2 (or a single digit). A slower routine is needed otherwise. Without more information it's not possible to say more.
    – egreg
    Nov 18 at 23:05










  • @egreg thanks. Yes, the commands from Maple only have 1 or 2 at the end. So I will try your suggestion above now.
    – Nasser
    Nov 18 at 23:07








4




4




Command names cannot have digits in them, only letters.
– egreg
Nov 18 at 23:01




Command names cannot have digits in them, only letters.
– egreg
Nov 18 at 23:01












newcommand{LommelS}[1]{operatorname{LommelS#1}} will do if LommelS is always followed by 1 or 2 (or a single digit). A slower routine is needed otherwise. Without more information it's not possible to say more.
– egreg
Nov 18 at 23:05




newcommand{LommelS}[1]{operatorname{LommelS#1}} will do if LommelS is always followed by 1 or 2 (or a single digit). A slower routine is needed otherwise. Without more information it's not possible to say more.
– egreg
Nov 18 at 23:05












@egreg thanks. Yes, the commands from Maple only have 1 or 2 at the end. So I will try your suggestion above now.
– Nasser
Nov 18 at 23:07




@egreg thanks. Yes, the commands from Maple only have 1 or 2 at the end. So I will try your suggestion above now.
– Nasser
Nov 18 at 23:07










1 Answer
1






active

oldest

votes

















up vote
5
down vote



accepted










If there's no LommelS without a following digit and Maple always generates either LommelS1 or LommelS2, then it's easy:



newcommand{LommelS}[1]{operatorname{LommelS#1}}


You should know that only letters are accepted in command names that have a letter in their name (only a single nonletter can form a command name).






share|improve this answer





















    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%2f460667%2fdeclaremathoperator-not-working-on-some-math-names-with-a-number-at-the-end%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
    5
    down vote



    accepted










    If there's no LommelS without a following digit and Maple always generates either LommelS1 or LommelS2, then it's easy:



    newcommand{LommelS}[1]{operatorname{LommelS#1}}


    You should know that only letters are accepted in command names that have a letter in their name (only a single nonletter can form a command name).






    share|improve this answer

























      up vote
      5
      down vote



      accepted










      If there's no LommelS without a following digit and Maple always generates either LommelS1 or LommelS2, then it's easy:



      newcommand{LommelS}[1]{operatorname{LommelS#1}}


      You should know that only letters are accepted in command names that have a letter in their name (only a single nonletter can form a command name).






      share|improve this answer























        up vote
        5
        down vote



        accepted







        up vote
        5
        down vote



        accepted






        If there's no LommelS without a following digit and Maple always generates either LommelS1 or LommelS2, then it's easy:



        newcommand{LommelS}[1]{operatorname{LommelS#1}}


        You should know that only letters are accepted in command names that have a letter in their name (only a single nonletter can form a command name).






        share|improve this answer












        If there's no LommelS without a following digit and Maple always generates either LommelS1 or LommelS2, then it's easy:



        newcommand{LommelS}[1]{operatorname{LommelS#1}}


        You should know that only letters are accepted in command names that have a letter in their name (only a single nonletter can form a command name).







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 18 at 23:10









        egreg

        699k8518613132




        699k8518613132






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f460667%2fdeclaremathoperator-not-working-on-some-math-names-with-a-number-at-the-end%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

            Probability when a professor distributes a quiz and homework assignment to a class of n students.

            Aardman Animations

            Are they similar matrix