Horizontal alignment of nodes (with straight line edge connectors)











up vote
0
down vote

favorite












There are two things wrong with the qtree version of the MWE. What I want is to have three nodes horizontally aligned (the root 1SA, the 1st level child "0--7 HL" and the second level child "Various distributions4") and having straight line connectors with the same y-coordinate so that they look like a single straight line. In the more complex source from which I've extracted the MWE, the first two happen automatically since there is only one 1st level child - somehow I've turned the latter into a second level child in preparing the MWE :-(



I'm including a forest version where that problem is resolved but horizontal alignment is still an issue.



Qtree MWE:



RequirePackage{tikz}
RequirePackage{tikz-qtree}
usetikzlibrary{fit, positioning, shapes, trees}

documentclass{article}

begin{document}
tikzset{frontier/.style={distance from root=10baselineskip}}
tikzset{edge from parent/.style=
{draw, edge from parent fork right},
every tree node/.style =
{anchor=base west, shape=rectangle, rounded corners, draw=red, align=left, top color=white, bottom color=blue!20, minimum width = 2mm, minimum height = 4mm}
}

begin{tikzpicture}[thick, every node/.style={transform shape}, grow=right]
begin{scope}[font=small, color=black, ultra thick, node distance=25mm, level distance=25mm, sibling distance=5mm]
Tree
[.{1SA}
[node (1) {0--7 HL};
[.{underline{textbf{Various distributions1}}\Stayman Takis} ]
[.{underline{textbf{Various distributions2 }}\Texas} ]
[.{underline{textbf{Various distributions3}}\Stayman normal, if a single major\Texas, otherwise} ]
[node (2) [right=of 1] {underline{textbf{Various distributions4}}\Pass, with bad suit\Texas, otherwise}; ]
[.{underline{textbf{Various distributions5}}\Pass, 0--4 HL\Texas M 5--7 HL} ]
[.{underline{textbf{Various distributions6}}\Pass, 0--4 HL\Texas M 5--7 HL} ]
[.{underline{textbf{Various distributions7}}\Pass} ]
]
]
end{scope}
end{tikzpicture}
end{document}


Forest MWE:



RequirePackage{tikz}
usetikzlibrary{fit, positioning, shapes, trees}
RequirePackage[edges]{forest}

documentclass{article}

begin{document}
begin{forest}
for tree={rounded corners,
grow'=0, l=0, l sep=2em,
child anchor=west, anchor=west,
parent anchor=east,
tier/.pgfmath=level(),
shape=rectangle, rounded corners, draw=red, align=left, top color=white, bottom color=blue!20, minimum width = 2mm, minimum height = 4mm,
edge path={noexpandpath[forestoption{edge}](!u.parent anchor)|-(.child anchor)forestoption{edge label};},
}
[{1SA}, calign=child, calign child=2
[{0--7 HL}
[{underline{textbf{Various distributions1}}\Stayman Takis} ]
[{underline{textbf{Various distributions2}}\Texas} ]
[{underline{textbf{Various distributions3}}\Stayman normal, if a single major\Texas, otherwise} ]
[{underline{textbf{Various distributions4}}\Pass, with bad suit\Texas, otherwise} ]
[{underline{textbf{Various distributions5}}\Pass, 0--4 HL\Texas M 5--7 HL} ]
[{underline{textbf{Various distributions6}}\Pass, 0--4 HL\Texas M 5--7 HL} ]
[{underline{textbf{Various distributions7}}\Pass} ]
]
]
end{forest}
end{document}









share|improve this question




























    up vote
    0
    down vote

    favorite












    There are two things wrong with the qtree version of the MWE. What I want is to have three nodes horizontally aligned (the root 1SA, the 1st level child "0--7 HL" and the second level child "Various distributions4") and having straight line connectors with the same y-coordinate so that they look like a single straight line. In the more complex source from which I've extracted the MWE, the first two happen automatically since there is only one 1st level child - somehow I've turned the latter into a second level child in preparing the MWE :-(



    I'm including a forest version where that problem is resolved but horizontal alignment is still an issue.



    Qtree MWE:



    RequirePackage{tikz}
    RequirePackage{tikz-qtree}
    usetikzlibrary{fit, positioning, shapes, trees}

    documentclass{article}

    begin{document}
    tikzset{frontier/.style={distance from root=10baselineskip}}
    tikzset{edge from parent/.style=
    {draw, edge from parent fork right},
    every tree node/.style =
    {anchor=base west, shape=rectangle, rounded corners, draw=red, align=left, top color=white, bottom color=blue!20, minimum width = 2mm, minimum height = 4mm}
    }

    begin{tikzpicture}[thick, every node/.style={transform shape}, grow=right]
    begin{scope}[font=small, color=black, ultra thick, node distance=25mm, level distance=25mm, sibling distance=5mm]
    Tree
    [.{1SA}
    [node (1) {0--7 HL};
    [.{underline{textbf{Various distributions1}}\Stayman Takis} ]
    [.{underline{textbf{Various distributions2 }}\Texas} ]
    [.{underline{textbf{Various distributions3}}\Stayman normal, if a single major\Texas, otherwise} ]
    [node (2) [right=of 1] {underline{textbf{Various distributions4}}\Pass, with bad suit\Texas, otherwise}; ]
    [.{underline{textbf{Various distributions5}}\Pass, 0--4 HL\Texas M 5--7 HL} ]
    [.{underline{textbf{Various distributions6}}\Pass, 0--4 HL\Texas M 5--7 HL} ]
    [.{underline{textbf{Various distributions7}}\Pass} ]
    ]
    ]
    end{scope}
    end{tikzpicture}
    end{document}


    Forest MWE:



    RequirePackage{tikz}
    usetikzlibrary{fit, positioning, shapes, trees}
    RequirePackage[edges]{forest}

    documentclass{article}

    begin{document}
    begin{forest}
    for tree={rounded corners,
    grow'=0, l=0, l sep=2em,
    child anchor=west, anchor=west,
    parent anchor=east,
    tier/.pgfmath=level(),
    shape=rectangle, rounded corners, draw=red, align=left, top color=white, bottom color=blue!20, minimum width = 2mm, minimum height = 4mm,
    edge path={noexpandpath[forestoption{edge}](!u.parent anchor)|-(.child anchor)forestoption{edge label};},
    }
    [{1SA}, calign=child, calign child=2
    [{0--7 HL}
    [{underline{textbf{Various distributions1}}\Stayman Takis} ]
    [{underline{textbf{Various distributions2}}\Texas} ]
    [{underline{textbf{Various distributions3}}\Stayman normal, if a single major\Texas, otherwise} ]
    [{underline{textbf{Various distributions4}}\Pass, with bad suit\Texas, otherwise} ]
    [{underline{textbf{Various distributions5}}\Pass, 0--4 HL\Texas M 5--7 HL} ]
    [{underline{textbf{Various distributions6}}\Pass, 0--4 HL\Texas M 5--7 HL} ]
    [{underline{textbf{Various distributions7}}\Pass} ]
    ]
    ]
    end{forest}
    end{document}









    share|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      There are two things wrong with the qtree version of the MWE. What I want is to have three nodes horizontally aligned (the root 1SA, the 1st level child "0--7 HL" and the second level child "Various distributions4") and having straight line connectors with the same y-coordinate so that they look like a single straight line. In the more complex source from which I've extracted the MWE, the first two happen automatically since there is only one 1st level child - somehow I've turned the latter into a second level child in preparing the MWE :-(



      I'm including a forest version where that problem is resolved but horizontal alignment is still an issue.



      Qtree MWE:



      RequirePackage{tikz}
      RequirePackage{tikz-qtree}
      usetikzlibrary{fit, positioning, shapes, trees}

      documentclass{article}

      begin{document}
      tikzset{frontier/.style={distance from root=10baselineskip}}
      tikzset{edge from parent/.style=
      {draw, edge from parent fork right},
      every tree node/.style =
      {anchor=base west, shape=rectangle, rounded corners, draw=red, align=left, top color=white, bottom color=blue!20, minimum width = 2mm, minimum height = 4mm}
      }

      begin{tikzpicture}[thick, every node/.style={transform shape}, grow=right]
      begin{scope}[font=small, color=black, ultra thick, node distance=25mm, level distance=25mm, sibling distance=5mm]
      Tree
      [.{1SA}
      [node (1) {0--7 HL};
      [.{underline{textbf{Various distributions1}}\Stayman Takis} ]
      [.{underline{textbf{Various distributions2 }}\Texas} ]
      [.{underline{textbf{Various distributions3}}\Stayman normal, if a single major\Texas, otherwise} ]
      [node (2) [right=of 1] {underline{textbf{Various distributions4}}\Pass, with bad suit\Texas, otherwise}; ]
      [.{underline{textbf{Various distributions5}}\Pass, 0--4 HL\Texas M 5--7 HL} ]
      [.{underline{textbf{Various distributions6}}\Pass, 0--4 HL\Texas M 5--7 HL} ]
      [.{underline{textbf{Various distributions7}}\Pass} ]
      ]
      ]
      end{scope}
      end{tikzpicture}
      end{document}


      Forest MWE:



      RequirePackage{tikz}
      usetikzlibrary{fit, positioning, shapes, trees}
      RequirePackage[edges]{forest}

      documentclass{article}

      begin{document}
      begin{forest}
      for tree={rounded corners,
      grow'=0, l=0, l sep=2em,
      child anchor=west, anchor=west,
      parent anchor=east,
      tier/.pgfmath=level(),
      shape=rectangle, rounded corners, draw=red, align=left, top color=white, bottom color=blue!20, minimum width = 2mm, minimum height = 4mm,
      edge path={noexpandpath[forestoption{edge}](!u.parent anchor)|-(.child anchor)forestoption{edge label};},
      }
      [{1SA}, calign=child, calign child=2
      [{0--7 HL}
      [{underline{textbf{Various distributions1}}\Stayman Takis} ]
      [{underline{textbf{Various distributions2}}\Texas} ]
      [{underline{textbf{Various distributions3}}\Stayman normal, if a single major\Texas, otherwise} ]
      [{underline{textbf{Various distributions4}}\Pass, with bad suit\Texas, otherwise} ]
      [{underline{textbf{Various distributions5}}\Pass, 0--4 HL\Texas M 5--7 HL} ]
      [{underline{textbf{Various distributions6}}\Pass, 0--4 HL\Texas M 5--7 HL} ]
      [{underline{textbf{Various distributions7}}\Pass} ]
      ]
      ]
      end{forest}
      end{document}









      share|improve this question















      There are two things wrong with the qtree version of the MWE. What I want is to have three nodes horizontally aligned (the root 1SA, the 1st level child "0--7 HL" and the second level child "Various distributions4") and having straight line connectors with the same y-coordinate so that they look like a single straight line. In the more complex source from which I've extracted the MWE, the first two happen automatically since there is only one 1st level child - somehow I've turned the latter into a second level child in preparing the MWE :-(



      I'm including a forest version where that problem is resolved but horizontal alignment is still an issue.



      Qtree MWE:



      RequirePackage{tikz}
      RequirePackage{tikz-qtree}
      usetikzlibrary{fit, positioning, shapes, trees}

      documentclass{article}

      begin{document}
      tikzset{frontier/.style={distance from root=10baselineskip}}
      tikzset{edge from parent/.style=
      {draw, edge from parent fork right},
      every tree node/.style =
      {anchor=base west, shape=rectangle, rounded corners, draw=red, align=left, top color=white, bottom color=blue!20, minimum width = 2mm, minimum height = 4mm}
      }

      begin{tikzpicture}[thick, every node/.style={transform shape}, grow=right]
      begin{scope}[font=small, color=black, ultra thick, node distance=25mm, level distance=25mm, sibling distance=5mm]
      Tree
      [.{1SA}
      [node (1) {0--7 HL};
      [.{underline{textbf{Various distributions1}}\Stayman Takis} ]
      [.{underline{textbf{Various distributions2 }}\Texas} ]
      [.{underline{textbf{Various distributions3}}\Stayman normal, if a single major\Texas, otherwise} ]
      [node (2) [right=of 1] {underline{textbf{Various distributions4}}\Pass, with bad suit\Texas, otherwise}; ]
      [.{underline{textbf{Various distributions5}}\Pass, 0--4 HL\Texas M 5--7 HL} ]
      [.{underline{textbf{Various distributions6}}\Pass, 0--4 HL\Texas M 5--7 HL} ]
      [.{underline{textbf{Various distributions7}}\Pass} ]
      ]
      ]
      end{scope}
      end{tikzpicture}
      end{document}


      Forest MWE:



      RequirePackage{tikz}
      usetikzlibrary{fit, positioning, shapes, trees}
      RequirePackage[edges]{forest}

      documentclass{article}

      begin{document}
      begin{forest}
      for tree={rounded corners,
      grow'=0, l=0, l sep=2em,
      child anchor=west, anchor=west,
      parent anchor=east,
      tier/.pgfmath=level(),
      shape=rectangle, rounded corners, draw=red, align=left, top color=white, bottom color=blue!20, minimum width = 2mm, minimum height = 4mm,
      edge path={noexpandpath[forestoption{edge}](!u.parent anchor)|-(.child anchor)forestoption{edge label};},
      }
      [{1SA}, calign=child, calign child=2
      [{0--7 HL}
      [{underline{textbf{Various distributions1}}\Stayman Takis} ]
      [{underline{textbf{Various distributions2}}\Texas} ]
      [{underline{textbf{Various distributions3}}\Stayman normal, if a single major\Texas, otherwise} ]
      [{underline{textbf{Various distributions4}}\Pass, with bad suit\Texas, otherwise} ]
      [{underline{textbf{Various distributions5}}\Pass, 0--4 HL\Texas M 5--7 HL} ]
      [{underline{textbf{Various distributions6}}\Pass, 0--4 HL\Texas M 5--7 HL} ]
      [{underline{textbf{Various distributions7}}\Pass} ]
      ]
      ]
      end{forest}
      end{document}






      horizontal-alignment forest tikz-qtree






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 8 hours ago

























      asked 10 hours ago









      DLyons

      1376




      1376






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote













          To get the horizontal alignment, one needs to specify calign=child for the second level as well. In the code below I simply set it for the entire tree.



          Actually, the code sets calign=child edge. This yields the desired result even when child/parent anchor differs from anchor. (calign=child aligns anchors, while calign=child edge aligns parent anchor and child anchor.)



          I have also included the automatic computatation of the middle child: calign child=(n_children()+1)/2. (Maybe having calign=mid-child and calign=mid-child edge is not a bad idea?)



          RequirePackage{tikz}
          usetikzlibrary{fit, positioning, shapes, trees}
          RequirePackage[edges]{forest}

          documentclass{article}

          begin{document}
          begin{forest}
          for tree={rounded corners,
          grow'=0, l=0, l sep=2em,
          child anchor=west, anchor=west,
          parent anchor=east,
          tier/.pgfmath=level(),
          shape=rectangle, rounded corners, draw=red, align=left, top color=white, bottom color=blue!20, minimum width = 2mm, minimum height = 4mm,
          edge path={noexpandpath[forestoption{edge}](!u.parent anchor)|-(.child anchor)forestoption{edge label};},
          calign=child edge, calign child=(n_children()+1)/2,
          }
          [{1SA},
          [{0--7 HL},
          [{underline{textbf{Various distributions1}}\Stayman Takis} ]
          [{underline{textbf{Various distributions2}}\Texas} ]
          [{underline{textbf{Various distributions3}}\Stayman normal, if a single major\Texas, otherwise} ]
          [{underline{textbf{Various distributions4}}\Pass, with bad suit\Texas, otherwise} ]
          [{underline{textbf{Various distributions5}}\Pass, 0--4 HL\Texas M 5--7 HL} ]
          [{underline{textbf{Various distributions6}}\Pass, 0--4 HL\Texas M 5--7 HL} ]
          [{underline{textbf{Various distributions7}}\Pass} ]
          ]
          ]
          end{forest}
          end{document}


          Result






          share|improve this answer





















          • Thanks! I've ported that code back to the source and it seems to work well. In doing my MWE I somehow lost the right edge out of "0--7 HL". The node shouldn't abut the vertical line joining the children. How should I restore that edge?
            – DLyons
            38 mins 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%2f459583%2fhorizontal-alignment-of-nodes-with-straight-line-edge-connectors%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
          1
          down vote













          To get the horizontal alignment, one needs to specify calign=child for the second level as well. In the code below I simply set it for the entire tree.



          Actually, the code sets calign=child edge. This yields the desired result even when child/parent anchor differs from anchor. (calign=child aligns anchors, while calign=child edge aligns parent anchor and child anchor.)



          I have also included the automatic computatation of the middle child: calign child=(n_children()+1)/2. (Maybe having calign=mid-child and calign=mid-child edge is not a bad idea?)



          RequirePackage{tikz}
          usetikzlibrary{fit, positioning, shapes, trees}
          RequirePackage[edges]{forest}

          documentclass{article}

          begin{document}
          begin{forest}
          for tree={rounded corners,
          grow'=0, l=0, l sep=2em,
          child anchor=west, anchor=west,
          parent anchor=east,
          tier/.pgfmath=level(),
          shape=rectangle, rounded corners, draw=red, align=left, top color=white, bottom color=blue!20, minimum width = 2mm, minimum height = 4mm,
          edge path={noexpandpath[forestoption{edge}](!u.parent anchor)|-(.child anchor)forestoption{edge label};},
          calign=child edge, calign child=(n_children()+1)/2,
          }
          [{1SA},
          [{0--7 HL},
          [{underline{textbf{Various distributions1}}\Stayman Takis} ]
          [{underline{textbf{Various distributions2}}\Texas} ]
          [{underline{textbf{Various distributions3}}\Stayman normal, if a single major\Texas, otherwise} ]
          [{underline{textbf{Various distributions4}}\Pass, with bad suit\Texas, otherwise} ]
          [{underline{textbf{Various distributions5}}\Pass, 0--4 HL\Texas M 5--7 HL} ]
          [{underline{textbf{Various distributions6}}\Pass, 0--4 HL\Texas M 5--7 HL} ]
          [{underline{textbf{Various distributions7}}\Pass} ]
          ]
          ]
          end{forest}
          end{document}


          Result






          share|improve this answer





















          • Thanks! I've ported that code back to the source and it seems to work well. In doing my MWE I somehow lost the right edge out of "0--7 HL". The node shouldn't abut the vertical line joining the children. How should I restore that edge?
            – DLyons
            38 mins ago















          up vote
          1
          down vote













          To get the horizontal alignment, one needs to specify calign=child for the second level as well. In the code below I simply set it for the entire tree.



          Actually, the code sets calign=child edge. This yields the desired result even when child/parent anchor differs from anchor. (calign=child aligns anchors, while calign=child edge aligns parent anchor and child anchor.)



          I have also included the automatic computatation of the middle child: calign child=(n_children()+1)/2. (Maybe having calign=mid-child and calign=mid-child edge is not a bad idea?)



          RequirePackage{tikz}
          usetikzlibrary{fit, positioning, shapes, trees}
          RequirePackage[edges]{forest}

          documentclass{article}

          begin{document}
          begin{forest}
          for tree={rounded corners,
          grow'=0, l=0, l sep=2em,
          child anchor=west, anchor=west,
          parent anchor=east,
          tier/.pgfmath=level(),
          shape=rectangle, rounded corners, draw=red, align=left, top color=white, bottom color=blue!20, minimum width = 2mm, minimum height = 4mm,
          edge path={noexpandpath[forestoption{edge}](!u.parent anchor)|-(.child anchor)forestoption{edge label};},
          calign=child edge, calign child=(n_children()+1)/2,
          }
          [{1SA},
          [{0--7 HL},
          [{underline{textbf{Various distributions1}}\Stayman Takis} ]
          [{underline{textbf{Various distributions2}}\Texas} ]
          [{underline{textbf{Various distributions3}}\Stayman normal, if a single major\Texas, otherwise} ]
          [{underline{textbf{Various distributions4}}\Pass, with bad suit\Texas, otherwise} ]
          [{underline{textbf{Various distributions5}}\Pass, 0--4 HL\Texas M 5--7 HL} ]
          [{underline{textbf{Various distributions6}}\Pass, 0--4 HL\Texas M 5--7 HL} ]
          [{underline{textbf{Various distributions7}}\Pass} ]
          ]
          ]
          end{forest}
          end{document}


          Result






          share|improve this answer





















          • Thanks! I've ported that code back to the source and it seems to work well. In doing my MWE I somehow lost the right edge out of "0--7 HL". The node shouldn't abut the vertical line joining the children. How should I restore that edge?
            – DLyons
            38 mins ago













          up vote
          1
          down vote










          up vote
          1
          down vote









          To get the horizontal alignment, one needs to specify calign=child for the second level as well. In the code below I simply set it for the entire tree.



          Actually, the code sets calign=child edge. This yields the desired result even when child/parent anchor differs from anchor. (calign=child aligns anchors, while calign=child edge aligns parent anchor and child anchor.)



          I have also included the automatic computatation of the middle child: calign child=(n_children()+1)/2. (Maybe having calign=mid-child and calign=mid-child edge is not a bad idea?)



          RequirePackage{tikz}
          usetikzlibrary{fit, positioning, shapes, trees}
          RequirePackage[edges]{forest}

          documentclass{article}

          begin{document}
          begin{forest}
          for tree={rounded corners,
          grow'=0, l=0, l sep=2em,
          child anchor=west, anchor=west,
          parent anchor=east,
          tier/.pgfmath=level(),
          shape=rectangle, rounded corners, draw=red, align=left, top color=white, bottom color=blue!20, minimum width = 2mm, minimum height = 4mm,
          edge path={noexpandpath[forestoption{edge}](!u.parent anchor)|-(.child anchor)forestoption{edge label};},
          calign=child edge, calign child=(n_children()+1)/2,
          }
          [{1SA},
          [{0--7 HL},
          [{underline{textbf{Various distributions1}}\Stayman Takis} ]
          [{underline{textbf{Various distributions2}}\Texas} ]
          [{underline{textbf{Various distributions3}}\Stayman normal, if a single major\Texas, otherwise} ]
          [{underline{textbf{Various distributions4}}\Pass, with bad suit\Texas, otherwise} ]
          [{underline{textbf{Various distributions5}}\Pass, 0--4 HL\Texas M 5--7 HL} ]
          [{underline{textbf{Various distributions6}}\Pass, 0--4 HL\Texas M 5--7 HL} ]
          [{underline{textbf{Various distributions7}}\Pass} ]
          ]
          ]
          end{forest}
          end{document}


          Result






          share|improve this answer












          To get the horizontal alignment, one needs to specify calign=child for the second level as well. In the code below I simply set it for the entire tree.



          Actually, the code sets calign=child edge. This yields the desired result even when child/parent anchor differs from anchor. (calign=child aligns anchors, while calign=child edge aligns parent anchor and child anchor.)



          I have also included the automatic computatation of the middle child: calign child=(n_children()+1)/2. (Maybe having calign=mid-child and calign=mid-child edge is not a bad idea?)



          RequirePackage{tikz}
          usetikzlibrary{fit, positioning, shapes, trees}
          RequirePackage[edges]{forest}

          documentclass{article}

          begin{document}
          begin{forest}
          for tree={rounded corners,
          grow'=0, l=0, l sep=2em,
          child anchor=west, anchor=west,
          parent anchor=east,
          tier/.pgfmath=level(),
          shape=rectangle, rounded corners, draw=red, align=left, top color=white, bottom color=blue!20, minimum width = 2mm, minimum height = 4mm,
          edge path={noexpandpath[forestoption{edge}](!u.parent anchor)|-(.child anchor)forestoption{edge label};},
          calign=child edge, calign child=(n_children()+1)/2,
          }
          [{1SA},
          [{0--7 HL},
          [{underline{textbf{Various distributions1}}\Stayman Takis} ]
          [{underline{textbf{Various distributions2}}\Texas} ]
          [{underline{textbf{Various distributions3}}\Stayman normal, if a single major\Texas, otherwise} ]
          [{underline{textbf{Various distributions4}}\Pass, with bad suit\Texas, otherwise} ]
          [{underline{textbf{Various distributions5}}\Pass, 0--4 HL\Texas M 5--7 HL} ]
          [{underline{textbf{Various distributions6}}\Pass, 0--4 HL\Texas M 5--7 HL} ]
          [{underline{textbf{Various distributions7}}\Pass} ]
          ]
          ]
          end{forest}
          end{document}


          Result







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 4 hours ago









          Sašo Živanović

          7,9951936




          7,9951936












          • Thanks! I've ported that code back to the source and it seems to work well. In doing my MWE I somehow lost the right edge out of "0--7 HL". The node shouldn't abut the vertical line joining the children. How should I restore that edge?
            – DLyons
            38 mins ago


















          • Thanks! I've ported that code back to the source and it seems to work well. In doing my MWE I somehow lost the right edge out of "0--7 HL". The node shouldn't abut the vertical line joining the children. How should I restore that edge?
            – DLyons
            38 mins ago
















          Thanks! I've ported that code back to the source and it seems to work well. In doing my MWE I somehow lost the right edge out of "0--7 HL". The node shouldn't abut the vertical line joining the children. How should I restore that edge?
          – DLyons
          38 mins ago




          Thanks! I've ported that code back to the source and it seems to work well. In doing my MWE I somehow lost the right edge out of "0--7 HL". The node shouldn't abut the vertical line joining the children. How should I restore that edge?
          – DLyons
          38 mins ago


















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f459583%2fhorizontal-alignment-of-nodes-with-straight-line-edge-connectors%23new-answer', 'question_page');
          }
          );

          Post as a guest




















































































          Popular posts from this blog

          How to send String Array data to Server using php in android

          Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

          Is anime1.com a legal site for watching anime?