Inclusion arrow in TikZ
up vote
14
down vote
favorite
How can I give shape to some arrow in tikz, to draw the inclusion arrow?
I read a similar question How to typeset inclusion arrow? with given answer, but the answer didn't really used TikZ, which I really need in order to produce nice large diagrams.
For instance, in this diagram (taken from here ), I want, say, A to be included in A' :
matrix (m) [matrix of math nodes, row sep=3em, column sep=3em]
{ 0 & A & B & C & 0 \
0 & A' & B' & C' & 0 \ };
{ [start chain] chainin (m-1-1);
chainin (m-1-2);
{ [start branch=A] chainin (m-2-2)
[join={node[right,labeled] {eta_1}}];}
chainin (m-1-3) [join={node[above,labeled] {varphi}}];
{ [start branch=B] chainin (m-2-3)
[join={node[right,labeled] {eta_2}}];}
chainin (m-1-4) [join={node[above,labeled] {psi}}];
{ [start branch=C] chainin (m-2-4)
[join={node[right,labeled] {eta_3}}];}
chainin (m-1-5); }
{ [start chain] chainin (m-2-1);
chainin (m-2-2);
chainin (m-2-3) [join={node[above,labeled] {varphi'}}];
chainin (m-2-4) [join={node[above,labeled] {psi'}}];
chainin (m-2-5); }
tikz-pgf diagrams arrows
add a comment |
up vote
14
down vote
favorite
How can I give shape to some arrow in tikz, to draw the inclusion arrow?
I read a similar question How to typeset inclusion arrow? with given answer, but the answer didn't really used TikZ, which I really need in order to produce nice large diagrams.
For instance, in this diagram (taken from here ), I want, say, A to be included in A' :
matrix (m) [matrix of math nodes, row sep=3em, column sep=3em]
{ 0 & A & B & C & 0 \
0 & A' & B' & C' & 0 \ };
{ [start chain] chainin (m-1-1);
chainin (m-1-2);
{ [start branch=A] chainin (m-2-2)
[join={node[right,labeled] {eta_1}}];}
chainin (m-1-3) [join={node[above,labeled] {varphi}}];
{ [start branch=B] chainin (m-2-3)
[join={node[right,labeled] {eta_2}}];}
chainin (m-1-4) [join={node[above,labeled] {psi}}];
{ [start branch=C] chainin (m-2-4)
[join={node[right,labeled] {eta_3}}];}
chainin (m-1-5); }
{ [start chain] chainin (m-2-1);
chainin (m-2-2);
chainin (m-2-3) [join={node[above,labeled] {varphi'}}];
chainin (m-2-4) [join={node[above,labeled] {psi'}}];
chainin (m-2-5); }
tikz-pgf diagrams arrows
add a comment |
up vote
14
down vote
favorite
up vote
14
down vote
favorite
How can I give shape to some arrow in tikz, to draw the inclusion arrow?
I read a similar question How to typeset inclusion arrow? with given answer, but the answer didn't really used TikZ, which I really need in order to produce nice large diagrams.
For instance, in this diagram (taken from here ), I want, say, A to be included in A' :
matrix (m) [matrix of math nodes, row sep=3em, column sep=3em]
{ 0 & A & B & C & 0 \
0 & A' & B' & C' & 0 \ };
{ [start chain] chainin (m-1-1);
chainin (m-1-2);
{ [start branch=A] chainin (m-2-2)
[join={node[right,labeled] {eta_1}}];}
chainin (m-1-3) [join={node[above,labeled] {varphi}}];
{ [start branch=B] chainin (m-2-3)
[join={node[right,labeled] {eta_2}}];}
chainin (m-1-4) [join={node[above,labeled] {psi}}];
{ [start branch=C] chainin (m-2-4)
[join={node[right,labeled] {eta_3}}];}
chainin (m-1-5); }
{ [start chain] chainin (m-2-1);
chainin (m-2-2);
chainin (m-2-3) [join={node[above,labeled] {varphi'}}];
chainin (m-2-4) [join={node[above,labeled] {psi'}}];
chainin (m-2-5); }
tikz-pgf diagrams arrows
How can I give shape to some arrow in tikz, to draw the inclusion arrow?
I read a similar question How to typeset inclusion arrow? with given answer, but the answer didn't really used TikZ, which I really need in order to produce nice large diagrams.
For instance, in this diagram (taken from here ), I want, say, A to be included in A' :
matrix (m) [matrix of math nodes, row sep=3em, column sep=3em]
{ 0 & A & B & C & 0 \
0 & A' & B' & C' & 0 \ };
{ [start chain] chainin (m-1-1);
chainin (m-1-2);
{ [start branch=A] chainin (m-2-2)
[join={node[right,labeled] {eta_1}}];}
chainin (m-1-3) [join={node[above,labeled] {varphi}}];
{ [start branch=B] chainin (m-2-3)
[join={node[right,labeled] {eta_2}}];}
chainin (m-1-4) [join={node[above,labeled] {psi}}];
{ [start branch=C] chainin (m-2-4)
[join={node[right,labeled] {eta_3}}];}
chainin (m-1-5); }
{ [start chain] chainin (m-2-1);
chainin (m-2-2);
chainin (m-2-3) [join={node[above,labeled] {varphi'}}];
chainin (m-2-4) [join={node[above,labeled] {psi'}}];
chainin (m-2-5); }
tikz-pgf diagrams arrows
tikz-pgf diagrams arrows
edited Dec 5 at 7:09
asked Aug 24 '12 at 23:01
c.p.
2,72142038
2,72142038
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
13
down vote
accepted
For commutative diagrams I suggest using the tikz-cd
package; it uses TikZ
to facilitate the drawing of commutative diagrams (it has its own arrows library designed for diagrams and the arrow you are looking for is already buil-in); a little example with the requested inclusion (and some others just for illustration):
documentclass{article}
usepackage{tikz-cd}
begin{document}
begin{tikzcd}
0 arrow[hookrightarrow]{r}
& Aarrow[hookrightarrow]{r}{varphi}arrow[hookrightarrow]{d}{eta_1}
& Barrow{r}{psi}arrow{d}{eta_2}
& Carrow{r}arrow{d}{eta_3}
& 0 \
0 arrow[hookrightarrow]{r}
& A'arrow[hookrightarrow]{r}[swap]{varphi'}
& B'arrow{r}[swap]{psi'}
& C'arrow{r}
& 0
end{tikzcd}
end{document}
You can use the arrows
library from TikZ
, so for example, to use the -latex
style from TikZ
, you can say
documentclass{article}
usepackage{tikz-cd}
usetikzlibrary{arrows}
tikzset{
commutative diagrams/.cd,
arrow style=tikz,
diagrams={>=latex}}
begin{document}
begin{tikzcd}
0 arrow[hookrightarrow]{r}
& Aarrow[hookrightarrow]{r}{varphi}arrow[hookrightarrow]{d}{eta_1}
& Barrow{r}{psi}arrow{d}{eta_2}
& Carrow{r}arrow{d}{eta_3}
& 0 \
0 arrow[hookrightarrow]{r}
& A'arrow[hookrightarrow]{r}[swap]{varphi'}
& B'arrow{r}[swap]{psi'}
& C'arrow{r}
& 0
end{tikzcd}
end{document}
The above code changes the tip arrow style for all the diagrams, but you can select the -latex arrow tip just for some arrows (perhaps not really desirable to have two different arrow tips on the same diagram):
arrow[hookrightarrow,-latex]{d}{eta_1}
@JorgeCampos yes, the syntax is similar. Regarding the arrow tips, I updated my answer showing how to do it.
– Gonzalo Medina
Aug 26 '12 at 2:19
add a comment |
up vote
17
down vote
You can use the right hook-latex
, or right hook->
arrow (depending on the arrow type you want on the other side) from the arrows
library:
Code:
documentclass{article}
usepackage{tikz}
usetikzlibrary{arrows}
begin{document}
begin{tikzpicture}
draw [ultra thick, right hook-latex, red] (0, 0) -- (3, 0);
draw [ultra thick, right hook->, blue] (0,-1) -- (3,-1);
end{tikzpicture}
end{document}
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
13
down vote
accepted
For commutative diagrams I suggest using the tikz-cd
package; it uses TikZ
to facilitate the drawing of commutative diagrams (it has its own arrows library designed for diagrams and the arrow you are looking for is already buil-in); a little example with the requested inclusion (and some others just for illustration):
documentclass{article}
usepackage{tikz-cd}
begin{document}
begin{tikzcd}
0 arrow[hookrightarrow]{r}
& Aarrow[hookrightarrow]{r}{varphi}arrow[hookrightarrow]{d}{eta_1}
& Barrow{r}{psi}arrow{d}{eta_2}
& Carrow{r}arrow{d}{eta_3}
& 0 \
0 arrow[hookrightarrow]{r}
& A'arrow[hookrightarrow]{r}[swap]{varphi'}
& B'arrow{r}[swap]{psi'}
& C'arrow{r}
& 0
end{tikzcd}
end{document}
You can use the arrows
library from TikZ
, so for example, to use the -latex
style from TikZ
, you can say
documentclass{article}
usepackage{tikz-cd}
usetikzlibrary{arrows}
tikzset{
commutative diagrams/.cd,
arrow style=tikz,
diagrams={>=latex}}
begin{document}
begin{tikzcd}
0 arrow[hookrightarrow]{r}
& Aarrow[hookrightarrow]{r}{varphi}arrow[hookrightarrow]{d}{eta_1}
& Barrow{r}{psi}arrow{d}{eta_2}
& Carrow{r}arrow{d}{eta_3}
& 0 \
0 arrow[hookrightarrow]{r}
& A'arrow[hookrightarrow]{r}[swap]{varphi'}
& B'arrow{r}[swap]{psi'}
& C'arrow{r}
& 0
end{tikzcd}
end{document}
The above code changes the tip arrow style for all the diagrams, but you can select the -latex arrow tip just for some arrows (perhaps not really desirable to have two different arrow tips on the same diagram):
arrow[hookrightarrow,-latex]{d}{eta_1}
@JorgeCampos yes, the syntax is similar. Regarding the arrow tips, I updated my answer showing how to do it.
– Gonzalo Medina
Aug 26 '12 at 2:19
add a comment |
up vote
13
down vote
accepted
For commutative diagrams I suggest using the tikz-cd
package; it uses TikZ
to facilitate the drawing of commutative diagrams (it has its own arrows library designed for diagrams and the arrow you are looking for is already buil-in); a little example with the requested inclusion (and some others just for illustration):
documentclass{article}
usepackage{tikz-cd}
begin{document}
begin{tikzcd}
0 arrow[hookrightarrow]{r}
& Aarrow[hookrightarrow]{r}{varphi}arrow[hookrightarrow]{d}{eta_1}
& Barrow{r}{psi}arrow{d}{eta_2}
& Carrow{r}arrow{d}{eta_3}
& 0 \
0 arrow[hookrightarrow]{r}
& A'arrow[hookrightarrow]{r}[swap]{varphi'}
& B'arrow{r}[swap]{psi'}
& C'arrow{r}
& 0
end{tikzcd}
end{document}
You can use the arrows
library from TikZ
, so for example, to use the -latex
style from TikZ
, you can say
documentclass{article}
usepackage{tikz-cd}
usetikzlibrary{arrows}
tikzset{
commutative diagrams/.cd,
arrow style=tikz,
diagrams={>=latex}}
begin{document}
begin{tikzcd}
0 arrow[hookrightarrow]{r}
& Aarrow[hookrightarrow]{r}{varphi}arrow[hookrightarrow]{d}{eta_1}
& Barrow{r}{psi}arrow{d}{eta_2}
& Carrow{r}arrow{d}{eta_3}
& 0 \
0 arrow[hookrightarrow]{r}
& A'arrow[hookrightarrow]{r}[swap]{varphi'}
& B'arrow{r}[swap]{psi'}
& C'arrow{r}
& 0
end{tikzcd}
end{document}
The above code changes the tip arrow style for all the diagrams, but you can select the -latex arrow tip just for some arrows (perhaps not really desirable to have two different arrow tips on the same diagram):
arrow[hookrightarrow,-latex]{d}{eta_1}
@JorgeCampos yes, the syntax is similar. Regarding the arrow tips, I updated my answer showing how to do it.
– Gonzalo Medina
Aug 26 '12 at 2:19
add a comment |
up vote
13
down vote
accepted
up vote
13
down vote
accepted
For commutative diagrams I suggest using the tikz-cd
package; it uses TikZ
to facilitate the drawing of commutative diagrams (it has its own arrows library designed for diagrams and the arrow you are looking for is already buil-in); a little example with the requested inclusion (and some others just for illustration):
documentclass{article}
usepackage{tikz-cd}
begin{document}
begin{tikzcd}
0 arrow[hookrightarrow]{r}
& Aarrow[hookrightarrow]{r}{varphi}arrow[hookrightarrow]{d}{eta_1}
& Barrow{r}{psi}arrow{d}{eta_2}
& Carrow{r}arrow{d}{eta_3}
& 0 \
0 arrow[hookrightarrow]{r}
& A'arrow[hookrightarrow]{r}[swap]{varphi'}
& B'arrow{r}[swap]{psi'}
& C'arrow{r}
& 0
end{tikzcd}
end{document}
You can use the arrows
library from TikZ
, so for example, to use the -latex
style from TikZ
, you can say
documentclass{article}
usepackage{tikz-cd}
usetikzlibrary{arrows}
tikzset{
commutative diagrams/.cd,
arrow style=tikz,
diagrams={>=latex}}
begin{document}
begin{tikzcd}
0 arrow[hookrightarrow]{r}
& Aarrow[hookrightarrow]{r}{varphi}arrow[hookrightarrow]{d}{eta_1}
& Barrow{r}{psi}arrow{d}{eta_2}
& Carrow{r}arrow{d}{eta_3}
& 0 \
0 arrow[hookrightarrow]{r}
& A'arrow[hookrightarrow]{r}[swap]{varphi'}
& B'arrow{r}[swap]{psi'}
& C'arrow{r}
& 0
end{tikzcd}
end{document}
The above code changes the tip arrow style for all the diagrams, but you can select the -latex arrow tip just for some arrows (perhaps not really desirable to have two different arrow tips on the same diagram):
arrow[hookrightarrow,-latex]{d}{eta_1}
For commutative diagrams I suggest using the tikz-cd
package; it uses TikZ
to facilitate the drawing of commutative diagrams (it has its own arrows library designed for diagrams and the arrow you are looking for is already buil-in); a little example with the requested inclusion (and some others just for illustration):
documentclass{article}
usepackage{tikz-cd}
begin{document}
begin{tikzcd}
0 arrow[hookrightarrow]{r}
& Aarrow[hookrightarrow]{r}{varphi}arrow[hookrightarrow]{d}{eta_1}
& Barrow{r}{psi}arrow{d}{eta_2}
& Carrow{r}arrow{d}{eta_3}
& 0 \
0 arrow[hookrightarrow]{r}
& A'arrow[hookrightarrow]{r}[swap]{varphi'}
& B'arrow{r}[swap]{psi'}
& C'arrow{r}
& 0
end{tikzcd}
end{document}
You can use the arrows
library from TikZ
, so for example, to use the -latex
style from TikZ
, you can say
documentclass{article}
usepackage{tikz-cd}
usetikzlibrary{arrows}
tikzset{
commutative diagrams/.cd,
arrow style=tikz,
diagrams={>=latex}}
begin{document}
begin{tikzcd}
0 arrow[hookrightarrow]{r}
& Aarrow[hookrightarrow]{r}{varphi}arrow[hookrightarrow]{d}{eta_1}
& Barrow{r}{psi}arrow{d}{eta_2}
& Carrow{r}arrow{d}{eta_3}
& 0 \
0 arrow[hookrightarrow]{r}
& A'arrow[hookrightarrow]{r}[swap]{varphi'}
& B'arrow{r}[swap]{psi'}
& C'arrow{r}
& 0
end{tikzcd}
end{document}
The above code changes the tip arrow style for all the diagrams, but you can select the -latex arrow tip just for some arrows (perhaps not really desirable to have two different arrow tips on the same diagram):
arrow[hookrightarrow,-latex]{d}{eta_1}
edited Jun 3 '17 at 13:45
Moriambar
7,83731846
7,83731846
answered Aug 25 '12 at 0:49
Gonzalo Medina
394k4012921559
394k4012921559
@JorgeCampos yes, the syntax is similar. Regarding the arrow tips, I updated my answer showing how to do it.
– Gonzalo Medina
Aug 26 '12 at 2:19
add a comment |
@JorgeCampos yes, the syntax is similar. Regarding the arrow tips, I updated my answer showing how to do it.
– Gonzalo Medina
Aug 26 '12 at 2:19
@JorgeCampos yes, the syntax is similar. Regarding the arrow tips, I updated my answer showing how to do it.
– Gonzalo Medina
Aug 26 '12 at 2:19
@JorgeCampos yes, the syntax is similar. Regarding the arrow tips, I updated my answer showing how to do it.
– Gonzalo Medina
Aug 26 '12 at 2:19
add a comment |
up vote
17
down vote
You can use the right hook-latex
, or right hook->
arrow (depending on the arrow type you want on the other side) from the arrows
library:
Code:
documentclass{article}
usepackage{tikz}
usetikzlibrary{arrows}
begin{document}
begin{tikzpicture}
draw [ultra thick, right hook-latex, red] (0, 0) -- (3, 0);
draw [ultra thick, right hook->, blue] (0,-1) -- (3,-1);
end{tikzpicture}
end{document}
add a comment |
up vote
17
down vote
You can use the right hook-latex
, or right hook->
arrow (depending on the arrow type you want on the other side) from the arrows
library:
Code:
documentclass{article}
usepackage{tikz}
usetikzlibrary{arrows}
begin{document}
begin{tikzpicture}
draw [ultra thick, right hook-latex, red] (0, 0) -- (3, 0);
draw [ultra thick, right hook->, blue] (0,-1) -- (3,-1);
end{tikzpicture}
end{document}
add a comment |
up vote
17
down vote
up vote
17
down vote
You can use the right hook-latex
, or right hook->
arrow (depending on the arrow type you want on the other side) from the arrows
library:
Code:
documentclass{article}
usepackage{tikz}
usetikzlibrary{arrows}
begin{document}
begin{tikzpicture}
draw [ultra thick, right hook-latex, red] (0, 0) -- (3, 0);
draw [ultra thick, right hook->, blue] (0,-1) -- (3,-1);
end{tikzpicture}
end{document}
You can use the right hook-latex
, or right hook->
arrow (depending on the arrow type you want on the other side) from the arrows
library:
Code:
documentclass{article}
usepackage{tikz}
usetikzlibrary{arrows}
begin{document}
begin{tikzpicture}
draw [ultra thick, right hook-latex, red] (0, 0) -- (3, 0);
draw [ultra thick, right hook->, blue] (0,-1) -- (3,-1);
end{tikzpicture}
end{document}
answered Aug 24 '12 at 23:25
Peter Grill
163k24432744
163k24432744
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.
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%2f68676%2finclusion-arrow-in-tikz%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