Inclusion arrow in TikZ











up vote
14
down vote

favorite
11












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); }









share|improve this question




























    up vote
    14
    down vote

    favorite
    11












    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); }









    share|improve this question


























      up vote
      14
      down vote

      favorite
      11









      up vote
      14
      down vote

      favorite
      11






      11





      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); }









      share|improve this question















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 27 mins ago

























      asked Aug 24 '12 at 23:01









      c.p.

      2,72142038




      2,72142038






















          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}


          enter image description here



          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}


          enter image description here



          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}





          share|improve this answer























          • @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


















          up vote
          15
          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:



          enter image description here



          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}





          share|improve this answer





















            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "85"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f68676%2finclusion-arrow-in-tikz%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








            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}


            enter image description here



            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}


            enter image description here



            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}





            share|improve this answer























            • @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















            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}


            enter image description here



            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}


            enter image description here



            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}





            share|improve this answer























            • @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













            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}


            enter image description here



            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}


            enter image description here



            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}





            share|improve this answer














            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}


            enter image description here



            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}


            enter image description here



            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}






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Jun 3 '17 at 13:45









            Moriambar

            7,82731846




            7,82731846










            answered Aug 25 '12 at 0:49









            Gonzalo Medina

            393k4012881558




            393k4012881558












            • @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




            @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










            up vote
            15
            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:



            enter image description here



            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}





            share|improve this answer

























              up vote
              15
              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:



              enter image description here



              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}





              share|improve this answer























                up vote
                15
                down vote










                up vote
                15
                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:



                enter image description here



                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}





                share|improve this answer












                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:



                enter image description here



                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}






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Aug 24 '12 at 23:25









                Peter Grill

                163k24432743




                163k24432743






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    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.




                    draft saved


                    draft discarded














                    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





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    サソリ

                    広島県道265号伴広島線

                    Accessing regular linux commands in Huawei's Dopra Linux