Correctly order float counter (perpage.sty) while sharing eqn/thm counter












4
















  1. Sharing float (fig) and thm counter can be done with newtheorem{theorem}[figure]{Theorem}.

  2. Correctly ordering float (fig) counter based on actual location in the PDF (as opposed to location in source code) can be done with MakeSorted{figure} from perpage.sty.

  3. Sharing float (fig) and eqn counter can be done with makeatletterletc@equationc@figuremakeatother.


I can do 1 and 2 together (see mwe-b).
I can do 1 and 3 together (see mwe-c).
But I can't do all three together (see mwe-d).



Partial/fake solution. I can skirt the issue by making a myeqn environment (see mwe-a).



Question. Is there an actual solution that allows you to keep the equation environment? Maybe one can resolve the clash in mwe-d by swapping c@figure out for something (based on the precise implementation of perpage.sty)? Any help would be greatly appreciated!



mwe-amwe-bmwe-cmwe-d



%% MWE-A
documentlass{article}
usepackage{blindtext}
newtheorem{theorem}[figure]{Theorem} %1
usepackage{perpage}MakeSorted{figure} %2
newenvironment{myeqn}
{stepcounter{figure}hfillbegin{math}}
{end{math}hfill(arabic{figure})}
begin{document}
begin{theorem}blindtextend{theorem}
begin{figure}blindtextcaption{Caption}end{figure}
begin{myeqn}a^2+b^2=c^2end{myeqn}
end{document}

%% MWE-B
documentclass{article}
usepackage{blindtext}
newtheorem{theorem}[figure]{Theorem} %1
usepackage{perpage}MakeSorted{figure} %2
begin{document}
begin{theorem}blindtextend{theorem}
begin{figure}blindtextcaption{Caption}end{figure}
begin{equation}a^2+b^2=c^2end{equation}
end{document}

%% MWE-C
documentclass{article}
usepackage{blindtext}
newtheorem{theorem}[figure]{Theorem} %1
makeatletterletc@equationc@figuremakeatother %3
begin{document}
begin{theorem}blindtextend{theorem}
begin{figure}blindtextcaption{Caption}end{figure}
begin{equation}a^2+b^2=c^2end{equation}
end{document}

%% MWE-D
documentclass{article}
usepackage{blindtext}
newtheorem{theorem}[figure]{Theorem} %1
usepackage{perpage}MakeSorted{figure} %2
makeatletterletc@equationc@figuremakeatother %3
begin{document}
begin{theorem}blindtextend{theorem}
begin{figure}blindtextcaption{Caption}end{figure}
begin{equation}a^2+b^2=c^2end{equation}
end{document}









