我对箭头的描述很长,但row sep = huge
箭头不够长。有没有办法更好地格式化它?
\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{tikz-cd}
\usepackage{fullpage}
\usepackage{amsthm}
\usepackage{adjustbox}
\usepackage{xcolor}
\begin{document}
\begin{tikzcd}[column sep = huge, row sep = huge]
E \arrow[r, "e"] & \Pi_{i \in ob(\mathcal{E})} F(i) \arrow[r, shift left, "
{<\pi_{cod(u)} \ | \ u \in \hom(\mathcal{E})>}"] \arrow[r, shift right, "{<F(u)
\pi_{dom(u)} \ | \ u \in \hom(\mathcal{E})}"'] & {\Pi_{u \in \hom(\mathcal{E})
F(cod(u))}}
\end{tikzcd}
\end{document}
答案1
以下是两种不同的方法
\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{tikz-cd}
\DeclareMathOperator{\cod}{cod}
\DeclareMathOperator{\dom}{dom}
\DeclareMathOperator{\ob}{ob}
\begin{document}
Option 1: wide column separation specified by dimension
\begin{equation*}
\begin{tikzcd}[column sep = 10em]
E \arrow[r, "e"] & \displaystyle\prod_{i \in
\ob(\mathcal{E})} \mkern-12mu F(i)
\arrow[r, shift left, " {\langle\pi_{\cod(u)} \mid u \in
\hom(\mathcal{E})\rangle}"] \arrow[r, shift right, "{\langle F(u)
\pi_{\dom(u)} \mid u \in
\hom(\mathcal{E})\rangle}"']
& {\displaystyle\prod_{u \in \hom(\mathcal{E})} \mkern-12mu F(\cod(u))}
\end{tikzcd}
\end{equation*}
Option 2: let arrows cover two (or more) columns
\begin{equation*}
\begin{tikzcd}[column sep = huge]
E \arrow[r, "e"]
& \displaystyle\prod_{i \in \ob(\mathcal{E})} \mkern-12mu F(i)
\arrow[rr, shift left, " {\langle\pi_{\cod(u)} \mid u \in
\hom(\mathcal{E})\rangle}"]
\arrow[rr, shift right, "{\langle F(u) \pi_{\dom(u)}
\mid u \in \hom(\mathcal{E})\rangle}"']
&& {\displaystyle\prod_{u \in \hom(\mathcal{E})} \mkern-12mu F(\cod(u))}
\end{tikzcd}
\end{equation*}
\end{document}
第一种是简单地指定column sep
为维度。第二种是在长箭头下添加一个额外的列,这样你就有了
A \arrow[r] & B \arrow[rr] && C
代替
A \arrow[r] & B \arrow[r] & C
您可以使用更多列来使其更宽
A \arrow[r] & B \arrow[rrr] &&& C
ETC。
请注意,我已重新编码了你的大部分数学知识。
上述解决方案对应于使用固定网格,这通常是实现一致间距的好主意。另一种方法是使用 egreg 的答案中的额外空间语法:
&[5em]
在第一行,将把后续列5em
向右推,从而使相应的箭头更长。
答案2
添加宽度规范:
\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{tikz-cd}
\DeclareMathOperator{\ob}{ob}
\DeclareMathOperator{\dom}{dom}
\DeclareMathOperator{\cod}{cod}
\begin{document}
\begin{tikzcd}
E \arrow[r, "e"] &
\prod_{i \in \ob(\mathcal{E})} F(i)
\arrow[
r, shift left,
"{\langle\pi_{\cod(u)} \mid u \in \hom(\mathcal{E})\rangle}"
]
\arrow[
r, shift right,
"{\langle F(u)\pi_{\dom(u)} \mid u \in \hom(\mathcal{E})\rangle}"'
] &[8em]
\prod_{u \in \hom(\mathcal{E})} F(\cod(u))
\end{tikzcd}
\end{document}
请注意我所做的调整:
<...>
应该\langle...\rangle
\Pi
应该\prod
\ | \
应该\mid
- ob、dom 和 cod 应直立排版
一个可能的替代方案\smashoperator
是使图表更短:
\documentclass{article}
\usepackage{amsmath,mathtools}
\usepackage{amssymb}
\usepackage{tikz-cd}
\DeclareMathOperator{\ob}{ob}
\DeclareMathOperator{\dom}{dom}
\DeclareMathOperator{\cod}{cod}
\begin{document}
\begin{tikzcd}
E \arrow[r, "e"] &
\smashoperator{\prod_{i \in \ob(\mathcal{E})}} F(i)
\arrow[
r, shift left,
"{\langle\pi_{\cod(u)} \mid u \in \hom(\mathcal{E})\rangle}"
]
\arrow[
r, shift right,
"{\langle F(u)\pi_{\dom(u)} \mid u \in \hom(\mathcal{E})\rangle}"'
] &[10em]
\smashoperator{\prod_{u \in \hom(\mathcal{E})}} F(\cod(u))
\end{tikzcd}
\end{document}
答案3
在第 2 列和第 3 列之间添加一个空列。我还对图表进行了一些改进。
\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{tikz-cd}
\usepackage{fullpage}
\usepackage{amsthm}
\usepackage{adjustbox}
\begin{document}
\begin{tikzcd}[column sep= huge, row sep=huge]
E \arrow[r, "e"] & \Pi_{i \in ob(\mathcal{E})} F(i) \arrow[rr, shift left=1ex, "
{\langle\pi_{cod(u)} \, | \, u \in \hom(\mathcal{E})\rangle}"] \arrow[rr, shift right=1ex, "{\langle F(u)
\pi_{dom(u)} \, | \, u \in \hom(\mathcal{E})\rangle}"'] & & {\Pi_{u \in \hom(\mathcal{E})
F(cod(u))}}
\end{tikzcd}
\end{document}
答案4
我以正常的 Ti 重新制作了一切钾Z 并纠正(许多)拼写错误。另外,请注意,我使用\langle
and\rangle
而不是<
and >
。我认为在这种情况下,曲线总是比直线更具可读性。
\documentclass{standalone}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{positioning}
\DeclareMathOperator{\ob}{ob}
\DeclareMathOperator{\cod}{cod}
\DeclareMathOperator{\dom}{dom}
\begin{document}
\begin{tikzpicture}[>=stealth]
\node (mid) {$\prod_{i \in \ob(\mathcal{E})} F(i)$};
\node[left=1cm of mid] (left) {$E$};
\node[right=4cm of mid] (right) {$\prod_{u \in \hom(\mathcal{E})}F(\cod(u))$};
\draw[->] (left)--(mid) node[midway,above] {$\scriptstyle e$};
\draw[->] ([yshift=.2em]mid.east) to[bend left=5] node[midway,above] {$\scriptstyle\langle\pi_{\cod(u)} \ | \ u \in \hom(\mathcal{E})\rangle$} ([yshift=.2em]right.west);
\draw[->] ([yshift=-.2em]mid.east) to[bend right=5] node[midway,below] {$\scriptstyle\langle F(u)\pi_{\dom(u)} \ | \ u \in \hom(\mathcal{E})\rangle$} ([yshift=-.2em]right.west);
\end{tikzpicture}
\end{document}