tikz block diagonally divideda divided rectangle in tikzUML StatediagramHow to define the default vertical...

Unsolved Problems due to Lack of Computational Power

Why don't politicians push for fossil fuel reduction by pointing out their scarcity?

Can 'in-' mean both 'in' and 'no'?

Why is the name Bergson pronounced like Berksonne?

Metal that glows when near pieces of itself

Starships without computers?

Can I check a small array of bools in one go?

Chess software to analyze games

Killer Neighbors

Vegetarian dishes on Russian trains (European part)

The Lucky House

Show two plots together: a two dimensional curve tangent to the maxima of a three dimensional plot

Is there such a thing as too inconvenient?

iPad or iPhone doesn't charge until unlocked?

Why Won't my Serial Read value stay the same

Control GPIO pins from C

Saying something to a foreign coworker who uses "you people"

How to shade a polygon with curved lines in tikz?

Hiker's Cabin Mystery | Pt. XV

On the relation between the asymptotics of a Dirichlet series' coefficients and the series' analytic continuability

Why do aircraft leave the cruising altitude long before landing just to circle?

Are there reliable, formulaic ways to form chords on the guitar?

Is recepted a word?

How do you call it when two celestial bodies come as close to each other as they will in their current orbits?



tikz block diagonally divided


a divided rectangle in tikzUML StatediagramHow to define the default vertical distance between nodes?Numerical conditional within tikz keys?TikZ/ERD: node (=Entity) label on the insideHow to draw integrator block with Tikz?Tikz: Shading a rectangle diagonally,Line up nested tikz enviroments or how to get rid of them






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







7















I'm trying to draw the following diagram:



enter image description here



What I could do so far:



enter image description here



The code:



documentclass[tikz,border=20pt]{standalone}

usetikzlibrary{shapes,arrows}
usetikzlibrary{decorations.pathreplacing}
usetikzlibrary{babel}
usetikzlibrary{calc,arrows.meta,patterns,backgrounds}
usetikzlibrary{shapes.multipart}

tikzstyle{block} = [draw, rectangle, rounded corners, minimum size=1cm, text centered]
tikzstyle{transform} = [draw, block, path picture={draw (path picture bounding box.south west)--(path picture bounding box.north east);}]
tikzstyle{state} = [draw, rectangle split,rectangle split parts=2,rounded corners, minimum size=1cm, text centered]

begin{document}

begin{tikzpicture}
node at (0.0,0.0) [transform](inverter){$qd0$};
node at (2.0,0.0) [state] {$qd0$ nodepart{two} $abc$};
end{tikzpicture}

end{document}


I need some help :)










