3

Here is a minimum working example:

\documentclass{book}[12pt]

\usepackage{pstricks,pst-node,pst-tree}

\begin{document}

\begin{figure}
\centering
\psmatrix[colsep=.3cm,rowsep=.5cm,mnode=r]
    [mnode=circle] 1 && && [mnode=circle] 3 \\
    & ~ && ~ \\
    [mnode=circle] 2 && && [mnode=circle] 4 \\
    \ncline{1,1}{2,2}\tlput{$\tau_{1}$}
    \ncline{2,2}{3,1}\tlput{$\tau_{2}$}
    \ncline{2,2}{2,4}\taput{$\tau_{1234}$}
    \ncline{2,4}{1,5}\trput{$\tau_{3}$}
    \ncline{2,4}{3,5}\trput{$\tau_{4}$}
    \endpsmatrix
\end{figure}

\end{document}

I am processing the file through LaTeX -> PS -> PDF.

It does exactly what I want it to do except the horizontal line doesn't quite line up to the other lines.

3
  • You should use \documentclass[12pt]{book}, not \documentclass{book}[12pt]...
    – Werner
    Jan 26, 2016 at 7:03
  • Why's that? I've pretty much learnt LaTeX on the fly.
    – Jonathan
    Jan 27, 2016 at 0:11
  • That's how it is. While it does work, providing an optional argument after the \documentclass{<class>} it should typically represent a date, not a point-size.
    – Werner
    Jan 27, 2016 at 0:23

1 Answer 1

3

Instead of supplying ~ (a tie or non-breaking space; it has width), use an empty group {} for your nodes in the second row (columns 2 and 4):

enter image description here

\documentclass{article}

\usepackage{pst-node}

\begin{document}

\begin{figure}
  \centering
  \psmatrix[colsep=3mm,rowsep=.5cm,mnode=r]
    [mnode=circle] 1 &    &&    & [mnode=circle] 3 \\
                     & {} && {} & \\
    [mnode=circle] 2 &    &&    & [mnode=circle] 4 \\
    \ncline{1,1}{2,2}\tlput{$\tau_{1}$}
    \ncline{2,2}{3,1}\tlput{$\tau_{2}$}
    \ncline{2,2}{2,4}\taput{$\tau_{1234}$}
    \ncline{2,4}{1,5}\trput{$\tau_{3}$}
    \ncline{2,4}{3,5}\trput{$\tau_{4}$}
  \endpsmatrix
\end{figure}

\end{document}
0

You must log in to answer this question.

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