6
\documentclass[convert = false, tikz]{standalone}

\usepackage{float}

\begin{document}

\begin{tikzpicture}[every node/.style={midway}]
  \matrix[column sep={4em,between origins}, row sep={2em}] at (0,0) {

    \node(A) {$A$}  ; & \node(B) {$B$}; \\

    \node(C) {$C$}  ; & \node (D) {$D$};\\
  };
  \draw[<-] (C) -- (D) node[anchor=east]{};

  \draw[->] (A) -- (B) node[anchor=south] {};

  \draw[->] (B) -- (D) node[anchor=west] {};

  \draw[->] (C) -- (D) node[anchor=north] {};

\end{tikzpicture}

\end{document}

Here, I am trying to use an inclusion arrow between $A$ to $C$. Could you please suggest any idea for me? Thanks

1
  • Why latex3? and why beamerposter?
    – Manuel
    Commented Feb 27, 2014 at 0:22

2 Answers 2

9

Use left hook-> or right hook-> from the library arrows:

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows}

\begin{document}

    \begin{tikzpicture}[every node/.style={midway}]
        \matrix[column sep={4em,between origins}, row sep={2em}] at (0,0) {
            \node(A) {$A$}; & \node(B) {$B$}; \\
            \node(C) {$C$}; & \node(D) {$D$}; \\
        };

        \draw[<->] (C) -- (D) node[anchor=east]{};
        \draw[->] (A) -- (B) node[anchor=south]{};
        \draw[->] (B) -- (D) node[anchor=west]{};
        \draw[right hook->] (A) -- (C) node[anchor=north]{};

    \end{tikzpicture}

\end{document}
9

Much more compact with tikz-cd

\documentclass{standalone}
\usepackage{tikz-cd}

\begin{document}
\begin{tikzcd}
A \arrow{r} \arrow[hookrightarrow]{d} & B \arrow{d}
\\
C \arrow[leftrightarrow]{r} & D
\end{tikzcd}
\end{document}

enter image description here

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .