Tikz - Overlapping arrows make them too big
I'm pretty new to Tikz and I'm facing a little issue.
I'd like to draw arrows that are overlapping, all going in same directions, but it's getting wider and wider and is pretty horrible. How could I face it ? Here is the code :
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
usetikzlibrary{shapes.geometric, arrows, calc}
begin{document}
begin{tikzpicture}[node distance=2.3cm]
% Style
tikzstyle{cell} = [rectangle, minimum width=1.5cm, minimum height=1.5cm, text centered, draw=black, fill=green!20]
tikzstyle{tensor} = [circle, minimum width=1cm, text centered, draw=black, fill=green!10]
tikzstyle{arrow} = [thick,->,>=stealth]
% Nodes
node (he) [tensor] {$h^e$};
node (d1) [cell, right of=he, below of=he, xshift=1.5cm, yshift=-2cm] {$d$};
node (d2) [cell, right of=d1, xshift=1.5cm] {$d$};
node (dn) [cell, right of=d2, xshift=2cm] {$d$};
node (w1) [tensor, above of=d1, left of=d1, minimum width=1.25cm] {$w_1$};
node (w2) [tensor, above of=d2, left of=d2, minimum width=1.25cm] {$w_2$};
node (wn) [tensor, above of=dn, left of=dn, minimum width=1.25cm] {$w_n$};
% Arrows
draw[arrow] (w1) -| (d1);
draw[arrow] (w2) -| (d2);
draw[arrow] (wn) -| (dn);
draw[arrow] (d1) -- (d2);
draw[arrow] (he) |- (d1);
draw[arrow] (he) -| (d1);
draw[arrow] (he) -| (d2);
draw[arrow] (he) -| (dn);
end{tikzpicture}
end{document}
If you render the figure, you'll see arrows getting darker, how can I fix it ?
Thanks,
Cheers
tikz-arrows
New contributor
|
show 1 more comment
I'm pretty new to Tikz and I'm facing a little issue.
I'd like to draw arrows that are overlapping, all going in same directions, but it's getting wider and wider and is pretty horrible. How could I face it ? Here is the code :
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
usetikzlibrary{shapes.geometric, arrows, calc}
begin{document}
begin{tikzpicture}[node distance=2.3cm]
% Style
tikzstyle{cell} = [rectangle, minimum width=1.5cm, minimum height=1.5cm, text centered, draw=black, fill=green!20]
tikzstyle{tensor} = [circle, minimum width=1cm, text centered, draw=black, fill=green!10]
tikzstyle{arrow} = [thick,->,>=stealth]
% Nodes
node (he) [tensor] {$h^e$};
node (d1) [cell, right of=he, below of=he, xshift=1.5cm, yshift=-2cm] {$d$};
node (d2) [cell, right of=d1, xshift=1.5cm] {$d$};
node (dn) [cell, right of=d2, xshift=2cm] {$d$};
node (w1) [tensor, above of=d1, left of=d1, minimum width=1.25cm] {$w_1$};
node (w2) [tensor, above of=d2, left of=d2, minimum width=1.25cm] {$w_2$};
node (wn) [tensor, above of=dn, left of=dn, minimum width=1.25cm] {$w_n$};
% Arrows
draw[arrow] (w1) -| (d1);
draw[arrow] (w2) -| (d2);
draw[arrow] (wn) -| (dn);
draw[arrow] (d1) -- (d2);
draw[arrow] (he) |- (d1);
draw[arrow] (he) -| (d1);
draw[arrow] (he) -| (d2);
draw[arrow] (he) -| (dn);
end{tikzpicture}
end{document}
If you render the figure, you'll see arrows getting darker, how can I fix it ?
Thanks,
Cheers
tikz-arrows
New contributor
Welcome to TeX.Stackexchange! Can you make your example compilable? When I try to run your code I get errors. I can debug them, but how would I know if this still reproduces the problem you are asking about?
– samcarter
4 hours ago
Actually, as I know, if two lines overlapping each other in TikZ, they are darkened.
– JouleV
4 hours ago
@samcarter I fixed it, bad copy/paster my bad
– Ricocotam
4 hours ago
@joulev That's exactly my problem, I don't want arrows being darkened
– Ricocotam
4 hours ago
1
Have you tried to print it? There are often aliasing problems with PDF viewers, and the line can seems darker or not depending on the zoom level.
– Rmano
4 hours ago
|
show 1 more comment
I'm pretty new to Tikz and I'm facing a little issue.
I'd like to draw arrows that are overlapping, all going in same directions, but it's getting wider and wider and is pretty horrible. How could I face it ? Here is the code :
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
usetikzlibrary{shapes.geometric, arrows, calc}
begin{document}
begin{tikzpicture}[node distance=2.3cm]
% Style
tikzstyle{cell} = [rectangle, minimum width=1.5cm, minimum height=1.5cm, text centered, draw=black, fill=green!20]
tikzstyle{tensor} = [circle, minimum width=1cm, text centered, draw=black, fill=green!10]
tikzstyle{arrow} = [thick,->,>=stealth]
% Nodes
node (he) [tensor] {$h^e$};
node (d1) [cell, right of=he, below of=he, xshift=1.5cm, yshift=-2cm] {$d$};
node (d2) [cell, right of=d1, xshift=1.5cm] {$d$};
node (dn) [cell, right of=d2, xshift=2cm] {$d$};
node (w1) [tensor, above of=d1, left of=d1, minimum width=1.25cm] {$w_1$};
node (w2) [tensor, above of=d2, left of=d2, minimum width=1.25cm] {$w_2$};
node (wn) [tensor, above of=dn, left of=dn, minimum width=1.25cm] {$w_n$};
% Arrows
draw[arrow] (w1) -| (d1);
draw[arrow] (w2) -| (d2);
draw[arrow] (wn) -| (dn);
draw[arrow] (d1) -- (d2);
draw[arrow] (he) |- (d1);
draw[arrow] (he) -| (d1);
draw[arrow] (he) -| (d2);
draw[arrow] (he) -| (dn);
end{tikzpicture}
end{document}
If you render the figure, you'll see arrows getting darker, how can I fix it ?
Thanks,
Cheers
tikz-arrows
New contributor
I'm pretty new to Tikz and I'm facing a little issue.
I'd like to draw arrows that are overlapping, all going in same directions, but it's getting wider and wider and is pretty horrible. How could I face it ? Here is the code :
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
usetikzlibrary{shapes.geometric, arrows, calc}
begin{document}
begin{tikzpicture}[node distance=2.3cm]
% Style
tikzstyle{cell} = [rectangle, minimum width=1.5cm, minimum height=1.5cm, text centered, draw=black, fill=green!20]
tikzstyle{tensor} = [circle, minimum width=1cm, text centered, draw=black, fill=green!10]
tikzstyle{arrow} = [thick,->,>=stealth]
% Nodes
node (he) [tensor] {$h^e$};
node (d1) [cell, right of=he, below of=he, xshift=1.5cm, yshift=-2cm] {$d$};
node (d2) [cell, right of=d1, xshift=1.5cm] {$d$};
node (dn) [cell, right of=d2, xshift=2cm] {$d$};
node (w1) [tensor, above of=d1, left of=d1, minimum width=1.25cm] {$w_1$};
node (w2) [tensor, above of=d2, left of=d2, minimum width=1.25cm] {$w_2$};
node (wn) [tensor, above of=dn, left of=dn, minimum width=1.25cm] {$w_n$};
% Arrows
draw[arrow] (w1) -| (d1);
draw[arrow] (w2) -| (d2);
draw[arrow] (wn) -| (dn);
draw[arrow] (d1) -- (d2);
draw[arrow] (he) |- (d1);
draw[arrow] (he) -| (d1);
draw[arrow] (he) -| (d2);
draw[arrow] (he) -| (dn);
end{tikzpicture}
end{document}
If you render the figure, you'll see arrows getting darker, how can I fix it ?
Thanks,
Cheers
tikz-arrows
tikz-arrows
New contributor
New contributor
edited 4 hours ago
samcarter
87.8k796280
87.8k796280
New contributor
asked 4 hours ago
RicocotamRicocotam
133
133
New contributor
New contributor
Welcome to TeX.Stackexchange! Can you make your example compilable? When I try to run your code I get errors. I can debug them, but how would I know if this still reproduces the problem you are asking about?
– samcarter
4 hours ago
Actually, as I know, if two lines overlapping each other in TikZ, they are darkened.
– JouleV
4 hours ago
@samcarter I fixed it, bad copy/paster my bad
– Ricocotam
4 hours ago
@joulev That's exactly my problem, I don't want arrows being darkened
– Ricocotam
4 hours ago
1
Have you tried to print it? There are often aliasing problems with PDF viewers, and the line can seems darker or not depending on the zoom level.
– Rmano
4 hours ago
|
show 1 more comment
Welcome to TeX.Stackexchange! Can you make your example compilable? When I try to run your code I get errors. I can debug them, but how would I know if this still reproduces the problem you are asking about?
– samcarter
4 hours ago
Actually, as I know, if two lines overlapping each other in TikZ, they are darkened.
– JouleV
4 hours ago
@samcarter I fixed it, bad copy/paster my bad
– Ricocotam
4 hours ago
@joulev That's exactly my problem, I don't want arrows being darkened
– Ricocotam
4 hours ago
1
Have you tried to print it? There are often aliasing problems with PDF viewers, and the line can seems darker or not depending on the zoom level.
– Rmano
4 hours ago
Welcome to TeX.Stackexchange! Can you make your example compilable? When I try to run your code I get errors. I can debug them, but how would I know if this still reproduces the problem you are asking about?
– samcarter
4 hours ago
Welcome to TeX.Stackexchange! Can you make your example compilable? When I try to run your code I get errors. I can debug them, but how would I know if this still reproduces the problem you are asking about?
– samcarter
4 hours ago
Actually, as I know, if two lines overlapping each other in TikZ, they are darkened.
– JouleV
4 hours ago
Actually, as I know, if two lines overlapping each other in TikZ, they are darkened.
– JouleV
4 hours ago
@samcarter I fixed it, bad copy/paster my bad
– Ricocotam
4 hours ago
@samcarter I fixed it, bad copy/paster my bad
– Ricocotam
4 hours ago
@joulev That's exactly my problem, I don't want arrows being darkened
– Ricocotam
4 hours ago
@joulev That's exactly my problem, I don't want arrows being darkened
– Ricocotam
4 hours ago
1
1
Have you tried to print it? There are often aliasing problems with PDF viewers, and the line can seems darker or not depending on the zoom level.
– Rmano
4 hours ago
Have you tried to print it? There are often aliasing problems with PDF viewers, and the line can seems darker or not depending on the zoom level.
– Rmano
4 hours ago
|
show 1 more comment
2 Answers
2
active
oldest
votes
The following example uses the calc
library to print each line only once. If you still experience problems with varying line widths this is most probably an issue of your pdf viewer.
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
usetikzlibrary{shapes.geometric, arrows, calc}
begin{document}
begin{tikzpicture}[node distance=2.3cm]
% Style
tikzset{
cell/.style={rectangle, minimum width=1.5cm, minimum height=1.5cm, text centered, draw=black, fill=green!20},
tensor/.style={circle, minimum width=1cm, text centered, draw=black, fill=green!10}, arrow/.style={thick,->,>=stealth},
arrow/.style={thick,->,>=stealth}
}
% Nodes
node (he) [tensor] {$h^e$};
node (d1) [cell, right of=he, below of=he, xshift=1.5cm, yshift=-2cm] {$d$};
node (d2) [cell, right of=d1, xshift=1.5cm] {$d$};
node (dn) [cell, right of=d2, xshift=2cm] {$d$};
node (w1) [tensor, above of=d1, left of=d1, minimum width=1.25cm] {$w_1$};
node (w2) [tensor, above of=d2, left of=d2, minimum width=1.25cm] {$w_2$};
node (wn) [tensor, above of=dn, left of=dn, minimum width=1.25cm] {$w_n$};
% Arrows
draw[arrow] (w1) -| (d1);
draw[arrow] (w2) -| (d2);
draw[arrow] (wn) -| (dn);
draw[arrow] (d1) -- (d2);
draw[arrow] (he) |- (d1);
draw[arrow] (he) -| (d1);
draw[arrow] let p1 = (he), p2 = (d1) in (x2,y1) -| (d2);
draw[arrow] let p1 = (he), p2 = (d2) in (x2,y1) -| (dn);
end{tikzpicture}
end{document}
Thanks to @marmot for suggesting this calc
free version:
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
usetikzlibrary{shapes.geometric, arrows}
begin{document}
begin{tikzpicture}[node distance=2.3cm]
% Style
tikzset{
cell/.style={rectangle, minimum width=1.5cm, minimum height=1.5cm, text centered, draw=black, fill=green!20},
tensor/.style={circle, minimum width=1cm, text centered, draw=black, fill=green!10}, arrow/.style={thick,->,>=stealth},
arrow/.style={thick,->,>=stealth}
}
% Nodes
node (he) [tensor] {$h^e$};
node (d1) [cell, right of=he, below of=he, xshift=1.5cm, yshift=-2cm] {$d$};
node (d2) [cell, right of=d1, xshift=1.5cm] {$d$};
node (dn) [cell, right of=d2, xshift=2cm] {$d$};
node (w1) [tensor, above of=d1, left of=d1, minimum width=1.25cm] {$w_1$};
node (w2) [tensor, above of=d2, left of=d2, minimum width=1.25cm] {$w_2$};
node (wn) [tensor, above of=dn, left of=dn, minimum width=1.25cm] {$w_n$};
% Arrows
draw[arrow] (w1) -| (d1);
draw[arrow] (w2) -| (d2);
draw[arrow] (wn) -| (dn);
draw[arrow] (d1) -- (d2);
draw[arrow] (he) |- (d1);
draw[arrow] (he) -| (d1);
draw[arrow] (d1|-he) -| (d2);
draw[arrow] (d2|-he) -| (dn);
end{tikzpicture}
end{document}
Thanks a lot, you're awsome ! Could you give a bit background or give some resources so I understand how to reuse this kind of things ?
– Ricocotam
4 hours ago
@Ricocotam See tex.stackexchange.com/a/18393/36296 for a short example how the calc library works
– samcarter
2 hours ago
draw[arrow] (d1|-he) -| (d2); draw[arrow] (d2|-he) -| (dn);
would also do, so you may not even needcalc
here. And perhapstikzset{cell/.style={rectangle, minimum width=1.5cm, minimum height=1.5cm, text centered, draw=black, fill=green!20}, tensor/.style={circle, minimum width=1cm, text centered, draw=black, fill=green!10}, arrow/.style={thick,->,>=stealth}}
?
– marmot
42 mins ago
@marmot Thanks for your suggestions! I just fixed thetikzset
and will soon post a second example without calc.
– samcarter
10 mins ago
add a comment |
This is what I see (okular
) at 100% zoom:
so I can't see any "darkening". Now, zooming in:
This is a rendering/aliasing problem for subpixel zooms, and it is mostly unsolvable (it depends on the anti-aliasing algorithm of the viewer).
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
});
}
});
Ricocotam is a new contributor. Be nice, and check out our Code of Conduct.
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%2f471444%2ftikz-overlapping-arrows-make-them-too-big%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
The following example uses the calc
library to print each line only once. If you still experience problems with varying line widths this is most probably an issue of your pdf viewer.
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
usetikzlibrary{shapes.geometric, arrows, calc}
begin{document}
begin{tikzpicture}[node distance=2.3cm]
% Style
tikzset{
cell/.style={rectangle, minimum width=1.5cm, minimum height=1.5cm, text centered, draw=black, fill=green!20},
tensor/.style={circle, minimum width=1cm, text centered, draw=black, fill=green!10}, arrow/.style={thick,->,>=stealth},
arrow/.style={thick,->,>=stealth}
}
% Nodes
node (he) [tensor] {$h^e$};
node (d1) [cell, right of=he, below of=he, xshift=1.5cm, yshift=-2cm] {$d$};
node (d2) [cell, right of=d1, xshift=1.5cm] {$d$};
node (dn) [cell, right of=d2, xshift=2cm] {$d$};
node (w1) [tensor, above of=d1, left of=d1, minimum width=1.25cm] {$w_1$};
node (w2) [tensor, above of=d2, left of=d2, minimum width=1.25cm] {$w_2$};
node (wn) [tensor, above of=dn, left of=dn, minimum width=1.25cm] {$w_n$};
% Arrows
draw[arrow] (w1) -| (d1);
draw[arrow] (w2) -| (d2);
draw[arrow] (wn) -| (dn);
draw[arrow] (d1) -- (d2);
draw[arrow] (he) |- (d1);
draw[arrow] (he) -| (d1);
draw[arrow] let p1 = (he), p2 = (d1) in (x2,y1) -| (d2);
draw[arrow] let p1 = (he), p2 = (d2) in (x2,y1) -| (dn);
end{tikzpicture}
end{document}
Thanks to @marmot for suggesting this calc
free version:
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
usetikzlibrary{shapes.geometric, arrows}
begin{document}
begin{tikzpicture}[node distance=2.3cm]
% Style
tikzset{
cell/.style={rectangle, minimum width=1.5cm, minimum height=1.5cm, text centered, draw=black, fill=green!20},
tensor/.style={circle, minimum width=1cm, text centered, draw=black, fill=green!10}, arrow/.style={thick,->,>=stealth},
arrow/.style={thick,->,>=stealth}
}
% Nodes
node (he) [tensor] {$h^e$};
node (d1) [cell, right of=he, below of=he, xshift=1.5cm, yshift=-2cm] {$d$};
node (d2) [cell, right of=d1, xshift=1.5cm] {$d$};
node (dn) [cell, right of=d2, xshift=2cm] {$d$};
node (w1) [tensor, above of=d1, left of=d1, minimum width=1.25cm] {$w_1$};
node (w2) [tensor, above of=d2, left of=d2, minimum width=1.25cm] {$w_2$};
node (wn) [tensor, above of=dn, left of=dn, minimum width=1.25cm] {$w_n$};
% Arrows
draw[arrow] (w1) -| (d1);
draw[arrow] (w2) -| (d2);
draw[arrow] (wn) -| (dn);
draw[arrow] (d1) -- (d2);
draw[arrow] (he) |- (d1);
draw[arrow] (he) -| (d1);
draw[arrow] (d1|-he) -| (d2);
draw[arrow] (d2|-he) -| (dn);
end{tikzpicture}
end{document}
Thanks a lot, you're awsome ! Could you give a bit background or give some resources so I understand how to reuse this kind of things ?
– Ricocotam
4 hours ago
@Ricocotam See tex.stackexchange.com/a/18393/36296 for a short example how the calc library works
– samcarter
2 hours ago
draw[arrow] (d1|-he) -| (d2); draw[arrow] (d2|-he) -| (dn);
would also do, so you may not even needcalc
here. And perhapstikzset{cell/.style={rectangle, minimum width=1.5cm, minimum height=1.5cm, text centered, draw=black, fill=green!20}, tensor/.style={circle, minimum width=1cm, text centered, draw=black, fill=green!10}, arrow/.style={thick,->,>=stealth}}
?
– marmot
42 mins ago
@marmot Thanks for your suggestions! I just fixed thetikzset
and will soon post a second example without calc.
– samcarter
10 mins ago
add a comment |
The following example uses the calc
library to print each line only once. If you still experience problems with varying line widths this is most probably an issue of your pdf viewer.
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
usetikzlibrary{shapes.geometric, arrows, calc}
begin{document}
begin{tikzpicture}[node distance=2.3cm]
% Style
tikzset{
cell/.style={rectangle, minimum width=1.5cm, minimum height=1.5cm, text centered, draw=black, fill=green!20},
tensor/.style={circle, minimum width=1cm, text centered, draw=black, fill=green!10}, arrow/.style={thick,->,>=stealth},
arrow/.style={thick,->,>=stealth}
}
% Nodes
node (he) [tensor] {$h^e$};
node (d1) [cell, right of=he, below of=he, xshift=1.5cm, yshift=-2cm] {$d$};
node (d2) [cell, right of=d1, xshift=1.5cm] {$d$};
node (dn) [cell, right of=d2, xshift=2cm] {$d$};
node (w1) [tensor, above of=d1, left of=d1, minimum width=1.25cm] {$w_1$};
node (w2) [tensor, above of=d2, left of=d2, minimum width=1.25cm] {$w_2$};
node (wn) [tensor, above of=dn, left of=dn, minimum width=1.25cm] {$w_n$};
% Arrows
draw[arrow] (w1) -| (d1);
draw[arrow] (w2) -| (d2);
draw[arrow] (wn) -| (dn);
draw[arrow] (d1) -- (d2);
draw[arrow] (he) |- (d1);
draw[arrow] (he) -| (d1);
draw[arrow] let p1 = (he), p2 = (d1) in (x2,y1) -| (d2);
draw[arrow] let p1 = (he), p2 = (d2) in (x2,y1) -| (dn);
end{tikzpicture}
end{document}
Thanks to @marmot for suggesting this calc
free version:
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
usetikzlibrary{shapes.geometric, arrows}
begin{document}
begin{tikzpicture}[node distance=2.3cm]
% Style
tikzset{
cell/.style={rectangle, minimum width=1.5cm, minimum height=1.5cm, text centered, draw=black, fill=green!20},
tensor/.style={circle, minimum width=1cm, text centered, draw=black, fill=green!10}, arrow/.style={thick,->,>=stealth},
arrow/.style={thick,->,>=stealth}
}
% Nodes
node (he) [tensor] {$h^e$};
node (d1) [cell, right of=he, below of=he, xshift=1.5cm, yshift=-2cm] {$d$};
node (d2) [cell, right of=d1, xshift=1.5cm] {$d$};
node (dn) [cell, right of=d2, xshift=2cm] {$d$};
node (w1) [tensor, above of=d1, left of=d1, minimum width=1.25cm] {$w_1$};
node (w2) [tensor, above of=d2, left of=d2, minimum width=1.25cm] {$w_2$};
node (wn) [tensor, above of=dn, left of=dn, minimum width=1.25cm] {$w_n$};
% Arrows
draw[arrow] (w1) -| (d1);
draw[arrow] (w2) -| (d2);
draw[arrow] (wn) -| (dn);
draw[arrow] (d1) -- (d2);
draw[arrow] (he) |- (d1);
draw[arrow] (he) -| (d1);
draw[arrow] (d1|-he) -| (d2);
draw[arrow] (d2|-he) -| (dn);
end{tikzpicture}
end{document}
Thanks a lot, you're awsome ! Could you give a bit background or give some resources so I understand how to reuse this kind of things ?
– Ricocotam
4 hours ago
@Ricocotam See tex.stackexchange.com/a/18393/36296 for a short example how the calc library works
– samcarter
2 hours ago
draw[arrow] (d1|-he) -| (d2); draw[arrow] (d2|-he) -| (dn);
would also do, so you may not even needcalc
here. And perhapstikzset{cell/.style={rectangle, minimum width=1.5cm, minimum height=1.5cm, text centered, draw=black, fill=green!20}, tensor/.style={circle, minimum width=1cm, text centered, draw=black, fill=green!10}, arrow/.style={thick,->,>=stealth}}
?
– marmot
42 mins ago
@marmot Thanks for your suggestions! I just fixed thetikzset
and will soon post a second example without calc.
– samcarter
10 mins ago
add a comment |
The following example uses the calc
library to print each line only once. If you still experience problems with varying line widths this is most probably an issue of your pdf viewer.
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
usetikzlibrary{shapes.geometric, arrows, calc}
begin{document}
begin{tikzpicture}[node distance=2.3cm]
% Style
tikzset{
cell/.style={rectangle, minimum width=1.5cm, minimum height=1.5cm, text centered, draw=black, fill=green!20},
tensor/.style={circle, minimum width=1cm, text centered, draw=black, fill=green!10}, arrow/.style={thick,->,>=stealth},
arrow/.style={thick,->,>=stealth}
}
% Nodes
node (he) [tensor] {$h^e$};
node (d1) [cell, right of=he, below of=he, xshift=1.5cm, yshift=-2cm] {$d$};
node (d2) [cell, right of=d1, xshift=1.5cm] {$d$};
node (dn) [cell, right of=d2, xshift=2cm] {$d$};
node (w1) [tensor, above of=d1, left of=d1, minimum width=1.25cm] {$w_1$};
node (w2) [tensor, above of=d2, left of=d2, minimum width=1.25cm] {$w_2$};
node (wn) [tensor, above of=dn, left of=dn, minimum width=1.25cm] {$w_n$};
% Arrows
draw[arrow] (w1) -| (d1);
draw[arrow] (w2) -| (d2);
draw[arrow] (wn) -| (dn);
draw[arrow] (d1) -- (d2);
draw[arrow] (he) |- (d1);
draw[arrow] (he) -| (d1);
draw[arrow] let p1 = (he), p2 = (d1) in (x2,y1) -| (d2);
draw[arrow] let p1 = (he), p2 = (d2) in (x2,y1) -| (dn);
end{tikzpicture}
end{document}
Thanks to @marmot for suggesting this calc
free version:
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
usetikzlibrary{shapes.geometric, arrows}
begin{document}
begin{tikzpicture}[node distance=2.3cm]
% Style
tikzset{
cell/.style={rectangle, minimum width=1.5cm, minimum height=1.5cm, text centered, draw=black, fill=green!20},
tensor/.style={circle, minimum width=1cm, text centered, draw=black, fill=green!10}, arrow/.style={thick,->,>=stealth},
arrow/.style={thick,->,>=stealth}
}
% Nodes
node (he) [tensor] {$h^e$};
node (d1) [cell, right of=he, below of=he, xshift=1.5cm, yshift=-2cm] {$d$};
node (d2) [cell, right of=d1, xshift=1.5cm] {$d$};
node (dn) [cell, right of=d2, xshift=2cm] {$d$};
node (w1) [tensor, above of=d1, left of=d1, minimum width=1.25cm] {$w_1$};
node (w2) [tensor, above of=d2, left of=d2, minimum width=1.25cm] {$w_2$};
node (wn) [tensor, above of=dn, left of=dn, minimum width=1.25cm] {$w_n$};
% Arrows
draw[arrow] (w1) -| (d1);
draw[arrow] (w2) -| (d2);
draw[arrow] (wn) -| (dn);
draw[arrow] (d1) -- (d2);
draw[arrow] (he) |- (d1);
draw[arrow] (he) -| (d1);
draw[arrow] (d1|-he) -| (d2);
draw[arrow] (d2|-he) -| (dn);
end{tikzpicture}
end{document}
The following example uses the calc
library to print each line only once. If you still experience problems with varying line widths this is most probably an issue of your pdf viewer.
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
usetikzlibrary{shapes.geometric, arrows, calc}
begin{document}
begin{tikzpicture}[node distance=2.3cm]
% Style
tikzset{
cell/.style={rectangle, minimum width=1.5cm, minimum height=1.5cm, text centered, draw=black, fill=green!20},
tensor/.style={circle, minimum width=1cm, text centered, draw=black, fill=green!10}, arrow/.style={thick,->,>=stealth},
arrow/.style={thick,->,>=stealth}
}
% Nodes
node (he) [tensor] {$h^e$};
node (d1) [cell, right of=he, below of=he, xshift=1.5cm, yshift=-2cm] {$d$};
node (d2) [cell, right of=d1, xshift=1.5cm] {$d$};
node (dn) [cell, right of=d2, xshift=2cm] {$d$};
node (w1) [tensor, above of=d1, left of=d1, minimum width=1.25cm] {$w_1$};
node (w2) [tensor, above of=d2, left of=d2, minimum width=1.25cm] {$w_2$};
node (wn) [tensor, above of=dn, left of=dn, minimum width=1.25cm] {$w_n$};
% Arrows
draw[arrow] (w1) -| (d1);
draw[arrow] (w2) -| (d2);
draw[arrow] (wn) -| (dn);
draw[arrow] (d1) -- (d2);
draw[arrow] (he) |- (d1);
draw[arrow] (he) -| (d1);
draw[arrow] let p1 = (he), p2 = (d1) in (x2,y1) -| (d2);
draw[arrow] let p1 = (he), p2 = (d2) in (x2,y1) -| (dn);
end{tikzpicture}
end{document}
Thanks to @marmot for suggesting this calc
free version:
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
usetikzlibrary{shapes.geometric, arrows}
begin{document}
begin{tikzpicture}[node distance=2.3cm]
% Style
tikzset{
cell/.style={rectangle, minimum width=1.5cm, minimum height=1.5cm, text centered, draw=black, fill=green!20},
tensor/.style={circle, minimum width=1cm, text centered, draw=black, fill=green!10}, arrow/.style={thick,->,>=stealth},
arrow/.style={thick,->,>=stealth}
}
% Nodes
node (he) [tensor] {$h^e$};
node (d1) [cell, right of=he, below of=he, xshift=1.5cm, yshift=-2cm] {$d$};
node (d2) [cell, right of=d1, xshift=1.5cm] {$d$};
node (dn) [cell, right of=d2, xshift=2cm] {$d$};
node (w1) [tensor, above of=d1, left of=d1, minimum width=1.25cm] {$w_1$};
node (w2) [tensor, above of=d2, left of=d2, minimum width=1.25cm] {$w_2$};
node (wn) [tensor, above of=dn, left of=dn, minimum width=1.25cm] {$w_n$};
% Arrows
draw[arrow] (w1) -| (d1);
draw[arrow] (w2) -| (d2);
draw[arrow] (wn) -| (dn);
draw[arrow] (d1) -- (d2);
draw[arrow] (he) |- (d1);
draw[arrow] (he) -| (d1);
draw[arrow] (d1|-he) -| (d2);
draw[arrow] (d2|-he) -| (dn);
end{tikzpicture}
end{document}
edited 11 mins ago
answered 4 hours ago
samcartersamcarter
87.8k796280
87.8k796280
Thanks a lot, you're awsome ! Could you give a bit background or give some resources so I understand how to reuse this kind of things ?
– Ricocotam
4 hours ago
@Ricocotam See tex.stackexchange.com/a/18393/36296 for a short example how the calc library works
– samcarter
2 hours ago
draw[arrow] (d1|-he) -| (d2); draw[arrow] (d2|-he) -| (dn);
would also do, so you may not even needcalc
here. And perhapstikzset{cell/.style={rectangle, minimum width=1.5cm, minimum height=1.5cm, text centered, draw=black, fill=green!20}, tensor/.style={circle, minimum width=1cm, text centered, draw=black, fill=green!10}, arrow/.style={thick,->,>=stealth}}
?
– marmot
42 mins ago
@marmot Thanks for your suggestions! I just fixed thetikzset
and will soon post a second example without calc.
– samcarter
10 mins ago
add a comment |
Thanks a lot, you're awsome ! Could you give a bit background or give some resources so I understand how to reuse this kind of things ?
– Ricocotam
4 hours ago
@Ricocotam See tex.stackexchange.com/a/18393/36296 for a short example how the calc library works
– samcarter
2 hours ago
draw[arrow] (d1|-he) -| (d2); draw[arrow] (d2|-he) -| (dn);
would also do, so you may not even needcalc
here. And perhapstikzset{cell/.style={rectangle, minimum width=1.5cm, minimum height=1.5cm, text centered, draw=black, fill=green!20}, tensor/.style={circle, minimum width=1cm, text centered, draw=black, fill=green!10}, arrow/.style={thick,->,>=stealth}}
?
– marmot
42 mins ago
@marmot Thanks for your suggestions! I just fixed thetikzset
and will soon post a second example without calc.
– samcarter
10 mins ago
Thanks a lot, you're awsome ! Could you give a bit background or give some resources so I understand how to reuse this kind of things ?
– Ricocotam
4 hours ago
Thanks a lot, you're awsome ! Could you give a bit background or give some resources so I understand how to reuse this kind of things ?
– Ricocotam
4 hours ago
@Ricocotam See tex.stackexchange.com/a/18393/36296 for a short example how the calc library works
– samcarter
2 hours ago
@Ricocotam See tex.stackexchange.com/a/18393/36296 for a short example how the calc library works
– samcarter
2 hours ago
draw[arrow] (d1|-he) -| (d2); draw[arrow] (d2|-he) -| (dn);
would also do, so you may not even need calc
here. And perhaps tikzset{cell/.style={rectangle, minimum width=1.5cm, minimum height=1.5cm, text centered, draw=black, fill=green!20}, tensor/.style={circle, minimum width=1cm, text centered, draw=black, fill=green!10}, arrow/.style={thick,->,>=stealth}}
?– marmot
42 mins ago
draw[arrow] (d1|-he) -| (d2); draw[arrow] (d2|-he) -| (dn);
would also do, so you may not even need calc
here. And perhaps tikzset{cell/.style={rectangle, minimum width=1.5cm, minimum height=1.5cm, text centered, draw=black, fill=green!20}, tensor/.style={circle, minimum width=1cm, text centered, draw=black, fill=green!10}, arrow/.style={thick,->,>=stealth}}
?– marmot
42 mins ago
@marmot Thanks for your suggestions! I just fixed the
tikzset
and will soon post a second example without calc.– samcarter
10 mins ago
@marmot Thanks for your suggestions! I just fixed the
tikzset
and will soon post a second example without calc.– samcarter
10 mins ago
add a comment |
This is what I see (okular
) at 100% zoom:
so I can't see any "darkening". Now, zooming in:
This is a rendering/aliasing problem for subpixel zooms, and it is mostly unsolvable (it depends on the anti-aliasing algorithm of the viewer).
add a comment |
This is what I see (okular
) at 100% zoom:
so I can't see any "darkening". Now, zooming in:
This is a rendering/aliasing problem for subpixel zooms, and it is mostly unsolvable (it depends on the anti-aliasing algorithm of the viewer).
add a comment |
This is what I see (okular
) at 100% zoom:
so I can't see any "darkening". Now, zooming in:
This is a rendering/aliasing problem for subpixel zooms, and it is mostly unsolvable (it depends on the anti-aliasing algorithm of the viewer).
This is what I see (okular
) at 100% zoom:
so I can't see any "darkening". Now, zooming in:
This is a rendering/aliasing problem for subpixel zooms, and it is mostly unsolvable (it depends on the anti-aliasing algorithm of the viewer).
answered 4 hours ago
RmanoRmano
7,88721647
7,88721647
add a comment |
add a comment |
Ricocotam is a new contributor. Be nice, and check out our Code of Conduct.
Ricocotam is a new contributor. Be nice, and check out our Code of Conduct.
Ricocotam is a new contributor. Be nice, and check out our Code of Conduct.
Ricocotam 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.
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%2f471444%2ftikz-overlapping-arrows-make-them-too-big%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.Stackexchange! Can you make your example compilable? When I try to run your code I get errors. I can debug them, but how would I know if this still reproduces the problem you are asking about?
– samcarter
4 hours ago
Actually, as I know, if two lines overlapping each other in TikZ, they are darkened.
– JouleV
4 hours ago
@samcarter I fixed it, bad copy/paster my bad
– Ricocotam
4 hours ago
@joulev That's exactly my problem, I don't want arrows being darkened
– Ricocotam
4 hours ago
1
Have you tried to print it? There are often aliasing problems with PDF viewers, and the line can seems darker or not depending on the zoom level.
– Rmano
4 hours ago