答案1
tikz-cd
使用包应用包的技巧,xy
我们有:
\documentclass[a4paper,12pt]{article}
\usepackage{amsmath,amssymb}
\usepackage[all,cmtip]{xy}
\begin{document}
\xymatrix{A \ar[r] \ar@{-->}@/_2.5pc/[rr]_{g \circ f} &B \ar[r] &C}
\end{document}
附有包装提示xy
:
\documentclass[a4paper,12pt]{article}
\usepackage{amsmath,amssymb}
\usepackage[all]{xy}
\begin{document}
\xymatrix{A \ar[r] \ar@{-->}@/_2.5pc/[rr]_{g \circ f} &B \ar[r] &C}
\end{document}
第二幅图:
\documentclass[a4paper,12pt]{article}
\usepackage{amsmath,amssymb}
\usepackage[all]{xy}
\begin{document}
\xymatrix{ & B\ar[rr]^g \ar@{-->}[drrr]_{h\circ g} & & C\ar[dr]^h \\
A \ar[ur]^f \ar@{-->}[rrrr]_{h\circ(g\circ f)} \ar@{-->}[urrr]_{g\circ f} \ar@{-->}@/_2.5pc/[rrrr]_{(h\circ g)\circ f}& & & & D
}
\end{document}
包装的提示箭头tikz-cd
。
\documentclass[a4paper,12pt]{article}
\usepackage{amsmath,amssymb}
\usepackage[all,cmtip]{xy}
\begin{document}
\xymatrix{ & B\ar[rr]^g \ar@{-->}[drrr]_{h\circ g} & & C\ar[dr]^h \\
A \ar[ur]^f \ar@{-->}[rrrr]_{h\circ(g\circ f)} \ar@{-->}[urrr]_{g\circ f} \ar@{-->}@/_2.5pc/[rrrr]_{(h\circ g)\circ f}& & & & D
}
\end{document}
答案2
以下是第一个映射的代码:
\begin{tikzpicture}[]
\node[](A){A};
\node[right of=A](B){B};
\node[right of=B](C){C};
\path[draw, -latex'] (A) -- node[above]{$f$} (B);
\path[draw, -latex'] (B) -- node[above]{$g$} (C);
\path[draw, -latex', dashed] (A) to [bend right] node[below]{$g\circ f$} (C);
\end{tikzpicture}
以下是第二次映射的代码:
\begin{tikzpicture}[]
\node[](A){A};
\node[above right of=A, node distance=20 mm](B){B};
\node[right of=B, node distance=20 mm](C){C};
\node[below right of=C, node distance=20 mm](D){D};
\path[draw, -latex'] (A) -- node[above]{$f$} (B);
\path[draw, -latex'] (B) -- node[above]{$g$} (C);
\path[draw, -latex'] (C) -- node[above]{$h$} (D);
\path[draw, -latex', dashed] (A) -- node[below]{$g\circ f$} (C);
\path[draw, -latex', dashed] (B) -- node[below]{$h\circ g$} (D);
\path[draw, -latex', dashed] (A) -- node[below]{$h\circ (g\circ f)$} (D);
\path[draw, -latex', dashed] (A) to [bend right] node[below]{$(h\circ g)\circ f$} (D);
\end{tikzpicture}
输出: