如何实现交换图(使用 TikZ-cd)与文本的缠绕?

如何实现交换图(使用 TikZ-cd)与文本的缠绕?

如何实现下图的效果:

enter image description here 我的困扰是常用的包wrapfig好像只有“本地图片”支持比较好

我不想使用“本地图片”来插入和获取这个交换图,它是通过TikZ的编码绘制的。

我应该怎么办?

我也想将它嵌套到定理环境中......

我无法完成这个想法,所以我不能提供可以运行的代码,只能提供一些可能有用的片段(复制自在 ntheorem 环境中放置图形

\documentclass[a4paper,11pt]{book}
\usepackage[margin=3.5cm]{geometry}
\usepackage{lipsum}
\usepackage[english]{babel}
\usepackage[pangram]{blindtext}
\usepackage{cutwin,graphicx,wrapfig}
\usepackage{ntheorem}
\usepackage[calc]{adjustbox}
\usepackage{amsmath,amssymb,mathtools,tikz,tikz-cd}

\newtheorem{theorem}{Theorem}

\opencutleft
\renewcommand\windowpagestuff{%%    \rule{4cm}{3cm}
\includegraphics[width=0.8\linewidth]{example-image-b.png}
    }

    \pagestyle{empty}

\begin{document}

\opencutright 
\renewcommand\windowpagestuff{% setup the image to be placed in the     cutout
    \centering
    \includegraphics[width=0.80\linewidth]{example-image-b.png}
}

% cutout in adjustbox, cutout on the left
\begin{adjustbox}{valign=C,vspace=0bp,minipage={1.0\linewidth}}
    \begin{theorem}
        \begin{cutout}{2}{0.70\linewidth}{0pt}{6}
         \Blindtext[1][12]
        \end{cutout}
    \end{theorem}
\end{adjustbox}

\[
\begin{tikzcd}
\tilde{H}_{n+1}(S^{n+1}) \arrow{r}{\partial}[swap]{\approx} \arrow{d}[swap]{Sf_*}
&\tilde{H}_n(S^n) \arrow{d}{f_*}\\
\tilde{H}_{n+1}(S^{n+1}) \arrow{r}{\partial}[swap]{\approx} 
&\tilde{H}_n(S^n)
\end{tikzcd}
\]

\end{document}

答案1

在图表中使用\begin{tikzcd}[ampersand replacement=\&]和 然后\&代替。&

enter image description here

\documentclass[a4paper,11pt]{book}
\usepackage[margin=3.5cm]{geometry}
\usepackage{lipsum}
\usepackage[english]{babel}
\usepackage[pangram]{blindtext}
\usepackage{cutwin,graphicx,wrapfig}
\usepackage{ntheorem}
\usepackage[calc]{adjustbox}
\usepackage{amsmath,amssymb,mathtools,tikz,tikz-cd}

\newtheorem{theorem}{Theorem}

%\opencutleft
%\renewcommand\windowpagestuff{%%    \rule{4cm}{3cm}
%\includegraphics[width=0.8\linewidth]{example-image-b.png}
%    }

    \pagestyle{empty}

\begin{document}

\opencutright 
\renewcommand\windowpagestuff{% setup the image to be placed in the     cutout
    \centering
\begin{tikzcd}[ampersand replacement=\&]
\tilde{H}_{n+1}(S^{n+1}) \arrow{r}{\partial}[swap]{\approx} \arrow{d}[swap]{Sf_*}
\&\tilde{H}_n(S^n) \arrow{d}{f_*}\\
\tilde{H}_{n+1}(S^{n+1}) \arrow{r}{\partial}[swap]{\approx} 
\&\tilde{H}_n(S^n)
\end{tikzcd}
}

% cutout in adjustbox, cutout on the left
\begin{adjustbox}{valign=C,vspace=0bp,minipage={1.0\linewidth}}
    \begin{theorem}
        \begin{cutout}{2}{0.70\linewidth}{0pt}{6}
         \Blindtext[1][12]
        \end{cutout}
    \end{theorem}
\end{adjustbox}

\end{document}

答案2

我不知道为什么它不适用于tikz-cd,但它确实适用于psmatrix环境,形式pstricks。这是您想要的布局吗?

\documentclass[a4paper,11pt]{book}
\usepackage[margin=3.5cm]{geometry}
\usepackage{lipsum}
\usepackage[english]{babel}
\usepackage[pangram]{blindtext}
\usepackage{cutwin}
\usepackage{ntheorem}
\usepackage[calc]{adjustbox}

\usepackage{amssymb,mathtools}
\input{insbox} 
\newtheorem{theorem}{Theorem}

\opencutleft
\renewcommand\windowpagestuff{%% \rule{4cm}{3cm}
\includegraphics[width=0.8\linewidth]{example-image-b.png}
    }
\usepackage{pst-node, auto-pst-pdf}
\pagestyle{empty}

\begin{document}

\opencutright
\renewcommand\windowpagestuff{% setup the image to be placed in the cutout
 \raggedleft\small
\psset{arrows=->, arrowinset=0.12, nodesep=3pt, labelsep=2pt, npos=0.5}
\everypsbox{\scriptstyle}
$ \begin{psmatrix}[rowsep = 1cm, colsep = 1.2cm, shortput = nab]
\tilde{H}_{n+1}(S^{n+1}) & \tilde{H}_n(S^n) \\
\tilde{H}_{n+1}(S^{n+1}) & \tilde{H}_n(S^n)
\ncline{1,1}{1,2}\naput{\partial}\nbput{\approx}
\ncline{1,1}{2,1}\tlput{Sf_*}
\ncline{1,2}{2,2}\trput{f_*}
\ncline{2,1}{2,2}\naput{\partial}\nbput{\approx}
\end{psmatrix} $
}

% cutout in adjustbox, cutout on the left
\begin{adjustbox}{valign=C,vspace=0bp,minipage={1.0\linewidth}}
    \begin{theorem}
        \begin{cutout}{2}{0.65\linewidth}{0pt}{6}
         \Blindtext[1][12]
        \end{cutout}
    \end{theorem}
\end{adjustbox}

\end{document} 

enter image description here

相关内容