1

Consider the figure below

\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz-cd}
\usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,positioning,fit,petri,calc,shapes.misc,decorations.markings}
\tikzset{degil/.style={
                decoration={markings,
                mark= at position 0.5 with {
                \node[transform shape] (tempnode) {$\backslash$};
                %\draw[thick] (tempnode.north east) -- (tempnode.south west);
                }
                },
                postaction={decorate}
}
}

\begin{document}

%\tikzcdset{row sep/normal=1cm}

\begin{tikzcd}[arrows=Rightarrow,column sep=large, row sep=large]
    &  \text{$Y$ is mean indt. of $X$} \arrow[shift right=0ex]{dr}{} \arrow[degil,shift right=1.5ex]{dl}{}  &  \\
  \text{Stochastic Independence} \arrow[shift right=0ex]{ur} \arrow[shift left=1.5ex]{dr}{}  &   & C(X,Y)=0 \arrow [degil,shift right=1.5ex]{ul} \arrow [degil,shift left=1.5ex]{dl} \\
  & \text{$X$ is mean indt. of $Y$} \arrow[shift left=0ex]{ur} \arrow[degil,shift left=0ex]{ul}{} & 
\end{tikzcd}

\end{document}

I tried using the fine tuning options but still I face two (different) issues:

  1. How to make the diagram more elegant in the sense that arrows are regular and are neatly arranged from the text. (perhaps using the rlap and llap macros of stackengine package?)

  2. Also, how to ensure the figure is horizontally at the centre of the page? [Answered by egreg in comments]


BTW, thanks to Enrico's solution here I modified it a bit but the key issue (no. 1) above remains

\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz-cd}
\usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,positioning,fit,petri,calc,shapes.misc,decorations.markings}
\tikzset{degil/.style={
                decoration={markings,
                mark= at position 0.5 with {
                \node[transform shape] (tempnode) {$\backslash$};
                %\draw[thick] (tempnode.north east) -- (tempnode.south west);
                }
                },
                postaction={decorate}
}
}

\begin{document}

%\tikzcdset{row sep/normal=1cm}

\[\begin{tikzcd}[arrows=Rightarrow,column sep=large, row sep=large]
    &  \begin{tabular}{@{}c@{}} $Y$ is mean \\ indt. of $X$ \end{tabular}   \arrow[shift right=0ex]{dr}{} \arrow[degil,shift right=1.5ex]{dl}{}  &  \\
  \begin{tabular}{@{}c@{}} Stochastic \\ Independence \end{tabular}\arrow[shift right=0ex]{ur} \arrow[shift left=1.5ex]{dr}{}  &   & C(X,Y)=0 \arrow [degil,shift right=1.5ex]{ul} \arrow [degil,shift left=1.5ex]{dl} \\
  & \begin{tabular}{@{}c@{}} $X$ is mean \\ indt. of $Y$ \end{tabular} \arrow[shift left=0ex]{ur} \arrow[degil,shift left=0ex]{ul}{} & 
\end{tikzcd}\]





\end{document}
3
  • 1
    You get centering by \[\begin{tikzcd}...\end{tikzcd}\]
    – egreg
    Aug 13, 2014 at 22:17
  • btw, thanks to egreg's soln I modified a bit Aug 14, 2014 at 10:39
  • 1
    “Fine tune” is a bit vague.
    – egreg
    Aug 14, 2014 at 10:51

1 Answer 1

2

Here do you have something to start with. I just have no Idea how to properly center the right cell at the moment. I just put it on two lines now.

% arara: pdflatex

\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz-cd}
\usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,positioning,fit,petri,calc,shapes.misc,decorations.markings}
\tikzset{degil/.style={
        decoration={markings,
            mark= at position 0.5 with {
                \node[transform shape] (tempnode) {$\backslash$};
            }
        },
        postaction={decorate}
    }
}

\begin{document}        
    \tikzset{foo/.style={align=center, minimum height=1cm, minimum width=2cm}}
    \[\begin{tikzcd}[arrows=Rightarrow]
    & \tikz\node[foo]{ $Y$ is mean\\indt.\ of $X$}; \arrow[degil, shift right=1ex, start anchor=south west, end anchor=north east]{dl} \arrow[shift right=1ex, start anchor=south east, end anchor = north west]{dr} &\\
    \tikz\node[foo]{Stochastic\\Independence}; \arrow[shift right=1ex, start anchor=north east, end anchor=south west]{ur} \arrow[shift left=1ex, start anchor=south east, end anchor = north west]{dr}&&\tikz\node[foo]{$ C(X,Y)$\\$\quad=0$}; \arrow[shift right=1ex, degil, start anchor= north west, end anchor = south east]{ul} \arrow[shift left=1ex, degil, start anchor=south west, end anchor = north east]{dl}\\
    &\tikz\node[foo]{ $X$ is mean\\indt.\ of $Y$};  \arrow[degil, shift left=1ex, start anchor=north west, end anchor = south east]{ul} \arrow[shift left=1ex, start anchor=north east, end anchor = south west]{ur}&
    \end{tikzcd}\]
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.