pgf-tikz / pgf

A Portable Graphic Format for TeX
https://pgf-tikz.github.io/
1.13k stars 106 forks source link

\graph{(1) -> {(2), (3) -> (2)}}; does not connect nodes 1 and 2 #500

Open pgf-tikz-bot opened 5 years ago

pgf-tikz-bot commented 5 years ago

Migrated from SourceForge Author: gbraun Timestamp: 2019-01-10 12:37:16.585000

The following example should produce a graph with three nodes 1, 2,3 and edges 1->2, 1->3, 3->2. However, the edge 1->2 is omitted in the output.

\documentclass[tikz]{standalone}
\usetikzlibrary{graphs}
\begin{document}
\begin{tikzpicture}
  \node foreach \x in {1,2,3} (\x) at (120*\x:1) {\x};
  \graph{(1) -> {(2), (3) -> (2)}};
\end{tikzpicture}
\end{document}
pgf-tikz-bot commented 5 years ago

Migrated from SourceForge Author: mo-gul Timestamp: 2019-01-10 19:13:53.491000

Are you sure that your syntax is right? Using

\documentclass[tikz]{standalone}
    \usetikzlibrary{graphs}
\begin{document}
\begin{tikzpicture}
  \node foreach \x in {1,2,3} (\x) at (120*\x:1) {\x};
  \graph{(1) -> {(2), (3)} -> (2)};
\end{tikzpicture}
\end{document}

gives the desired result.

(Please note that I have never used the graphs library. If you show me in the manual that your syntax is allowed or an example in the manual that uses your syntax I accept your bug report. Otherwise I'll close it as "invalid" (or similar).

pgf-tikz-bot commented 5 years ago

Migrated from SourceForge Author: gbraun Timestamp: 2019-01-10 22:43:42.991000

https://sourceforge.net/p/pgf/bugs/_discuss/thread/ccc92ae780/5741/9cd3/attachment/alternate Are you sure that your syntax is right?

Yes. Please look at the following places in the manual:

Section 19.1 Overview [for specifying graphs]: the last example with edge labels f, a, g.

Section 19.2.2: Concept: Chain Groups: the very first example uses a -> {b -> c, d->e } -> f.

Section 19.7.3: This section discusses which nodes should be connected by a specification like {a, b, c} -> {d, e->f}.

If these do not answer your concerns, please point out the place where you think the syntax is wrong, because I am only guessing it now.

pgf-tikz-bot commented 5 years ago

Migrated from SourceForge Author: hmenke Timestamp: 2019-01-12 07:57:08.631000

Seems to be a problem with the parser. When you flip the order it works.

\graph{(1) -> {(3) -> (2), (2)}};

Bug confirmed.

pgf-tikz-bot commented 5 years ago

Migrated from SourceForge Author: hmenke Timestamp: 2019-01-18 05:51:18.173000

https://sourceforge.net/p/pgf/bugs/_discuss/thread/ccc92ae780/e16e/attachment/test.png That's more broken than I thought it was. Try this \graph{(1) -> {(1), (2), (3)}};

pgf-tikz-bot commented 5 years ago

Migrated from SourceForge Author: hmenke Timestamp: 2019-01-21 21:01:28.153000

pgf-tikz-bot commented 5 years ago

Migrated from SourceForge Author: hmenke Timestamp: 2019-02-04 22:19:23.892000

Diff:


--- old
+++ new
@@ -10,462 +10,3 @@
 \end{tikzpicture}
 \end{document}

-Log file: -``` -This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2019/dev/Debian) (preloaded format=pdflatex 2018.12.21) 10 JAN 2019 13:29 -entering extended mode