Straight line with arrows and dots












4















I am beginner for tikz package and I'd like to know how to draw following graph in LaTeX.



line with arrows and dots



Thanks in advance.










share|improve this question























  • Welcome to TeX.SX. Please read the introductory material for this site. When you post a question, please provide a "Minimal Working Example" (MWE) that starts with documentclass, includes all relevant usepackage commands, ends with end{document} and compiles without errors, even if it does not produce your desired output.

    – Sandy G
    10 hours ago











  • welcome to tex.se!

    – Zarko
    10 hours ago


















4















I am beginner for tikz package and I'd like to know how to draw following graph in LaTeX.



line with arrows and dots



Thanks in advance.










share|improve this question























  • Welcome to TeX.SX. Please read the introductory material for this site. When you post a question, please provide a "Minimal Working Example" (MWE) that starts with documentclass, includes all relevant usepackage commands, ends with end{document} and compiles without errors, even if it does not produce your desired output.

    – Sandy G
    10 hours ago











  • welcome to tex.se!

    – Zarko
    10 hours ago
















4












4








4


1






I am beginner for tikz package and I'd like to know how to draw following graph in LaTeX.



line with arrows and dots



Thanks in advance.










share|improve this question














I am beginner for tikz package and I'd like to know how to draw following graph in LaTeX.



line with arrows and dots



Thanks in advance.







tikz-pgf






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 10 hours ago









CandanCandan

234




234













  • Welcome to TeX.SX. Please read the introductory material for this site. When you post a question, please provide a "Minimal Working Example" (MWE) that starts with documentclass, includes all relevant usepackage commands, ends with end{document} and compiles without errors, even if it does not produce your desired output.

    – Sandy G
    10 hours ago











  • welcome to tex.se!

    – Zarko
    10 hours ago





















  • Welcome to TeX.SX. Please read the introductory material for this site. When you post a question, please provide a "Minimal Working Example" (MWE) that starts with documentclass, includes all relevant usepackage commands, ends with end{document} and compiles without errors, even if it does not produce your desired output.

    – Sandy G
    10 hours ago











  • welcome to tex.se!

    – Zarko
    10 hours ago



















Welcome to TeX.SX. Please read the introductory material for this site. When you post a question, please provide a "Minimal Working Example" (MWE) that starts with documentclass, includes all relevant usepackage commands, ends with end{document} and compiles without errors, even if it does not produce your desired output.

– Sandy G
10 hours ago





Welcome to TeX.SX. Please read the introductory material for this site. When you post a question, please provide a "Minimal Working Example" (MWE) that starts with documentclass, includes all relevant usepackage commands, ends with end{document} and compiles without errors, even if it does not produce your desired output.

– Sandy G
10 hours ago













welcome to tex.se!

– Zarko
10 hours ago







welcome to tex.se!

– Zarko
10 hours ago












2 Answers
2






active

oldest

votes


















9














A quick solution



documentclass[tikz]{standalone}
begin{document}
begin{tikzpicture}
fill (0,0) circle (1pt) node[below] {$n$} (2,0) circle (1pt) node[below] {$n+1$} (-2,0) circle (1pt) node[below] {$n-1$};
draw[-latex] (0,0)--(-1,0) node[above] {$n$};
draw[-latex] (0,0)--(1,0) node[above] {$a(n)$};
draw (-3,0)--(3,0);
end{tikzpicture}
end{document}


enter image description here






share|improve this answer
























  • Thank you so much @JouleV ! That is enough for now, I could modify it. Have a nice day!

    – Candan
    10 hours ago








  • 1





    @Candan If you find this answer useful, consider accepting it by clicking the tick-mark in the top-beneath the voting button.

    – Raaja
    9 hours ago



















6














an alternative:



documentclass[tikz,margin=3mm]{standalone}
usetikzlibrary{arrows,decorations.markings, positioning, quotes}

begin{document}
begin{tikzpicture}[
node distance =22mm,
->-/.style = {decoration={markings,
mark=at position 0.5 with {arrow{>}}},postaction={decorate}},
dot/.style = {circle, fill, inner sep=2pt, node contents={}}
]
node (d1) [dot,label=below:$n-1$];
node (d2) [dot,label=below:$n$, right=of d1];
node (d3) [dot,label=below:$n+1$, right=of d2];
path (d2) edge [->-, "$n$" '] (d1)
(d2) edge [->-, "$a(n)$"] (d3);
draw (d1.west) -- + (-1,0)
(d3.east) -- + ( 1,0);
end{tikzpicture}

end{document}


enter image description here






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%2f479283%2fstraight-line-with-arrows-and-dots%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









    9














    A quick solution



    documentclass[tikz]{standalone}
    begin{document}
    begin{tikzpicture}
    fill (0,0) circle (1pt) node[below] {$n$} (2,0) circle (1pt) node[below] {$n+1$} (-2,0) circle (1pt) node[below] {$n-1$};
    draw[-latex] (0,0)--(-1,0) node[above] {$n$};
    draw[-latex] (0,0)--(1,0) node[above] {$a(n)$};
    draw (-3,0)--(3,0);
    end{tikzpicture}
    end{document}


    enter image description here






    share|improve this answer
























    • Thank you so much @JouleV ! That is enough for now, I could modify it. Have a nice day!

      – Candan
      10 hours ago








    • 1





      @Candan If you find this answer useful, consider accepting it by clicking the tick-mark in the top-beneath the voting button.

      – Raaja
      9 hours ago
















    9














    A quick solution



    documentclass[tikz]{standalone}
    begin{document}
    begin{tikzpicture}
    fill (0,0) circle (1pt) node[below] {$n$} (2,0) circle (1pt) node[below] {$n+1$} (-2,0) circle (1pt) node[below] {$n-1$};
    draw[-latex] (0,0)--(-1,0) node[above] {$n$};
    draw[-latex] (0,0)--(1,0) node[above] {$a(n)$};
    draw (-3,0)--(3,0);
    end{tikzpicture}
    end{document}


    enter image description here






    share|improve this answer
























    • Thank you so much @JouleV ! That is enough for now, I could modify it. Have a nice day!

      – Candan
      10 hours ago








    • 1





      @Candan If you find this answer useful, consider accepting it by clicking the tick-mark in the top-beneath the voting button.

      – Raaja
      9 hours ago














    9












    9








    9







    A quick solution



    documentclass[tikz]{standalone}
    begin{document}
    begin{tikzpicture}
    fill (0,0) circle (1pt) node[below] {$n$} (2,0) circle (1pt) node[below] {$n+1$} (-2,0) circle (1pt) node[below] {$n-1$};
    draw[-latex] (0,0)--(-1,0) node[above] {$n$};
    draw[-latex] (0,0)--(1,0) node[above] {$a(n)$};
    draw (-3,0)--(3,0);
    end{tikzpicture}
    end{document}


    enter image description here






    share|improve this answer













    A quick solution



    documentclass[tikz]{standalone}
    begin{document}
    begin{tikzpicture}
    fill (0,0) circle (1pt) node[below] {$n$} (2,0) circle (1pt) node[below] {$n+1$} (-2,0) circle (1pt) node[below] {$n-1$};
    draw[-latex] (0,0)--(-1,0) node[above] {$n$};
    draw[-latex] (0,0)--(1,0) node[above] {$a(n)$};
    draw (-3,0)--(3,0);
    end{tikzpicture}
    end{document}


    enter image description here







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered 10 hours ago









    JouleVJouleV

    5,28621241




    5,28621241













    • Thank you so much @JouleV ! That is enough for now, I could modify it. Have a nice day!

      – Candan
      10 hours ago








    • 1





      @Candan If you find this answer useful, consider accepting it by clicking the tick-mark in the top-beneath the voting button.

      – Raaja
      9 hours ago



















    • Thank you so much @JouleV ! That is enough for now, I could modify it. Have a nice day!

      – Candan
      10 hours ago








    • 1





      @Candan If you find this answer useful, consider accepting it by clicking the tick-mark in the top-beneath the voting button.

      – Raaja
      9 hours ago

















    Thank you so much @JouleV ! That is enough for now, I could modify it. Have a nice day!

    – Candan
    10 hours ago







    Thank you so much @JouleV ! That is enough for now, I could modify it. Have a nice day!

    – Candan
    10 hours ago






    1




    1





    @Candan If you find this answer useful, consider accepting it by clicking the tick-mark in the top-beneath the voting button.

    – Raaja
    9 hours ago





    @Candan If you find this answer useful, consider accepting it by clicking the tick-mark in the top-beneath the voting button.

    – Raaja
    9 hours ago











    6














    an alternative:



    documentclass[tikz,margin=3mm]{standalone}
    usetikzlibrary{arrows,decorations.markings, positioning, quotes}

    begin{document}
    begin{tikzpicture}[
    node distance =22mm,
    ->-/.style = {decoration={markings,
    mark=at position 0.5 with {arrow{>}}},postaction={decorate}},
    dot/.style = {circle, fill, inner sep=2pt, node contents={}}
    ]
    node (d1) [dot,label=below:$n-1$];
    node (d2) [dot,label=below:$n$, right=of d1];
    node (d3) [dot,label=below:$n+1$, right=of d2];
    path (d2) edge [->-, "$n$" '] (d1)
    (d2) edge [->-, "$a(n)$"] (d3);
    draw (d1.west) -- + (-1,0)
    (d3.east) -- + ( 1,0);
    end{tikzpicture}

    end{document}


    enter image description here






    share|improve this answer




























      6














      an alternative:



      documentclass[tikz,margin=3mm]{standalone}
      usetikzlibrary{arrows,decorations.markings, positioning, quotes}

      begin{document}
      begin{tikzpicture}[
      node distance =22mm,
      ->-/.style = {decoration={markings,
      mark=at position 0.5 with {arrow{>}}},postaction={decorate}},
      dot/.style = {circle, fill, inner sep=2pt, node contents={}}
      ]
      node (d1) [dot,label=below:$n-1$];
      node (d2) [dot,label=below:$n$, right=of d1];
      node (d3) [dot,label=below:$n+1$, right=of d2];
      path (d2) edge [->-, "$n$" '] (d1)
      (d2) edge [->-, "$a(n)$"] (d3);
      draw (d1.west) -- + (-1,0)
      (d3.east) -- + ( 1,0);
      end{tikzpicture}

      end{document}


      enter image description here






      share|improve this answer


























        6












        6








        6







        an alternative:



        documentclass[tikz,margin=3mm]{standalone}
        usetikzlibrary{arrows,decorations.markings, positioning, quotes}

        begin{document}
        begin{tikzpicture}[
        node distance =22mm,
        ->-/.style = {decoration={markings,
        mark=at position 0.5 with {arrow{>}}},postaction={decorate}},
        dot/.style = {circle, fill, inner sep=2pt, node contents={}}
        ]
        node (d1) [dot,label=below:$n-1$];
        node (d2) [dot,label=below:$n$, right=of d1];
        node (d3) [dot,label=below:$n+1$, right=of d2];
        path (d2) edge [->-, "$n$" '] (d1)
        (d2) edge [->-, "$a(n)$"] (d3);
        draw (d1.west) -- + (-1,0)
        (d3.east) -- + ( 1,0);
        end{tikzpicture}

        end{document}


        enter image description here






        share|improve this answer













        an alternative:



        documentclass[tikz,margin=3mm]{standalone}
        usetikzlibrary{arrows,decorations.markings, positioning, quotes}

        begin{document}
        begin{tikzpicture}[
        node distance =22mm,
        ->-/.style = {decoration={markings,
        mark=at position 0.5 with {arrow{>}}},postaction={decorate}},
        dot/.style = {circle, fill, inner sep=2pt, node contents={}}
        ]
        node (d1) [dot,label=below:$n-1$];
        node (d2) [dot,label=below:$n$, right=of d1];
        node (d3) [dot,label=below:$n+1$, right=of d2];
        path (d2) edge [->-, "$n$" '] (d1)
        (d2) edge [->-, "$a(n)$"] (d3);
        draw (d1.west) -- + (-1,0)
        (d3.east) -- + ( 1,0);
        end{tikzpicture}

        end{document}


        enter image description here







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 9 hours ago









        ZarkoZarko

        127k868166




        127k868166






























            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%2f479283%2fstraight-line-with-arrows-and-dots%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 did Captain America manage to do this?

            迪纳利

            南乌拉尔铁路局