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

Straight quotes should not be rendered as smart quotes in the documentation #683

Closed
dbitouze opened this issue May 22, 2019 · 11 comments
Closed

Comments

@dbitouze
Copy link

dbitouze commented May 22, 2019

In the PDF file of the documentation, the straight quotes in code sample are rendered as smart quotes. This makes these samples fail to compile with the error:

! Missing \endcsname inserted.
...
\OT1\textquoteright

For instance, this is the case for the code to be found on page 568 of the documentation (version 3.1.3):

\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}
@hmenke
Copy link
Member

hmenke commented May 22, 2019

Why should copy-pasting from the PDF work? It doesn't work for anything else in TeX (like math) and there is no way to preserve spaces.

@hmenke
Copy link
Member

hmenke commented May 22, 2019

This is the offending line by the way:

% Fontenc (new beginning 2014, let's see, what it breaks...):
\usepackage[T1]{fontenc}

Another related issue is #385, which is another incarnation of the same problem but which I marked wont-fix.

@dbitouze

This comment was marked as off-topic.

@hmenke
Copy link
Member

hmenke commented May 22, 2019

That's a cool story but your example code is completely irrelevant to the PGF manual, which does not use listings.

@dbitouze
Copy link
Author

your example code is completely irrelevant to the PGF manual, which does not use listings.

And? Is it a reason for closing the issue? Maybe it is however possible to improve the TikZ documentation from this point of view.

@joulev
Copy link
Contributor

joulev commented May 22, 2019

@dbitouze The codeexample environment in the manual, AFAIK, is based on verbatim. I do not think you can copy the code from verbatim in the right way.

If you want to "improve" the documentation using listings or minted, I totally disagree. There are many special features offered by the codeexample environment, especially the automatic cross-reference, which I rely on literally everyday. and which, in my opinion, makes the PGF manual different from the rest. And do you think such a feature can be implemented easily using listings?

Of course you can make a pull request which redefines codeexample to a listings-based environment (and I will appreciate it), but codeexample is now perfect (or nearly perfect as the syntax highlighting doesn't always work well), in my point of view. IMHO you never have to (or should never) copy and paste code from the manual (why do you have to do so, when the output is exactly on the left of the code?), but you should read it and try to understand it. TikZ is like any other programming languages, where code-copying never gives a positive result. But when you have understood it, you will be able to code it from scratch by yourself...

@dbitouze

This comment was marked as off-topic.

@dbitouze

This comment was marked as off-topic.

@hmenke
Copy link
Member

hmenke commented May 22, 2019

Yes, \usepackage[T1]{fontenc} is the problem. Again, your example is of absolutely no use in the context of the PGF manual. Please stop spamming the thread with unrelated code.
I also feel that you have no idea how any of those things work. The codeexample environment uses \scantokens which immediately rules out the usage of any active characters. If you look at the implementation of either the upquote package or the verbatim environment you will see that they attempt to solve the apostrophe vs single right quotation mark using an active character.

@hmenke
Copy link
Member

hmenke commented May 23, 2019

6f2a726 should implement what you want. I'm marking this as wont-fix anyway.

@dbitouze
Copy link
Author

@hmenke Please do not confuse spamming and legitimate attempts to help. Hopefully there are many less rude contributors.

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

No branches or pull requests

3 participants