Circle and colored-arrow in xypic

colorxy-pic

I'm using \usepackage[all,cmtip]{xy} and I'd like to create a circle for $\overline{D_1^n}$, I'd like to color in red the $f\circ\pi$-arrow, I'd like also to shade the $S^n/\mathbb{Z}^2$. I inserted the dsfrac-funcion, where dsfrac stands for

\newcommand{\dsfrac}[2]{\displaystyle{\Huge{\sfrac{#1}{#2}}}}

The code is:

\documentclass{book}
\usepackage[all,cmtip]{xy}
\usepackage{stix}
\usepackage{mathtools}
\usepackage{xfrac}
\usepackage[bb=ams]{mathalpha}

\begin{document}

\Large

\newcommand{\dsfrac}[2]{\displaystyle{\Huge{\sfrac{#1}{#2}}}}

\newcommand{\tonde}[1]{\bigl(#1\bigr)}

\newcommand{\Z}{\mathbb Z}

\renewcommand{\P}{\mathbb P}

\newcommand{\R}{\mathbb R}

\begin{equation}
\xymatrix{{\overline{D_1^n}}\ar@{^{(}->}[rr]^{i}\ar@{>>}[d]_{\pi_1}\ar@{^{(}->>}[drr]_{f\circ\pi_1}^{\pi_2\circ i}&&S^n\ar@{>>}[d]^{\pi_ 2}\\\dsfrac{\overline{D_1^n}}{\!\!\sim}\ar@{^{(}->>}[rr]^{f}_{\cong}&&\boxed{\dsfrac{S^n}{\Z^2}}\ar@{=}[r]&\P^n\tonde{\R}}
\end{equation}

\end{document}

Thank you so much

Best Answer

Here is a solution with tikz-cd, which makes this somewhat easier. In particular, you can use cells=nodes to get your box and circle.

There are a few problems with the way you are changing type size in your code. If you want to enlarge the whole diagram, use the adjustbox package and

\adjustbox{scale=1.5,center}{\begin{tikzcd}...\end{tikzcd}}

I wasn't sure what you meant by shading the $S^n/\mathbb{Z}^2$, so I made it blue. Easy to change that.

To change the arrowheads, add arrow style=tikz, >={Triangle[length=2mm]} to the tikzcd options. You can adjust the length and width of the arrowheads however you like. You might also consider >={latex} as a similar option.

enter image description here

\documentclass{article}
\usepackage{amsmath}
\usepackage{stix}
\usepackage{tikz-cd}
\usepackage{adjustbox}

\newcommand{\Z}{\mathbb Z}
\renewcommand{\P}{\mathbb P}
\newcommand{\R}{\mathbb R}

\begin{document}

\begin{tikzcd}[arrow style=tikz, >={Triangle[length=2mm]}, cells={nodes={inner sep=2mm}}, row sep=1cm]
\overline{D_1^n}\arrow[rr, hook, "i"]\arrow[drr, red, hook, two heads, text=black, "\pi_2\circ i", "f\circ\pi_1"']\arrow[d, two heads, "\pi_1"'] 
    && S^n\arrow[d, two heads, "\pi_2"]\\
|[draw, circle, inner sep=0pt, outer sep=2pt]|\raisebox{.5ex}{$\overline{D_1^n}$}\Big/\raisebox{-.5ex}{$\sim$}\arrow[rr, hook, two heads, "f", "\cong"'] 
    && |[draw, inner sep=2pt, outer sep=2pt, text=blue]|\raisebox{.5ex}{$S^n\!$}\Big/\raisebox{-.5ex}{$\Z^2$}\arrow[r, equals] & \P^n(\R) 
\end{tikzcd}

\end{document}
Related Question