The coordinates for a text node in tikz specifies the centre of the box. Is there a way to get it to specify...












1















I would like the two lines of text to the right of the diagonal lines to be left aligned. Is there any way to do this?



begin{tikzpicture}

node[text] at (2,4) {/p/};

draw (2.5,4) -- (5,5);
draw (2.5,4) -- (5,3);

node[text,align=left] at (7.2,5) {textipa{[b]} / [+voice] __ [+voice]};
node[text,align=left] at (6.5,3) {[p] / elsewhere};

end{tikzpicture}


enter image description here










share|improve this question

























  • Welcome to TeX-SE! Are you looking for anchor=west?

    – marmot
    Feb 26 at 6:10
















1















I would like the two lines of text to the right of the diagonal lines to be left aligned. Is there any way to do this?



begin{tikzpicture}

node[text] at (2,4) {/p/};

draw (2.5,4) -- (5,5);
draw (2.5,4) -- (5,3);

node[text,align=left] at (7.2,5) {textipa{[b]} / [+voice] __ [+voice]};
node[text,align=left] at (6.5,3) {[p] / elsewhere};

end{tikzpicture}


enter image description here










share|improve this question

























  • Welcome to TeX-SE! Are you looking for anchor=west?

    – marmot
    Feb 26 at 6:10














1












1








1








I would like the two lines of text to the right of the diagonal lines to be left aligned. Is there any way to do this?



begin{tikzpicture}

node[text] at (2,4) {/p/};

draw (2.5,4) -- (5,5);
draw (2.5,4) -- (5,3);

node[text,align=left] at (7.2,5) {textipa{[b]} / [+voice] __ [+voice]};
node[text,align=left] at (6.5,3) {[p] / elsewhere};

end{tikzpicture}


enter image description here










share|improve this question
















I would like the two lines of text to the right of the diagonal lines to be left aligned. Is there any way to do this?



begin{tikzpicture}

node[text] at (2,4) {/p/};

draw (2.5,4) -- (5,5);
draw (2.5,4) -- (5,3);

node[text,align=left] at (7.2,5) {textipa{[b]} / [+voice] __ [+voice]};
node[text,align=left] at (6.5,3) {[p] / elsewhere};

end{tikzpicture}


enter image description here







tikz-pgf positioning text






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 26 at 6:09









marmot

106k4127242




106k4127242










asked Feb 26 at 6:05









Michael BarrieMichael Barrie

61




61













  • Welcome to TeX-SE! Are you looking for anchor=west?

    – marmot
    Feb 26 at 6:10



















  • Welcome to TeX-SE! Are you looking for anchor=west?

    – marmot
    Feb 26 at 6:10

















Welcome to TeX-SE! Are you looking for anchor=west?

– marmot
Feb 26 at 6:10





Welcome to TeX-SE! Are you looking for anchor=west?

– marmot
Feb 26 at 6:10










2 Answers
2






active

oldest

votes


















2














You could use anchor=west to specify the location of the box via its leftmost point, or just right.



documentclass{article}
usepackage{tikz}
usepackage{tipa}
begin{document}
begin{tikzpicture}
node at (2,4) {/p/};
draw (2.5,4) -- (5,5) node[right,align=left] {textipa{[b]} / [+voice] __ [+voice]};
draw (2.5,4) -- (5,3) node[right,align=left] {[p] / elsewhere};
end{tikzpicture}

begin{tikzpicture}
node at (2,4) {/p/};
draw (2.5,4) -- (5,5) node[anchor=west,align=left] {textipa{[b]} / [+voice] __ [+voice]};
draw (2.5,4) -- (5,3) node[anchor=west,align=left] {[p] / elsewhere};
end{tikzpicture}
end{document}


enter image description here






