Moving a point along a “multi-node path”How can I fix jumping TikZ pictures in beamer?Draw an animated gif of trigonometry functionIncrease the thickness of node border in TikZHow to define the default vertical distance between nodes?Preserve node and font size when scalingTikZ scaling graphic and adjust node position and keep font sizeInput/Output Nodes - Specification and Description LanguageTikZ: Drawing an arc from an intersection to an intersectionDraw nodes with path in tikzLine up nested tikz enviroments or how to get rid of themThe order of execution of options (draw & font), pgfextra, and a node along a TikZ pathInclude node at end point tikz decorations

What does it mean by "d-ism of Leibniz" and "dotage of Newton" in simple English?

Is there a rule that prohibits us from using 2 possessives in a row?

Computing the differentials in the Adams spectral sequence

What is the correct expression of 10/20, 20/30, 30/40 etc?

Will dual-learning in a glider make my airplane learning safer?

How can Iron Man's suit withstand this?

Can an old DSLR be upgraded to match modern smartphone image quality

Credit card offering 0.5 miles for every cent rounded up. Too good to be true?

What happens if you do emergency landing on a US base in middle of the ocean?

Access to all elements on the page

Accidentally cashed a check twice

Is it OK to bring delicacies from hometown as tokens of gratitude for an out-of-town interview?

PhD student with mental health issues and bad performance

Chopin: marche funèbre bar 15 impossible place

Could a guilty Boris Johnson be used to cancel Brexit?

Anyone teach web development? How do you assess it?

Is it a problem that pull requests are approved without any comments

Why were the Night's Watch required to be celibate?

Unconventional Opposites

You've spoiled/damaged the card

Setting extra bits in a bool makes it true and false at the same time

What is a simple, physical situation where complex numbers emerge naturally?

Explain Ant-Man's "not it" scene from Avengers: Endgame

Get value of the passed argument to script importing variables from another script



Moving a point along a “multi-node path”


How can I fix jumping TikZ pictures in beamer?Draw an animated gif of trigonometry functionIncrease the thickness of node border in TikZHow to define the default vertical distance between nodes?Preserve node and font size when scalingTikZ scaling graphic and adjust node position and keep font sizeInput/Output Nodes - Specification and Description LanguageTikZ: Drawing an arc from an intersection to an intersectionDraw nodes with path in tikzLine up nested tikz enviroments or how to get rid of themThe order of execution of options (draw & font), pgfextra, and a node along a TikZ pathInclude node at end point tikz decorations













5















I would like to create a gif (as explained in this answer) of a point moving along a crooked "multi-node path". I would like this path to be specified as below: a sequence of nodes connected by edges. In the iteration I would like to specify nodes along this "multi-node path" as in node[pos=n, above] x.



I have a solution but it's not easily scalable: if I want more nodes along the path I have to change it by hand. Also there is a problem with the window shifting up and down as the point moves along the path.



enter image description here



