align two piecewise functions












5














I have problem with my piecewise functions



I read others post and I tried this but I have errors



documentclass{article}
usepackage{amsmath}
begin{document}
begin{align*}
$x_{{i}{j}}$ =
&begin{cases}
text{1,} &quadtext{Si se envía agua desde área i ( i $in$ {1,2,3,4,5,6,7,8,9,10}) a sitio j ( j $in$ {1,2,3,4,5,6,7})} \
text{0,} &quadtext{En caso contrario}
end{cases}\
$y_{j}$ =
&begin{cases}
text{1,} &quadtext{ Si se construye planta en el sitio j ( j $in $ {1,2,3,4,5,6,7})} \
text{0,} &quadtext{En caso contrario}
end{cases}
end{align*}
end{document}



Runaway argument? ! Paragraph ended before align* was complete.
par l.592




I did this (using [) and it works well but they appear not aligned



documentclass{article}
usepackage{amsmath}
begin{document}
[
x_{{i}{j}} =
begin{cases}
text{1,} &quadtext{Si se envía agua desde área i ( i $in$ {1,2,3,4,5,6,7,8,9,10}) a sitio j ( j $in$ {1,2,3,4,5,6,7})} \
text{0,} &quadtext{En caso contrario}
end{cases}
]
[
y_{j} =
begin{cases}
text{1,} &quadtext{ Si se construye planta en el sitio j ( j $in $ {1,2,3,4,5,6,7})} \
text{0,} &quadtext{En caso contrario}
end{cases}
]


end{document}


enter image description here



and I want they are aligned, like this



enter image description here










share|improve this question






















  • remove the $$ around x_{ij} and y_{j}. begin{align*} is already a math environment.
    – Troy
    Nov 30 at 17:00












  • lol I did that and it didn't work before but now it works hahaha thanks man!! is there a way to align the functions using [ .... ] ?
    – EmiliOrtega
    Nov 30 at 17:02










  • Yes, with the begin{aligned} environment from amsmath. E.g. of its use: Alignment in equations
    – Troy
    Nov 30 at 17:04


















5














I have problem with my piecewise functions



I read others post and I tried this but I have errors



documentclass{article}
usepackage{amsmath}
begin{document}
begin{align*}
$x_{{i}{j}}$ =
&begin{cases}
text{1,} &quadtext{Si se envía agua desde área i ( i $in$ {1,2,3,4,5,6,7,8,9,10}) a sitio j ( j $in$ {1,2,3,4,5,6,7})} \
text{0,} &quadtext{En caso contrario}
end{cases}\
$y_{j}$ =
&begin{cases}
text{1,} &quadtext{ Si se construye planta en el sitio j ( j $in $ {1,2,3,4,5,6,7})} \
text{0,} &quadtext{En caso contrario}
end{cases}
end{align*}
end{document}



Runaway argument? ! Paragraph ended before align* was complete.
par l.592




I did this (using [) and it works well but they appear not aligned



documentclass{article}
usepackage{amsmath}
begin{document}
[
x_{{i}{j}} =
begin{cases}
text{1,} &quadtext{Si se envía agua desde área i ( i $in$ {1,2,3,4,5,6,7,8,9,10}) a sitio j ( j $in$ {1,2,3,4,5,6,7})} \
text{0,} &quadtext{En caso contrario}
end{cases}
]
[
y_{j} =
begin{cases}
text{1,} &quadtext{ Si se construye planta en el sitio j ( j $in $ {1,2,3,4,5,6,7})} \
text{0,} &quadtext{En caso contrario}
end{cases}
]


end{document}


enter image description here



and I want they are aligned, like this



enter image description here










share|improve this question






















  • remove the $$ around x_{ij} and y_{j}. begin{align*} is already a math environment.
    – Troy
    Nov 30 at 17:00












  • lol I did that and it didn't work before but now it works hahaha thanks man!! is there a way to align the functions using [ .... ] ?
    – EmiliOrtega
    Nov 30 at 17:02










  • Yes, with the begin{aligned} environment from amsmath. E.g. of its use: Alignment in equations
    – Troy
    Nov 30 at 17:04
















5












5








5







I have problem with my piecewise functions



I read others post and I tried this but I have errors



documentclass{article}
usepackage{amsmath}
begin{document}
begin{align*}
$x_{{i}{j}}$ =
&begin{cases}
text{1,} &quadtext{Si se envía agua desde área i ( i $in$ {1,2,3,4,5,6,7,8,9,10}) a sitio j ( j $in$ {1,2,3,4,5,6,7})} \
text{0,} &quadtext{En caso contrario}
end{cases}\
$y_{j}$ =
&begin{cases}
text{1,} &quadtext{ Si se construye planta en el sitio j ( j $in $ {1,2,3,4,5,6,7})} \
text{0,} &quadtext{En caso contrario}
end{cases}
end{align*}
end{document}



Runaway argument? ! Paragraph ended before align* was complete.
par l.592




I did this (using [) and it works well but they appear not aligned



documentclass{article}
usepackage{amsmath}
begin{document}
[
x_{{i}{j}} =
begin{cases}
text{1,} &quadtext{Si se envía agua desde área i ( i $in$ {1,2,3,4,5,6,7,8,9,10}) a sitio j ( j $in$ {1,2,3,4,5,6,7})} \
text{0,} &quadtext{En caso contrario}
end{cases}
]
[
y_{j} =
begin{cases}
text{1,} &quadtext{ Si se construye planta en el sitio j ( j $in $ {1,2,3,4,5,6,7})} \
text{0,} &quadtext{En caso contrario}
end{cases}
]


end{document}


enter image description here



and I want they are aligned, like this



enter image description here










share|improve this question













I have problem with my piecewise functions



I read others post and I tried this but I have errors



documentclass{article}
usepackage{amsmath}
begin{document}
begin{align*}
$x_{{i}{j}}$ =
&begin{cases}
text{1,} &quadtext{Si se envía agua desde área i ( i $in$ {1,2,3,4,5,6,7,8,9,10}) a sitio j ( j $in$ {1,2,3,4,5,6,7})} \
text{0,} &quadtext{En caso contrario}
end{cases}\
$y_{j}$ =
&begin{cases}
text{1,} &quadtext{ Si se construye planta en el sitio j ( j $in $ {1,2,3,4,5,6,7})} \
text{0,} &quadtext{En caso contrario}
end{cases}
end{align*}
end{document}



Runaway argument? ! Paragraph ended before align* was complete.
par l.592




I did this (using [) and it works well but they appear not aligned



documentclass{article}
usepackage{amsmath}
begin{document}
[
x_{{i}{j}} =
begin{cases}
text{1,} &quadtext{Si se envía agua desde área i ( i $in$ {1,2,3,4,5,6,7,8,9,10}) a sitio j ( j $in$ {1,2,3,4,5,6,7})} \
text{0,} &quadtext{En caso contrario}
end{cases}
]
[
y_{j} =
begin{cases}
text{1,} &quadtext{ Si se construye planta en el sitio j ( j $in $ {1,2,3,4,5,6,7})} \
text{0,} &quadtext{En caso contrario}
end{cases}
]


end{document}


enter image description here



and I want they are aligned, like this



enter image description here







horizontal-alignment equations






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 30 at 16:38









EmiliOrtega

333




333












  • remove the $$ around x_{ij} and y_{j}. begin{align*} is already a math environment.
    – Troy
    Nov 30 at 17:00












  • lol I did that and it didn't work before but now it works hahaha thanks man!! is there a way to align the functions using [ .... ] ?
    – EmiliOrtega
    Nov 30 at 17:02










  • Yes, with the begin{aligned} environment from amsmath. E.g. of its use: Alignment in equations
    – Troy
    Nov 30 at 17:04




















  • remove the $$ around x_{ij} and y_{j}. begin{align*} is already a math environment.
    – Troy
    Nov 30 at 17:00












  • lol I did that and it didn't work before but now it works hahaha thanks man!! is there a way to align the functions using [ .... ] ?
    – EmiliOrtega
    Nov 30 at 17:02










  • Yes, with the begin{aligned} environment from amsmath. E.g. of its use: Alignment in equations
    – Troy
    Nov 30 at 17:04


















remove the $$ around x_{ij} and y_{j}. begin{align*} is already a math environment.
– Troy
Nov 30 at 17:00






remove the $$ around x_{ij} and y_{j}. begin{align*} is already a math environment.
– Troy
Nov 30 at 17:00














lol I did that and it didn't work before but now it works hahaha thanks man!! is there a way to align the functions using [ .... ] ?
– EmiliOrtega
Nov 30 at 17:02




lol I did that and it didn't work before but now it works hahaha thanks man!! is there a way to align the functions using [ .... ] ?
– EmiliOrtega
Nov 30 at 17:02












Yes, with the begin{aligned} environment from amsmath. E.g. of its use: Alignment in equations
– Troy
Nov 30 at 17:04






Yes, with the begin{aligned} environment from amsmath. E.g. of its use: Alignment in equations
– Troy
Nov 30 at 17:04












3 Answers
3






active

oldest

votes


















3














Beware! align already typesets its contents in math mode (but text reverts to text mode).



You have to just align the equals signs with &=; for the long line, I suggest a tabular. Some vertical spacing will help, too.



documentclass{article}
usepackage{amsmath}
begin{document}

begin{align*}
x_{ij} &=
begin{cases}
1, &begin{tabular}[t]{@{}l@{}}
Si se envía agua desde área $i$ ($iin{1,2,3,4,5,6,7,8,9,10}$) \
a sitio $j$ ($jin{1,2,3,4,5,6,7}$)
end{tabular} \[4ex]
0, &text{En caso contrario}
end{cases}\
y_{j} &=
begin{cases}
1, &text{Si se construye planta en el sitio $j$ ($jin{1,2,3,4,5,6,7}$)} \[1ex]
0, &text{En caso contrario}
end{cases}
end{align*}

end{document}


enter image description here






share|improve this answer





























    2














    Here it is I simplified the text part typing using the cases* environment from mathtols (needless to load àmsmath`). I had to dplit the first case to make it fit the margins:



    documentclass{article}
    usepackage[utf8]{inputenc}
    usepackage[showframe]{geometry}
    usepackage{mathtools}

    begin{document}

    begin{align*}
    x_{{i}{j}} & =
    begin{cases*}
    text{1,} &quad Si se envía agua desde área $ i: ( i in {1,2,3,4,5,6,7,8,9,10})$ \
    & quad a sitio $ j: ( j in {1,2,3,4,5,6,7})$ \
    text{0,} &quad{En caso contrario}
    end{cases*}\[1.5ex]
    y_{j} & =
    begin{cases*}
    1, &quad Si se construye planta en el sitio $ j: ( j in {1,2,3,4,5,6,7})$ \
    0, &quad En caso contrario
    end{cases*}
    end{align*}

    end{document}


    enter image description here






    share|improve this answer





























      1














      If we go back to your original attempt, a few quick changes gives the result you wanted. This: removes the $$ around x_{ij} and y_j and moves the & you use for alignment to align the equals signs. Edit: I also compressed the set notation to shorten the long line and returned i and j to math mode, as you currently have them as subscripts in math mode. If you'd prefer them to be set upright you should change the subscripts as well.



      documentclass{article}
      usepackage{amsmath}
      begin{document}
      begin{align*}
      x_{ij} &=
      begin{cases}
      text{1,} &quadtext{Si se envía agua desde área $i$ ($i in {1,2,dots,10}$) a sitio $j$ ($j in {1,2,dots,7}$)} \
      text{0,} &quadtext{En caso contrario}
      end{cases}\
      y_{j} &=
      begin{cases}
      text{1,} &quadtext{ Si se construye planta en el sitio $j$ ($j in {1,2,dots,7}$)} \
      text{0,} &quadtext{En caso contrario}
      end{cases}
      end{align*}
      end{document}


      Output:
      New aligned output






      share|improve this answer























      • Since i and j are used in math mode on the LHS, it seems appropriate to use $i$ ($i in {1,dots,10}$) and $j$ ($j in {1,dots,7}$) on the RHS.
        – Werner
        Nov 30 at 17:17










      • Good point, as is the compression of the set notation. Edits made.
        – aoi
        Nov 30 at 17:30











      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%2f462589%2falign-two-piecewise-functions%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      3














      Beware! align already typesets its contents in math mode (but text reverts to text mode).



      You have to just align the equals signs with &=; for the long line, I suggest a tabular. Some vertical spacing will help, too.



      documentclass{article}
      usepackage{amsmath}
      begin{document}

      begin{align*}
      x_{ij} &=
      begin{cases}
      1, &begin{tabular}[t]{@{}l@{}}
      Si se envía agua desde área $i$ ($iin{1,2,3,4,5,6,7,8,9,10}$) \
      a sitio $j$ ($jin{1,2,3,4,5,6,7}$)
      end{tabular} \[4ex]
      0, &text{En caso contrario}
      end{cases}\
      y_{j} &=
      begin{cases}
      1, &text{Si se construye planta en el sitio $j$ ($jin{1,2,3,4,5,6,7}$)} \[1ex]
      0, &text{En caso contrario}
      end{cases}
      end{align*}

      end{document}


      enter image description here






      share|improve this answer


























        3














        Beware! align already typesets its contents in math mode (but text reverts to text mode).



        You have to just align the equals signs with &=; for the long line, I suggest a tabular. Some vertical spacing will help, too.



        documentclass{article}
        usepackage{amsmath}
        begin{document}

        begin{align*}
        x_{ij} &=
        begin{cases}
        1, &begin{tabular}[t]{@{}l@{}}
        Si se envía agua desde área $i$ ($iin{1,2,3,4,5,6,7,8,9,10}$) \
        a sitio $j$ ($jin{1,2,3,4,5,6,7}$)
        end{tabular} \[4ex]
        0, &text{En caso contrario}
        end{cases}\
        y_{j} &=
        begin{cases}
        1, &text{Si se construye planta en el sitio $j$ ($jin{1,2,3,4,5,6,7}$)} \[1ex]
        0, &text{En caso contrario}
        end{cases}
        end{align*}

        end{document}


        enter image description here






        share|improve this answer
























          3












          3








          3






          Beware! align already typesets its contents in math mode (but text reverts to text mode).



          You have to just align the equals signs with &=; for the long line, I suggest a tabular. Some vertical spacing will help, too.



          documentclass{article}
          usepackage{amsmath}
          begin{document}

          begin{align*}
          x_{ij} &=
          begin{cases}
          1, &begin{tabular}[t]{@{}l@{}}
          Si se envía agua desde área $i$ ($iin{1,2,3,4,5,6,7,8,9,10}$) \
          a sitio $j$ ($jin{1,2,3,4,5,6,7}$)
          end{tabular} \[4ex]
          0, &text{En caso contrario}
          end{cases}\
          y_{j} &=
          begin{cases}
          1, &text{Si se construye planta en el sitio $j$ ($jin{1,2,3,4,5,6,7}$)} \[1ex]
          0, &text{En caso contrario}
          end{cases}
          end{align*}

          end{document}


          enter image description here






          share|improve this answer












          Beware! align already typesets its contents in math mode (but text reverts to text mode).



          You have to just align the equals signs with &=; for the long line, I suggest a tabular. Some vertical spacing will help, too.



          documentclass{article}
          usepackage{amsmath}
          begin{document}

          begin{align*}
          x_{ij} &=
          begin{cases}
          1, &begin{tabular}[t]{@{}l@{}}
          Si se envía agua desde área $i$ ($iin{1,2,3,4,5,6,7,8,9,10}$) \
          a sitio $j$ ($jin{1,2,3,4,5,6,7}$)
          end{tabular} \[4ex]
          0, &text{En caso contrario}
          end{cases}\
          y_{j} &=
          begin{cases}
          1, &text{Si se construye planta en el sitio $j$ ($jin{1,2,3,4,5,6,7}$)} \[1ex]
          0, &text{En caso contrario}
          end{cases}
          end{align*}

          end{document}


          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 30 at 17:22









          egreg

          706k8618783160




          706k8618783160























              2














              Here it is I simplified the text part typing using the cases* environment from mathtols (needless to load àmsmath`). I had to dplit the first case to make it fit the margins:



              documentclass{article}
              usepackage[utf8]{inputenc}
              usepackage[showframe]{geometry}
              usepackage{mathtools}

              begin{document}

              begin{align*}
              x_{{i}{j}} & =
              begin{cases*}
              text{1,} &quad Si se envía agua desde área $ i: ( i in {1,2,3,4,5,6,7,8,9,10})$ \
              & quad a sitio $ j: ( j in {1,2,3,4,5,6,7})$ \
              text{0,} &quad{En caso contrario}
              end{cases*}\[1.5ex]
              y_{j} & =
              begin{cases*}
              1, &quad Si se construye planta en el sitio $ j: ( j in {1,2,3,4,5,6,7})$ \
              0, &quad En caso contrario
              end{cases*}
              end{align*}

              end{document}


              enter image description here






              share|improve this answer


























                2














                Here it is I simplified the text part typing using the cases* environment from mathtols (needless to load àmsmath`). I had to dplit the first case to make it fit the margins:



                documentclass{article}
                usepackage[utf8]{inputenc}
                usepackage[showframe]{geometry}
                usepackage{mathtools}

                begin{document}

                begin{align*}
                x_{{i}{j}} & =
                begin{cases*}
                text{1,} &quad Si se envía agua desde área $ i: ( i in {1,2,3,4,5,6,7,8,9,10})$ \
                & quad a sitio $ j: ( j in {1,2,3,4,5,6,7})$ \
                text{0,} &quad{En caso contrario}
                end{cases*}\[1.5ex]
                y_{j} & =
                begin{cases*}
                1, &quad Si se construye planta en el sitio $ j: ( j in {1,2,3,4,5,6,7})$ \
                0, &quad En caso contrario
                end{cases*}
                end{align*}

                end{document}


                enter image description here






                share|improve this answer
























                  2












                  2








                  2






                  Here it is I simplified the text part typing using the cases* environment from mathtols (needless to load àmsmath`). I had to dplit the first case to make it fit the margins:



                  documentclass{article}
                  usepackage[utf8]{inputenc}
                  usepackage[showframe]{geometry}
                  usepackage{mathtools}

                  begin{document}

                  begin{align*}
                  x_{{i}{j}} & =
                  begin{cases*}
                  text{1,} &quad Si se envía agua desde área $ i: ( i in {1,2,3,4,5,6,7,8,9,10})$ \
                  & quad a sitio $ j: ( j in {1,2,3,4,5,6,7})$ \
                  text{0,} &quad{En caso contrario}
                  end{cases*}\[1.5ex]
                  y_{j} & =
                  begin{cases*}
                  1, &quad Si se construye planta en el sitio $ j: ( j in {1,2,3,4,5,6,7})$ \
                  0, &quad En caso contrario
                  end{cases*}
                  end{align*}

                  end{document}


                  enter image description here






                  share|improve this answer












                  Here it is I simplified the text part typing using the cases* environment from mathtols (needless to load àmsmath`). I had to dplit the first case to make it fit the margins:



                  documentclass{article}
                  usepackage[utf8]{inputenc}
                  usepackage[showframe]{geometry}
                  usepackage{mathtools}

                  begin{document}

                  begin{align*}
                  x_{{i}{j}} & =
                  begin{cases*}
                  text{1,} &quad Si se envía agua desde área $ i: ( i in {1,2,3,4,5,6,7,8,9,10})$ \
                  & quad a sitio $ j: ( j in {1,2,3,4,5,6,7})$ \
                  text{0,} &quad{En caso contrario}
                  end{cases*}\[1.5ex]
                  y_{j} & =
                  begin{cases*}
                  1, &quad Si se construye planta en el sitio $ j: ( j in {1,2,3,4,5,6,7})$ \
                  0, &quad En caso contrario
                  end{cases*}
                  end{align*}

                  end{document}


                  enter image description here







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 30 at 17:21









                  Bernard

                  165k769193




                  165k769193























                      1














                      If we go back to your original attempt, a few quick changes gives the result you wanted. This: removes the $$ around x_{ij} and y_j and moves the & you use for alignment to align the equals signs. Edit: I also compressed the set notation to shorten the long line and returned i and j to math mode, as you currently have them as subscripts in math mode. If you'd prefer them to be set upright you should change the subscripts as well.



                      documentclass{article}
                      usepackage{amsmath}
                      begin{document}
                      begin{align*}
                      x_{ij} &=
                      begin{cases}
                      text{1,} &quadtext{Si se envía agua desde área $i$ ($i in {1,2,dots,10}$) a sitio $j$ ($j in {1,2,dots,7}$)} \
                      text{0,} &quadtext{En caso contrario}
                      end{cases}\
                      y_{j} &=
                      begin{cases}
                      text{1,} &quadtext{ Si se construye planta en el sitio $j$ ($j in {1,2,dots,7}$)} \
                      text{0,} &quadtext{En caso contrario}
                      end{cases}
                      end{align*}
                      end{document}


                      Output:
                      New aligned output






                      share|improve this answer























                      • Since i and j are used in math mode on the LHS, it seems appropriate to use $i$ ($i in {1,dots,10}$) and $j$ ($j in {1,dots,7}$) on the RHS.
                        – Werner
                        Nov 30 at 17:17










                      • Good point, as is the compression of the set notation. Edits made.
                        – aoi
                        Nov 30 at 17:30
















                      1














                      If we go back to your original attempt, a few quick changes gives the result you wanted. This: removes the $$ around x_{ij} and y_j and moves the & you use for alignment to align the equals signs. Edit: I also compressed the set notation to shorten the long line and returned i and j to math mode, as you currently have them as subscripts in math mode. If you'd prefer them to be set upright you should change the subscripts as well.



                      documentclass{article}
                      usepackage{amsmath}
                      begin{document}
                      begin{align*}
                      x_{ij} &=
                      begin{cases}
                      text{1,} &quadtext{Si se envía agua desde área $i$ ($i in {1,2,dots,10}$) a sitio $j$ ($j in {1,2,dots,7}$)} \
                      text{0,} &quadtext{En caso contrario}
                      end{cases}\
                      y_{j} &=
                      begin{cases}
                      text{1,} &quadtext{ Si se construye planta en el sitio $j$ ($j in {1,2,dots,7}$)} \
                      text{0,} &quadtext{En caso contrario}
                      end{cases}
                      end{align*}
                      end{document}


                      Output:
                      New aligned output






                      share|improve this answer























                      • Since i and j are used in math mode on the LHS, it seems appropriate to use $i$ ($i in {1,dots,10}$) and $j$ ($j in {1,dots,7}$) on the RHS.
                        – Werner
                        Nov 30 at 17:17










                      • Good point, as is the compression of the set notation. Edits made.
                        – aoi
                        Nov 30 at 17:30














                      1












                      1








                      1






                      If we go back to your original attempt, a few quick changes gives the result you wanted. This: removes the $$ around x_{ij} and y_j and moves the & you use for alignment to align the equals signs. Edit: I also compressed the set notation to shorten the long line and returned i and j to math mode, as you currently have them as subscripts in math mode. If you'd prefer them to be set upright you should change the subscripts as well.



                      documentclass{article}
                      usepackage{amsmath}
                      begin{document}
                      begin{align*}
                      x_{ij} &=
                      begin{cases}
                      text{1,} &quadtext{Si se envía agua desde área $i$ ($i in {1,2,dots,10}$) a sitio $j$ ($j in {1,2,dots,7}$)} \
                      text{0,} &quadtext{En caso contrario}
                      end{cases}\
                      y_{j} &=
                      begin{cases}
                      text{1,} &quadtext{ Si se construye planta en el sitio $j$ ($j in {1,2,dots,7}$)} \
                      text{0,} &quadtext{En caso contrario}
                      end{cases}
                      end{align*}
                      end{document}


                      Output:
                      New aligned output






                      share|improve this answer














                      If we go back to your original attempt, a few quick changes gives the result you wanted. This: removes the $$ around x_{ij} and y_j and moves the & you use for alignment to align the equals signs. Edit: I also compressed the set notation to shorten the long line and returned i and j to math mode, as you currently have them as subscripts in math mode. If you'd prefer them to be set upright you should change the subscripts as well.



                      documentclass{article}
                      usepackage{amsmath}
                      begin{document}
                      begin{align*}
                      x_{ij} &=
                      begin{cases}
                      text{1,} &quadtext{Si se envía agua desde área $i$ ($i in {1,2,dots,10}$) a sitio $j$ ($j in {1,2,dots,7}$)} \
                      text{0,} &quadtext{En caso contrario}
                      end{cases}\
                      y_{j} &=
                      begin{cases}
                      text{1,} &quadtext{ Si se construye planta en el sitio $j$ ($j in {1,2,dots,7}$)} \
                      text{0,} &quadtext{En caso contrario}
                      end{cases}
                      end{align*}
                      end{document}


                      Output:
                      New aligned output







                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited Nov 30 at 17:30

























                      answered Nov 30 at 17:12









                      aoi

                      83110




                      83110












                      • Since i and j are used in math mode on the LHS, it seems appropriate to use $i$ ($i in {1,dots,10}$) and $j$ ($j in {1,dots,7}$) on the RHS.
                        – Werner
                        Nov 30 at 17:17










                      • Good point, as is the compression of the set notation. Edits made.
                        – aoi
                        Nov 30 at 17:30


















                      • Since i and j are used in math mode on the LHS, it seems appropriate to use $i$ ($i in {1,dots,10}$) and $j$ ($j in {1,dots,7}$) on the RHS.
                        – Werner
                        Nov 30 at 17:17










                      • Good point, as is the compression of the set notation. Edits made.
                        – aoi
                        Nov 30 at 17:30
















                      Since i and j are used in math mode on the LHS, it seems appropriate to use $i$ ($i in {1,dots,10}$) and $j$ ($j in {1,dots,7}$) on the RHS.
                      – Werner
                      Nov 30 at 17:17




                      Since i and j are used in math mode on the LHS, it seems appropriate to use $i$ ($i in {1,dots,10}$) and $j$ ($j in {1,dots,7}$) on the RHS.
                      – Werner
                      Nov 30 at 17:17












                      Good point, as is the compression of the set notation. Edits made.
                      – aoi
                      Nov 30 at 17:30




                      Good point, as is the compression of the set notation. Edits made.
                      – aoi
                      Nov 30 at 17:30


















                      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%2f462589%2falign-two-piecewise-functions%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