share|improve this answer































    1














    There are many ways to do that, besides of marmot's methods. Here are three of them (I will add more if I find one in the future).



    Method 1



    documentclass[tikz,margin=3mm]{standalone}
    begin{document}
    begin{tikzpicture}
    draw (0,0) node[right] {Something} -- (-2,-1) node[left] {Dummy text} -- (0,-2) node[right] {Hello World};
    end{tikzpicture}
    end{document}


    enter image description here



    You can use polar coordinates instead of Cartesian coordinates. Also, this way is quite natural (I prefer this way) and doesn't require any TikZ libraries. However, this is not quite a standard way (draw is not supposed to do this stuff, as far as I know).



    Method 2



    documentclass[tikz,margin=3mm]{standalone}
    usetikzlibrary{positioning}
    begin{document}
    begin{tikzpicture}
    node (x) {Something};
    node[below left=1cm and 2cm of x.south west] (o) {Dummy text};
    node[below right=1cm and 2cm of o.south east] (y) {Hello World};
    draw (x.west)--(o.east)--(y.west);
    end{tikzpicture}
    end{document}


    enter image description here



    This way use the standard command for inserting strings to TikZ pictures: node. However, aligning the texts and controlling the positions are not really easy IMHO. You need positioning library.



    Method 3



    documentclass[tikz,margin=3mm]{standalone}
    usetikzlibrary{positioning}
    begin{document}
    begin{tikzpicture}
    coordinate[label=right: Something] (x);
    coordinate[label=right: Hello World,below=2cm of x] (y);
    coordinate[label=left: Dummy text,below left=1cm and 2cm of x] (o);
    draw (x)--(o)--(y);
    end{tikzpicture}
    end{document}


    enter image description here



    This way uses coordinate command with label option.






    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%2f476706%2fthe-coordinates-for-a-text-node-in-tikz-specifies-the-centre-of-the-box-is-ther%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









      2














      You could use anchor=west to specify the location of the box via its leftmost point, or just right.



      documentclass{article}
      usepackage{tikz}
      usepackage{tipa}
      begin{document}
      begin{tikzpicture}
      node at (2,4) {/p/};
      draw (2.5,4) -- (5,5) node[right,align=left] {textipa{[b]} / [+voice] __ [+voice]};
      draw (2.5,4) -- (5,3) node[right,align=left] {[p] / elsewhere};
      end{tikzpicture}

      begin{tikzpicture}
      node at (2,4) {/p/};
      draw (2.5,4) -- (5,5) node[anchor=west,align=left] {textipa{[b]} / [+voice] __ [+voice]};
      draw (2.5,4) -- (5,3) node[anchor=west,align=left] {[p] / elsewhere};
      end{tikzpicture}
      end{document}


      enter image description here






      share|improve this answer




























        2














        You could use anchor=west to specify the location of the box via its leftmost point, or just right.



        documentclass{article}
        usepackage{tikz}
        usepackage{tipa}
        begin{document}
        begin{tikzpicture}
        node at (2,4) {/p/};
        draw (2.5,4) -- (5,5) node[right,align=left] {textipa{[b]} / [+voice] __ [+voice]};
        draw (2.5,4) -- (5,3) node[right,align=left] {[p] / elsewhere};
        end{tikzpicture}

        begin{tikzpicture}
        node at (2,4) {/p/};
        draw (2.5,4) -- (5,5) node[anchor=west,align=left] {textipa{[b]} / [+voice] __ [+voice]};
        draw (2.5,4) -- (5,3) node[anchor=west,align=left] {[p] / elsewhere};
        end{tikzpicture}
        end{document}


        enter image description here






        share|improve this answer


























          2












          2








          2







          You could use anchor=west to specify the location of the box via its leftmost point, or just right.



          documentclass{article}
          usepackage{tikz}
          usepackage{tipa}
          begin{document}
          begin{tikzpicture}
          node at (2,4) {/p/};
          draw (2.5,4) -- (5,5) node[right,align=left] {textipa{[b]} / [+voice] __ [+voice]};
          draw (2.5,4) -- (5,3) node[right,align=left] {[p] / elsewhere};
          end{tikzpicture}

          begin{tikzpicture}
          node at (2,4) {/p/};
          draw (2.5,4) -- (5,5) node[anchor=west,align=left] {textipa{[b]} / [+voice] __ [+voice]};
          draw (2.5,4) -- (5,3) node[anchor=west,align=left] {[p] / elsewhere};
          end{tikzpicture}
          end{document}


          enter image description here






          share|improve this answer













          You could use anchor=west to specify the location of the box via its leftmost point, or just right.



          documentclass{article}
          usepackage{tikz}
          usepackage{tipa}
          begin{document}
          begin{tikzpicture}
          node at (2,4) {/p/};
          draw (2.5,4) -- (5,5) node[right,align=left] {textipa{[b]} / [+voice] __ [+voice]};
          draw (2.5,4) -- (5,3) node[right,align=left] {[p] / elsewhere};
          end{tikzpicture}

          begin{tikzpicture}
          node at (2,4) {/p/};
          draw (2.5,4) -- (5,5) node[anchor=west,align=left] {textipa{[b]} / [+voice] __ [+voice]};
          draw (2.5,4) -- (5,3) node[anchor=west,align=left] {[p] / elsewhere};
          end{tikzpicture}
          end{document}


          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 26 at 6:15









          marmotmarmot

          106k4127242




          106k4127242























              1














              There are many ways to do that, besides of marmot's methods. Here are three of them (I will add more if I find one in the future).



              Method 1



              documentclass[tikz,margin=3mm]{standalone}
              begin{document}
              begin{tikzpicture}
              draw (0,0) node[right] {Something} -- (-2,-1) node[left] {Dummy text} -- (0,-2) node[right] {Hello World};
              end{tikzpicture}
              end{document}


              enter image description here



              You can use polar coordinates instead of Cartesian coordinates. Also, this way is quite natural (I prefer this way) and doesn't require any TikZ libraries. However, this is not quite a standard way (draw is not supposed to do this stuff, as far as I know).



              Method 2



              documentclass[tikz,margin=3mm]{standalone}
              usetikzlibrary{positioning}
              begin{document}
              begin{tikzpicture}
              node (x) {Something};
              node[below left=1cm and 2cm of x.south west] (o) {Dummy text};
              node[below right=1cm and 2cm of o.south east] (y) {Hello World};
              draw (x.west)--(o.east)--(y.west);
              end{tikzpicture}
              end{document}


              enter image description here



              This way use the standard command for inserting strings to TikZ pictures: node. However, aligning the texts and controlling the positions are not really easy IMHO. You need positioning library.



              Method 3



              documentclass[tikz,margin=3mm]{standalone}
              usetikzlibrary{positioning}
              begin{document}
              begin{tikzpicture}
              coordinate[label=right: Something] (x);
              coordinate[label=right: Hello World,below=2cm of x] (y);
              coordinate[label=left: Dummy text,below left=1cm and 2cm of x] (o);
              draw (x)--(o)--(y);
              end{tikzpicture}
              end{document}


              enter image description here



              This way uses coordinate command with label option.






              share|improve this answer






























                1














                There are many ways to do that, besides of marmot's methods. Here are three of them (I will add more if I find one in the future).



                Method 1



                documentclass[tikz,margin=3mm]{standalone}
                begin{document}
                begin{tikzpicture}
                draw (0,0) node[right] {Something} -- (-2,-1) node[left] {Dummy text} -- (0,-2) node[right] {Hello World};
                end{tikzpicture}
                end{document}


                enter image description here



                You can use polar coordinates instead of Cartesian coordinates. Also, this way is quite natural (I prefer this way) and doesn't require any TikZ libraries. However, this is not quite a standard way (draw is not supposed to do this stuff, as far as I know).



                Method 2



                documentclass[tikz,margin=3mm]{standalone}
                usetikzlibrary{positioning}
                begin{document}
                begin{tikzpicture}
                node (x) {Something};
                node[below left=1cm and 2cm of x.south west] (o) {Dummy text};
                node[below right=1cm and 2cm of o.south east] (y) {Hello World};
                draw (x.west)--(o.east)--(y.west);
                end{tikzpicture}
                end{document}


                enter image description here



                This way use the standard command for inserting strings to TikZ pictures: node. However, aligning the texts and controlling the positions are not really easy IMHO. You need positioning library.



                Method 3



                documentclass[tikz,margin=3mm]{standalone}
                usetikzlibrary{positioning}
                begin{document}
                begin{tikzpicture}
                coordinate[label=right: Something] (x);
                coordinate[label=right: Hello World,below=2cm of x] (y);
                coordinate[label=left: Dummy text,below left=1cm and 2cm of x] (o);
                draw (x)--(o)--(y);
                end{tikzpicture}
                end{document}


                enter image description here



                This way uses coordinate command with label option.






                share|improve this answer




























                  1












                  1








                  1







                  There are many ways to do that, besides of marmot's methods. Here are three of them (I will add more if I find one in the future).



                  Method 1



                  documentclass[tikz,margin=3mm]{standalone}
                  begin{document}
                  begin{tikzpicture}
                  draw (0,0) node[right] {Something} -- (-2,-1) node[left] {Dummy text} -- (0,-2) node[right] {Hello World};
                  end{tikzpicture}
                  end{document}


                  enter image description here



                  You can use polar coordinates instead of Cartesian coordinates. Also, this way is quite natural (I prefer this way) and doesn't require any TikZ libraries. However, this is not quite a standard way (draw is not supposed to do this stuff, as far as I know).



                  Method 2



                  documentclass[tikz,margin=3mm]{standalone}
                  usetikzlibrary{positioning}
                  begin{document}
                  begin{tikzpicture}
                  node (x) {Something};
                  node[below left=1cm and 2cm of x.south west] (o) {Dummy text};
                  node[below right=1cm and 2cm of o.south east] (y) {Hello World};
                  draw (x.west)--(o.east)--(y.west);
                  end{tikzpicture}
                  end{document}


                  enter image description here



                  This way use the standard command for inserting strings to TikZ pictures: node. However, aligning the texts and controlling the positions are not really easy IMHO. You need positioning library.



                  Method 3



                  documentclass[tikz,margin=3mm]{standalone}
                  usetikzlibrary{positioning}
                  begin{document}
                  begin{tikzpicture}
                  coordinate[label=right: Something] (x);
                  coordinate[label=right: Hello World,below=2cm of x] (y);
                  coordinate[label=left: Dummy text,below left=1cm and 2cm of x] (o);
                  draw (x)--(o)--(y);
                  end{tikzpicture}
                  end{document}


                  enter image description here



                  This way uses coordinate command with label option.






                  share|improve this answer















                  There are many ways to do that, besides of marmot's methods. Here are three of them (I will add more if I find one in the future).



                  Method 1



                  documentclass[tikz,margin=3mm]{standalone}
                  begin{document}
                  begin{tikzpicture}
                  draw (0,0) node[right] {Something} -- (-2,-1) node[left] {Dummy text} -- (0,-2) node[right] {Hello World};
                  end{tikzpicture}
                  end{document}


                  enter image description here



                  You can use polar coordinates instead of Cartesian coordinates. Also, this way is quite natural (I prefer this way) and doesn't require any TikZ libraries. However, this is not quite a standard way (draw is not supposed to do this stuff, as far as I know).



                  Method 2



                  documentclass[tikz,margin=3mm]{standalone}
                  usetikzlibrary{positioning}
                  begin{document}
                  begin{tikzpicture}
                  node (x) {Something};
                  node[below left=1cm and 2cm of x.south west] (o) {Dummy text};
                  node[below right=1cm and 2cm of o.south east] (y) {Hello World};
                  draw (x.west)--(o.east)--(y.west);
                  end{tikzpicture}
                  end{document}


                  enter image description here



                  This way use the standard command for inserting strings to TikZ pictures: node. However, aligning the texts and controlling the positions are not really easy IMHO. You need positioning library.



                  Method 3



                  documentclass[tikz,margin=3mm]{standalone}
                  usetikzlibrary{positioning}
                  begin{document}
                  begin{tikzpicture}
                  coordinate[label=right: Something] (x);
                  coordinate[label=right: Hello World,below=2cm of x] (y);
                  coordinate[label=left: Dummy text,below left=1cm and 2cm of x] (o);
                  draw (x)--(o)--(y);
                  end{tikzpicture}
                  end{document}


                  enter image description here



                  This way uses coordinate command with label option.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Feb 26 at 6:45

























                  answered Feb 26 at 6:22









                  JouleVJouleV

                  4,88611139




                  4,88611139






























                      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%2f476706%2fthe-coordinates-for-a-text-node-in-tikz-specifies-the-centre-of-the-box-is-ther%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

                      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?