Tikz-cd 交叉问题

Tikz-cd 交叉问题

我正在画一个图,我想让一条特定的线与经过它的其他线交叉。我将我的图的图片放在下面,以便您看到我想要的。

图表

所以,红色箭头表示我希望交叉发生的位置,我希望 A 和 G 之间的线与 B 和 D' 之间的线以及 B 和 F' 之间的线交叉。

黑色箭头表示我不想进行任何更改的位置,我希望 B 和 F' 之间的线与 D 和 {e} 之间的线相交。

我对此进行了如下编程:

\documentclass[border=20]{standalone}
\usepackage[utf8]{inputenc}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amstext}
\usepackage{amssymb}
\usepackage[brazil]{babel}
\usepackage{natbib}
\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage{subfigure}
\usepackage{latexsym}
\usepackage[normalem]{ulem}
\usepackage{graphicx}
\usepackage[all]{xy}
\usepackage{epsfig}
\usepackage{pgf}
\usepackage{tikz-cd}
\usepackage{tikz}
\newcommand{\Q}{\mathbb{Q}}
\begin{document}
\begin{tikzcd}[every arrow/.append style={dash}]
     &&  &&&  & \{e\} &  &&&  &&  \\
     &&  &&&  &  &  &&&  &&  \\
     &&  &&&  &  &  &&&  &&  \\
     &&  &&&  &  &  &&&  &&  \\
     &&  &&&  &  &  &&&  &&  \\
     &&  &&&  &  &  &&&  &&  \\
     &&  &&&  & B'\arrow[uuuuuu, dashed, purple] & A'\arrow[uuuuuul, dashed, blue] &&&  &&  \\
    E'\arrow[uuuuuuurrrrrr, blue]\arrow[dddddrrrrrr, dashed, purple] &&  &&&  &  &  &&&  && F'\arrow[uuuuuuullllll, blue]\arrow[dddddllllll, dashed, crossing over, purple] \\
     &&  &&&  &  &  &&&  &&  \\
     &&  &&&  &  &  &&&  &&  \\
     && C'\arrow[uuuuuuuuuurrrr, crossing over, blue]\arrow[ddrrrr, dashed, purple] &&&  &  & A\arrow[uuuu, dashed, blue] &&& D'\arrow[ddllll, dashed, crossing over, purple]\arrow[uuuuuuuuuullll, crossing over, blue] &&  \\
     &&  &&&  &  &  &&&  &&  \\
    E\arrow[uuuuu, blue]\arrow[dddddrrrrrr, blue] &&  &&&  & B\arrow[uuuuuu, dashed, purple]\arrow[uuuuuur, dashed, purple] &  &&&  && F\arrow[uuuuu, blue]\arrow[dddddllllll, blue] \\
     &&  &&&  &  &  &&&  &&  \\
     &&  &&&  &  &  &&&  &&  \\
     && C\arrow[uuuuu, crossing over, blue] &&&  &  &  &&& D\arrow[uuuuu, crossing over, blue] &&  \\
     &&  &&&  &  &  &&&  &&  \\
     &&  &&&  & G\arrow[uullll, blue]\arrow[uurrrr, blue]\arrow[uuuuu, dashed, purple]\arrow[uuuuuuur, dashed, blue] &  &&&  &&  \\
\end{tikzcd}
\end{document}

我怎么解决这个问题?

提前致谢!

答案1

如果我理解正确的话,你希望BF'线越过线AG并越过D'{e}线。以下是图片:

在此处输入图片描述

你只需要按照正确的顺序画线:首先AG,然后(交叉)BD'BF'。最后(再次交叉)D'{e}。你可以使用语法\arrow[from=11-11, to=13-7, dashed, crossing over, purple],即从D'B。(B在第 13 行,第 7 列)。

以下是代码:

\begin{tikzcd}[every arrow/.append style={dash}]
     &&  &&&  & \{e\} &  &&&  &&  \\
     &&  &&&  &  &  &&&  &&  \\
     &&  &&&  &  &  &&&  &&  \\
     &&  &&&  &  &  &&&  &&  \\
     &&  &&&  &  &  &&&  &&  \\
     &&  &&&  &  &  &&&  &&  \\
     &&  &&&  & B'\arrow[uuuuuu, dashed, purple] & A'\arrow[uuuuuul, dashed, blue] &&&  &&  \\
    E'\arrow[uuuuuuurrrrrr, blue]\arrow[dddddrrrrrr, dashed, purple] &&  &&&  &  &  &&&  && F'\arrow[uuuuuuullllll, blue] \\
     &&  &&&  &  &  &&&  &&  \\
     &&  &&&  &  &  &&&  &&  \\
     && C'\arrow[uuuuuuuuuurrrr, crossing over, blue]\arrow[ddrrrr, dashed, purple] &&&  &  & A\arrow[uuuu, dashed, blue] &&& D' &&  \\
     &&  &&&  &  &  &&&  &&  \\
    E\arrow[uuuuu, blue]\arrow[dddddrrrrrr, blue] &&  &&&  & B\arrow[uuuuuu, dashed, purple]\arrow[uuuuuur, dashed, purple] &  &&&  && F\arrow[uuuuu, blue]\arrow[dddddllllll, blue] \\
     &&  &&&  &  &  &&&  &&  \\
     &&  &&&  &  &  &&&  &&  \\
     && C\arrow[uuuuu, crossing over, blue] &&&  &  &  &&& D\arrow[uuuuu, crossing over, blue] &&  \\
     &&  &&&  &  &  &&&  &&  \\
     &&  &&&  & G\arrow[uullll, blue]\arrow[uurrrr, blue]\arrow[uuuuu, dashed, purple]\arrow[uuuuuuur, dashed, blue] &  &&&  && \\
     \arrow[from=11-11, to=13-7, dashed, crossing over, purple]
     \arrow[from=8-13, to=13-7, dashed, crossing over, purple]
     \arrow[from=11-11, to=13-7, dashed, purple]
     \arrow[from=11-11, to=1-7, crossing over, blue]
\end{tikzcd}

请注意,我画了D'B两次箭头。一次是穿过,另一次是在之后F'B(但在之前)画的D'{e},这样线的末端就B不会互相干扰。

答案2

这个 MWE 是否满足你的问题的要求?

在此处输入图片描述

\documentclass[border=20]{standalone}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[brazil]{babel}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}[every arrow/.append style={dash}]
     &&  &&&  & \{e\} &  &&&  &&  \\
     &&  &&&  &  &  &&&  &&  \\
     &&  &&&  &  &  &&&  &&  \\
     &&  &&&  &  &  &&&  &&  \\
     &&  &&&  &  &  &&&  &&  \\
     &&  &&&  &  &  &&&  &&  \\
     &&  &&&  & B'\arrow[uuuuuu, dashed, purple] & A'\arrow[uuuuuul, dashed, blue] &&&  &&  \\
    E'\arrow[uuuuuuurrrrrr, blue]\arrow[dddddrrrrrr, dashed, purple] &&  &&&  &  &  &&&  && F'\arrow[uuuuuuullllll, blue]\arrow[dddddllllll, dashed, crossing over, purple] \\
     &&  &&&  &  &  &&&  &&  \\
     &&  &&&  &  &  &&&  &&  \\
     && C'\arrow[uuuuuuuuuurrrr, crossing over, blue]\arrow[ddrrrr, dashed, purple] &&&  &  & A\arrow[uuuu, dashed, blue] &&& D'\arrow[ddllll, dashed, crossing over, purple]\arrow[uuuuuuuuuullll, crossing over, blue] &&  \\
     &&  &&&  &  &  &&&  &&  \\
    E\arrow[uuuuu, blue]\arrow[dddddrrrrrr, blue] &&  &&&  & B\arrow[uuuuuu, dashed, purple]\arrow[uuuuuur, dashed, purple] &  &&&  && F\arrow[uuuuu, blue]\arrow[dddddllllll, blue] \\
     &&  &&&  &  &  &&&  &&  \\
     &&  &&&  &  &  &&&  &&  \\
     && C\arrow[uuuuu, crossing over, blue] &&&  &  &  &&& D\arrow[uuuuu, crossing over, blue] &&  \\
     &&  &&&  &  &  &&&  &&  \\
     &&  &&&  & G\arrow[uullll,blue]\arrow[uurrrr, blue]\arrow[uuuuu, dashed, purple]\arrow[uuuuuuur, crossing over, dashed, blue] &  &&&  &&  \\
\end{tikzcd}
\end{document}

相关内容