Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typo in documentation #681

Closed
dbitouze opened this issue May 21, 2019 · 5 comments
Closed

Typo in documentation #681

dbitouze opened this issue May 21, 2019 · 5 comments

Comments

@dbitouze
Copy link

If I'm right, the following code to be found on page 568 of the TikZ & PGF's documentation (Version 3.1.3) contains a spurious ': it should be >=stealth instead of >=stealth’.

\begin{tikzpicture}[->,>=stealth’,shorten >=1pt,%
auto,node distance=2cm,on grid,semithick,
inner sep=2pt,bend angle=45]
\node[initial,state] (A)
{$q_a$};
\node[state]
(B) [above right=of A] {$q_b$};
\node[state]
(D) [below right=of A] {$q_d$};
\node[state]
(C) [below right=of B] {$q_c$};
\node[state]
(E) [below=of D]
{$q_e$};
\path [every node/.style={font=\footnotesize}]
(A) edge
node {0,1,L} (B)
edge
node {1,1,R} (C)
(B) edge [loop above] node {1,1,L} (B)
edge
node {0,1,L} (C)
(C) edge
node {0,1,L} (D)
edge [bend left] node {1,0,R} (E)
(D) edge [loop below] node {1,1,R} (D)
edge
node {0,1,R} (A)
(E) edge [bend left] node {1,0,R} (A);
\end{tikzpicture}
@hmenke
Copy link
Member

hmenke commented May 21, 2019

If you had posted a MWE, you would have noticed that it is not a bug.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows, automata, positioning}

\begin{document}

\begin{tikzpicture}[->,>=stealth',shorten >=1pt,%
                    auto,node distance=2cm,on grid,semithick,
                    inner sep=2pt,bend angle=45]
  \node[initial,state] (A)                    {$q_a$};
  \node[state]         (B) [above right=of A] {$q_b$};
  \node[state]         (D) [below right=of A] {$q_d$};
  \node[state]         (C) [below right=of B] {$q_c$};
  \node[state]         (E) [below=of D]       {$q_e$};

  \path [every node/.style={font=\footnotesize}]
        (A) edge              node {0,1,L} (B)
            edge              node {1,1,R} (C)
        (B) edge [loop above] node {1,1,L} (B)
            edge              node {0,1,L} (C)
        (C) edge              node {0,1,L} (D)
            edge [bend left]  node {1,0,R} (E)
        (D) edge [loop below] node {1,1,R} (D)
            edge              node {0,1,R} (A)
        (E) edge [bend left]  node {1,0,R} (A);
\end{tikzpicture}

\end{document}

The code for the picture is from here

\begin{tikzpicture}[->,>=stealth',shorten >=1pt,%
auto,node distance=2cm,on grid,semithick,
inner sep=2pt,bend angle=45]
\node[initial,state] (A) {$q_a$};
\node[state] (B) [above right=of A] {$q_b$};
\node[state] (D) [below right=of A] {$q_d$};
\node[state] (C) [below right=of B] {$q_c$};
\node[state] (E) [below=of D] {$q_e$};
\path [every node/.style={font=\footnotesize}]
(A) edge node {0,1,L} (B)
edge node {1,1,R} (C)
(B) edge [loop above] node {1,1,L} (B)
edge node {0,1,L} (C)
(C) edge node {0,1,L} (D)
edge [bend left] node {1,0,R} (E)
(D) edge [loop below] node {1,1,R} (D)
edge node {0,1,R} (A)
(E) edge [bend left] node {1,0,R} (A);
\end{tikzpicture}

@dbitouze
Copy link
Author

OK, sorry for the noise. My mistake for this (quickly, sorry) reported issue came from:

  1. copy-paste from the PDF leads to a smart quote instead of a straight quote ',
  2. the example code doesn't mention the needed arrows library,
  3. without the arrows library, the example compiles nicely without the quote (okay on grid has to be dropped).

@hmenke
Copy link
Member

hmenke commented May 22, 2019

  1. You already opened a new issue for this (Straight quotes should not be rendered as smart quotes in the documentation #683), although I don't see the benefit. You still won't be able to reliably copy-paste code from the PDF.
  2. Examples in the manual are not MWEs, which should be obvious because there is no \documentclass skeleton. It's also an open issue: Examples in the manual as MWE #640
  3. Well, of course. If you read the manual carefully you will notice that stealth is a builtin arrow tip, whereas stealth' is provided by the old arrows library.

@dbitouze
Copy link
Author

  1. You already opened a new issue for this (Straight quotes should not be rendered as smart quotes in the documentation #683), although I don't see the benefit. You still won't be able to reliably copy-paste code from the PDF.

The benefit is because it is a different issue. The (im)possibility to copy-paste code from the PDF is not the main point of the current issue and it is worth opening a new issue for a different matter.

  1. It's also an open issue: Examples in the manual as MWE #640

I didn't notice: nice!

  1. If you read the manual carefully you will notice that stealth is a builtin arrow tip, whereas stealth' is provided by the old arrows library.

When people (in the present case, a student of mine) want to try automata library (or other library or any code in TikZ documentation), they probably want to not have to read each of the 1247 pages TikZ documentation.

For instance, pgfplots documentation gives hints of what is needed in the preamble.

@hmenke
Copy link
Member

hmenke commented May 24, 2019

Sorry for the misunderstanding. I wasn't referring to the benefit of opening a separate issue but to the benefit of being able to copy-paste from the PDF. In my experience this is extremely unreliable because different viewers implement different heuristics for detecting spaces and things like multicolumn typesetting. In most cases copying from the PDF yields garbled output and for the PGF manual it is not even necessary because the source code of the manual is available, either as part of your TeX distribution or right here on GitHub.

The issue #640 is a real problem and has hit us multiple times in the past. If you have any good ideas, please comment there.

Having things magically work without reading the manual would be nice and in principle I could implement a fast path which simply loads all available TikZ libraries, but the processing times for your documents would skyrocket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants