3

How to achieve the effect of the next figure:

enter image description here My trouble is that the commonly used package wrapfig seems that only "local picture" support is better

I don't want to use the "local picture" to insert and get this exchange diagram, it's drawn through TikZ's coding.

what should I do?

I also want to nest it into the theorem environment...

I am not able to complete this idea, so I can't provide code that I can run, just put on potentially useful fragments (copy from Placement of figures inside an ntheorem environment)

\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}
Torbjørn T.
  • 206,688
poorich
  • 613

2 Answers2

3

Use \begin{tikzcd}[ampersand replacement=\&] and then \& instead of & in the diagram.

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}
Torbjørn T.
  • 206,688
2

I don't why it doesn't work with tikz-cd, but it does work with the psmatrix environment, form pstricks. Is this the kind of layout you want?

\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

Bernard
  • 271,350