2

I am trying to write a simple commutative diagram using an array. I know that there are fancier ways to do this, but for my purposes this is quick and simple and means I don't have to look up things I have previously half-remembered. Or so I thought.

My question is: how can I get an "implies" version of the diagonal arrows, such as \nwarrow? The standard way of doing this is to capitalise the first letter (\rightarrow becomes \Rightarrow, \uparrow becomes \Uparrow, etc.). However, as I'm sure you realised (because I am asking this question!) \Nwarrow doesn't work.

My MWE is below, and there is a picture of what is produced. I want the diagonal arrow to have the same forms as the other two arrows. "Simple" solutions would be appreciated; I can cobble something together myself using tikz, but this seems like overkill.

\documentclass{article}

\begin{document}
\[
\begin{array}{ccc}
A&\Rightarrow&B\\
&\nwarrow&\Downarrow\\
&&C
\end{array}
\]
\end{document}

picture of diagram

2 Answers 2

2

You can use \rotatebox from graphicx to rotate symbols.

\documentclass{article}
\usepackage{graphicx}
\newcommand*{\Nwarrow}{\rotatebox[origin=c]{135}{\(\Longrightarrow\)}}
\begin{document}
\[
\begin{array}{c@{\ }c@{\ }c}
A&\Rightarrow&B\\
&\Nwarrow&\Downarrow\\
&&C
\end{array}
\]
\end{document}

2

I do not see how this is an overkill:

\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\[
\begin{tikzcd}[arrows=Rightarrow]
A\arrow[r]&B\arrow[d]\\
&\arrow[ul]C
\end{tikzcd}
\]
\[
\begin{tikzcd}[sep=small,arrows=Rightarrow]
A\arrow[r]&B\arrow[d]\\
&\arrow[ul]C
\end{tikzcd}
\]
\end{document}

enter image description here

4
  • I had actually written something like this already, and it was one of the reasons for my asking the question. I know I didn't say it in the question (for the sake of not over-complicating things), but one of the reasons for my not using tikz-cd is that I'm also using beamer, and they don't play nice together. So your code does not work unless I start my frame with \begin{frame}[fragile]. However, I don't understand why this is needed and its all getting a bit too complicated! Thus my plea for simplicity :-) [In fact, I only learned how to get tikz-cd to work after asking the question.]
    – user1729
    Commented Jun 11, 2020 at 16:23
  • 1
    @user1729 This does not have much to do with simplicity (or the lack of simplicity), but with the way beamer and LaTeX work. You can equally well use an ampersand replacement. You will run also in related problems when you try to define a macro with parameters in a frame. Of course, everyone is free to choose to produce the output in the way they want, but I personally would think that adding a fragile is simpler than tuning distances and rotation angles, which you would have to do once you want a more general diagram.
    – user194703
    Commented Jun 11, 2020 at 16:30
  • Well, my issue was really that I didn't understand why the error was occurring. Tikz itself seems to play fine with beamer. But I've now been looking at the tikz-cd documentation and it seems that the reason for the lack of issues was that I wasn't using matrices in my TikZ, as apparently "TikZ makes the character & active inside matrices". I don't really know what this means, apart from that the people/person who wrote the package know about the issue and have a suggestion for getting around it. Which makes any worries I had go away :-)
    – user1729
    Commented Jun 11, 2020 at 16:51
  • @user1729 This is a well-defined question, which however does not coincide with your above question. The fact that there is an active character does not explain the problem completely. However, a full explanation will depend on what you already know, and what you want to learn, and is certainly too much for a comment. I guess that the main issue is that the term fragile may not be optimally chosen, it sounds like "shaky" but there is no real downside in choosing fragile, see tex.stackexchange.com/q/136240.
    – user194703
    Commented Jun 11, 2020 at 17:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .