4

I'd like to use a dashed hook right arrow instead of a classic one in my LaTeX document, but I don't know how to create one. MWE:

\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{fullpage}

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{mathtools}
\usepackage{tikz-cd}

\begin{document}
 \[
 \begin{tikzcd}[row sep=huge, column sep=large]
  \Z \arrow{r}{\Phi} \arrow[twoheadrightarrow]{d} & R \\
  \Z_n \arrow[hookrightarrow]{ru}[swap]{\bar{\Phi}}
 \end{tikzcd}
 \]
\end{document}
  • 1
    \arrow[hookrightarrow,dashed]{ru}[swap]{\bar{\Phi}}? – user121799 Dec 5 '18 at 15:39
  • Easier: \arrow[ru,hookrightarrow,dashed,swap,"\bar{\Phi}"] (no need to remember the order of arguments. – egreg Dec 5 '18 at 16:49
6

Add the keyword dashed. There's a simpler syntax available, which doesn't require to remember the argument positions.

Note that hook is sufficient. Similarly, two heads is simpler than twoheadrightarrow.

\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{mathtools}
\usepackage{tikz-cd}

\newcommand{\Z}{\mathbb{Z}}

\begin{document}

\[
\begin{tikzcd}[row sep=huge, column sep=large]
  \Z \arrow[r,"\Phi"] \arrow[d,two heads] & R \\
  \Z_n \arrow[ru,hook,dashed,swap,"\bar{\Phi}"]
\end{tikzcd}
\]

\end{document}

enter image description here

1

An alternative with xymatrix.

enter image description here

\documentclass[a4paper,12pt]{article}
\usepackage[all,cmtip]{xy}
\usepackage{amsmath}
\usepackage{amssymb}

\begin{document}
\xymatrix{
\mathbb{Z} \ar@{->>}[d] \ar[r]^{\Phi}& R \ar@{<--^{)}}[ld]^{\bar{\Phi}}\\
\mathbb{Z}}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.