pgf-tikz / pgf

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

Example for subgraph C_n (page 268, version 3.1.9a) not reproducible #1194

Open jasperhabicht opened 2 years ago

jasperhabicht commented 2 years ago

Version

3.1.9a

Details

The fourth example on page 268 (section 19 "Specifying Graphs", subsection "19.1" Overview) can only be reproduced using the graphs.standard library, but not using the graphs library as the code suggests. There seems to be a mistake in the code example.

The provided code example is:

\usetikzlibrary {graphs}
    \tikz
        \graph [nodes={draw, circle}, clockwise, radius=.75cm, empty nodes, n=8] {
            subgraph C_n [name=inner] <->[shorten <=1pt, shorten >=1pt]
            subgraph C_n [name=outer]
    };

It should be:

\usetikzlibrary {graphs.standard}
    \tikz
        \graph [nodes={draw, circle}, clockwise, radius=.75cm, empty nodes, n=8] {
            subgraph C_n [name=inner] <->[shorten <=1pt, shorten >=1pt]
            subgraph C_n [name=outer]
    };
muzimuzhi commented 2 years ago

duplicate of #971, which was marked as duplicate of the more general #640

Mo-Gul commented 2 years ago

@muzimuzhi, true, but I think nonetheless this issue should be fixed, because it is quite easy to do.

There are also some other wrong instances left. But they can be found easily. It just needs to be checked if examples containing subgraph have the library graphs.standard listed (at least for the non-Lua parts of the manual). Shall I propose a PR or do you want to do that?

muzimuzhi commented 2 years ago

Shall I propose a PR or do you want to do that?

@Mo-Gul Please feel free to go ahead.