Draw a line not touching edges
up vote
5
down vote
favorite
I'm drawing a line between 2 nodes and I'd like to avoid to touch the nodes, I have been able to do it with the first node but not with the second.
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
begin{document}
tikzstyle{every picture}+=[remember picture]
tikz[baseline] node[fill opacity=0.1,circle,label=left:2016,fill=black,inner sep=3pt] at (0,0) (n1) {};
tikz[baseline] node[draw=none,fill=none,align=left] {
vbox{
bar
}
};
tikz[baseline] node[draw=none,align=left] {
hspace*{20mm}parbox{10cm}{
foo
}
};
tikz[baseline] node[fill opacity=0.1,circle,label=left:2016,fill=black,inner sep=3pt] at (0,0) (n2) {};
tikz[baseline] node[draw=none,fill=none,align=left] {
vbox{
bar
}
};
tikz[baseline] node[draw=none,align=left] {
hspace*{20mm}parbox{10cm}{
foo
}
};
begin{tikzpicture}[overlay]
draw (n1)++(0, -0.25) -- (n2)++(0, 0.25);
end{tikzpicture}
end{document}
https://www.overleaf.com/project/5c00283f4365993602702d4f
tikz-pgf xetex
New contributor
add a comment |
up vote
5
down vote
favorite
I'm drawing a line between 2 nodes and I'd like to avoid to touch the nodes, I have been able to do it with the first node but not with the second.
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
begin{document}
tikzstyle{every picture}+=[remember picture]
tikz[baseline] node[fill opacity=0.1,circle,label=left:2016,fill=black,inner sep=3pt] at (0,0) (n1) {};
tikz[baseline] node[draw=none,fill=none,align=left] {
vbox{
bar
}
};
tikz[baseline] node[draw=none,align=left] {
hspace*{20mm}parbox{10cm}{
foo
}
};
tikz[baseline] node[fill opacity=0.1,circle,label=left:2016,fill=black,inner sep=3pt] at (0,0) (n2) {};
tikz[baseline] node[draw=none,fill=none,align=left] {
vbox{
bar
}
};
tikz[baseline] node[draw=none,align=left] {
hspace*{20mm}parbox{10cm}{
foo
}
};
begin{tikzpicture}[overlay]
draw (n1)++(0, -0.25) -- (n2)++(0, 0.25);
end{tikzpicture}
end{document}
https://www.overleaf.com/project/5c00283f4365993602702d4f
tikz-pgf xetex
New contributor
Trydraw ([yshift=-0.1cm]n1.south) -- ([yshift=0.1cm]n2.north);
. (And replacetikzstyle{every picture}+=[remember picture]
bytikzset{every picture/.append style={remember picture}}
) Not sure if I would draw this picture in the way you do, why don't you just draw one picture?
– marmot
2 days ago
It works nicely, thanks again @marmot. I also replaced the section you mentioned. I'm not using one picture because I'm mixing text and a few nodes, if I used begin{tikzpicture} It would not allow me to use some commands. Probably because I do not know Latex
– Rod
2 days ago
add a comment |
up vote
5
down vote
favorite
up vote
5
down vote
favorite
I'm drawing a line between 2 nodes and I'd like to avoid to touch the nodes, I have been able to do it with the first node but not with the second.
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
begin{document}
tikzstyle{every picture}+=[remember picture]
tikz[baseline] node[fill opacity=0.1,circle,label=left:2016,fill=black,inner sep=3pt] at (0,0) (n1) {};
tikz[baseline] node[draw=none,fill=none,align=left] {
vbox{
bar
}
};
tikz[baseline] node[draw=none,align=left] {
hspace*{20mm}parbox{10cm}{
foo
}
};
tikz[baseline] node[fill opacity=0.1,circle,label=left:2016,fill=black,inner sep=3pt] at (0,0) (n2) {};
tikz[baseline] node[draw=none,fill=none,align=left] {
vbox{
bar
}
};
tikz[baseline] node[draw=none,align=left] {
hspace*{20mm}parbox{10cm}{
foo
}
};
begin{tikzpicture}[overlay]
draw (n1)++(0, -0.25) -- (n2)++(0, 0.25);
end{tikzpicture}
end{document}
https://www.overleaf.com/project/5c00283f4365993602702d4f
tikz-pgf xetex
New contributor
I'm drawing a line between 2 nodes and I'd like to avoid to touch the nodes, I have been able to do it with the first node but not with the second.
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
begin{document}
tikzstyle{every picture}+=[remember picture]
tikz[baseline] node[fill opacity=0.1,circle,label=left:2016,fill=black,inner sep=3pt] at (0,0) (n1) {};
tikz[baseline] node[draw=none,fill=none,align=left] {
vbox{
bar
}
};
tikz[baseline] node[draw=none,align=left] {
hspace*{20mm}parbox{10cm}{
foo
}
};
tikz[baseline] node[fill opacity=0.1,circle,label=left:2016,fill=black,inner sep=3pt] at (0,0) (n2) {};
tikz[baseline] node[draw=none,fill=none,align=left] {
vbox{
bar
}
};
tikz[baseline] node[draw=none,align=left] {
hspace*{20mm}parbox{10cm}{
foo
}
};
begin{tikzpicture}[overlay]
draw (n1)++(0, -0.25) -- (n2)++(0, 0.25);
end{tikzpicture}
end{document}
https://www.overleaf.com/project/5c00283f4365993602702d4f
tikz-pgf xetex
tikz-pgf xetex
New contributor
New contributor
New contributor
asked 2 days ago
Rod
794
794
New contributor
New contributor
Trydraw ([yshift=-0.1cm]n1.south) -- ([yshift=0.1cm]n2.north);
. (And replacetikzstyle{every picture}+=[remember picture]
bytikzset{every picture/.append style={remember picture}}
) Not sure if I would draw this picture in the way you do, why don't you just draw one picture?
– marmot
2 days ago
It works nicely, thanks again @marmot. I also replaced the section you mentioned. I'm not using one picture because I'm mixing text and a few nodes, if I used begin{tikzpicture} It would not allow me to use some commands. Probably because I do not know Latex
– Rod
2 days ago
add a comment |
Trydraw ([yshift=-0.1cm]n1.south) -- ([yshift=0.1cm]n2.north);
. (And replacetikzstyle{every picture}+=[remember picture]
bytikzset{every picture/.append style={remember picture}}
) Not sure if I would draw this picture in the way you do, why don't you just draw one picture?
– marmot
2 days ago
It works nicely, thanks again @marmot. I also replaced the section you mentioned. I'm not using one picture because I'm mixing text and a few nodes, if I used begin{tikzpicture} It would not allow me to use some commands. Probably because I do not know Latex
– Rod
2 days ago
Try
draw ([yshift=-0.1cm]n1.south) -- ([yshift=0.1cm]n2.north);
. (And replace tikzstyle{every picture}+=[remember picture]
by tikzset{every picture/.append style={remember picture}}
) Not sure if I would draw this picture in the way you do, why don't you just draw one picture?– marmot
2 days ago
Try
draw ([yshift=-0.1cm]n1.south) -- ([yshift=0.1cm]n2.north);
. (And replace tikzstyle{every picture}+=[remember picture]
by tikzset{every picture/.append style={remember picture}}
) Not sure if I would draw this picture in the way you do, why don't you just draw one picture?– marmot
2 days ago
It works nicely, thanks again @marmot. I also replaced the section you mentioned. I'm not using one picture because I'm mixing text and a few nodes, if I used begin{tikzpicture} It would not allow me to use some commands. Probably because I do not know Latex
– Rod
2 days ago
It works nicely, thanks again @marmot. I also replaced the section you mentioned. I'm not using one picture because I'm mixing text and a few nodes, if I used begin{tikzpicture} It would not allow me to use some commands. Probably because I do not know Latex
– Rod
2 days ago
add a comment |
3 Answers
3
active
oldest
votes
up vote
5
down vote
accepted
In your setting, you'd only need to use draw ([yshift=-0.1cm]n1.south) -- ([yshift=0.1cm]n2.north);
. However, one can draw your picture in a single picture without remember picture
.
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
usetikzlibrary{positioning}
begin{document}
begin{tikzpicture}
node[fill opacity=0.1,circle,label=left:2016,fill=black,inner
sep=3pt,label={[xshift=5mm]right:bar},label={[xshift=2mm,yshift=-5mm]right:foo},] (N1){};
node[below=1cm of N1,fill opacity=0.1,circle,label=left:2016,fill=black,inner
sep=3pt,label={[xshift=5mm]right:bar},label={[xshift=2mm,yshift=-5mm]right:foo}] (N2) {};
draw ([yshift=-0.1cm]N1.south) -- ([yshift=0.1cm]N2.north);
end{tikzpicture}
end{document}
ADDENDUM: Using Zarko's way to define a universal style, one could use outer sep
to produce the gaps. I would rather not use shorten as this can have unwanted side-effects if you consider using curved paths.
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
usetikzlibrary{positioning}
begin{document}
begin{tikzpicture}[pfft/.style={circle,fill opacity=0.1,fill=black,inner
sep=3pt,outer sep=1mm}]
node[pfft,label=left:2016,,label={[xshift=5mm]right:bar},label={[xshift=2mm,yshift=-5mm]right:foo},] (N1){};
node[below=1cm of N1,pfft,label=left:2016,label={[xshift=5mm]right:bar},label={[xshift=2mm,yshift=-5mm]right:foo}] (N2) {};
draw (N1) -- (N2);
end{tikzpicture}
end{document}
When didshorten
get deprecated? It is still used in the examples in the3.0.1a
manual.
– Peter Grill
2 days ago
@PeterGrill I do not think it got officially deprecated. However, it can cause issues on curved paths, see e.g. here. So I do not see that it is better than theyshift
solution, rather it can backfire.
– marmot
2 days ago
add a comment |
up vote
4
down vote
And a third option, without yshift
and without outer sep
but shorten
option in line between nodes:
documentclass[tikz, margin=3.141592mm]{standalone}
usetikzlibrary{positioning}
begin{document}
begin{tikzpicture}[
node distance = 12mm,
dot/.style = {circle, fill=black, fill opacity=0.1,
inner sep=3pt, %No outer sep like in Zarko's answer
node contents={}}
]
node (n1) [dot, label=left:2016, label={[xshift=3mm]right:bar}, label=below right:foo];
node (n2) [dot, label=left:2017, label={[xshift=3mm]right:bar}, label=below right:foo,
below=of n1];
draw[shorten >=2pt, shorten <=2pt] (n1) -- (n2); %No `yshift` like in Marmot's answer
end{tikzpicture}
end{document}
add a comment |
up vote
3
down vote
as complement to nice @marmot answer:
documentclass[tikz, margin=3.141592mm]{standalone}
usetikzlibrary{positioning}
begin{document}
begin{tikzpicture}[
node distance = 12mm,
dot/.style = {circle, fill=black, fill opacity=0.1,
inner sep=3pt, outer sep=2pt,
node contents={}}
]
node (n1) [dot, label=left:2016, label={[xshift=3mm]right:bar}, label=below right:foo];
node (n2) [dot, label=left:2017, label={[xshift=3mm]right:bar}, label=below right:foo,
below=of n1];
draw (n1) -- (n2);
end{tikzpicture}
end{document}
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
accepted
In your setting, you'd only need to use draw ([yshift=-0.1cm]n1.south) -- ([yshift=0.1cm]n2.north);
. However, one can draw your picture in a single picture without remember picture
.
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
usetikzlibrary{positioning}
begin{document}
begin{tikzpicture}
node[fill opacity=0.1,circle,label=left:2016,fill=black,inner
sep=3pt,label={[xshift=5mm]right:bar},label={[xshift=2mm,yshift=-5mm]right:foo},] (N1){};
node[below=1cm of N1,fill opacity=0.1,circle,label=left:2016,fill=black,inner
sep=3pt,label={[xshift=5mm]right:bar},label={[xshift=2mm,yshift=-5mm]right:foo}] (N2) {};
draw ([yshift=-0.1cm]N1.south) -- ([yshift=0.1cm]N2.north);
end{tikzpicture}
end{document}
ADDENDUM: Using Zarko's way to define a universal style, one could use outer sep
to produce the gaps. I would rather not use shorten as this can have unwanted side-effects if you consider using curved paths.
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
usetikzlibrary{positioning}
begin{document}
begin{tikzpicture}[pfft/.style={circle,fill opacity=0.1,fill=black,inner
sep=3pt,outer sep=1mm}]
node[pfft,label=left:2016,,label={[xshift=5mm]right:bar},label={[xshift=2mm,yshift=-5mm]right:foo},] (N1){};
node[below=1cm of N1,pfft,label=left:2016,label={[xshift=5mm]right:bar},label={[xshift=2mm,yshift=-5mm]right:foo}] (N2) {};
draw (N1) -- (N2);
end{tikzpicture}
end{document}
When didshorten
get deprecated? It is still used in the examples in the3.0.1a
manual.
– Peter Grill
2 days ago
@PeterGrill I do not think it got officially deprecated. However, it can cause issues on curved paths, see e.g. here. So I do not see that it is better than theyshift
solution, rather it can backfire.
– marmot
2 days ago
add a comment |
up vote
5
down vote
accepted
In your setting, you'd only need to use draw ([yshift=-0.1cm]n1.south) -- ([yshift=0.1cm]n2.north);
. However, one can draw your picture in a single picture without remember picture
.
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
usetikzlibrary{positioning}
begin{document}
begin{tikzpicture}
node[fill opacity=0.1,circle,label=left:2016,fill=black,inner
sep=3pt,label={[xshift=5mm]right:bar},label={[xshift=2mm,yshift=-5mm]right:foo},] (N1){};
node[below=1cm of N1,fill opacity=0.1,circle,label=left:2016,fill=black,inner
sep=3pt,label={[xshift=5mm]right:bar},label={[xshift=2mm,yshift=-5mm]right:foo}] (N2) {};
draw ([yshift=-0.1cm]N1.south) -- ([yshift=0.1cm]N2.north);
end{tikzpicture}
end{document}
ADDENDUM: Using Zarko's way to define a universal style, one could use outer sep
to produce the gaps. I would rather not use shorten as this can have unwanted side-effects if you consider using curved paths.
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
usetikzlibrary{positioning}
begin{document}
begin{tikzpicture}[pfft/.style={circle,fill opacity=0.1,fill=black,inner
sep=3pt,outer sep=1mm}]
node[pfft,label=left:2016,,label={[xshift=5mm]right:bar},label={[xshift=2mm,yshift=-5mm]right:foo},] (N1){};
node[below=1cm of N1,pfft,label=left:2016,label={[xshift=5mm]right:bar},label={[xshift=2mm,yshift=-5mm]right:foo}] (N2) {};
draw (N1) -- (N2);
end{tikzpicture}
end{document}
When didshorten
get deprecated? It is still used in the examples in the3.0.1a
manual.
– Peter Grill
2 days ago
@PeterGrill I do not think it got officially deprecated. However, it can cause issues on curved paths, see e.g. here. So I do not see that it is better than theyshift
solution, rather it can backfire.
– marmot
2 days ago
add a comment |
up vote
5
down vote
accepted
up vote
5
down vote
accepted
In your setting, you'd only need to use draw ([yshift=-0.1cm]n1.south) -- ([yshift=0.1cm]n2.north);
. However, one can draw your picture in a single picture without remember picture
.
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
usetikzlibrary{positioning}
begin{document}
begin{tikzpicture}
node[fill opacity=0.1,circle,label=left:2016,fill=black,inner
sep=3pt,label={[xshift=5mm]right:bar},label={[xshift=2mm,yshift=-5mm]right:foo},] (N1){};
node[below=1cm of N1,fill opacity=0.1,circle,label=left:2016,fill=black,inner
sep=3pt,label={[xshift=5mm]right:bar},label={[xshift=2mm,yshift=-5mm]right:foo}] (N2) {};
draw ([yshift=-0.1cm]N1.south) -- ([yshift=0.1cm]N2.north);
end{tikzpicture}
end{document}
ADDENDUM: Using Zarko's way to define a universal style, one could use outer sep
to produce the gaps. I would rather not use shorten as this can have unwanted side-effects if you consider using curved paths.
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
usetikzlibrary{positioning}
begin{document}
begin{tikzpicture}[pfft/.style={circle,fill opacity=0.1,fill=black,inner
sep=3pt,outer sep=1mm}]
node[pfft,label=left:2016,,label={[xshift=5mm]right:bar},label={[xshift=2mm,yshift=-5mm]right:foo},] (N1){};
node[below=1cm of N1,pfft,label=left:2016,label={[xshift=5mm]right:bar},label={[xshift=2mm,yshift=-5mm]right:foo}] (N2) {};
draw (N1) -- (N2);
end{tikzpicture}
end{document}
In your setting, you'd only need to use draw ([yshift=-0.1cm]n1.south) -- ([yshift=0.1cm]n2.north);
. However, one can draw your picture in a single picture without remember picture
.
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
usetikzlibrary{positioning}
begin{document}
begin{tikzpicture}
node[fill opacity=0.1,circle,label=left:2016,fill=black,inner
sep=3pt,label={[xshift=5mm]right:bar},label={[xshift=2mm,yshift=-5mm]right:foo},] (N1){};
node[below=1cm of N1,fill opacity=0.1,circle,label=left:2016,fill=black,inner
sep=3pt,label={[xshift=5mm]right:bar},label={[xshift=2mm,yshift=-5mm]right:foo}] (N2) {};
draw ([yshift=-0.1cm]N1.south) -- ([yshift=0.1cm]N2.north);
end{tikzpicture}
end{document}
ADDENDUM: Using Zarko's way to define a universal style, one could use outer sep
to produce the gaps. I would rather not use shorten as this can have unwanted side-effects if you consider using curved paths.
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
usetikzlibrary{positioning}
begin{document}
begin{tikzpicture}[pfft/.style={circle,fill opacity=0.1,fill=black,inner
sep=3pt,outer sep=1mm}]
node[pfft,label=left:2016,,label={[xshift=5mm]right:bar},label={[xshift=2mm,yshift=-5mm]right:foo},] (N1){};
node[below=1cm of N1,pfft,label=left:2016,label={[xshift=5mm]right:bar},label={[xshift=2mm,yshift=-5mm]right:foo}] (N2) {};
draw (N1) -- (N2);
end{tikzpicture}
end{document}
edited 2 days ago
answered 2 days ago
marmot
79.8k490169
79.8k490169
When didshorten
get deprecated? It is still used in the examples in the3.0.1a
manual.
– Peter Grill
2 days ago
@PeterGrill I do not think it got officially deprecated. However, it can cause issues on curved paths, see e.g. here. So I do not see that it is better than theyshift
solution, rather it can backfire.
– marmot
2 days ago
add a comment |
When didshorten
get deprecated? It is still used in the examples in the3.0.1a
manual.
– Peter Grill
2 days ago
@PeterGrill I do not think it got officially deprecated. However, it can cause issues on curved paths, see e.g. here. So I do not see that it is better than theyshift
solution, rather it can backfire.
– marmot
2 days ago
When did
shorten
get deprecated? It is still used in the examples in the 3.0.1a
manual.– Peter Grill
2 days ago
When did
shorten
get deprecated? It is still used in the examples in the 3.0.1a
manual.– Peter Grill
2 days ago
@PeterGrill I do not think it got officially deprecated. However, it can cause issues on curved paths, see e.g. here. So I do not see that it is better than the
yshift
solution, rather it can backfire.– marmot
2 days ago
@PeterGrill I do not think it got officially deprecated. However, it can cause issues on curved paths, see e.g. here. So I do not see that it is better than the
yshift
solution, rather it can backfire.– marmot
2 days ago
add a comment |
up vote
4
down vote
And a third option, without yshift
and without outer sep
but shorten
option in line between nodes:
documentclass[tikz, margin=3.141592mm]{standalone}
usetikzlibrary{positioning}
begin{document}
begin{tikzpicture}[
node distance = 12mm,
dot/.style = {circle, fill=black, fill opacity=0.1,
inner sep=3pt, %No outer sep like in Zarko's answer
node contents={}}
]
node (n1) [dot, label=left:2016, label={[xshift=3mm]right:bar}, label=below right:foo];
node (n2) [dot, label=left:2017, label={[xshift=3mm]right:bar}, label=below right:foo,
below=of n1];
draw[shorten >=2pt, shorten <=2pt] (n1) -- (n2); %No `yshift` like in Marmot's answer
end{tikzpicture}
end{document}
add a comment |
up vote
4
down vote
And a third option, without yshift
and without outer sep
but shorten
option in line between nodes:
documentclass[tikz, margin=3.141592mm]{standalone}
usetikzlibrary{positioning}
begin{document}
begin{tikzpicture}[
node distance = 12mm,
dot/.style = {circle, fill=black, fill opacity=0.1,
inner sep=3pt, %No outer sep like in Zarko's answer
node contents={}}
]
node (n1) [dot, label=left:2016, label={[xshift=3mm]right:bar}, label=below right:foo];
node (n2) [dot, label=left:2017, label={[xshift=3mm]right:bar}, label=below right:foo,
below=of n1];
draw[shorten >=2pt, shorten <=2pt] (n1) -- (n2); %No `yshift` like in Marmot's answer
end{tikzpicture}
end{document}
add a comment |
up vote
4
down vote
up vote
4
down vote
And a third option, without yshift
and without outer sep
but shorten
option in line between nodes:
documentclass[tikz, margin=3.141592mm]{standalone}
usetikzlibrary{positioning}
begin{document}
begin{tikzpicture}[
node distance = 12mm,
dot/.style = {circle, fill=black, fill opacity=0.1,
inner sep=3pt, %No outer sep like in Zarko's answer
node contents={}}
]
node (n1) [dot, label=left:2016, label={[xshift=3mm]right:bar}, label=below right:foo];
node (n2) [dot, label=left:2017, label={[xshift=3mm]right:bar}, label=below right:foo,
below=of n1];
draw[shorten >=2pt, shorten <=2pt] (n1) -- (n2); %No `yshift` like in Marmot's answer
end{tikzpicture}
end{document}
And a third option, without yshift
and without outer sep
but shorten
option in line between nodes:
documentclass[tikz, margin=3.141592mm]{standalone}
usetikzlibrary{positioning}
begin{document}
begin{tikzpicture}[
node distance = 12mm,
dot/.style = {circle, fill=black, fill opacity=0.1,
inner sep=3pt, %No outer sep like in Zarko's answer
node contents={}}
]
node (n1) [dot, label=left:2016, label={[xshift=3mm]right:bar}, label=below right:foo];
node (n2) [dot, label=left:2017, label={[xshift=3mm]right:bar}, label=below right:foo,
below=of n1];
draw[shorten >=2pt, shorten <=2pt] (n1) -- (n2); %No `yshift` like in Marmot's answer
end{tikzpicture}
end{document}
answered 2 days ago
Ignasi
90.5k4163302
90.5k4163302
add a comment |
add a comment |
up vote
3
down vote
as complement to nice @marmot answer:
documentclass[tikz, margin=3.141592mm]{standalone}
usetikzlibrary{positioning}
begin{document}
begin{tikzpicture}[
node distance = 12mm,
dot/.style = {circle, fill=black, fill opacity=0.1,
inner sep=3pt, outer sep=2pt,
node contents={}}
]
node (n1) [dot, label=left:2016, label={[xshift=3mm]right:bar}, label=below right:foo];
node (n2) [dot, label=left:2017, label={[xshift=3mm]right:bar}, label=below right:foo,
below=of n1];
draw (n1) -- (n2);
end{tikzpicture}
end{document}
add a comment |
up vote
3
down vote
as complement to nice @marmot answer:
documentclass[tikz, margin=3.141592mm]{standalone}
usetikzlibrary{positioning}
begin{document}
begin{tikzpicture}[
node distance = 12mm,
dot/.style = {circle, fill=black, fill opacity=0.1,
inner sep=3pt, outer sep=2pt,
node contents={}}
]
node (n1) [dot, label=left:2016, label={[xshift=3mm]right:bar}, label=below right:foo];
node (n2) [dot, label=left:2017, label={[xshift=3mm]right:bar}, label=below right:foo,
below=of n1];
draw (n1) -- (n2);
end{tikzpicture}
end{document}
add a comment |
up vote
3
down vote
up vote
3
down vote
as complement to nice @marmot answer:
documentclass[tikz, margin=3.141592mm]{standalone}
usetikzlibrary{positioning}
begin{document}
begin{tikzpicture}[
node distance = 12mm,
dot/.style = {circle, fill=black, fill opacity=0.1,
inner sep=3pt, outer sep=2pt,
node contents={}}
]
node (n1) [dot, label=left:2016, label={[xshift=3mm]right:bar}, label=below right:foo];
node (n2) [dot, label=left:2017, label={[xshift=3mm]right:bar}, label=below right:foo,
below=of n1];
draw (n1) -- (n2);
end{tikzpicture}
end{document}
as complement to nice @marmot answer:
documentclass[tikz, margin=3.141592mm]{standalone}
usetikzlibrary{positioning}
begin{document}
begin{tikzpicture}[
node distance = 12mm,
dot/.style = {circle, fill=black, fill opacity=0.1,
inner sep=3pt, outer sep=2pt,
node contents={}}
]
node (n1) [dot, label=left:2016, label={[xshift=3mm]right:bar}, label=below right:foo];
node (n2) [dot, label=left:2017, label={[xshift=3mm]right:bar}, label=below right:foo,
below=of n1];
draw (n1) -- (n2);
end{tikzpicture}
end{document}
answered 2 days ago
Zarko
117k865155
117k865155
add a comment |
add a comment |
Rod is a new contributor. Be nice, and check out our Code of Conduct.
Rod is a new contributor. Be nice, and check out our Code of Conduct.
Rod is a new contributor. Be nice, and check out our Code of Conduct.
Rod is a new contributor. Be nice, and check out our Code of Conduct.
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2f462433%2fdraw-a-line-not-touching-edges%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
Try
draw ([yshift=-0.1cm]n1.south) -- ([yshift=0.1cm]n2.north);
. (And replacetikzstyle{every picture}+=[remember picture]
bytikzset{every picture/.append style={remember picture}}
) Not sure if I would draw this picture in the way you do, why don't you just draw one picture?– marmot
2 days ago
It works nicely, thanks again @marmot. I also replaced the section you mentioned. I'm not using one picture because I'm mixing text and a few nodes, if I used begin{tikzpicture} It would not allow me to use some commands. Probably because I do not know Latex
– Rod
2 days ago