Environment to hide number from numbered equations












3















I'd like to create an environment that hides equation numbers from numbered equations. I'd should work like this:



documentclass{article}
begin{document}
% ---------------------------
% begin{nonumber}
begin{equation}
a + b = c quad text{this equation should be unnumbered}
end{equation}
% end{nonumber}

begin{equation}
a + b = c quad text{this equation should be numbered}
end{equation}
end{document}









share|improve this question


















  • 3





    why not simply use equation* ? (amsmath, or [)

    – David Carlisle
    Mar 22 at 18:10













  • To make a long story short, I'm inputting them from an external text file which I load with a command, so the intended use would be like begin{nonumber}thatcommandend{nonumber}.

    – noibe
    Mar 22 at 18:47
















3















I'd like to create an environment that hides equation numbers from numbered equations. I'd should work like this:



documentclass{article}
begin{document}
% ---------------------------
% begin{nonumber}
begin{equation}
a + b = c quad text{this equation should be unnumbered}
end{equation}
% end{nonumber}

begin{equation}
a + b = c quad text{this equation should be numbered}
end{equation}
end{document}









share|improve this question


















  • 3





    why not simply use equation* ? (amsmath, or [)

    – David Carlisle
    Mar 22 at 18:10













  • To make a long story short, I'm inputting them from an external text file which I load with a command, so the intended use would be like begin{nonumber}thatcommandend{nonumber}.

    – noibe
    Mar 22 at 18:47














3












3








3








I'd like to create an environment that hides equation numbers from numbered equations. I'd should work like this:



documentclass{article}
begin{document}
% ---------------------------
% begin{nonumber}
begin{equation}
a + b = c quad text{this equation should be unnumbered}
end{equation}
% end{nonumber}

begin{equation}
a + b = c quad text{this equation should be numbered}
end{equation}
end{document}









share|improve this question














I'd like to create an environment that hides equation numbers from numbered equations. I'd should work like this:



documentclass{article}
begin{document}
% ---------------------------
% begin{nonumber}
begin{equation}
a + b = c quad text{this equation should be unnumbered}
end{equation}
% end{nonumber}

begin{equation}
a + b = c quad text{this equation should be numbered}
end{equation}
end{document}






equations amsmath






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 22 at 18:07









noibenoibe

554113




554113








  • 3





    why not simply use equation* ? (amsmath, or [)

    – David Carlisle
    Mar 22 at 18:10













  • To make a long story short, I'm inputting them from an external text file which I load with a command, so the intended use would be like begin{nonumber}thatcommandend{nonumber}.

    – noibe
    Mar 22 at 18:47














  • 3





    why not simply use equation* ? (amsmath, or [)

    – David Carlisle
    Mar 22 at 18:10













  • To make a long story short, I'm inputting them from an external text file which I load with a command, so the intended use would be like begin{nonumber}thatcommandend{nonumber}.

    – noibe
    Mar 22 at 18:47








3




3





why not simply use equation* ? (amsmath, or [)

– David Carlisle
Mar 22 at 18:10







why not simply use equation* ? (amsmath, or [)

– David Carlisle
Mar 22 at 18:10















To make a long story short, I'm inputting them from an external text file which I load with a command, so the intended use would be like begin{nonumber}thatcommandend{nonumber}.

– noibe
Mar 22 at 18:47





To make a long story short, I'm inputting them from an external text file which I load with a command, so the intended use would be like begin{nonumber}thatcommandend{nonumber}.

– noibe
Mar 22 at 18:47










1 Answer
1






active

oldest

votes


















3














If you're only using equations, then the following will suffice:



enter image description here



documentclass{article}

newenvironment{noeqnumber}
{renewenvironment{equation}{[}{]}}
{}

begin{document}

begin{noeqnumber}
begin{equation}
a + b = c quad mbox{this equation should be unnumbered}
end{equation}
end{noeqnumber}

begin{equation}
a + b = c quad mbox{this equation should be numbered}
end{equation}

end{document}


Note that nonumber already exists, so you'd have to use a different environment name, like noeqnumber.





If you're using aligns, then we can adjust the counter stepping and tag printing mechanism:



enter image description here



documentclass{article}

usepackage{mathtools}
makeatletter
% New tag form that gobbles the number
newtagform{gobble}[@gobble]{}{}
makeatother

letoldrefstepcounterrefstepcounter

newenvironment{noeqnumber}
{renewcommand{refstepcounter}[1]{%
% Only step counter if it is not equation
ifnumpdfstrcmp{##1}{equation}=0else
oldrefstepcounter{##1}%
fi
}%
usetagform{gobble}}
{}

begin{document}

begin{noeqnumber}
begin{align}
a + b &= c quad text{this equation should be unnumbered} \
d &= e + f quad text{this equation should be unnumbered}
end{align}
end{noeqnumber}

begin{equation}
a + b = c quad text{this equation should be numbered}
end{equation}

end{document}





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


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f480960%2fenvironment-to-hide-number-from-numbered-equations%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









    3














    If you're only using equations, then the following will suffice:



    enter image description here



    documentclass{article}

    newenvironment{noeqnumber}
    {renewenvironment{equation}{[}{]}}
    {}

    begin{document}

    begin{noeqnumber}
    begin{equation}
    a + b = c quad mbox{this equation should be unnumbered}
    end{equation}
    end{noeqnumber}

    begin{equation}
    a + b = c quad mbox{this equation should be numbered}
    end{equation}

    end{document}


    Note that nonumber already exists, so you'd have to use a different environment name, like noeqnumber.





    If you're using aligns, then we can adjust the counter stepping and tag printing mechanism:



    enter image description here



    documentclass{article}

    usepackage{mathtools}
    makeatletter
    % New tag form that gobbles the number
    newtagform{gobble}[@gobble]{}{}
    makeatother

    letoldrefstepcounterrefstepcounter

    newenvironment{noeqnumber}
    {renewcommand{refstepcounter}[1]{%
    % Only step counter if it is not equation
    ifnumpdfstrcmp{##1}{equation}=0else
    oldrefstepcounter{##1}%
    fi
    }%
    usetagform{gobble}}
    {}

    begin{document}

    begin{noeqnumber}
    begin{align}
    a + b &= c quad text{this equation should be unnumbered} \
    d &= e + f quad text{this equation should be unnumbered}
    end{align}
    end{noeqnumber}

    begin{equation}
    a + b = c quad text{this equation should be numbered}
    end{equation}

    end{document}





    share|improve this answer






























      3














      If you're only using equations, then the following will suffice:



      enter image description here



      documentclass{article}

      newenvironment{noeqnumber}
      {renewenvironment{equation}{[}{]}}
      {}

      begin{document}

      begin{noeqnumber}
      begin{equation}
      a + b = c quad mbox{this equation should be unnumbered}
      end{equation}
      end{noeqnumber}

      begin{equation}
      a + b = c quad mbox{this equation should be numbered}
      end{equation}

      end{document}


      Note that nonumber already exists, so you'd have to use a different environment name, like noeqnumber.





      If you're using aligns, then we can adjust the counter stepping and tag printing mechanism:



      enter image description here



      documentclass{article}

      usepackage{mathtools}
      makeatletter
      % New tag form that gobbles the number
      newtagform{gobble}[@gobble]{}{}
      makeatother

      letoldrefstepcounterrefstepcounter

      newenvironment{noeqnumber}
      {renewcommand{refstepcounter}[1]{%
      % Only step counter if it is not equation
      ifnumpdfstrcmp{##1}{equation}=0else
      oldrefstepcounter{##1}%
      fi
      }%
      usetagform{gobble}}
      {}

      begin{document}

      begin{noeqnumber}
      begin{align}
      a + b &= c quad text{this equation should be unnumbered} \
      d &= e + f quad text{this equation should be unnumbered}
      end{align}
      end{noeqnumber}

      begin{equation}
      a + b = c quad text{this equation should be numbered}
      end{equation}

      end{document}





      share|improve this answer




























        3












        3








        3







        If you're only using equations, then the following will suffice:



        enter image description here



        documentclass{article}

        newenvironment{noeqnumber}
        {renewenvironment{equation}{[}{]}}
        {}

        begin{document}

        begin{noeqnumber}
        begin{equation}
        a + b = c quad mbox{this equation should be unnumbered}
        end{equation}
        end{noeqnumber}

        begin{equation}
        a + b = c quad mbox{this equation should be numbered}
        end{equation}

        end{document}


        Note that nonumber already exists, so you'd have to use a different environment name, like noeqnumber.





        If you're using aligns, then we can adjust the counter stepping and tag printing mechanism:



        enter image description here



        documentclass{article}

        usepackage{mathtools}
        makeatletter
        % New tag form that gobbles the number
        newtagform{gobble}[@gobble]{}{}
        makeatother

        letoldrefstepcounterrefstepcounter

        newenvironment{noeqnumber}
        {renewcommand{refstepcounter}[1]{%
        % Only step counter if it is not equation
        ifnumpdfstrcmp{##1}{equation}=0else
        oldrefstepcounter{##1}%
        fi
        }%
        usetagform{gobble}}
        {}

        begin{document}

        begin{noeqnumber}
        begin{align}
        a + b &= c quad text{this equation should be unnumbered} \
        d &= e + f quad text{this equation should be unnumbered}
        end{align}
        end{noeqnumber}

        begin{equation}
        a + b = c quad text{this equation should be numbered}
        end{equation}

        end{document}





        share|improve this answer















        If you're only using equations, then the following will suffice:



        enter image description here



        documentclass{article}

        newenvironment{noeqnumber}
        {renewenvironment{equation}{[}{]}}
        {}

        begin{document}

        begin{noeqnumber}
        begin{equation}
        a + b = c quad mbox{this equation should be unnumbered}
        end{equation}
        end{noeqnumber}

        begin{equation}
        a + b = c quad mbox{this equation should be numbered}
        end{equation}

        end{document}


        Note that nonumber already exists, so you'd have to use a different environment name, like noeqnumber.





        If you're using aligns, then we can adjust the counter stepping and tag printing mechanism:



        enter image description here



        documentclass{article}

        usepackage{mathtools}
        makeatletter
        % New tag form that gobbles the number
        newtagform{gobble}[@gobble]{}{}
        makeatother

        letoldrefstepcounterrefstepcounter

        newenvironment{noeqnumber}
        {renewcommand{refstepcounter}[1]{%
        % Only step counter if it is not equation
        ifnumpdfstrcmp{##1}{equation}=0else
        oldrefstepcounter{##1}%
        fi
        }%
        usetagform{gobble}}
        {}

        begin{document}

        begin{noeqnumber}
        begin{align}
        a + b &= c quad text{this equation should be unnumbered} \
        d &= e + f quad text{this equation should be unnumbered}
        end{align}
        end{noeqnumber}

        begin{equation}
        a + b = c quad text{this equation should be numbered}
        end{equation}

        end{document}






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Mar 22 at 19:15

























        answered Mar 22 at 18:59









        WernerWerner

        449k729971704




        449k729971704






























            draft saved

            draft discarded




















































            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.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f480960%2fenvironment-to-hide-number-from-numbered-equations%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

            How to send String Array data to Server using php in android

            Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

            Is anime1.com a legal site for watching anime?