5

The following code:

\usepackage{tikz}
\usetikzlibrary{matrix}
%...
\begin{tikzpicture}
\matrix (m) [matrix of math nodes, inner sep=0.3pt,row sep=0.3em,column sep=0.3em] 
{
1s & & & \\
2s & 2p & & \\
3s & 3p & 3d & \\
4s & 4p & 4d & 4f \\
5s & 5p & 5d & 5f \\
6s & 6p & 6d & \\
7s & 7p & & \\
}
;
\draw[->] (m-1-1.north east) -- (m-1-1.south west);
\draw[->] (m-2-1.north east) -- (m-2-1.south west);
\draw[->] (m-2-2.north east) -- (m-3-1.south west);
\draw[->] (m-3-2.north east) -- (m-4-1.south west);
\draw[->] (m-3-3.north east) -- (m-5-1.south west);
\draw[->] (m-4-3.north east) -- (m-6-1.south west);
\draw[->] (m-4-4.north east) -- (m-7-1.south west);
\draw[->] (m-5-4.north east) -- (m-7-2.south west);
\end{tikzpicture}

Yields the image:

enter image description here

How do I make the arrow to continue a little longer?
Its edge (on the leftmost column) is too close to the number..
Without compromising the compact size of the matrix!

Dor
  • 467
  • 1
  • 5
  • 12

1 Answers1

4

Let be last answer in this year :)

Tray;

    \documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix}

\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}% <---------------------------------
    \setlength\PreviewBorder{1em}

    \begin{document}
\begin{tikzpicture}
\matrix (m) [matrix of math nodes, inner sep=0.3pt,row sep=0.3em,column sep=0.3em]
{
1s & & & \\
2s & 2p & & \\
3s & 3p & 3d & \\
4s & 4p & 4d & 4f \\
5s & 5p & 5d & 5f \\
6s & 6p & 6d & \\
7s & 7p & & \\
}
;
\draw[->,shorten >=-2pt] 
    (m-1-1.north east) edge (m-1-1.south west) 
    (m-2-1.north east) edge (m-2-1.south west)
    (m-2-2.north east) edge (m-3-1.south west)
    (m-3-2.north east) edge (m-4-1.south west)
    (m-3-3.north east) edge (m-5-1.south west)
    (m-4-3.north east) edge (m-6-1.south west)
    (m-4-4.north east) edge (m-7-1.south west)
    (m-5-4.north east)  --  (m-7-2.south west);
\end{tikzpicture}
    \end{document}

enter image description here

And as I said in comment, you can select amount for prolonging a arrowas according to yor taste.

Zarko
  • 296,517