Straight line with arrows and dots
I am beginner for tikz package and I'd like to know how to draw following graph in LaTeX.
Thanks in advance.
tikz-pgf
add a comment |
I am beginner for tikz package and I'd like to know how to draw following graph in LaTeX.
Thanks in advance.
tikz-pgf
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 withdocumentclass
, includes all relevantusepackage
commands, ends withend{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
add a comment |
I am beginner for tikz package and I'd like to know how to draw following graph in LaTeX.
Thanks in advance.
tikz-pgf
I am beginner for tikz package and I'd like to know how to draw following graph in LaTeX.
Thanks in advance.
tikz-pgf
tikz-pgf
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 withdocumentclass
, includes all relevantusepackage
commands, ends withend{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
add a comment |
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 withdocumentclass
, includes all relevantusepackage
commands, ends withend{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
add a comment |
2 Answers
2
active
oldest
votes
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}
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
add a comment |
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}
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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}
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
add a comment |
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}
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
add a comment |
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}
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}
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
add a comment |
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
add a comment |
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}
add a comment |
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}
add a comment |
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}
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}
answered 9 hours ago
ZarkoZarko
127k868166
127k868166
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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 relevantusepackage
commands, ends withend{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