I could do this by having as many for loops as there are edges, and placing the node[pos=n, above] x on the relevant edge every time, but I'd like to have a more generic solution where I don't have to know in advance how long the "multi-node path" will be, something like the following (which doesn't work):



documentclass[tikz]standalone
usepackagetikz
usetikzlibraryintersections
begindocument

foreach n in 0,0.05,...,1
begintikzpicture
draw[name path=mypath]
(0,0) -- ++ (1,2)
-- ++ (1,.5)
-- ++ (1,-1)
-- ++ (1,0)
-- ++ (1,-4);
draw (mypath) node [draw=black, fill=red, circle]
node [pos=n, above] x;
endtikzpicture


enddocument


My current solution is ugly :( :



documentclass[tikz, border=.5cm]standalone
usepackagetikz
begindocument

foreach n in 0,0.1,...,.9
begintikzpicture
draw
(0,0) -- node [circle, fill=red, draw=black, pos=n, inner sep = 0, minimum size = 4pt] node [pos=n, above] x ++ (1,2)
-- ++ (1,.5)
-- ++ (1,-1)
-- ++ (1,0)
-- ++ (1,-4);
endtikzpicture


foreach n in 0,0.1,...,.9
begintikzpicture
draw
(0,0) -- ++ (1,2)
-- node [circle, fill=red, draw=black, pos=n, inner sep = 0, minimum size = 4pt] node [pos=n, above] x ++ (1,.5)
-- ++ (1,-1)
-- ++ (1,0)
-- ++ (1,-4);
endtikzpicture


foreach n in 0,0.1,...,.9
begintikzpicture
draw
(0,0) -- ++ (1,2)
-- ++ (1,.5)
-- node [circle, fill=red, draw=black, pos=n, inner sep = 0, minimum size = 4pt] node [pos=n, above] x ++ (1,-1)
-- ++ (1,0)
-- ++ (1,-4);
endtikzpicture


foreach n in 0,0.1,...,.9
begintikzpicture
draw
(0,0) -- ++ (1,2)
-- ++ (1,.5)
-- ++ (1,-1)
-- node [circle, fill=red, draw=black, pos=n, inner sep = 0, minimum size = 4pt] node [pos=n, above] x ++ (1,0)
-- ++ (1,-4);
endtikzpicture


foreach n in 0,0.1,...,.9
begintikzpicture
draw
(0,0) -- ++ (1,2)
-- ++ (1,.5)
-- ++ (1,-1)
-- ++ (1,0)
-- node [circle, fill=red, draw=black, pos=n, inner sep = 0, minimum size = 4pt] node [pos=n, above] x ++ (1,-4);
endtikzpicture


begintikzpicture
draw
(0,0) -- ++ (1,2)
-- ++ (1,.5)
-- ++ (1,-1)
-- ++ (1,0)
-- node [circle, fill=red, draw=black, pos=1, inner sep = 0, minimum size = 4pt] node [pos=1, above] x ++ (1,-4);
endtikzpicture

enddocument









share|improve this question




























    5















    I would like to create a gif (as explained in this answer) of a point moving along a crooked "multi-node path". I would like this path to be specified as below: a sequence of nodes connected by edges. In the iteration I would like to specify nodes along this "multi-node path" as in node[pos=n, above] x.



    I have a solution but it's not easily scalable: if I want more nodes along the path I have to change it by hand. Also there is a problem with the window shifting up and down as the point moves along the path.



    enter image description here



    I could do this by having as many for loops as there are edges, and placing the node[pos=n, above] x on the relevant edge every time, but I'd like to have a more generic solution where I don't have to know in advance how long the "multi-node path" will be, something like the following (which doesn't work):



    documentclass[tikz]standalone
    usepackagetikz
    usetikzlibraryintersections
    begindocument

    foreach n in 0,0.05,...,1
    begintikzpicture
    draw[name path=mypath]
    (0,0) -- ++ (1,2)
    -- ++ (1,.5)
    -- ++ (1,-1)
    -- ++ (1,0)
    -- ++ (1,-4);
    draw (mypath) node [draw=black, fill=red, circle]
    node [pos=n, above] x;
    endtikzpicture


    enddocument


    My current solution is ugly :( :



    documentclass[tikz, border=.5cm]standalone
    usepackagetikz
    begindocument

    foreach n in 0,0.1,...,.9
    begintikzpicture
    draw
    (0,0) -- node [circle, fill=red, draw=black, pos=n, inner sep = 0, minimum size = 4pt] node [pos=n, above] x ++ (1,2)
    -- ++ (1,.5)
    -- ++ (1,-1)
    -- ++ (1,0)
    -- ++ (1,-4);
    endtikzpicture


    foreach n in 0,0.1,...,.9
    begintikzpicture
    draw
    (0,0) -- ++ (1,2)
    -- node [circle, fill=red, draw=black, pos=n, inner sep = 0, minimum size = 4pt] node [pos=n, above] x ++ (1,.5)
    -- ++ (1,-1)
    -- ++ (1,0)
    -- ++ (1,-4);
    endtikzpicture


    foreach n in 0,0.1,...,.9
    begintikzpicture
    draw
    (0,0) -- ++ (1,2)
    -- ++ (1,.5)
    -- node [circle, fill=red, draw=black, pos=n, inner sep = 0, minimum size = 4pt] node [pos=n, above] x ++ (1,-1)
    -- ++ (1,0)
    -- ++ (1,-4);
    endtikzpicture


    foreach n in 0,0.1,...,.9
    begintikzpicture
    draw
    (0,0) -- ++ (1,2)
    -- ++ (1,.5)
    -- ++ (1,-1)
    -- node [circle, fill=red, draw=black, pos=n, inner sep = 0, minimum size = 4pt] node [pos=n, above] x ++ (1,0)
    -- ++ (1,-4);
    endtikzpicture


    foreach n in 0,0.1,...,.9
    begintikzpicture
    draw
    (0,0) -- ++ (1,2)
    -- ++ (1,.5)
    -- ++ (1,-1)
    -- ++ (1,0)
    -- node [circle, fill=red, draw=black, pos=n, inner sep = 0, minimum size = 4pt] node [pos=n, above] x ++ (1,-4);
    endtikzpicture


    begintikzpicture
    draw
    (0,0) -- ++ (1,2)
    -- ++ (1,.5)
    -- ++ (1,-1)
    -- ++ (1,0)
    -- node [circle, fill=red, draw=black, pos=1, inner sep = 0, minimum size = 4pt] node [pos=1, above] x ++ (1,-4);
    endtikzpicture

    enddocument









    share|improve this question


























      5












      5








      5








      I would like to create a gif (as explained in this answer) of a point moving along a crooked "multi-node path". I would like this path to be specified as below: a sequence of nodes connected by edges. In the iteration I would like to specify nodes along this "multi-node path" as in node[pos=n, above] x.



      I have a solution but it's not easily scalable: if I want more nodes along the path I have to change it by hand. Also there is a problem with the window shifting up and down as the point moves along the path.



      enter image description here



      I could do this by having as many for loops as there are edges, and placing the node[pos=n, above] x on the relevant edge every time, but I'd like to have a more generic solution where I don't have to know in advance how long the "multi-node path" will be, something like the following (which doesn't work):



      documentclass[tikz]standalone
      usepackagetikz
      usetikzlibraryintersections
      begindocument

      foreach n in 0,0.05,...,1
      begintikzpicture
      draw[name path=mypath]
      (0,0) -- ++ (1,2)
      -- ++ (1,.5)
      -- ++ (1,-1)
      -- ++ (1,0)
      -- ++ (1,-4);
      draw (mypath) node [draw=black, fill=red, circle]
      node [pos=n, above] x;
      endtikzpicture


      enddocument


      My current solution is ugly :( :



      documentclass[tikz, border=.5cm]standalone
      usepackagetikz
      begindocument

      foreach n in 0,0.1,...,.9
      begintikzpicture
      draw
      (0,0) -- node [circle, fill=red, draw=black, pos=n, inner sep = 0, minimum size = 4pt] node [pos=n, above] x ++ (1,2)
      -- ++ (1,.5)
      -- ++ (1,-1)
      -- ++ (1,0)
      -- ++ (1,-4);
      endtikzpicture


      foreach n in 0,0.1,...,.9
      begintikzpicture
      draw
      (0,0) -- ++ (1,2)
      -- node [circle, fill=red, draw=black, pos=n, inner sep = 0, minimum size = 4pt] node [pos=n, above] x ++ (1,.5)
      -- ++ (1,-1)
      -- ++ (1,0)
      -- ++ (1,-4);
      endtikzpicture


      foreach n in 0,0.1,...,.9
      begintikzpicture
      draw
      (0,0) -- ++ (1,2)
      -- ++ (1,.5)
      -- node [circle, fill=red, draw=black, pos=n, inner sep = 0, minimum size = 4pt] node [pos=n, above] x ++ (1,-1)
      -- ++ (1,0)
      -- ++ (1,-4);
      endtikzpicture


      foreach n in 0,0.1,...,.9
      begintikzpicture
      draw
      (0,0) -- ++ (1,2)
      -- ++ (1,.5)
      -- ++ (1,-1)
      -- node [circle, fill=red, draw=black, pos=n, inner sep = 0, minimum size = 4pt] node [pos=n, above] x ++ (1,0)
      -- ++ (1,-4);
      endtikzpicture


      foreach n in 0,0.1,...,.9
      begintikzpicture
      draw
      (0,0) -- ++ (1,2)
      -- ++ (1,.5)
      -- ++ (1,-1)
      -- ++ (1,0)
      -- node [circle, fill=red, draw=black, pos=n, inner sep = 0, minimum size = 4pt] node [pos=n, above] x ++ (1,-4);
      endtikzpicture


      begintikzpicture
      draw
      (0,0) -- ++ (1,2)
      -- ++ (1,.5)
      -- ++ (1,-1)
      -- ++ (1,0)
      -- node [circle, fill=red, draw=black, pos=1, inner sep = 0, minimum size = 4pt] node [pos=1, above] x ++ (1,-4);
      endtikzpicture

      enddocument









      share|improve this question
















      I would like to create a gif (as explained in this answer) of a point moving along a crooked "multi-node path". I would like this path to be specified as below: a sequence of nodes connected by edges. In the iteration I would like to specify nodes along this "multi-node path" as in node[pos=n, above] x.



      I have a solution but it's not easily scalable: if I want more nodes along the path I have to change it by hand. Also there is a problem with the window shifting up and down as the point moves along the path.



      enter image description here



      I could do this by having as many for loops as there are edges, and placing the node[pos=n, above] x on the relevant edge every time, but I'd like to have a more generic solution where I don't have to know in advance how long the "multi-node path" will be, something like the following (which doesn't work):



      documentclass[tikz]standalone
      usepackagetikz
      usetikzlibraryintersections
      begindocument

      foreach n in 0,0.05,...,1
      begintikzpicture
      draw[name path=mypath]
      (0,0) -- ++ (1,2)
      -- ++ (1,.5)
      -- ++ (1,-1)
      -- ++ (1,0)
      -- ++ (1,-4);
      draw (mypath) node [draw=black, fill=red, circle]
      node [pos=n, above] x;
      endtikzpicture


      enddocument


      My current solution is ugly :( :



      documentclass[tikz, border=.5cm]standalone
      usepackagetikz
      begindocument

      foreach n in 0,0.1,...,.9
      begintikzpicture
      draw
      (0,0) -- node [circle, fill=red, draw=black, pos=n, inner sep = 0, minimum size = 4pt] node [pos=n, above] x ++ (1,2)
      -- ++ (1,.5)
      -- ++ (1,-1)
      -- ++ (1,0)
      -- ++ (1,-4);
      endtikzpicture


      foreach n in 0,0.1,...,.9
      begintikzpicture
      draw
      (0,0) -- ++ (1,2)
      -- node [circle, fill=red, draw=black, pos=n, inner sep = 0, minimum size = 4pt] node [pos=n, above] x ++ (1,.5)
      -- ++ (1,-1)
      -- ++ (1,0)
      -- ++ (1,-4);
      endtikzpicture


      foreach n in 0,0.1,...,.9
      begintikzpicture
      draw
      (0,0) -- ++ (1,2)
      -- ++ (1,.5)
      -- node [circle, fill=red, draw=black, pos=n, inner sep = 0, minimum size = 4pt] node [pos=n, above] x ++ (1,-1)
      -- ++ (1,0)
      -- ++ (1,-4);
      endtikzpicture


      foreach n in 0,0.1,...,.9
      begintikzpicture
      draw
      (0,0) -- ++ (1,2)
      -- ++ (1,.5)
      -- ++ (1,-1)
      -- node [circle, fill=red, draw=black, pos=n, inner sep = 0, minimum size = 4pt] node [pos=n, above] x ++ (1,0)
      -- ++ (1,-4);
      endtikzpicture


      foreach n in 0,0.1,...,.9
      begintikzpicture
      draw
      (0,0) -- ++ (1,2)
      -- ++ (1,.5)
      -- ++ (1,-1)
      -- ++ (1,0)
      -- node [circle, fill=red, draw=black, pos=n, inner sep = 0, minimum size = 4pt] node [pos=n, above] x ++ (1,-4);
      endtikzpicture


      begintikzpicture
      draw
      (0,0) -- ++ (1,2)
      -- ++ (1,.5)
      -- ++ (1,-1)
      -- ++ (1,0)
      -- node [circle, fill=red, draw=black, pos=1, inner sep = 0, minimum size = 4pt] node [pos=1, above] x ++ (1,-4);
      endtikzpicture

      enddocument






      tikz-pgf positioning tikz-path






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited May 25 at 0:13







      Olivier Bégassat

















      asked May 24 at 23:59









      Olivier BégassatOlivier Bégassat

      91721019




      91721019




















          2 Answers
          2






          active

          oldest

          votes


















          6














          Use decorations.markings and the overlay option. The overlay option pretends that the object has zero size and therefore doesn't add to the bounding box. Because the nodes are now going outside the bounding box of the path, you have to add a border around the drawing so it doesn't fall off the page.



          documentclass[tikz,border=10pt]standalone
          usepackagetikz
          usetikzlibrarydecorations.markings
          begindocument

          foreach n in 0,0.05,...,1
          begintikzpicture
          draw
          [postaction=decorate,
          decoration=
          markings,
          mark=at position n with
          draw [overlay, draw=black, fill=red] circle (2pt);
          node [overlay, above] x;

          ]
          (0,0) -- ++ (1,2)
          -- ++ (1,.5)
          -- ++ (1,-1)
          -- ++ (1,0)
          -- ++ (1,-4);
          endtikzpicture


          enddocument


          enter image description here






          share|improve this answer























          • Excellent :) Thank you!

            – Olivier Bégassat
            May 25 at 8:58


















          4














          Very similar to Henri Menke's great answer with a small tilt: the bounding box gets recorded and the maximal bounding box of all iterations gets applied. You need to compile twice that it works. The code is more complex but the bounding box gets only increased in the directions in which it is needed. This code is somewhat similar to this nice answer which addresses a similar problem.



          documentclass[tikz]standalone
          usetikzlibrarydecorations.markings,calc
          begindocument
          pgfmathsetmacroxmin0
          pgfmathsetmacroxmax0
          pgfmathsetmacroymin0
          pgfmathsetmacroymax0
          foreach X in 0,0.05,...,1
          begintikzpicture
          ifdefinedfigbbrelax
          path figbb;
          fi
          draw
          [postaction=decorate,
          decoration=
          markings,
          mark=at position X with
          node [circle,inner sep=2pt,draw,fill=red,label=above:$x$];

          ]
          (0,0) -- ++ (1,2)
          -- ++ (1,.5)
          -- ++ (1,-1)
          -- ++ (1,0)
          -- ++ (1,-4);
          path let p1=(current bounding box.south west),
          p2=(current bounding box.north east)
          in pgfextra%
          pgfmathsetmacroxminmin(x1,xmin)
          pgfmathsetmacroxmaxmax(x2,xmax)
          pgfmathsetmacroyminmin(y1,ymin)
          pgfmathsetmacroymaxmax(y2,ymax)
          xdefxminxmin pt
          xdefxmaxxmax pt
          xdefyminymin pt
          xdefymaxymax pt
          ;
          endtikzpicture

          makeatletter
          edeffigbb(xmin,ymin) rectangle (xmax,ymax)
          immediatewrite@mainauxxdefstringfigbbfigbbrelax
          makeatother
          enddocument


          enter image description here






          share|improve this answer























          • Thank you marmot :)

            – Olivier Bégassat
            May 25 at 8:59











          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%2f492532%2fmoving-a-point-along-a-multi-node-path%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









          6














          Use decorations.markings and the overlay option. The overlay option pretends that the object has zero size and therefore doesn't add to the bounding box. Because the nodes are now going outside the bounding box of the path, you have to add a border around the drawing so it doesn't fall off the page.



          documentclass[tikz,border=10pt]standalone
          usepackagetikz
          usetikzlibrarydecorations.markings
          begindocument

          foreach n in 0,0.05,...,1
          begintikzpicture
          draw
          [postaction=decorate,
          decoration=
          markings,
          mark=at position n with
          draw [overlay, draw=black, fill=red] circle (2pt);
          node [overlay, above] x;

          ]
          (0,0) -- ++ (1,2)
          -- ++ (1,.5)
          -- ++ (1,-1)
          -- ++ (1,0)
          -- ++ (1,-4);
          endtikzpicture


          enddocument


          enter image description here






          share|improve this answer























          • Excellent :) Thank you!

            – Olivier Bégassat
            May 25 at 8:58















          6














          Use decorations.markings and the overlay option. The overlay option pretends that the object has zero size and therefore doesn't add to the bounding box. Because the nodes are now going outside the bounding box of the path, you have to add a border around the drawing so it doesn't fall off the page.



          documentclass[tikz,border=10pt]standalone
          usepackagetikz
          usetikzlibrarydecorations.markings
          begindocument

          foreach n in 0,0.05,...,1
          begintikzpicture
          draw
          [postaction=decorate,
          decoration=
          markings,
          mark=at position n with
          draw [overlay, draw=black, fill=red] circle (2pt);
          node [overlay, above] x;

          ]
          (0,0) -- ++ (1,2)
          -- ++ (1,.5)
          -- ++ (1,-1)
          -- ++ (1,0)
          -- ++ (1,-4);
          endtikzpicture


          enddocument


          enter image description here






          share|improve this answer























          • Excellent :) Thank you!

            – Olivier Bégassat
            May 25 at 8:58













          6












          6








          6







          Use decorations.markings and the overlay option. The overlay option pretends that the object has zero size and therefore doesn't add to the bounding box. Because the nodes are now going outside the bounding box of the path, you have to add a border around the drawing so it doesn't fall off the page.



          documentclass[tikz,border=10pt]standalone
          usepackagetikz
          usetikzlibrarydecorations.markings
          begindocument

          foreach n in 0,0.05,...,1
          begintikzpicture
          draw
          [postaction=decorate,
          decoration=
          markings,
          mark=at position n with
          draw [overlay, draw=black, fill=red] circle (2pt);
          node [overlay, above] x;

          ]
          (0,0) -- ++ (1,2)
          -- ++ (1,.5)
          -- ++ (1,-1)
          -- ++ (1,0)
          -- ++ (1,-4);
          endtikzpicture


          enddocument


          enter image description here






          share|improve this answer













          Use decorations.markings and the overlay option. The overlay option pretends that the object has zero size and therefore doesn't add to the bounding box. Because the nodes are now going outside the bounding box of the path, you have to add a border around the drawing so it doesn't fall off the page.



          documentclass[tikz,border=10pt]standalone
          usepackagetikz
          usetikzlibrarydecorations.markings
          begindocument

          foreach n in 0,0.05,...,1
          begintikzpicture
          draw
          [postaction=decorate,
          decoration=
          markings,
          mark=at position n with
          draw [overlay, draw=black, fill=red] circle (2pt);
          node [overlay, above] x;

          ]
          (0,0) -- ++ (1,2)
          -- ++ (1,.5)
          -- ++ (1,-1)
          -- ++ (1,0)
          -- ++ (1,-4);
          endtikzpicture


          enddocument


          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered May 25 at 2:42









          Henri MenkeHenri Menke

          79.7k9175288




          79.7k9175288












          • Excellent :) Thank you!

            – Olivier Bégassat
            May 25 at 8:58

















          • Excellent :) Thank you!

            – Olivier Bégassat
            May 25 at 8:58
















          Excellent :) Thank you!

          – Olivier Bégassat
          May 25 at 8:58





          Excellent :) Thank you!

          – Olivier Bégassat
          May 25 at 8:58











          4














          Very similar to Henri Menke's great answer with a small tilt: the bounding box gets recorded and the maximal bounding box of all iterations gets applied. You need to compile twice that it works. The code is more complex but the bounding box gets only increased in the directions in which it is needed. This code is somewhat similar to this nice answer which addresses a similar problem.



          documentclass[tikz]standalone
          usetikzlibrarydecorations.markings,calc
          begindocument
          pgfmathsetmacroxmin0
          pgfmathsetmacroxmax0
          pgfmathsetmacroymin0
          pgfmathsetmacroymax0
          foreach X in 0,0.05,...,1
          begintikzpicture
          ifdefinedfigbbrelax
          path figbb;
          fi
          draw
          [postaction=decorate,
          decoration=
          markings,
          mark=at position X with
          node [circle,inner sep=2pt,draw,fill=red,label=above:$x$];

          ]
          (0,0) -- ++ (1,2)
          -- ++ (1,.5)
          -- ++ (1,-1)
          -- ++ (1,0)
          -- ++ (1,-4);
          path let p1=(current bounding box.south west),
          p2=(current bounding box.north east)
          in pgfextra%
          pgfmathsetmacroxminmin(x1,xmin)
          pgfmathsetmacroxmaxmax(x2,xmax)
          pgfmathsetmacroyminmin(y1,ymin)
          pgfmathsetmacroymaxmax(y2,ymax)
          xdefxminxmin pt
          xdefxmaxxmax pt
          xdefyminymin pt
          xdefymaxymax pt
          ;
          endtikzpicture

          makeatletter
          edeffigbb(xmin,ymin) rectangle (xmax,ymax)
          immediatewrite@mainauxxdefstringfigbbfigbbrelax
          makeatother
          enddocument


          enter image description here






          share|improve this answer























          • Thank you marmot :)

            – Olivier Bégassat
            May 25 at 8:59















          4














          Very similar to Henri Menke's great answer with a small tilt: the bounding box gets recorded and the maximal bounding box of all iterations gets applied. You need to compile twice that it works. The code is more complex but the bounding box gets only increased in the directions in which it is needed. This code is somewhat similar to this nice answer which addresses a similar problem.



          documentclass[tikz]standalone
          usetikzlibrarydecorations.markings,calc
          begindocument
          pgfmathsetmacroxmin0
          pgfmathsetmacroxmax0
          pgfmathsetmacroymin0
          pgfmathsetmacroymax0
          foreach X in 0,0.05,...,1
          begintikzpicture
          ifdefinedfigbbrelax
          path figbb;
          fi
          draw
          [postaction=decorate,
          decoration=
          markings,
          mark=at position X with
          node [circle,inner sep=2pt,draw,fill=red,label=above:$x$];

          ]
          (0,0) -- ++ (1,2)
          -- ++ (1,.5)
          -- ++ (1,-1)
          -- ++ (1,0)
          -- ++ (1,-4);
          path let p1=(current bounding box.south west),
          p2=(current bounding box.north east)
          in pgfextra%
          pgfmathsetmacroxminmin(x1,xmin)
          pgfmathsetmacroxmaxmax(x2,xmax)
          pgfmathsetmacroyminmin(y1,ymin)
          pgfmathsetmacroymaxmax(y2,ymax)
          xdefxminxmin pt
          xdefxmaxxmax pt
          xdefyminymin pt
          xdefymaxymax pt
          ;
          endtikzpicture

          makeatletter
          edeffigbb(xmin,ymin) rectangle (xmax,ymax)
          immediatewrite@mainauxxdefstringfigbbfigbbrelax
          makeatother
          enddocument


          enter image description here






          share|improve this answer























          • Thank you marmot :)

            – Olivier Bégassat
            May 25 at 8:59













          4












          4








          4







          Very similar to Henri Menke's great answer with a small tilt: the bounding box gets recorded and the maximal bounding box of all iterations gets applied. You need to compile twice that it works. The code is more complex but the bounding box gets only increased in the directions in which it is needed. This code is somewhat similar to this nice answer which addresses a similar problem.



          documentclass[tikz]standalone
          usetikzlibrarydecorations.markings,calc
          begindocument
          pgfmathsetmacroxmin0
          pgfmathsetmacroxmax0
          pgfmathsetmacroymin0
          pgfmathsetmacroymax0
          foreach X in 0,0.05,...,1
          begintikzpicture
          ifdefinedfigbbrelax
          path figbb;
          fi
          draw
          [postaction=decorate,
          decoration=
          markings,
          mark=at position X with
          node [circle,inner sep=2pt,draw,fill=red,label=above:$x$];

          ]
          (0,0) -- ++ (1,2)
          -- ++ (1,.5)
          -- ++ (1,-1)
          -- ++ (1,0)
          -- ++ (1,-4);
          path let p1=(current bounding box.south west),
          p2=(current bounding box.north east)
          in pgfextra%
          pgfmathsetmacroxminmin(x1,xmin)
          pgfmathsetmacroxmaxmax(x2,xmax)
          pgfmathsetmacroyminmin(y1,ymin)
          pgfmathsetmacroymaxmax(y2,ymax)
          xdefxminxmin pt
          xdefxmaxxmax pt
          xdefyminymin pt
          xdefymaxymax pt
          ;
          endtikzpicture

          makeatletter
          edeffigbb(xmin,ymin) rectangle (xmax,ymax)
          immediatewrite@mainauxxdefstringfigbbfigbbrelax
          makeatother
          enddocument


          enter image description here






          share|improve this answer













          Very similar to Henri Menke's great answer with a small tilt: the bounding box gets recorded and the maximal bounding box of all iterations gets applied. You need to compile twice that it works. The code is more complex but the bounding box gets only increased in the directions in which it is needed. This code is somewhat similar to this nice answer which addresses a similar problem.



          documentclass[tikz]standalone
          usetikzlibrarydecorations.markings,calc
          begindocument
          pgfmathsetmacroxmin0
          pgfmathsetmacroxmax0
          pgfmathsetmacroymin0
          pgfmathsetmacroymax0
          foreach X in 0,0.05,...,1
          begintikzpicture
          ifdefinedfigbbrelax
          path figbb;
          fi
          draw
          [postaction=decorate,
          decoration=
          markings,
          mark=at position X with
          node [circle,inner sep=2pt,draw,fill=red,label=above:$x$];

          ]
          (0,0) -- ++ (1,2)
          -- ++ (1,.5)
          -- ++ (1,-1)
          -- ++ (1,0)
          -- ++ (1,-4);
          path let p1=(current bounding box.south west),
          p2=(current bounding box.north east)
          in pgfextra%
          pgfmathsetmacroxminmin(x1,xmin)
          pgfmathsetmacroxmaxmax(x2,xmax)
          pgfmathsetmacroyminmin(y1,ymin)
          pgfmathsetmacroymaxmax(y2,ymax)
          xdefxminxmin pt
          xdefxmaxxmax pt
          xdefyminymin pt
          xdefymaxymax pt
          ;
          endtikzpicture

          makeatletter
          edeffigbb(xmin,ymin) rectangle (xmax,ymax)
          immediatewrite@mainauxxdefstringfigbbfigbbrelax
          makeatother
          enddocument


          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered May 25 at 5:25









          marmotmarmot

          131k6166316




          131k6166316












          • Thank you marmot :)

            – Olivier Bégassat
            May 25 at 8:59

















          • Thank you marmot :)

            – Olivier Bégassat
            May 25 at 8:59
















          Thank you marmot :)

          – Olivier Bégassat
          May 25 at 8:59





          Thank you marmot :)

          – Olivier Bégassat
          May 25 at 8:59

















          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%2f492532%2fmoving-a-point-along-a-multi-node-path%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

          Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

          Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

          Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form