3

The code

\documentclass{minimal}

\usepackage{tikz}
\usetikzlibrary{matrix}

\begin{document}

\begin{tikzpicture}
\matrix[matrix of math nodes, column sep = {1.5cm,between origins}, row sep = 1cm]
{
&|(1)|1\\
|(nnjtoj)|\neg\neg jo\to jo&&|(nnjtojtojnj)|(\neg\neg jo\to jo)\to j\neg jo\\
&|(jnj)|j\neg jo&&|(nnj)|\neg\neg jo\\
|(nj)|\neg jo&&|(j)|jo\\
&|(o)|o\\
};
\draw (1) -- (nnjtoj) -- (jnj) -- (nj) -- (o) -- (j) -- (nnj) -- (nnjtojtojnj) -- (1);
\draw (j) -- (jnj) -- (nnjtojtojnj);
\end{tikzpicture}

\end{document}

results in enter image description here

Why is the rightmost cell placed so far? I've been able to correct it by inserting [-10ex] at an appropriate place but still wonder -- what might be the reason?

  • I see now the answer, in time of writing of my comment it wasn't here (in my PC, so I will erase comment as surplus ... – Zarko May 21 '16 at 8:24
3

This is not a bug, in fact the behavior is (indirectly) documented in the manual:

The between origins option can only be used for columns mentioned in the first row, that is, you cannot specify this option for columns introduced only in later rows.

(Section 20.3.2 Setting and Adjusting Column and Row Spacing)

In your matrix you only have one column in the first row, so the between origins only applies to the first column. The fix is simple though: add empty columns in the first row:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\begin{tikzpicture}
\matrix[matrix of math nodes, column sep = {1.5cm,between origins}, row sep = 1cm]
{
 & |(1)|1 & & \\ % <-- Added two & here
|(nnjtoj)|\neg\neg jo\to jo & & |(nnjtojtojnj)|(\neg\neg jo\to jo)\to j\neg jo\\
 & |(jnj)|j\neg jo & & |(nnj)|\neg\neg jo\\
|(nj)|\neg jo & & |(j)|jo\\
 &|(o)|o\\
};
\draw (1) -- (nnjtoj) -- (jnj) -- (nj) -- (o) -- (j) -- (nnj) -- (nnjtojtojnj) -- (1);
\draw (j) -- (jnj) -- (nnjtojtojnj);
\end{tikzpicture}

\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.