`fit` does not respect relative positioning

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
4
down vote

favorite












documentclassarticle
usepackagetikz
usetikzlibrarypositioning,fit
begindocument
begintikzpicture
node[name=a] longa;
node[name=b, below=of a] longb;
node[name=c, below=of b] longc;
node[name=talld, right=of c, fit=(a)(c), draw] talld;
endtikzpicture
enddocument


Now talld overlaps the leftmost text. If I remove the fit=(a)(c) it shifts talld appropriately. How do I make fit respect relative positioning?







share|improve this question























    up vote
    4
    down vote

    favorite












    documentclassarticle
    usepackagetikz
    usetikzlibrarypositioning,fit
    begindocument
    begintikzpicture
    node[name=a] longa;
    node[name=b, below=of a] longb;
    node[name=c, below=of b] longc;
    node[name=talld, right=of c, fit=(a)(c), draw] talld;
    endtikzpicture
    enddocument


    Now talld overlaps the leftmost text. If I remove the fit=(a)(c) it shifts talld appropriately. How do I make fit respect relative positioning?







    share|improve this question





















      up vote
      4
      down vote

      favorite









      up vote
      4
      down vote

      favorite











      documentclassarticle
      usepackagetikz
      usetikzlibrarypositioning,fit
      begindocument
      begintikzpicture
      node[name=a] longa;
      node[name=b, below=of a] longb;
      node[name=c, below=of b] longc;
      node[name=talld, right=of c, fit=(a)(c), draw] talld;
      endtikzpicture
      enddocument


      Now talld overlaps the leftmost text. If I remove the fit=(a)(c) it shifts talld appropriately. How do I make fit respect relative positioning?







      share|improve this question











      documentclassarticle
      usepackagetikz
      usetikzlibrarypositioning,fit
      begindocument
      begintikzpicture
      node[name=a] longa;
      node[name=b, below=of a] longb;
      node[name=c, below=of b] longc;
      node[name=talld, right=of c, fit=(a)(c), draw] talld;
      endtikzpicture
      enddocument


      Now talld overlaps the leftmost text. If I remove the fit=(a)(c) it shifts talld appropriately. How do I make fit respect relative positioning?









      share|improve this question










      share|improve this question




      share|improve this question









      asked Aug 6 at 8:30









      enthdegree

      307212




      307212




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          7
          down vote



          accepted










          Edit: Added manual text alignment adjustment



          You say that the code that correctly places the nodes produces this:



          premier-code



          But you want the right node to be as big as the other three combined.



          Since tikz processes instructions in the order they are read, simply reverse the instructions you have written by first fiting the node around the other three:



          write fit=(a)(c), right=of c, instead of right=of c, fit=(a)(c)



          As longb is in the center, just place it on this right:
          fit=(a)(c), right=of b



          documentclassarticle
          usepackagetikz
          usetikzlibrarypositioning,fit
          begindocument
          begintikzpicture
          node[name=a,draw] longa;
          node[name=b,draw, below=of a] longb;
          node[name=c,draw, below=of b] longc;
          node[name=talld, fit=(a)(c), right=of b,draw,text height=55pt,inner sep=0pt,outer sep=0pt] talgd;
          endtikzpicture
          enddocument


          corrige



          I've traced every node to make sure everything is done the way you want it.






          share|improve this answer























          • Thank you, this works and makes sense except now talld's text isn't centered in its rectangle!
            – enthdegree
            Aug 6 at 18:21










          • Indeed, I had not paid attention to it. You can manually adjust the text. i edited the solution.
            – AndréC
            Aug 6 at 20:21










          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: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          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%2f444801%2ffit-does-not-respect-relative-positioning%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          7
          down vote



          accepted










          Edit: Added manual text alignment adjustment



          You say that the code that correctly places the nodes produces this:



          premier-code



          But you want the right node to be as big as the other three combined.



          Since tikz processes instructions in the order they are read, simply reverse the instructions you have written by first fiting the node around the other three:



          write fit=(a)(c), right=of c, instead of right=of c, fit=(a)(c)



          As longb is in the center, just place it on this right:
          fit=(a)(c), right=of b



          documentclassarticle
          usepackagetikz
          usetikzlibrarypositioning,fit
          begindocument
          begintikzpicture
          node[name=a,draw] longa;
          node[name=b,draw, below=of a] longb;
          node[name=c,draw, below=of b] longc;
          node[name=talld, fit=(a)(c), right=of b,draw,text height=55pt,inner sep=0pt,outer sep=0pt] talgd;
          endtikzpicture
          enddocument


          corrige



          I've traced every node to make sure everything is done the way you want it.






          share|improve this answer























          • Thank you, this works and makes sense except now talld's text isn't centered in its rectangle!
            – enthdegree
            Aug 6 at 18:21










          • Indeed, I had not paid attention to it. You can manually adjust the text. i edited the solution.
            – AndréC
            Aug 6 at 20:21














          up vote
          7
          down vote



          accepted










          Edit: Added manual text alignment adjustment



          You say that the code that correctly places the nodes produces this:



          premier-code



          But you want the right node to be as big as the other three combined.



          Since tikz processes instructions in the order they are read, simply reverse the instructions you have written by first fiting the node around the other three:



          write fit=(a)(c), right=of c, instead of right=of c, fit=(a)(c)



          As longb is in the center, just place it on this right:
          fit=(a)(c), right=of b



          documentclassarticle
          usepackagetikz
          usetikzlibrarypositioning,fit
          begindocument
          begintikzpicture
          node[name=a,draw] longa;
          node[name=b,draw, below=of a] longb;
          node[name=c,draw, below=of b] longc;
          node[name=talld, fit=(a)(c), right=of b,draw,text height=55pt,inner sep=0pt,outer sep=0pt] talgd;
          endtikzpicture
          enddocument


          corrige



          I've traced every node to make sure everything is done the way you want it.






          share|improve this answer























          • Thank you, this works and makes sense except now talld's text isn't centered in its rectangle!
            – enthdegree
            Aug 6 at 18:21










          • Indeed, I had not paid attention to it. You can manually adjust the text. i edited the solution.
            – AndréC
            Aug 6 at 20:21












          up vote
          7
          down vote



          accepted







          up vote
          7
          down vote



          accepted






          Edit: Added manual text alignment adjustment



          You say that the code that correctly places the nodes produces this:



          premier-code



          But you want the right node to be as big as the other three combined.



          Since tikz processes instructions in the order they are read, simply reverse the instructions you have written by first fiting the node around the other three:



          write fit=(a)(c), right=of c, instead of right=of c, fit=(a)(c)



          As longb is in the center, just place it on this right:
          fit=(a)(c), right=of b



          documentclassarticle
          usepackagetikz
          usetikzlibrarypositioning,fit
          begindocument
          begintikzpicture
          node[name=a,draw] longa;
          node[name=b,draw, below=of a] longb;
          node[name=c,draw, below=of b] longc;
          node[name=talld, fit=(a)(c), right=of b,draw,text height=55pt,inner sep=0pt,outer sep=0pt] talgd;
          endtikzpicture
          enddocument


          corrige



          I've traced every node to make sure everything is done the way you want it.






          share|improve this answer















          Edit: Added manual text alignment adjustment



          You say that the code that correctly places the nodes produces this:



          premier-code



          But you want the right node to be as big as the other three combined.



          Since tikz processes instructions in the order they are read, simply reverse the instructions you have written by first fiting the node around the other three:



          write fit=(a)(c), right=of c, instead of right=of c, fit=(a)(c)



          As longb is in the center, just place it on this right:
          fit=(a)(c), right=of b



          documentclassarticle
          usepackagetikz
          usetikzlibrarypositioning,fit
          begindocument
          begintikzpicture
          node[name=a,draw] longa;
          node[name=b,draw, below=of a] longb;
          node[name=c,draw, below=of b] longc;
          node[name=talld, fit=(a)(c), right=of b,draw,text height=55pt,inner sep=0pt,outer sep=0pt] talgd;
          endtikzpicture
          enddocument


          corrige



          I've traced every node to make sure everything is done the way you want it.







          share|improve this answer















          share|improve this answer



          share|improve this answer








          edited Aug 6 at 20:19


























          answered Aug 6 at 9:30









          AndréC

          2,233726




          2,233726











          • Thank you, this works and makes sense except now talld's text isn't centered in its rectangle!
            – enthdegree
            Aug 6 at 18:21










          • Indeed, I had not paid attention to it. You can manually adjust the text. i edited the solution.
            – AndréC
            Aug 6 at 20:21
















          • Thank you, this works and makes sense except now talld's text isn't centered in its rectangle!
            – enthdegree
            Aug 6 at 18:21










          • Indeed, I had not paid attention to it. You can manually adjust the text. i edited the solution.
            – AndréC
            Aug 6 at 20:21















          Thank you, this works and makes sense except now talld's text isn't centered in its rectangle!
          – enthdegree
          Aug 6 at 18:21




          Thank you, this works and makes sense except now talld's text isn't centered in its rectangle!
          – enthdegree
          Aug 6 at 18:21












          Indeed, I had not paid attention to it. You can manually adjust the text. i edited the solution.
          – AndréC
          Aug 6 at 20:21




          Indeed, I had not paid attention to it. You can manually adjust the text. i edited the solution.
          – AndréC
          Aug 6 at 20:21












           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f444801%2ffit-does-not-respect-relative-positioning%23new-answer', 'question_page');

          );

          Post as a guest













































































          Comments

          Popular posts from this blog

          What does second last employer means? [closed]

          List of Gilmore Girls characters

          Confectionery