2

I'm working with a bunch of short exact sequences, and I think they look best when the arrows are about 1cm long. It allows just enough room to throw labels on the arrows if needed, but not too much that it looks totally empty if I choose not to. When the nodes have simple labels, setting the node distances works just fine

\begin{tikzpicture}[node distance = 1.25cm, auto]
  \node (01) {$0$};
  \node (A) [right of=01] {$A$};
  \node (B) [right of=A] {$B$};
  \node (C) [right of=B] {$C$};
  \node (02) [right of=C] {$0$};
  \draw[->] (01) to node {} (A);
  \draw[->] (A) to node {$\alpha$} (B);
  \draw[->] (B) to node {$\beta$} (C);
  \draw[->] (C) to node {} (02);
\end{tikzpicture}

But when the node labels become more complex, it starts to get cluttered and kind of awkward.

\begin{tikzpicture}[node distance = 1.25cm, auto]
  \node (01) {$0$};
  \node (AM) [right of=01] {$A \oplus M$};
  \node (BM) [right of=AM] {$B \oplus M$};
  \node (C) [right of=BM] {$C$};
  \node (02) [right of=C] {$0$};
  \draw[->] (01) to node {} (AM);
  \draw[->] (AM) to node {$\alpha'$} (BM);
  \draw[->] (BM) to node {$\beta'$} (C);
  \draw[->] (C) to node {} (02);
\end{tikzpicture}

(Sorry, I couldn't figure out how to get the TeX to compile and actually appear in this post)

So, is there a way to set a standard arrow length, or have the node distance measured by the space between nodes and not center-to-center?

4

Use positioning library and the new syntax

right =of 01

instead of right of=01. I hope your happiness will increase ;)

\documentclass[tikz]{standalone}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}[node distance = 1.25cm, auto]
  \node (01) {$0$};
  \node (AM) [right =of 01] {$A \oplus M$};
  \node (BM) [right =of AM] {$B \oplus M$};
  \node (C) [right =of BM] {$C$};
  \node (02) [right =of C] {$0$};
  \draw[->] (01) to node {} (AM);
  \draw[->] (AM) to node {$\alpha'$} (BM);
  \draw[->] (BM) to node {$\beta'$} (C);
  \draw[->] (C) to node {} (02);
\end{tikzpicture}

\begin{tikzpicture}[node distance = 1.25cm, auto]
  \node (01) {$0$};
  \node (A) [right =of 01] {$A$};
  \node (B) [right =of A] {$B$};
  \node (C) [right =of B] {$C$};
  \node (02) [right =of C] {$0$};
  \draw[->] (01) to node {} (A);
  \draw[->] (A) to node {$\alpha$} (B);
  \draw[->] (B) to node {$\beta$} (C);
  \draw[->] (C) to node {} (02);
\end{tikzpicture}
\end{document}

enter image description here

  • Oh, that makes me so happy. So then using "right of= node" will still retain the usual center-to-center measurement? – JoeDub Jan 27 '14 at 4:06

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.