Nested cases, alignment and numbering











up vote
6
down vote

favorite












Sought result except with numbering for the three different equations within the aligned subenvironment



I have tried all different sorts of solutions including align, aligned, cases and equation to have the result I get with this code except that I want numbering for the three lines in the aligned subenvironment. Do you have a solution or better way of representing this?



begin{equation}
left{
begin{aligned}
partial_t u(vec{x},t) - alpha Delta u(vec{x},t) &= f(vec{x}), &&(vec{x},t) in Omega times J, \
%
u(vec{x},t) &= 0, &&(vec{x},t) in partial Omega times J, \
%
u(vec{x},0) &=
begin{cases}
rho, &vec{x} in T \
0, &vec{x} in B textbackslash T
end{cases}
&&vec{x} in B
end{aligned}
right.
end{equation}









share|improve this question


























    up vote
    6
    down vote

    favorite












    Sought result except with numbering for the three different equations within the aligned subenvironment



    I have tried all different sorts of solutions including align, aligned, cases and equation to have the result I get with this code except that I want numbering for the three lines in the aligned subenvironment. Do you have a solution or better way of representing this?



    begin{equation}
    left{
    begin{aligned}
    partial_t u(vec{x},t) - alpha Delta u(vec{x},t) &= f(vec{x}), &&(vec{x},t) in Omega times J, \
    %
    u(vec{x},t) &= 0, &&(vec{x},t) in partial Omega times J, \
    %
    u(vec{x},0) &=
    begin{cases}
    rho, &vec{x} in T \
    0, &vec{x} in B textbackslash T
    end{cases}
    &&vec{x} in B
    end{aligned}
    right.
    end{equation}









    share|improve this question
























      up vote
      6
      down vote

      favorite









      up vote
      6
      down vote

      favorite











      Sought result except with numbering for the three different equations within the aligned subenvironment



      I have tried all different sorts of solutions including align, aligned, cases and equation to have the result I get with this code except that I want numbering for the three lines in the aligned subenvironment. Do you have a solution or better way of representing this?



      begin{equation}
      left{
      begin{aligned}
      partial_t u(vec{x},t) - alpha Delta u(vec{x},t) &= f(vec{x}), &&(vec{x},t) in Omega times J, \
      %
      u(vec{x},t) &= 0, &&(vec{x},t) in partial Omega times J, \
      %
      u(vec{x},0) &=
      begin{cases}
      rho, &vec{x} in T \
      0, &vec{x} in B textbackslash T
      end{cases}
      &&vec{x} in B
      end{aligned}
      right.
      end{equation}









      share|improve this question













      Sought result except with numbering for the three different equations within the aligned subenvironment



      I have tried all different sorts of solutions including align, aligned, cases and equation to have the result I get with this code except that I want numbering for the three lines in the aligned subenvironment. Do you have a solution or better way of representing this?



      begin{equation}
      left{
      begin{aligned}
      partial_t u(vec{x},t) - alpha Delta u(vec{x},t) &= f(vec{x}), &&(vec{x},t) in Omega times J, \
      %
      u(vec{x},t) &= 0, &&(vec{x},t) in partial Omega times J, \
      %
      u(vec{x},0) &=
      begin{cases}
      rho, &vec{x} in T \
      0, &vec{x} in B textbackslash T
      end{cases}
      &&vec{x} in B
      end{aligned}
      right.
      end{equation}






      numbering align cases nesting alignment






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 10 at 19:06









      Robin Hellmers

      969




      969






















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          6
          down vote



          accepted










          With the use of the empheq package:



          documentclass{article}

          usepackage{empheq}
          begin{document}
          begin{empheq}[left=empheqlbrace]{align}
          partial_t u(vec{x},t) - alpha Delta u(vec{x},t)
          &= f(vec{x}), &&(vec{x},t) in Omega times J, \
          %
          u(vec{x},t) &= 0, &&(vec{x},t) in partial Omega times J, \
          %
          u(vec{x},0)
          & = begin{cases}
          rho, &vec{x} in T \
          0, &vec{x} in B setminus T
          end{cases}
          &&vec{x} in B
          end{empheq}
          end{document}


          enter image description here






          share|improve this answer



















          • 1




            Don't use textbackslash. Use setminus instead.
            – Mico
            Dec 10 at 19:24










          • @Mico, ups, i didn't check used symbols :-(. corrected now. thank you very much!
            – Zarko
            Dec 10 at 19:46










          • @Mico, do you have an short explanation of why to use setminus instead of textbackslash?
            – Robin Hellmers
            Dec 10 at 19:51










          • @RobinHellmers - textbackslash is a text-mode command. In contrast, setminus is a math-mode command. In your screenshot, note that the spacing around the backslash character is too tight, when compared to the screenshots posted by Zarko and myself.
            – Mico
            Dec 10 at 20:58


















          up vote
          7
          down vote













          I don't think that much is gained by aligning the three equations on their respective = symbols. I'd left-align the expressions, using a numcases environment.



          enter image description here



          documentclass{article}
          usepackage{newtxtext,newtxmath,mathrsfs} % optional
          usepackage{cases} % for 'numcases' env.
          begin{document}
          begin{numcases}{}
          partial_t u(vec{x},t) - alphaDelta u(vec{x},t) = f(vec{x}),
          &$(vec{x},t)inOmegatimes J$, \
          u(vec{x},t) = 0,
          &$(vec{x},t)inpartialOmegatimes J$, \
          u(vec{x},0) =
          left{begin{array}{@{}ll@{}}
          rho, &vec{x} inmathscr{T} \
          0, &vec{x} inmathscr{B}setminus mathscr{T}
          end{array}right.
          &$vec{x} inmathscr{B}$
          end{numcases}
          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',
            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%2f464189%2fnested-cases-alignment-and-numbering%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            6
            down vote



            accepted










            With the use of the empheq package:



            documentclass{article}

            usepackage{empheq}
            begin{document}
            begin{empheq}[left=empheqlbrace]{align}
            partial_t u(vec{x},t) - alpha Delta u(vec{x},t)
            &= f(vec{x}), &&(vec{x},t) in Omega times J, \
            %
            u(vec{x},t) &= 0, &&(vec{x},t) in partial Omega times J, \
            %
            u(vec{x},0)
            & = begin{cases}
            rho, &vec{x} in T \
            0, &vec{x} in B setminus T
            end{cases}
            &&vec{x} in B
            end{empheq}
            end{document}


            enter image description here






            share|improve this answer



















            • 1




              Don't use textbackslash. Use setminus instead.
              – Mico
              Dec 10 at 19:24










            • @Mico, ups, i didn't check used symbols :-(. corrected now. thank you very much!
              – Zarko
              Dec 10 at 19:46










            • @Mico, do you have an short explanation of why to use setminus instead of textbackslash?
              – Robin Hellmers
              Dec 10 at 19:51










            • @RobinHellmers - textbackslash is a text-mode command. In contrast, setminus is a math-mode command. In your screenshot, note that the spacing around the backslash character is too tight, when compared to the screenshots posted by Zarko and myself.
              – Mico
              Dec 10 at 20:58















            up vote
            6
            down vote



            accepted










            With the use of the empheq package:



            documentclass{article}

            usepackage{empheq}
            begin{document}
            begin{empheq}[left=empheqlbrace]{align}
            partial_t u(vec{x},t) - alpha Delta u(vec{x},t)
            &= f(vec{x}), &&(vec{x},t) in Omega times J, \
            %
            u(vec{x},t) &= 0, &&(vec{x},t) in partial Omega times J, \
            %
            u(vec{x},0)
            & = begin{cases}
            rho, &vec{x} in T \
            0, &vec{x} in B setminus T
            end{cases}
            &&vec{x} in B
            end{empheq}
            end{document}


            enter image description here






            share|improve this answer



















            • 1




              Don't use textbackslash. Use setminus instead.
              – Mico
              Dec 10 at 19:24










            • @Mico, ups, i didn't check used symbols :-(. corrected now. thank you very much!
              – Zarko
              Dec 10 at 19:46










            • @Mico, do you have an short explanation of why to use setminus instead of textbackslash?
              – Robin Hellmers
              Dec 10 at 19:51










            • @RobinHellmers - textbackslash is a text-mode command. In contrast, setminus is a math-mode command. In your screenshot, note that the spacing around the backslash character is too tight, when compared to the screenshots posted by Zarko and myself.
              – Mico
              Dec 10 at 20:58













            up vote
            6
            down vote



            accepted







            up vote
            6
            down vote



            accepted






            With the use of the empheq package:



            documentclass{article}

            usepackage{empheq}
            begin{document}
            begin{empheq}[left=empheqlbrace]{align}
            partial_t u(vec{x},t) - alpha Delta u(vec{x},t)
            &= f(vec{x}), &&(vec{x},t) in Omega times J, \
            %
            u(vec{x},t) &= 0, &&(vec{x},t) in partial Omega times J, \
            %
            u(vec{x},0)
            & = begin{cases}
            rho, &vec{x} in T \
            0, &vec{x} in B setminus T
            end{cases}
            &&vec{x} in B
            end{empheq}
            end{document}


            enter image description here






            share|improve this answer














            With the use of the empheq package:



            documentclass{article}

            usepackage{empheq}
            begin{document}
            begin{empheq}[left=empheqlbrace]{align}
            partial_t u(vec{x},t) - alpha Delta u(vec{x},t)
            &= f(vec{x}), &&(vec{x},t) in Omega times J, \
            %
            u(vec{x},t) &= 0, &&(vec{x},t) in partial Omega times J, \
            %
            u(vec{x},0)
            & = begin{cases}
            rho, &vec{x} in T \
            0, &vec{x} in B setminus T
            end{cases}
            &&vec{x} in B
            end{empheq}
            end{document}


            enter image description here







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Dec 10 at 19:57









            Werner

            435k629561644




            435k629561644










            answered Dec 10 at 19:18









            Zarko

            119k865155




            119k865155








            • 1




              Don't use textbackslash. Use setminus instead.
              – Mico
              Dec 10 at 19:24










            • @Mico, ups, i didn't check used symbols :-(. corrected now. thank you very much!
              – Zarko
              Dec 10 at 19:46










            • @Mico, do you have an short explanation of why to use setminus instead of textbackslash?
              – Robin Hellmers
              Dec 10 at 19:51










            • @RobinHellmers - textbackslash is a text-mode command. In contrast, setminus is a math-mode command. In your screenshot, note that the spacing around the backslash character is too tight, when compared to the screenshots posted by Zarko and myself.
              – Mico
              Dec 10 at 20:58














            • 1




              Don't use textbackslash. Use setminus instead.
              – Mico
              Dec 10 at 19:24










            • @Mico, ups, i didn't check used symbols :-(. corrected now. thank you very much!
              – Zarko
              Dec 10 at 19:46










            • @Mico, do you have an short explanation of why to use setminus instead of textbackslash?
              – Robin Hellmers
              Dec 10 at 19:51










            • @RobinHellmers - textbackslash is a text-mode command. In contrast, setminus is a math-mode command. In your screenshot, note that the spacing around the backslash character is too tight, when compared to the screenshots posted by Zarko and myself.
              – Mico
              Dec 10 at 20:58








            1




            1




            Don't use textbackslash. Use setminus instead.
            – Mico
            Dec 10 at 19:24




            Don't use textbackslash. Use setminus instead.
            – Mico
            Dec 10 at 19:24












            @Mico, ups, i didn't check used symbols :-(. corrected now. thank you very much!
            – Zarko
            Dec 10 at 19:46




            @Mico, ups, i didn't check used symbols :-(. corrected now. thank you very much!
            – Zarko
            Dec 10 at 19:46












            @Mico, do you have an short explanation of why to use setminus instead of textbackslash?
            – Robin Hellmers
            Dec 10 at 19:51




            @Mico, do you have an short explanation of why to use setminus instead of textbackslash?
            – Robin Hellmers
            Dec 10 at 19:51












            @RobinHellmers - textbackslash is a text-mode command. In contrast, setminus is a math-mode command. In your screenshot, note that the spacing around the backslash character is too tight, when compared to the screenshots posted by Zarko and myself.
            – Mico
            Dec 10 at 20:58




            @RobinHellmers - textbackslash is a text-mode command. In contrast, setminus is a math-mode command. In your screenshot, note that the spacing around the backslash character is too tight, when compared to the screenshots posted by Zarko and myself.
            – Mico
            Dec 10 at 20:58










            up vote
            7
            down vote













            I don't think that much is gained by aligning the three equations on their respective = symbols. I'd left-align the expressions, using a numcases environment.



            enter image description here



            documentclass{article}
            usepackage{newtxtext,newtxmath,mathrsfs} % optional
            usepackage{cases} % for 'numcases' env.
            begin{document}
            begin{numcases}{}
            partial_t u(vec{x},t) - alphaDelta u(vec{x},t) = f(vec{x}),
            &$(vec{x},t)inOmegatimes J$, \
            u(vec{x},t) = 0,
            &$(vec{x},t)inpartialOmegatimes J$, \
            u(vec{x},0) =
            left{begin{array}{@{}ll@{}}
            rho, &vec{x} inmathscr{T} \
            0, &vec{x} inmathscr{B}setminus mathscr{T}
            end{array}right.
            &$vec{x} inmathscr{B}$
            end{numcases}
            end{document}





            share|improve this answer



























              up vote
              7
              down vote













              I don't think that much is gained by aligning the three equations on their respective = symbols. I'd left-align the expressions, using a numcases environment.



              enter image description here



              documentclass{article}
              usepackage{newtxtext,newtxmath,mathrsfs} % optional
              usepackage{cases} % for 'numcases' env.
              begin{document}
              begin{numcases}{}
              partial_t u(vec{x},t) - alphaDelta u(vec{x},t) = f(vec{x}),
              &$(vec{x},t)inOmegatimes J$, \
              u(vec{x},t) = 0,
              &$(vec{x},t)inpartialOmegatimes J$, \
              u(vec{x},0) =
              left{begin{array}{@{}ll@{}}
              rho, &vec{x} inmathscr{T} \
              0, &vec{x} inmathscr{B}setminus mathscr{T}
              end{array}right.
              &$vec{x} inmathscr{B}$
              end{numcases}
              end{document}





              share|improve this answer

























                up vote
                7
                down vote










                up vote
                7
                down vote









                I don't think that much is gained by aligning the three equations on their respective = symbols. I'd left-align the expressions, using a numcases environment.



                enter image description here



                documentclass{article}
                usepackage{newtxtext,newtxmath,mathrsfs} % optional
                usepackage{cases} % for 'numcases' env.
                begin{document}
                begin{numcases}{}
                partial_t u(vec{x},t) - alphaDelta u(vec{x},t) = f(vec{x}),
                &$(vec{x},t)inOmegatimes J$, \
                u(vec{x},t) = 0,
                &$(vec{x},t)inpartialOmegatimes J$, \
                u(vec{x},0) =
                left{begin{array}{@{}ll@{}}
                rho, &vec{x} inmathscr{T} \
                0, &vec{x} inmathscr{B}setminus mathscr{T}
                end{array}right.
                &$vec{x} inmathscr{B}$
                end{numcases}
                end{document}





                share|improve this answer














                I don't think that much is gained by aligning the three equations on their respective = symbols. I'd left-align the expressions, using a numcases environment.



                enter image description here



                documentclass{article}
                usepackage{newtxtext,newtxmath,mathrsfs} % optional
                usepackage{cases} % for 'numcases' env.
                begin{document}
                begin{numcases}{}
                partial_t u(vec{x},t) - alphaDelta u(vec{x},t) = f(vec{x}),
                &$(vec{x},t)inOmegatimes J$, \
                u(vec{x},t) = 0,
                &$(vec{x},t)inpartialOmegatimes J$, \
                u(vec{x},0) =
                left{begin{array}{@{}ll@{}}
                rho, &vec{x} inmathscr{T} \
                0, &vec{x} inmathscr{B}setminus mathscr{T}
                end{array}right.
                &$vec{x} inmathscr{B}$
                end{numcases}
                end{document}






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Dec 10 at 21:04

























                answered Dec 10 at 19:23









                Mico

                272k30369756




                272k30369756






























                    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.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • 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%2f464189%2fnested-cases-alignment-and-numbering%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

                    Сан-Квентин

                    Алькесар

                    Josef Freinademetz