How to draw a slanted rectangle divided by two using tikzpicture environment











up vote
3
down vote

favorite












I would like to draw the following rectangle divided by two using tikzpicture environment:



What I want



However, what I achieved so far is:



What I have done so far



MWE:



documentclass{article}

usepackage{tikz}
usetikzlibrary{shapes.multipart}
usetikzlibrary{decorations.text}

begin{document}

% Bend curves from https://tex.stackexchange.com/a/22316/152550
begin{tikzpicture}[delay rect/.style={rectangle split, rectangle split parts=2,draw,
minimum width=1.5cm,minimum height=1cm,
text width=2cm,align=center,inner ysep=2cm,draw,inner ysep=3mm,inner
xsep=3mm}] % From https://tex.stackexchange.com/a/452609/152550
node (start) at (0,0) {Start};
node (end) at (6,0) {End};
node[rotate=60,delay rect] (delay) at (3,0) {A1nodepart{two}text here};
defmyshift#1{scriptsizeraisebox{1ex}}
draw [->,postaction={decorate,decoration={text along path,text align=center,text={|myshift|hello}}}] (start) to [bend left=10] (delay);
draw [->,postaction={decorate,decoration={text along path,text align=center,text={|myshift|bye}}}] (delay) to [bend left=10] (end);
end{tikzpicture}

end{document}


Thanks!