share|improve this question



























    4
















    1. Sharing float (fig) and thm counter can be done with newtheorem{theorem}[figure]{Theorem}.

    2. Correctly ordering float (fig) counter based on actual location in the PDF (as opposed to location in source code) can be done with MakeSorted{figure} from perpage.sty.

    3. Sharing float (fig) and eqn counter can be done with makeatletterletc@equationc@figuremakeatother.


    I can do 1 and 2 together (see mwe-b).
    I can do 1 and 3 together (see mwe-c).
    But I can't do all three together (see mwe-d).



    Partial/fake solution. I can skirt the issue by making a myeqn environment (see mwe-a).



    Question. Is there an actual solution that allows you to keep the equation environment? Maybe one can resolve the clash in mwe-d by swapping c@figure out for something (based on the precise implementation of perpage.sty)? Any help would be greatly appreciated!



    mwe-amwe-bmwe-cmwe-d



    %% MWE-A
    documentlass{article}
    usepackage{blindtext}
    newtheorem{theorem}[figure]{Theorem} %1
    usepackage{perpage}MakeSorted{figure} %2
    newenvironment{myeqn}
    {stepcounter{figure}hfillbegin{math}}
    {end{math}hfill(arabic{figure})}
    begin{document}
    begin{theorem}blindtextend{theorem}
    begin{figure}blindtextcaption{Caption}end{figure}
    begin{myeqn}a^2+b^2=c^2end{myeqn}
    end{document}

    %% MWE-B
    documentclass{article}
    usepackage{blindtext}
    newtheorem{theorem}[figure]{Theorem} %1
    usepackage{perpage}MakeSorted{figure} %2
    begin{document}
    begin{theorem}blindtextend{theorem}
    begin{figure}blindtextcaption{Caption}end{figure}
    begin{equation}a^2+b^2=c^2end{equation}
    end{document}

    %% MWE-C
    documentclass{article}
    usepackage{blindtext}
    newtheorem{theorem}[figure]{Theorem} %1
    makeatletterletc@equationc@figuremakeatother %3
    begin{document}
    begin{theorem}blindtextend{theorem}
    begin{figure}blindtextcaption{Caption}end{figure}
    begin{equation}a^2+b^2=c^2end{equation}
    end{document}

    %% MWE-D
    documentclass{article}
    usepackage{blindtext}
    newtheorem{theorem}[figure]{Theorem} %1
    usepackage{perpage}MakeSorted{figure} %2
    makeatletterletc@equationc@figuremakeatother %3
    begin{document}
    begin{theorem}blindtextend{theorem}
    begin{figure}blindtextcaption{Caption}end{figure}
    begin{equation}a^2+b^2=c^2end{equation}
    end{document}









    share|improve this question

























      4












      4








      4









      1. Sharing float (fig) and thm counter can be done with newtheorem{theorem}[figure]{Theorem}.

      2. Correctly ordering float (fig) counter based on actual location in the PDF (as opposed to location in source code) can be done with MakeSorted{figure} from perpage.sty.

      3. Sharing float (fig) and eqn counter can be done with makeatletterletc@equationc@figuremakeatother.


      I can do 1 and 2 together (see mwe-b).
      I can do 1 and 3 together (see mwe-c).
      But I can't do all three together (see mwe-d).



      Partial/fake solution. I can skirt the issue by making a myeqn environment (see mwe-a).



      Question. Is there an actual solution that allows you to keep the equation environment? Maybe one can resolve the clash in mwe-d by swapping c@figure out for something (based on the precise implementation of perpage.sty)? Any help would be greatly appreciated!



      mwe-amwe-bmwe-cmwe-d



      %% MWE-A
      documentlass{article}
      usepackage{blindtext}
      newtheorem{theorem}[figure]{Theorem} %1
      usepackage{perpage}MakeSorted{figure} %2
      newenvironment{myeqn}
      {stepcounter{figure}hfillbegin{math}}
      {end{math}hfill(arabic{figure})}
      begin{document}
      begin{theorem}blindtextend{theorem}
      begin{figure}blindtextcaption{Caption}end{figure}
      begin{myeqn}a^2+b^2=c^2end{myeqn}
      end{document}

      %% MWE-B
      documentclass{article}
      usepackage{blindtext}
      newtheorem{theorem}[figure]{Theorem} %1
      usepackage{perpage}MakeSorted{figure} %2
      begin{document}
      begin{theorem}blindtextend{theorem}
      begin{figure}blindtextcaption{Caption}end{figure}
      begin{equation}a^2+b^2=c^2end{equation}
      end{document}

      %% MWE-C
      documentclass{article}
      usepackage{blindtext}
      newtheorem{theorem}[figure]{Theorem} %1
      makeatletterletc@equationc@figuremakeatother %3
      begin{document}
      begin{theorem}blindtextend{theorem}
      begin{figure}blindtextcaption{Caption}end{figure}
      begin{equation}a^2+b^2=c^2end{equation}
      end{document}

      %% MWE-D
      documentclass{article}
      usepackage{blindtext}
      newtheorem{theorem}[figure]{Theorem} %1
      usepackage{perpage}MakeSorted{figure} %2
      makeatletterletc@equationc@figuremakeatother %3
      begin{document}
      begin{theorem}blindtextend{theorem}
      begin{figure}blindtextcaption{Caption}end{figure}
      begin{equation}a^2+b^2=c^2end{equation}
      end{document}









      share|improve this question















      1. Sharing float (fig) and thm counter can be done with newtheorem{theorem}[figure]{Theorem}.

      2. Correctly ordering float (fig) counter based on actual location in the PDF (as opposed to location in source code) can be done with MakeSorted{figure} from perpage.sty.

      3. Sharing float (fig) and eqn counter can be done with makeatletterletc@equationc@figuremakeatother.


      I can do 1 and 2 together (see mwe-b).
      I can do 1 and 3 together (see mwe-c).
      But I can't do all three together (see mwe-d).



      Partial/fake solution. I can skirt the issue by making a myeqn environment (see mwe-a).



      Question. Is there an actual solution that allows you to keep the equation environment? Maybe one can resolve the clash in mwe-d by swapping c@figure out for something (based on the precise implementation of perpage.sty)? Any help would be greatly appreciated!



      mwe-amwe-bmwe-cmwe-d



      %% MWE-A
      documentlass{article}
      usepackage{blindtext}
      newtheorem{theorem}[figure]{Theorem} %1
      usepackage{perpage}MakeSorted{figure} %2
      newenvironment{myeqn}
      {stepcounter{figure}hfillbegin{math}}
      {end{math}hfill(arabic{figure})}
      begin{document}
      begin{theorem}blindtextend{theorem}
      begin{figure}blindtextcaption{Caption}end{figure}
      begin{myeqn}a^2+b^2=c^2end{myeqn}
      end{document}

      %% MWE-B
      documentclass{article}
      usepackage{blindtext}
      newtheorem{theorem}[figure]{Theorem} %1
      usepackage{perpage}MakeSorted{figure} %2
      begin{document}
      begin{theorem}blindtextend{theorem}
      begin{figure}blindtextcaption{Caption}end{figure}
      begin{equation}a^2+b^2=c^2end{equation}
      end{document}

      %% MWE-C
      documentclass{article}
      usepackage{blindtext}
      newtheorem{theorem}[figure]{Theorem} %1
      makeatletterletc@equationc@figuremakeatother %3
      begin{document}
      begin{theorem}blindtextend{theorem}
      begin{figure}blindtextcaption{Caption}end{figure}
      begin{equation}a^2+b^2=c^2end{equation}
      end{document}

      %% MWE-D
      documentclass{article}
      usepackage{blindtext}
      newtheorem{theorem}[figure]{Theorem} %1
      usepackage{perpage}MakeSorted{figure} %2
      makeatletterletc@equationc@figuremakeatother %3
      begin{document}
      begin{theorem}blindtextend{theorem}
      begin{figure}blindtextcaption{Caption}end{figure}
      begin{equation}a^2+b^2=c^2end{equation}
      end{document}






      floats theorems counters






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 29 at 22:59









      Matt SMatt S

      825




      825






















          1 Answer
          1






          active

          oldest

          votes


















          1














          Instead of making a new myeqn environment, just modify the equation environment. The solution seems to play fine with perpage's MakeSorted (the numbering looks as expected).



          usepackage{etoolbox}
          AtBeginEnvironment{equation}{%
          setcounter{equation}{value{figure}}%
          stepcounter{figure}%
          }
          renewcommandtheequation{arabic{figure}}


          The last line above replaces the equation counter's printout with the figure counter's printout, because the equation counter can be incorrect when MakeSorted renumbers the floats based on display order. Thus, the line setcounter{equation}{arabic{figure}} above is unnecessary and can be deleted (the line is just to insure against accidental referral to the equation counter).



          Similarly, because perpage clashes with chngcntr's counterwithin, you can modify section if you want to reset your counter each section.



          usepackage{etoolbox}
          pretosection{setcounter{figure}0}


          The patch seems to work as long as you don't have too many sections and floats close to each other, ie, on the same page.



          Edit. Here are two mwe's: just the equation fix (mwe-e), and the equation fix with the count within section fix (mwe-f).



          %% MWE-E
          documentclass{article}
          usepackage{lipsum, amsthm, perpage, etoolbox}
          newtheorem{theorem}[figure]{Theorem} % sync thm, float
          MakeSorted{figure} % renumber float
          AtBeginEnvironment{equation}{stepcounter{figure}} % sync eqn, float
          renewcommandtheequation{arabic{figure}} % sync eqn, float

          begin{document}
          section*{This is a section}
          begin{theorem}This is a theorem.end{theorem}
          begin{figure}lipsum[2]caption{This is a caption}end{figure}
          begin{equation}a^2+b^2=c^2end{equation}
          section*{Another section}
          begin{theorem}[This is a Title]lipsum[2]end{theorem}
          begin{equation}a^2+b^2=c^2end{equation}
          end{document}


          mwe-e



          %% MWE-F
          documentclass{article}
          usepackage{lipsum, amsthm, perpage, etoolbox}
          newtheorem{theorem}[figure]{Theorem}
          MakeSorted{figure}
          AtBeginEnvironment{equation}{stepcounter{figure}}
          renewcommandtheequation{arabic{section}.arabic{figure}} % count within sec
          renewcommandthefigure{arabic{section}.arabic{figure}} % count within sec
          pretosection{setcounter{figure}0} % count within sec

          begin{document}
          section{This is a section}
          begin{theorem}This is a theorem.end{theorem}
          begin{figure}lipsum[2]caption{This is a caption}end{figure}
          begin{equation}a^2+b^2=c^2end{equation}
          section{Another section}
          begin{theorem}[This is a Title]lipsum[2]end{theorem}
          begin{equation}a^2+b^2=c^2end{equation}
          end{document}


          mwe-f






          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%2f482195%2fcorrectly-order-float-counter-perpage-sty-while-sharing-eqn-thm-counter%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









            1














            Instead of making a new myeqn environment, just modify the equation environment. The solution seems to play fine with perpage's MakeSorted (the numbering looks as expected).



            usepackage{etoolbox}
            AtBeginEnvironment{equation}{%
            setcounter{equation}{value{figure}}%
            stepcounter{figure}%
            }
            renewcommandtheequation{arabic{figure}}


            The last line above replaces the equation counter's printout with the figure counter's printout, because the equation counter can be incorrect when MakeSorted renumbers the floats based on display order. Thus, the line setcounter{equation}{arabic{figure}} above is unnecessary and can be deleted (the line is just to insure against accidental referral to the equation counter).



            Similarly, because perpage clashes with chngcntr's counterwithin, you can modify section if you want to reset your counter each section.



            usepackage{etoolbox}
            pretosection{setcounter{figure}0}


            The patch seems to work as long as you don't have too many sections and floats close to each other, ie, on the same page.



            Edit. Here are two mwe's: just the equation fix (mwe-e), and the equation fix with the count within section fix (mwe-f).



            %% MWE-E
            documentclass{article}
            usepackage{lipsum, amsthm, perpage, etoolbox}
            newtheorem{theorem}[figure]{Theorem} % sync thm, float
            MakeSorted{figure} % renumber float
            AtBeginEnvironment{equation}{stepcounter{figure}} % sync eqn, float
            renewcommandtheequation{arabic{figure}} % sync eqn, float

            begin{document}
            section*{This is a section}
            begin{theorem}This is a theorem.end{theorem}
            begin{figure}lipsum[2]caption{This is a caption}end{figure}
            begin{equation}a^2+b^2=c^2end{equation}
            section*{Another section}
            begin{theorem}[This is a Title]lipsum[2]end{theorem}
            begin{equation}a^2+b^2=c^2end{equation}
            end{document}


            mwe-e



            %% MWE-F
            documentclass{article}
            usepackage{lipsum, amsthm, perpage, etoolbox}
            newtheorem{theorem}[figure]{Theorem}
            MakeSorted{figure}
            AtBeginEnvironment{equation}{stepcounter{figure}}
            renewcommandtheequation{arabic{section}.arabic{figure}} % count within sec
            renewcommandthefigure{arabic{section}.arabic{figure}} % count within sec
            pretosection{setcounter{figure}0} % count within sec

            begin{document}
            section{This is a section}
            begin{theorem}This is a theorem.end{theorem}
            begin{figure}lipsum[2]caption{This is a caption}end{figure}
            begin{equation}a^2+b^2=c^2end{equation}
            section{Another section}
            begin{theorem}[This is a Title]lipsum[2]end{theorem}
            begin{equation}a^2+b^2=c^2end{equation}
            end{document}


            mwe-f






            share|improve this answer






























              1














              Instead of making a new myeqn environment, just modify the equation environment. The solution seems to play fine with perpage's MakeSorted (the numbering looks as expected).



              usepackage{etoolbox}
              AtBeginEnvironment{equation}{%
              setcounter{equation}{value{figure}}%
              stepcounter{figure}%
              }
              renewcommandtheequation{arabic{figure}}


              The last line above replaces the equation counter's printout with the figure counter's printout, because the equation counter can be incorrect when MakeSorted renumbers the floats based on display order. Thus, the line setcounter{equation}{arabic{figure}} above is unnecessary and can be deleted (the line is just to insure against accidental referral to the equation counter).



              Similarly, because perpage clashes with chngcntr's counterwithin, you can modify section if you want to reset your counter each section.



              usepackage{etoolbox}
              pretosection{setcounter{figure}0}


              The patch seems to work as long as you don't have too many sections and floats close to each other, ie, on the same page.



              Edit. Here are two mwe's: just the equation fix (mwe-e), and the equation fix with the count within section fix (mwe-f).



              %% MWE-E
              documentclass{article}
              usepackage{lipsum, amsthm, perpage, etoolbox}
              newtheorem{theorem}[figure]{Theorem} % sync thm, float
              MakeSorted{figure} % renumber float
              AtBeginEnvironment{equation}{stepcounter{figure}} % sync eqn, float
              renewcommandtheequation{arabic{figure}} % sync eqn, float

              begin{document}
              section*{This is a section}
              begin{theorem}This is a theorem.end{theorem}
              begin{figure}lipsum[2]caption{This is a caption}end{figure}
              begin{equation}a^2+b^2=c^2end{equation}
              section*{Another section}
              begin{theorem}[This is a Title]lipsum[2]end{theorem}
              begin{equation}a^2+b^2=c^2end{equation}
              end{document}


              mwe-e



              %% MWE-F
              documentclass{article}
              usepackage{lipsum, amsthm, perpage, etoolbox}
              newtheorem{theorem}[figure]{Theorem}
              MakeSorted{figure}
              AtBeginEnvironment{equation}{stepcounter{figure}}
              renewcommandtheequation{arabic{section}.arabic{figure}} % count within sec
              renewcommandthefigure{arabic{section}.arabic{figure}} % count within sec
              pretosection{setcounter{figure}0} % count within sec

              begin{document}
              section{This is a section}
              begin{theorem}This is a theorem.end{theorem}
              begin{figure}lipsum[2]caption{This is a caption}end{figure}
              begin{equation}a^2+b^2=c^2end{equation}
              section{Another section}
              begin{theorem}[This is a Title]lipsum[2]end{theorem}
              begin{equation}a^2+b^2=c^2end{equation}
              end{document}


              mwe-f






              share|improve this answer




























                1












                1








                1







                Instead of making a new myeqn environment, just modify the equation environment. The solution seems to play fine with perpage's MakeSorted (the numbering looks as expected).



                usepackage{etoolbox}
                AtBeginEnvironment{equation}{%
                setcounter{equation}{value{figure}}%
                stepcounter{figure}%
                }
                renewcommandtheequation{arabic{figure}}


                The last line above replaces the equation counter's printout with the figure counter's printout, because the equation counter can be incorrect when MakeSorted renumbers the floats based on display order. Thus, the line setcounter{equation}{arabic{figure}} above is unnecessary and can be deleted (the line is just to insure against accidental referral to the equation counter).



                Similarly, because perpage clashes with chngcntr's counterwithin, you can modify section if you want to reset your counter each section.



                usepackage{etoolbox}
                pretosection{setcounter{figure}0}


                The patch seems to work as long as you don't have too many sections and floats close to each other, ie, on the same page.



                Edit. Here are two mwe's: just the equation fix (mwe-e), and the equation fix with the count within section fix (mwe-f).



                %% MWE-E
                documentclass{article}
                usepackage{lipsum, amsthm, perpage, etoolbox}
                newtheorem{theorem}[figure]{Theorem} % sync thm, float
                MakeSorted{figure} % renumber float
                AtBeginEnvironment{equation}{stepcounter{figure}} % sync eqn, float
                renewcommandtheequation{arabic{figure}} % sync eqn, float

                begin{document}
                section*{This is a section}
                begin{theorem}This is a theorem.end{theorem}
                begin{figure}lipsum[2]caption{This is a caption}end{figure}
                begin{equation}a^2+b^2=c^2end{equation}
                section*{Another section}
                begin{theorem}[This is a Title]lipsum[2]end{theorem}
                begin{equation}a^2+b^2=c^2end{equation}
                end{document}


                mwe-e



                %% MWE-F
                documentclass{article}
                usepackage{lipsum, amsthm, perpage, etoolbox}
                newtheorem{theorem}[figure]{Theorem}
                MakeSorted{figure}
                AtBeginEnvironment{equation}{stepcounter{figure}}
                renewcommandtheequation{arabic{section}.arabic{figure}} % count within sec
                renewcommandthefigure{arabic{section}.arabic{figure}} % count within sec
                pretosection{setcounter{figure}0} % count within sec

                begin{document}
                section{This is a section}
                begin{theorem}This is a theorem.end{theorem}
                begin{figure}lipsum[2]caption{This is a caption}end{figure}
                begin{equation}a^2+b^2=c^2end{equation}
                section{Another section}
                begin{theorem}[This is a Title]lipsum[2]end{theorem}
                begin{equation}a^2+b^2=c^2end{equation}
                end{document}


                mwe-f






                share|improve this answer















                Instead of making a new myeqn environment, just modify the equation environment. The solution seems to play fine with perpage's MakeSorted (the numbering looks as expected).



                usepackage{etoolbox}
                AtBeginEnvironment{equation}{%
                setcounter{equation}{value{figure}}%
                stepcounter{figure}%
                }
                renewcommandtheequation{arabic{figure}}


                The last line above replaces the equation counter's printout with the figure counter's printout, because the equation counter can be incorrect when MakeSorted renumbers the floats based on display order. Thus, the line setcounter{equation}{arabic{figure}} above is unnecessary and can be deleted (the line is just to insure against accidental referral to the equation counter).



                Similarly, because perpage clashes with chngcntr's counterwithin, you can modify section if you want to reset your counter each section.



                usepackage{etoolbox}
                pretosection{setcounter{figure}0}


                The patch seems to work as long as you don't have too many sections and floats close to each other, ie, on the same page.



                Edit. Here are two mwe's: just the equation fix (mwe-e), and the equation fix with the count within section fix (mwe-f).



                %% MWE-E
                documentclass{article}
                usepackage{lipsum, amsthm, perpage, etoolbox}
                newtheorem{theorem}[figure]{Theorem} % sync thm, float
                MakeSorted{figure} % renumber float
                AtBeginEnvironment{equation}{stepcounter{figure}} % sync eqn, float
                renewcommandtheequation{arabic{figure}} % sync eqn, float

                begin{document}
                section*{This is a section}
                begin{theorem}This is a theorem.end{theorem}
                begin{figure}lipsum[2]caption{This is a caption}end{figure}
                begin{equation}a^2+b^2=c^2end{equation}
                section*{Another section}
                begin{theorem}[This is a Title]lipsum[2]end{theorem}
                begin{equation}a^2+b^2=c^2end{equation}
                end{document}


                mwe-e



                %% MWE-F
                documentclass{article}
                usepackage{lipsum, amsthm, perpage, etoolbox}
                newtheorem{theorem}[figure]{Theorem}
                MakeSorted{figure}
                AtBeginEnvironment{equation}{stepcounter{figure}}
                renewcommandtheequation{arabic{section}.arabic{figure}} % count within sec
                renewcommandthefigure{arabic{section}.arabic{figure}} % count within sec
                pretosection{setcounter{figure}0} % count within sec

                begin{document}
                section{This is a section}
                begin{theorem}This is a theorem.end{theorem}
                begin{figure}lipsum[2]caption{This is a caption}end{figure}
                begin{equation}a^2+b^2=c^2end{equation}
                section{Another section}
                begin{theorem}[This is a Title]lipsum[2]end{theorem}
                begin{equation}a^2+b^2=c^2end{equation}
                end{document}


                mwe-f







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Mar 31 at 14:09

























                answered Mar 30 at 14:29









                Matt SMatt S

                825




                825






























                    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%2f482195%2fcorrectly-order-float-counter-perpage-sty-while-sharing-eqn-thm-counter%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

                    mysqli_query(): Empty query in /home/lucindabrummitt/public_html/blog/wp-includes/wp-db.php on line 1924

                    How to change which sound is reproduced for terminal bell?

                    Can I use Tabulator js library in my java Spring + Thymeleaf project?