share|improve this question

































    7















    I'm trying to draw the following diagram:



    enter image description here



    What I could do so far:



    enter image description here



    The code:



    documentclass[tikz,border=20pt]{standalone}

    usetikzlibrary{shapes,arrows}
    usetikzlibrary{decorations.pathreplacing}
    usetikzlibrary{babel}
    usetikzlibrary{calc,arrows.meta,patterns,backgrounds}
    usetikzlibrary{shapes.multipart}

    tikzstyle{block} = [draw, rectangle, rounded corners, minimum size=1cm, text centered]
    tikzstyle{transform} = [draw, block, path picture={draw (path picture bounding box.south west)--(path picture bounding box.north east);}]
    tikzstyle{state} = [draw, rectangle split,rectangle split parts=2,rounded corners, minimum size=1cm, text centered]

    begin{document}

    begin{tikzpicture}
    node at (0.0,0.0) [transform](inverter){$qd0$};
    node at (2.0,0.0) [state] {$qd0$ nodepart{two} $abc$};
    end{tikzpicture}

    end{document}


    I need some help :)










    share|improve this question





























      7












      7








      7


      1






      I'm trying to draw the following diagram:



      enter image description here



      What I could do so far:



      enter image description here



      The code:



      documentclass[tikz,border=20pt]{standalone}

      usetikzlibrary{shapes,arrows}
      usetikzlibrary{decorations.pathreplacing}
      usetikzlibrary{babel}
      usetikzlibrary{calc,arrows.meta,patterns,backgrounds}
      usetikzlibrary{shapes.multipart}

      tikzstyle{block} = [draw, rectangle, rounded corners, minimum size=1cm, text centered]
      tikzstyle{transform} = [draw, block, path picture={draw (path picture bounding box.south west)--(path picture bounding box.north east);}]
      tikzstyle{state} = [draw, rectangle split,rectangle split parts=2,rounded corners, minimum size=1cm, text centered]

      begin{document}

      begin{tikzpicture}
      node at (0.0,0.0) [transform](inverter){$qd0$};
      node at (2.0,0.0) [state] {$qd0$ nodepart{two} $abc$};
      end{tikzpicture}

      end{document}


      I need some help :)










      share|improve this question
















      I'm trying to draw the following diagram:



      enter image description here



      What I could do so far:



      enter image description here



      The code:



      documentclass[tikz,border=20pt]{standalone}

      usetikzlibrary{shapes,arrows}
      usetikzlibrary{decorations.pathreplacing}
      usetikzlibrary{babel}
      usetikzlibrary{calc,arrows.meta,patterns,backgrounds}
      usetikzlibrary{shapes.multipart}

      tikzstyle{block} = [draw, rectangle, rounded corners, minimum size=1cm, text centered]
      tikzstyle{transform} = [draw, block, path picture={draw (path picture bounding box.south west)--(path picture bounding box.north east);}]
      tikzstyle{state} = [draw, rectangle split,rectangle split parts=2,rounded corners, minimum size=1cm, text centered]

      begin{document}

      begin{tikzpicture}
      node at (0.0,0.0) [transform](inverter){$qd0$};
      node at (2.0,0.0) [state] {$qd0$ nodepart{two} $abc$};
      end{tikzpicture}

      end{document}


      I need some help :)







      tikz-pgf tikz-styles






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 2 days ago









      Bernard

      188k7 gold badges85 silver badges223 bronze badges




      188k7 gold badges85 silver badges223 bronze badges










      asked Aug 16 at 0:05









      Clecio JungClecio Jung

      1025 bronze badges




      1025 bronze badges

























          2 Answers
          2






          active

          oldest

          votes


















          13














          The computations are basic,



          enter image description here



          and if you consider using a pic instead of a full-fledged the node shape, the implementation is straightforward, too. The free parameter is taken to be the height of the full shape. The width is then computed in such a way that the diagonal does not cut any of the nodes (where the "safety distance" is given by the inner sep).



          documentclass{article}
          usepackage{tikz}
          tikzset{pics/dbox/.style 2 args={code={%
          pgfmathsetmacro{w}{max((width("#1")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#1")),%
          (width("#2")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#2")))*pgfkeysvalueof{/tikz/dbox/height}}
          path[pic actions] (-w*1pt/2,-pgfkeysvalueof{/tikz/dbox/height}/2)
          node[above right] {#2}
          rectangle
          (w*1pt/2,pgfkeysvalueof{/tikz/dbox/height}/2)
          node[below left] {#1} (-w*1pt/2,pgfkeysvalueof{/tikz/dbox/height}/2)
          -- (w*1pt/2,-pgfkeysvalueof{/tikz/dbox/height}/2) ;
          }},dbox/.cd,height/.initial=2cm}
          begin{document}
          begin{tikzpicture}
          path pic[draw]{dbox={abc}{xyzuv}} (3,0) pic[draw,blue]{dbox={abc}{xyz}}
          (6,0) pic[draw,red,thick]{dbox={abcdefgh}{xyz}};
          end{tikzpicture}
          end{document}


          enter image description here



          You can give this shape the usual anchors with a simple trick: just turn it into a node using fit. The names have then to be set using dbox/name=<name>.



          documentclass{article}
          usepackage{tikz}
          usetikzlibrary{fit}
          tikzset{pics/dbox/.style 2 args={code={%
          pgfmathsetmacro{w}{max((width("#1")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#1")),%
          (width("#2")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#2")))*pgfkeysvalueof{/tikz/dbox/height}}
          path (-w*1pt/2,-pgfkeysvalueof{/tikz/dbox/height}/2)
          node[above right] (bl) {#2}
          rectangle
          (w*1pt/2,pgfkeysvalueof{/tikz/dbox/height}/2)
          node[below left] (tr) {#1};
          node[pic actions,inner sep=0pt,fit=(bl)(tr),path picture={path[pic actions]
          (path picture bounding box.north west)
          -- (path picture bounding box.south east);}]
          (pgfkeysvalueof{/tikz/dbox/name}){};
          }},dbox/.cd,height/.initial=2cm,name/.initial=}
          begin{document}
          begin{tikzpicture}
          path pic[draw] {dbox={abc}{xyzuv}} (3,0)
          pic[draw,blue,dbox/name=A] {dbox={abc}{xyz}}
          (6,0) pic[draw,red,thick,rounded corners,dbox/name=B] {dbox={abcdefgh}{xyz}};
          draw[stealth-stealth] (A.north) to[out=80,in=100](B.100);
          end{tikzpicture}
          end{document}


          enter image description here






          share|improve this answer










          New contributor



          Schrödinger's cat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.





























            1














            Are you looking for a simple code like this? Think geometrically: just a (scaling) square with some text inside that can be manually adjusted.



            enter image description here



            documentclass[border=5mm]{standalone}
            usepackage{tikz}
            begin{document}
            begin{tikzpicture}[xscale=.8,yscale=1.5]
            draw[thick] (1,0)--(0,1) (0,0) rectangle (1,1);
            path[magenta]
            (0,0)+(.3,.3) node{$dq$}
            (1,1)+(-.4,-.15) node{$abc$};
            end{tikzpicture}

            begin{tikzpicture}[xscale=2.5,yscale=1.5]
            draw[thick] (1,0)--(0,1) (0,0) rectangle (1,1);
            path[blue]
            (0,0)+(.2,.15) node{$TikZ$}
            (1,1)+(-.4,-.15) node{$Asymptote$};
            end{tikzpicture}

            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',
              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%2f504386%2ftikz-block-diagonally-divided%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









              13














              The computations are basic,



              enter image description here



              and if you consider using a pic instead of a full-fledged the node shape, the implementation is straightforward, too. The free parameter is taken to be the height of the full shape. The width is then computed in such a way that the diagonal does not cut any of the nodes (where the "safety distance" is given by the inner sep).



              documentclass{article}
              usepackage{tikz}
              tikzset{pics/dbox/.style 2 args={code={%
              pgfmathsetmacro{w}{max((width("#1")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#1")),%
              (width("#2")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#2")))*pgfkeysvalueof{/tikz/dbox/height}}
              path[pic actions] (-w*1pt/2,-pgfkeysvalueof{/tikz/dbox/height}/2)
              node[above right] {#2}
              rectangle
              (w*1pt/2,pgfkeysvalueof{/tikz/dbox/height}/2)
              node[below left] {#1} (-w*1pt/2,pgfkeysvalueof{/tikz/dbox/height}/2)
              -- (w*1pt/2,-pgfkeysvalueof{/tikz/dbox/height}/2) ;
              }},dbox/.cd,height/.initial=2cm}
              begin{document}
              begin{tikzpicture}
              path pic[draw]{dbox={abc}{xyzuv}} (3,0) pic[draw,blue]{dbox={abc}{xyz}}
              (6,0) pic[draw,red,thick]{dbox={abcdefgh}{xyz}};
              end{tikzpicture}
              end{document}


              enter image description here



              You can give this shape the usual anchors with a simple trick: just turn it into a node using fit. The names have then to be set using dbox/name=<name>.



              documentclass{article}
              usepackage{tikz}
              usetikzlibrary{fit}
              tikzset{pics/dbox/.style 2 args={code={%
              pgfmathsetmacro{w}{max((width("#1")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#1")),%
              (width("#2")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#2")))*pgfkeysvalueof{/tikz/dbox/height}}
              path (-w*1pt/2,-pgfkeysvalueof{/tikz/dbox/height}/2)
              node[above right] (bl) {#2}
              rectangle
              (w*1pt/2,pgfkeysvalueof{/tikz/dbox/height}/2)
              node[below left] (tr) {#1};
              node[pic actions,inner sep=0pt,fit=(bl)(tr),path picture={path[pic actions]
              (path picture bounding box.north west)
              -- (path picture bounding box.south east);}]
              (pgfkeysvalueof{/tikz/dbox/name}){};
              }},dbox/.cd,height/.initial=2cm,name/.initial=}
              begin{document}
              begin{tikzpicture}
              path pic[draw] {dbox={abc}{xyzuv}} (3,0)
              pic[draw,blue,dbox/name=A] {dbox={abc}{xyz}}
              (6,0) pic[draw,red,thick,rounded corners,dbox/name=B] {dbox={abcdefgh}{xyz}};
              draw[stealth-stealth] (A.north) to[out=80,in=100](B.100);
              end{tikzpicture}
              end{document}


              enter image description here






              share|improve this answer










              New contributor



              Schrödinger's cat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.


























                13














                The computations are basic,



                enter image description here



                and if you consider using a pic instead of a full-fledged the node shape, the implementation is straightforward, too. The free parameter is taken to be the height of the full shape. The width is then computed in such a way that the diagonal does not cut any of the nodes (where the "safety distance" is given by the inner sep).



                documentclass{article}
                usepackage{tikz}
                tikzset{pics/dbox/.style 2 args={code={%
                pgfmathsetmacro{w}{max((width("#1")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#1")),%
                (width("#2")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#2")))*pgfkeysvalueof{/tikz/dbox/height}}
                path[pic actions] (-w*1pt/2,-pgfkeysvalueof{/tikz/dbox/height}/2)
                node[above right] {#2}
                rectangle
                (w*1pt/2,pgfkeysvalueof{/tikz/dbox/height}/2)
                node[below left] {#1} (-w*1pt/2,pgfkeysvalueof{/tikz/dbox/height}/2)
                -- (w*1pt/2,-pgfkeysvalueof{/tikz/dbox/height}/2) ;
                }},dbox/.cd,height/.initial=2cm}
                begin{document}
                begin{tikzpicture}
                path pic[draw]{dbox={abc}{xyzuv}} (3,0) pic[draw,blue]{dbox={abc}{xyz}}
                (6,0) pic[draw,red,thick]{dbox={abcdefgh}{xyz}};
                end{tikzpicture}
                end{document}


                enter image description here



                You can give this shape the usual anchors with a simple trick: just turn it into a node using fit. The names have then to be set using dbox/name=<name>.



                documentclass{article}
                usepackage{tikz}
                usetikzlibrary{fit}
                tikzset{pics/dbox/.style 2 args={code={%
                pgfmathsetmacro{w}{max((width("#1")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#1")),%
                (width("#2")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#2")))*pgfkeysvalueof{/tikz/dbox/height}}
                path (-w*1pt/2,-pgfkeysvalueof{/tikz/dbox/height}/2)
                node[above right] (bl) {#2}
                rectangle
                (w*1pt/2,pgfkeysvalueof{/tikz/dbox/height}/2)
                node[below left] (tr) {#1};
                node[pic actions,inner sep=0pt,fit=(bl)(tr),path picture={path[pic actions]
                (path picture bounding box.north west)
                -- (path picture bounding box.south east);}]
                (pgfkeysvalueof{/tikz/dbox/name}){};
                }},dbox/.cd,height/.initial=2cm,name/.initial=}
                begin{document}
                begin{tikzpicture}
                path pic[draw] {dbox={abc}{xyzuv}} (3,0)
                pic[draw,blue,dbox/name=A] {dbox={abc}{xyz}}
                (6,0) pic[draw,red,thick,rounded corners,dbox/name=B] {dbox={abcdefgh}{xyz}};
                draw[stealth-stealth] (A.north) to[out=80,in=100](B.100);
                end{tikzpicture}
                end{document}


                enter image description here






                share|improve this answer










                New contributor



                Schrödinger's cat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.
























                  13












                  13








                  13







                  The computations are basic,



                  enter image description here



                  and if you consider using a pic instead of a full-fledged the node shape, the implementation is straightforward, too. The free parameter is taken to be the height of the full shape. The width is then computed in such a way that the diagonal does not cut any of the nodes (where the "safety distance" is given by the inner sep).



                  documentclass{article}
                  usepackage{tikz}
                  tikzset{pics/dbox/.style 2 args={code={%
                  pgfmathsetmacro{w}{max((width("#1")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#1")),%
                  (width("#2")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#2")))*pgfkeysvalueof{/tikz/dbox/height}}
                  path[pic actions] (-w*1pt/2,-pgfkeysvalueof{/tikz/dbox/height}/2)
                  node[above right] {#2}
                  rectangle
                  (w*1pt/2,pgfkeysvalueof{/tikz/dbox/height}/2)
                  node[below left] {#1} (-w*1pt/2,pgfkeysvalueof{/tikz/dbox/height}/2)
                  -- (w*1pt/2,-pgfkeysvalueof{/tikz/dbox/height}/2) ;
                  }},dbox/.cd,height/.initial=2cm}
                  begin{document}
                  begin{tikzpicture}
                  path pic[draw]{dbox={abc}{xyzuv}} (3,0) pic[draw,blue]{dbox={abc}{xyz}}
                  (6,0) pic[draw,red,thick]{dbox={abcdefgh}{xyz}};
                  end{tikzpicture}
                  end{document}


                  enter image description here



                  You can give this shape the usual anchors with a simple trick: just turn it into a node using fit. The names have then to be set using dbox/name=<name>.



                  documentclass{article}
                  usepackage{tikz}
                  usetikzlibrary{fit}
                  tikzset{pics/dbox/.style 2 args={code={%
                  pgfmathsetmacro{w}{max((width("#1")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#1")),%
                  (width("#2")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#2")))*pgfkeysvalueof{/tikz/dbox/height}}
                  path (-w*1pt/2,-pgfkeysvalueof{/tikz/dbox/height}/2)
                  node[above right] (bl) {#2}
                  rectangle
                  (w*1pt/2,pgfkeysvalueof{/tikz/dbox/height}/2)
                  node[below left] (tr) {#1};
                  node[pic actions,inner sep=0pt,fit=(bl)(tr),path picture={path[pic actions]
                  (path picture bounding box.north west)
                  -- (path picture bounding box.south east);}]
                  (pgfkeysvalueof{/tikz/dbox/name}){};
                  }},dbox/.cd,height/.initial=2cm,name/.initial=}
                  begin{document}
                  begin{tikzpicture}
                  path pic[draw] {dbox={abc}{xyzuv}} (3,0)
                  pic[draw,blue,dbox/name=A] {dbox={abc}{xyz}}
                  (6,0) pic[draw,red,thick,rounded corners,dbox/name=B] {dbox={abcdefgh}{xyz}};
                  draw[stealth-stealth] (A.north) to[out=80,in=100](B.100);
                  end{tikzpicture}
                  end{document}


                  enter image description here






                  share|improve this answer










                  New contributor



                  Schrödinger's cat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  The computations are basic,



                  enter image description here



                  and if you consider using a pic instead of a full-fledged the node shape, the implementation is straightforward, too. The free parameter is taken to be the height of the full shape. The width is then computed in such a way that the diagonal does not cut any of the nodes (where the "safety distance" is given by the inner sep).



                  documentclass{article}
                  usepackage{tikz}
                  tikzset{pics/dbox/.style 2 args={code={%
                  pgfmathsetmacro{w}{max((width("#1")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#1")),%
                  (width("#2")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#2")))*pgfkeysvalueof{/tikz/dbox/height}}
                  path[pic actions] (-w*1pt/2,-pgfkeysvalueof{/tikz/dbox/height}/2)
                  node[above right] {#2}
                  rectangle
                  (w*1pt/2,pgfkeysvalueof{/tikz/dbox/height}/2)
                  node[below left] {#1} (-w*1pt/2,pgfkeysvalueof{/tikz/dbox/height}/2)
                  -- (w*1pt/2,-pgfkeysvalueof{/tikz/dbox/height}/2) ;
                  }},dbox/.cd,height/.initial=2cm}
                  begin{document}
                  begin{tikzpicture}
                  path pic[draw]{dbox={abc}{xyzuv}} (3,0) pic[draw,blue]{dbox={abc}{xyz}}
                  (6,0) pic[draw,red,thick]{dbox={abcdefgh}{xyz}};
                  end{tikzpicture}
                  end{document}


                  enter image description here



                  You can give this shape the usual anchors with a simple trick: just turn it into a node using fit. The names have then to be set using dbox/name=<name>.



                  documentclass{article}
                  usepackage{tikz}
                  usetikzlibrary{fit}
                  tikzset{pics/dbox/.style 2 args={code={%
                  pgfmathsetmacro{w}{max((width("#1")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#1")),%
                  (width("#2")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#2")))*pgfkeysvalueof{/tikz/dbox/height}}
                  path (-w*1pt/2,-pgfkeysvalueof{/tikz/dbox/height}/2)
                  node[above right] (bl) {#2}
                  rectangle
                  (w*1pt/2,pgfkeysvalueof{/tikz/dbox/height}/2)
                  node[below left] (tr) {#1};
                  node[pic actions,inner sep=0pt,fit=(bl)(tr),path picture={path[pic actions]
                  (path picture bounding box.north west)
                  -- (path picture bounding box.south east);}]
                  (pgfkeysvalueof{/tikz/dbox/name}){};
                  }},dbox/.cd,height/.initial=2cm,name/.initial=}
                  begin{document}
                  begin{tikzpicture}
                  path pic[draw] {dbox={abc}{xyzuv}} (3,0)
                  pic[draw,blue,dbox/name=A] {dbox={abc}{xyz}}
                  (6,0) pic[draw,red,thick,rounded corners,dbox/name=B] {dbox={abcdefgh}{xyz}};
                  draw[stealth-stealth] (A.north) to[out=80,in=100](B.100);
                  end{tikzpicture}
                  end{document}


                  enter image description here







                  share|improve this answer










                  New contributor



                  Schrödinger's cat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.








                  share|improve this answer



                  share|improve this answer








                  edited Aug 16 at 4:54





















                  New contributor



                  Schrödinger's cat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.








                  answered Aug 16 at 3:04









                  Schrödinger's catSchrödinger's cat

                  7363 silver badges9 bronze badges




                  7363 silver badges9 bronze badges




                  New contributor



                  Schrödinger's cat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.




                  New contributor




                  Schrödinger's cat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






























                      1














                      Are you looking for a simple code like this? Think geometrically: just a (scaling) square with some text inside that can be manually adjusted.



                      enter image description here



                      documentclass[border=5mm]{standalone}
                      usepackage{tikz}
                      begin{document}
                      begin{tikzpicture}[xscale=.8,yscale=1.5]
                      draw[thick] (1,0)--(0,1) (0,0) rectangle (1,1);
                      path[magenta]
                      (0,0)+(.3,.3) node{$dq$}
                      (1,1)+(-.4,-.15) node{$abc$};
                      end{tikzpicture}

                      begin{tikzpicture}[xscale=2.5,yscale=1.5]
                      draw[thick] (1,0)--(0,1) (0,0) rectangle (1,1);
                      path[blue]
                      (0,0)+(.2,.15) node{$TikZ$}
                      (1,1)+(-.4,-.15) node{$Asymptote$};
                      end{tikzpicture}

                      end{document}





                      share|improve this answer






























                        1














                        Are you looking for a simple code like this? Think geometrically: just a (scaling) square with some text inside that can be manually adjusted.



                        enter image description here



                        documentclass[border=5mm]{standalone}
                        usepackage{tikz}
                        begin{document}
                        begin{tikzpicture}[xscale=.8,yscale=1.5]
                        draw[thick] (1,0)--(0,1) (0,0) rectangle (1,1);
                        path[magenta]
                        (0,0)+(.3,.3) node{$dq$}
                        (1,1)+(-.4,-.15) node{$abc$};
                        end{tikzpicture}

                        begin{tikzpicture}[xscale=2.5,yscale=1.5]
                        draw[thick] (1,0)--(0,1) (0,0) rectangle (1,1);
                        path[blue]
                        (0,0)+(.2,.15) node{$TikZ$}
                        (1,1)+(-.4,-.15) node{$Asymptote$};
                        end{tikzpicture}

                        end{document}





                        share|improve this answer




























                          1












                          1








                          1







                          Are you looking for a simple code like this? Think geometrically: just a (scaling) square with some text inside that can be manually adjusted.



                          enter image description here



                          documentclass[border=5mm]{standalone}
                          usepackage{tikz}
                          begin{document}
                          begin{tikzpicture}[xscale=.8,yscale=1.5]
                          draw[thick] (1,0)--(0,1) (0,0) rectangle (1,1);
                          path[magenta]
                          (0,0)+(.3,.3) node{$dq$}
                          (1,1)+(-.4,-.15) node{$abc$};
                          end{tikzpicture}

                          begin{tikzpicture}[xscale=2.5,yscale=1.5]
                          draw[thick] (1,0)--(0,1) (0,0) rectangle (1,1);
                          path[blue]
                          (0,0)+(.2,.15) node{$TikZ$}
                          (1,1)+(-.4,-.15) node{$Asymptote$};
                          end{tikzpicture}

                          end{document}





                          share|improve this answer













                          Are you looking for a simple code like this? Think geometrically: just a (scaling) square with some text inside that can be manually adjusted.



                          enter image description here



                          documentclass[border=5mm]{standalone}
                          usepackage{tikz}
                          begin{document}
                          begin{tikzpicture}[xscale=.8,yscale=1.5]
                          draw[thick] (1,0)--(0,1) (0,0) rectangle (1,1);
                          path[magenta]
                          (0,0)+(.3,.3) node{$dq$}
                          (1,1)+(-.4,-.15) node{$abc$};
                          end{tikzpicture}

                          begin{tikzpicture}[xscale=2.5,yscale=1.5]
                          draw[thick] (1,0)--(0,1) (0,0) rectangle (1,1);
                          path[blue]
                          (0,0)+(.2,.15) node{$TikZ$}
                          (1,1)+(-.4,-.15) node{$Asymptote$};
                          end{tikzpicture}

                          end{document}






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 2 days ago









                          Black MildBlack Mild

                          1,8569 silver badges15 bronze badges




                          1,8569 silver badges15 bronze badges

































                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f504386%2ftikz-block-diagonally-divided%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

                              Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

                              Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

                              Ciclooctatetraenă Vezi și | Bibliografie | Meniu de navigare637866text4148569-500570979m