share|improve this question




























    up vote
    3
    down vote

    favorite












    I would like to draw the following rectangle divided by two using tikzpicture environment:



    What I want



    However, what I achieved so far is:



    What I have done so far



    MWE:



    documentclass{article}

    usepackage{tikz}
    usetikzlibrary{shapes.multipart}
    usetikzlibrary{decorations.text}

    begin{document}

    % Bend curves from https://tex.stackexchange.com/a/22316/152550
    begin{tikzpicture}[delay rect/.style={rectangle split, rectangle split parts=2,draw,
    minimum width=1.5cm,minimum height=1cm,
    text width=2cm,align=center,inner ysep=2cm,draw,inner ysep=3mm,inner
    xsep=3mm}] % From https://tex.stackexchange.com/a/452609/152550
    node (start) at (0,0) {Start};
    node (end) at (6,0) {End};
    node[rotate=60,delay rect] (delay) at (3,0) {A1nodepart{two}text here};
    defmyshift#1{scriptsizeraisebox{1ex}}
    draw [->,postaction={decorate,decoration={text along path,text align=center,text={|myshift|hello}}}] (start) to [bend left=10] (delay);
    draw [->,postaction={decorate,decoration={text along path,text align=center,text={|myshift|bye}}}] (delay) to [bend left=10] (end);
    end{tikzpicture}

    end{document}


    Thanks!










    share|improve this question


























      up vote
      3
      down vote

      favorite









      up vote
      3
      down vote

      favorite











      I would like to draw the following rectangle divided by two using tikzpicture environment:



      What I want



      However, what I achieved so far is:



      What I have done so far



      MWE:



      documentclass{article}

      usepackage{tikz}
      usetikzlibrary{shapes.multipart}
      usetikzlibrary{decorations.text}

      begin{document}

      % Bend curves from https://tex.stackexchange.com/a/22316/152550
      begin{tikzpicture}[delay rect/.style={rectangle split, rectangle split parts=2,draw,
      minimum width=1.5cm,minimum height=1cm,
      text width=2cm,align=center,inner ysep=2cm,draw,inner ysep=3mm,inner
      xsep=3mm}] % From https://tex.stackexchange.com/a/452609/152550
      node (start) at (0,0) {Start};
      node (end) at (6,0) {End};
      node[rotate=60,delay rect] (delay) at (3,0) {A1nodepart{two}text here};
      defmyshift#1{scriptsizeraisebox{1ex}}
      draw [->,postaction={decorate,decoration={text along path,text align=center,text={|myshift|hello}}}] (start) to [bend left=10] (delay);
      draw [->,postaction={decorate,decoration={text along path,text align=center,text={|myshift|bye}}}] (delay) to [bend left=10] (end);
      end{tikzpicture}

      end{document}


      Thanks!










      share|improve this question















      I would like to draw the following rectangle divided by two using tikzpicture environment:



      What I want



      However, what I achieved so far is:



      What I have done so far



      MWE:



      documentclass{article}

      usepackage{tikz}
      usetikzlibrary{shapes.multipart}
      usetikzlibrary{decorations.text}

      begin{document}

      % Bend curves from https://tex.stackexchange.com/a/22316/152550
      begin{tikzpicture}[delay rect/.style={rectangle split, rectangle split parts=2,draw,
      minimum width=1.5cm,minimum height=1cm,
      text width=2cm,align=center,inner ysep=2cm,draw,inner ysep=3mm,inner
      xsep=3mm}] % From https://tex.stackexchange.com/a/452609/152550
      node (start) at (0,0) {Start};
      node (end) at (6,0) {End};
      node[rotate=60,delay rect] (delay) at (3,0) {A1nodepart{two}text here};
      defmyshift#1{scriptsizeraisebox{1ex}}
      draw [->,postaction={decorate,decoration={text along path,text align=center,text={|myshift|hello}}}] (start) to [bend left=10] (delay);
      draw [->,postaction={decorate,decoration={text along path,text align=center,text={|myshift|bye}}}] (delay) to [bend left=10] (end);
      end{tikzpicture}

      end{document}


      Thanks!







      tikz-pgf






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 3 hours ago

























      asked 4 hours ago









      manooooh

      8561313




      8561313






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          3
          down vote



          accepted










          to your style definition for delay rec you need to add the option rectangle split horizontal:



          documentclass{article}
          usepackage{tikz}
          usetikzlibrary{shapes.multipart}
          usetikzlibrary{decorations.text}

          begin{document}
          % Bend curves from https://tex.stackexchange.com/a/22316/152550
          begin{tikzpicture}[
          delay rect/.style = {rectangle split, % now all double and not used options are removed
          rectangle split horizontal, % <---
          rectangle split parts=2, draw,
          minimum height=1cm,
          align=center,
          inner ysep=3mm,inner xsep=3mm}
          ] % From https://tex.stackexchange.com/a/452609/152550
          node (start) at (0,0) {Start};
          node (end) at (6,0) {End};
          node[delay rect,rotate=60] (delay) at (3,0) {A1nodepart{two}text here};
          defmyshift#1{scriptsizeraisebox{1ex}}
          draw [->,postaction={decorate,decoration={text along path,text align=center,text={|myshift|hello}}}] (start) to [bend left=10] (delay);
          draw [->,postaction={decorate,decoration={text along path,text align=center,text={|myshift|bye}}}] (delay) to [bend left=10] (end);
          end{tikzpicture}
          end{document}


          enter image description here



          edit:



          regarding sub questions in your comment below:



          1) reduce the font size of the rectangle (scriptsize)?



          in node style definition just define font size with `font=scriptsize`


          2) reduce a little more the height of the rectangle?



          in height of a rectangles are defined by `minimum height = <desired height>`. you have selected 1cmm, if this is to much, reduce for example to 7mm


          3) reduce a little more the width of each part of the rectangle so that there is not so much space between the text and the edges



          space between node border lines and nodes content (text) is controlled by `inner sep` (equal for all direction) or `inner ysep` in vertical direction) and `inner xsep` for horizontal. default value is `3pt`. if this is to much to you, than to node's style option add for example `inner sep=2pt`.





          share|improve this answer























          • Nice, thank you! Do you know how can we 1) reduce the font size of the rectangle (scriptsize)?; 2) reduce a little more the height of the rectangle?; 3) reduce a little more the width of each part of the rectangle so that there is not so much space between the text and the edges? (the latter is not necessary)
            – manooooh
            3 hours ago








          • 1




            @manooooh, i belive that is now time to read tikz & pgf manual, at least part III :-). i will add some instruction to answer asap (however, this is not part of your question).
            – Zarko
            3 hours ago










          • Forget that.... That's perfect, I can solve the font size by using {scriptsize A1nodepart{two}scriptsize text here} and adding minimum height=.1cm.
            – manooooh
            3 hours ago








          • 1




            @manooooh, don't doing this. you will destroy baseline distance of text. use approach described in explanation added to answer.
            – Zarko
            3 hours ago











          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%2f463758%2fhow-to-draw-a-slanted-rectangle-divided-by-two-using-tikzpicture-environment%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








          up vote
          3
          down vote



          accepted










          to your style definition for delay rec you need to add the option rectangle split horizontal:



          documentclass{article}
          usepackage{tikz}
          usetikzlibrary{shapes.multipart}
          usetikzlibrary{decorations.text}

          begin{document}
          % Bend curves from https://tex.stackexchange.com/a/22316/152550
          begin{tikzpicture}[
          delay rect/.style = {rectangle split, % now all double and not used options are removed
          rectangle split horizontal, % <---
          rectangle split parts=2, draw,
          minimum height=1cm,
          align=center,
          inner ysep=3mm,inner xsep=3mm}
          ] % From https://tex.stackexchange.com/a/452609/152550
          node (start) at (0,0) {Start};
          node (end) at (6,0) {End};
          node[delay rect,rotate=60] (delay) at (3,0) {A1nodepart{two}text here};
          defmyshift#1{scriptsizeraisebox{1ex}}
          draw [->,postaction={decorate,decoration={text along path,text align=center,text={|myshift|hello}}}] (start) to [bend left=10] (delay);
          draw [->,postaction={decorate,decoration={text along path,text align=center,text={|myshift|bye}}}] (delay) to [bend left=10] (end);
          end{tikzpicture}
          end{document}


          enter image description here



          edit:



          regarding sub questions in your comment below:



          1) reduce the font size of the rectangle (scriptsize)?



          in node style definition just define font size with `font=scriptsize`


          2) reduce a little more the height of the rectangle?



          in height of a rectangles are defined by `minimum height = <desired height>`. you have selected 1cmm, if this is to much, reduce for example to 7mm


          3) reduce a little more the width of each part of the rectangle so that there is not so much space between the text and the edges



          space between node border lines and nodes content (text) is controlled by `inner sep` (equal for all direction) or `inner ysep` in vertical direction) and `inner xsep` for horizontal. default value is `3pt`. if this is to much to you, than to node's style option add for example `inner sep=2pt`.





          share|improve this answer























          • Nice, thank you! Do you know how can we 1) reduce the font size of the rectangle (scriptsize)?; 2) reduce a little more the height of the rectangle?; 3) reduce a little more the width of each part of the rectangle so that there is not so much space between the text and the edges? (the latter is not necessary)
            – manooooh
            3 hours ago








          • 1




            @manooooh, i belive that is now time to read tikz & pgf manual, at least part III :-). i will add some instruction to answer asap (however, this is not part of your question).
            – Zarko
            3 hours ago










          • Forget that.... That's perfect, I can solve the font size by using {scriptsize A1nodepart{two}scriptsize text here} and adding minimum height=.1cm.
            – manooooh
            3 hours ago








          • 1




            @manooooh, don't doing this. you will destroy baseline distance of text. use approach described in explanation added to answer.
            – Zarko
            3 hours ago















          up vote
          3
          down vote



          accepted










          to your style definition for delay rec you need to add the option rectangle split horizontal:



          documentclass{article}
          usepackage{tikz}
          usetikzlibrary{shapes.multipart}
          usetikzlibrary{decorations.text}

          begin{document}
          % Bend curves from https://tex.stackexchange.com/a/22316/152550
          begin{tikzpicture}[
          delay rect/.style = {rectangle split, % now all double and not used options are removed
          rectangle split horizontal, % <---
          rectangle split parts=2, draw,
          minimum height=1cm,
          align=center,
          inner ysep=3mm,inner xsep=3mm}
          ] % From https://tex.stackexchange.com/a/452609/152550
          node (start) at (0,0) {Start};
          node (end) at (6,0) {End};
          node[delay rect,rotate=60] (delay) at (3,0) {A1nodepart{two}text here};
          defmyshift#1{scriptsizeraisebox{1ex}}
          draw [->,postaction={decorate,decoration={text along path,text align=center,text={|myshift|hello}}}] (start) to [bend left=10] (delay);
          draw [->,postaction={decorate,decoration={text along path,text align=center,text={|myshift|bye}}}] (delay) to [bend left=10] (end);
          end{tikzpicture}
          end{document}


          enter image description here



          edit:



          regarding sub questions in your comment below:



          1) reduce the font size of the rectangle (scriptsize)?



          in node style definition just define font size with `font=scriptsize`


          2) reduce a little more the height of the rectangle?



          in height of a rectangles are defined by `minimum height = <desired height>`. you have selected 1cmm, if this is to much, reduce for example to 7mm


          3) reduce a little more the width of each part of the rectangle so that there is not so much space between the text and the edges



          space between node border lines and nodes content (text) is controlled by `inner sep` (equal for all direction) or `inner ysep` in vertical direction) and `inner xsep` for horizontal. default value is `3pt`. if this is to much to you, than to node's style option add for example `inner sep=2pt`.





          share|improve this answer























          • Nice, thank you! Do you know how can we 1) reduce the font size of the rectangle (scriptsize)?; 2) reduce a little more the height of the rectangle?; 3) reduce a little more the width of each part of the rectangle so that there is not so much space between the text and the edges? (the latter is not necessary)
            – manooooh
            3 hours ago








          • 1




            @manooooh, i belive that is now time to read tikz & pgf manual, at least part III :-). i will add some instruction to answer asap (however, this is not part of your question).
            – Zarko
            3 hours ago










          • Forget that.... That's perfect, I can solve the font size by using {scriptsize A1nodepart{two}scriptsize text here} and adding minimum height=.1cm.
            – manooooh
            3 hours ago








          • 1




            @manooooh, don't doing this. you will destroy baseline distance of text. use approach described in explanation added to answer.
            – Zarko
            3 hours ago













          up vote
          3
          down vote



          accepted







          up vote
          3
          down vote



          accepted






          to your style definition for delay rec you need to add the option rectangle split horizontal:



          documentclass{article}
          usepackage{tikz}
          usetikzlibrary{shapes.multipart}
          usetikzlibrary{decorations.text}

          begin{document}
          % Bend curves from https://tex.stackexchange.com/a/22316/152550
          begin{tikzpicture}[
          delay rect/.style = {rectangle split, % now all double and not used options are removed
          rectangle split horizontal, % <---
          rectangle split parts=2, draw,
          minimum height=1cm,
          align=center,
          inner ysep=3mm,inner xsep=3mm}
          ] % From https://tex.stackexchange.com/a/452609/152550
          node (start) at (0,0) {Start};
          node (end) at (6,0) {End};
          node[delay rect,rotate=60] (delay) at (3,0) {A1nodepart{two}text here};
          defmyshift#1{scriptsizeraisebox{1ex}}
          draw [->,postaction={decorate,decoration={text along path,text align=center,text={|myshift|hello}}}] (start) to [bend left=10] (delay);
          draw [->,postaction={decorate,decoration={text along path,text align=center,text={|myshift|bye}}}] (delay) to [bend left=10] (end);
          end{tikzpicture}
          end{document}


          enter image description here



          edit:



          regarding sub questions in your comment below:



          1) reduce the font size of the rectangle (scriptsize)?



          in node style definition just define font size with `font=scriptsize`


          2) reduce a little more the height of the rectangle?



          in height of a rectangles are defined by `minimum height = <desired height>`. you have selected 1cmm, if this is to much, reduce for example to 7mm


          3) reduce a little more the width of each part of the rectangle so that there is not so much space between the text and the edges



          space between node border lines and nodes content (text) is controlled by `inner sep` (equal for all direction) or `inner ysep` in vertical direction) and `inner xsep` for horizontal. default value is `3pt`. if this is to much to you, than to node's style option add for example `inner sep=2pt`.





          share|improve this answer














          to your style definition for delay rec you need to add the option rectangle split horizontal:



          documentclass{article}
          usepackage{tikz}
          usetikzlibrary{shapes.multipart}
          usetikzlibrary{decorations.text}

          begin{document}
          % Bend curves from https://tex.stackexchange.com/a/22316/152550
          begin{tikzpicture}[
          delay rect/.style = {rectangle split, % now all double and not used options are removed
          rectangle split horizontal, % <---
          rectangle split parts=2, draw,
          minimum height=1cm,
          align=center,
          inner ysep=3mm,inner xsep=3mm}
          ] % From https://tex.stackexchange.com/a/452609/152550
          node (start) at (0,0) {Start};
          node (end) at (6,0) {End};
          node[delay rect,rotate=60] (delay) at (3,0) {A1nodepart{two}text here};
          defmyshift#1{scriptsizeraisebox{1ex}}
          draw [->,postaction={decorate,decoration={text along path,text align=center,text={|myshift|hello}}}] (start) to [bend left=10] (delay);
          draw [->,postaction={decorate,decoration={text along path,text align=center,text={|myshift|bye}}}] (delay) to [bend left=10] (end);
          end{tikzpicture}
          end{document}


          enter image description here



          edit:



          regarding sub questions in your comment below:



          1) reduce the font size of the rectangle (scriptsize)?



          in node style definition just define font size with `font=scriptsize`


          2) reduce a little more the height of the rectangle?



          in height of a rectangles are defined by `minimum height = <desired height>`. you have selected 1cmm, if this is to much, reduce for example to 7mm


          3) reduce a little more the width of each part of the rectangle so that there is not so much space between the text and the edges



          space between node border lines and nodes content (text) is controlled by `inner sep` (equal for all direction) or `inner ysep` in vertical direction) and `inner xsep` for horizontal. default value is `3pt`. if this is to much to you, than to node's style option add for example `inner sep=2pt`.






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 3 hours ago

























          answered 3 hours ago









          Zarko

          118k865155




          118k865155












          • Nice, thank you! Do you know how can we 1) reduce the font size of the rectangle (scriptsize)?; 2) reduce a little more the height of the rectangle?; 3) reduce a little more the width of each part of the rectangle so that there is not so much space between the text and the edges? (the latter is not necessary)
            – manooooh
            3 hours ago








          • 1




            @manooooh, i belive that is now time to read tikz & pgf manual, at least part III :-). i will add some instruction to answer asap (however, this is not part of your question).
            – Zarko
            3 hours ago










          • Forget that.... That's perfect, I can solve the font size by using {scriptsize A1nodepart{two}scriptsize text here} and adding minimum height=.1cm.
            – manooooh
            3 hours ago








          • 1




            @manooooh, don't doing this. you will destroy baseline distance of text. use approach described in explanation added to answer.
            – Zarko
            3 hours ago


















          • Nice, thank you! Do you know how can we 1) reduce the font size of the rectangle (scriptsize)?; 2) reduce a little more the height of the rectangle?; 3) reduce a little more the width of each part of the rectangle so that there is not so much space between the text and the edges? (the latter is not necessary)
            – manooooh
            3 hours ago








          • 1




            @manooooh, i belive that is now time to read tikz & pgf manual, at least part III :-). i will add some instruction to answer asap (however, this is not part of your question).
            – Zarko
            3 hours ago










          • Forget that.... That's perfect, I can solve the font size by using {scriptsize A1nodepart{two}scriptsize text here} and adding minimum height=.1cm.
            – manooooh
            3 hours ago








          • 1




            @manooooh, don't doing this. you will destroy baseline distance of text. use approach described in explanation added to answer.
            – Zarko
            3 hours ago
















          Nice, thank you! Do you know how can we 1) reduce the font size of the rectangle (scriptsize)?; 2) reduce a little more the height of the rectangle?; 3) reduce a little more the width of each part of the rectangle so that there is not so much space between the text and the edges? (the latter is not necessary)
          – manooooh
          3 hours ago






          Nice, thank you! Do you know how can we 1) reduce the font size of the rectangle (scriptsize)?; 2) reduce a little more the height of the rectangle?; 3) reduce a little more the width of each part of the rectangle so that there is not so much space between the text and the edges? (the latter is not necessary)
          – manooooh
          3 hours ago






          1




          1




          @manooooh, i belive that is now time to read tikz & pgf manual, at least part III :-). i will add some instruction to answer asap (however, this is not part of your question).
          – Zarko
          3 hours ago




          @manooooh, i belive that is now time to read tikz & pgf manual, at least part III :-). i will add some instruction to answer asap (however, this is not part of your question).
          – Zarko
          3 hours ago












          Forget that.... That's perfect, I can solve the font size by using {scriptsize A1nodepart{two}scriptsize text here} and adding minimum height=.1cm.
          – manooooh
          3 hours ago






          Forget that.... That's perfect, I can solve the font size by using {scriptsize A1nodepart{two}scriptsize text here} and adding minimum height=.1cm.
          – manooooh
          3 hours ago






          1




          1




          @manooooh, don't doing this. you will destroy baseline distance of text. use approach described in explanation added to answer.
          – Zarko
          3 hours ago




          @manooooh, don't doing this. you will destroy baseline distance of text. use approach described in explanation added to answer.
          – Zarko
          3 hours ago


















          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%2f463758%2fhow-to-draw-a-slanted-rectangle-divided-by-two-using-tikzpicture-environment%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

          flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

          Mangá

          Eduardo VII do Reino Unido