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

[doc] Replace \diameter representing radius with \r #905

Merged
merged 2 commits into from Aug 12, 2020

Conversation

muzimuzhi
Copy link
Member

@muzimuzhi muzimuzhi commented Aug 2, 2020

  1. Replace -to with -To in Section 3. Tutorial: A Petri-Net for Hagen
    Arrow tip to is from deprecated library arrows, which is not
    documented in latest pgfmanual anymore. Use undocumented setting
    in tutorial sections will confuse careful new users, see Archive old manuals? #903.
    Hence I replace -to with ->.

  2. Replace \diameter used in ... circle (\diameter) with \r.
    Note: Although ... circle (<radius>) is an old syntax (mentioned
    in the last two paragraphs of pgfmanual 3.1.5b, sec. 14.6), I didn't
    replace it with ... circle[radius=<radius>].
    A simple grep shows there are ~200 usages of ... circle (<radius>)
    throughout the pgfmanual, and since this syntax is more convenient,
    I don't have a strong opinion to replace all of them.

@muzimuzhi muzimuzhi changed the title [doc] Replace arrow tip "to" with ">" [doc] Replace a) arrow tip to with >, 2) \diameter representing radius with \r Aug 2, 2020
@muzimuzhi muzimuzhi changed the title [doc] Replace a) arrow tip to with >, 2) \diameter representing radius with \r [doc] Replace a) arrow tip to with >, b) \diameter representing radius with \r Aug 2, 2020
@muzimuzhi
Copy link
Member Author

@AndreC75

there is still -to in page 1076 \begin{pgfpicture} \begin{pgfscope} { \pgfsetarrows{-to} \pgfpathmoveto{\pgfpointorigin}\pgfpathlineto{\pgfpoint{2ex}{2ex}} \pgfusepath{stroke} } \pgfpathmoveto{\pgfpoint{3ex}{0ex}}\pgfpathlineto{\pgfpoint{5ex}{2ex}} \pgfusepath{stroke} \end{pgfscope} \pgfpathmoveto{\pgfpoint{6ex}{0ex}}\pgfpathlineto{\pgfpoint{8ex}{2ex}} \pgfusepath{stroke} \end{pgfpicture}
#903 (comment)

What you found is already handled in the second commit of current pr, b983e77.

@Mo-Gul
Copy link
Contributor

Mo-Gul commented Aug 2, 2020

To 1.
Actually the to arrow tip was/is not an arrow tip of the arrows library, but is a predefined arrow tip. See #746 (comment).

@muzimuzhi
Copy link
Member Author

To 1.
Actually this to was/is not an arrow of the arrows library, but is a predefined arrow tip. See #746 (comment).

Ah yes. I should have found this by myself. I've opened #906 to discuss this issue. After #906 get resolved, the first two commits of current pr are then avoidable.

@AndreC75
Copy link

AndreC75 commented Aug 2, 2020

@Mo-Gul @muzimuzhi I noticed that -To (with a capital T) is also an arrow. Manual 3.1.5b talks about this on page 207.

@Mo-Gul
Copy link
Contributor

Mo-Gul commented Aug 2, 2020

@AndreC75, To is an arrow tip from the arrows.meta library, as can be seen on the corresponding manual section 16.5 on page 212.

@AndreC75
Copy link

AndreC75 commented Aug 2, 2020

@muzimuzhi @Mo-Gul

the arrows -to, -To are the same, so in the manual it seems better to replace -to by -To

`\documentclass[tikz,border=5mm]{standalone}

\begin{document}

\begin{tikzpicture}[nodes={font=\small\ttfamily, black, right}]

\draw[-to] (0,0)--(2,0)node{arrow "-to"};

\begin{scope}[yshift=-1cm]
\draw[-To] (0,0)--(2,0)node{arrow "-To"};
\end{scope}

\begin{scope}[yshift=-2cm]
\draw[->] (0,0)--(2,0) node{arrow "->"};
\end{scope}
\end{tikzpicture}

\end{document}`

@muzimuzhi
Copy link
Member Author

@AndreC75

the arrows -to, -To are the same,

They are the same by default, but are different if arrows.meta is loaded, since at that time To is redefined to Computer Modern Rightarrow.

\pgfkeys{To /.tip = to}

To /.tip = {Computer Modern Rightarrow},

And > is always the same as To.

Also see this example.
\documentclass{article}
\usepackage{graphicx}
\usepackage{tikz}

\begin{document}
\tikzset{nodes={font=\ttfamily\tiny}}

Default\par
% Default arrow tips like `to` does not respect arrow options like `scale`, hence I have to use `\scalebox` to enlarge it.
\scalebox{3}{\begin{tikzpicture}
  \foreach \i[count=\xi] in {>, to, To} {
    \draw[-\i, yshift=\xi*-.3cm] (0, 0) -- (1, 0) node[right] {\i};
  }
\end{tikzpicture}}

\usetikzlibrary{arrows.meta}

With \texttt{arrows.meta} loaded\par
\scalebox{3}{\begin{tikzpicture}
  \foreach \i[count=\xi] in {>, to, Classical TikZ Rightarrow, To, Computer Modern Rightarrow} {
    \draw[-\i, yshift=\xi*-.3cm] (0, 0) -- (1, 0) node[right] {\i};
  }
\end{tikzpicture}}
\end{document}

image

so in the manual it seems better to replace -to by -To

I agree. Though using > in tutorial sections of pgfmanual seems more gentle for new users.

@AndreC75
Copy link

AndreC75 commented Aug 2, 2020

@muzimuzhi The tutorials are also an opportunity to discover new features. I prefer to put -To quite to indicate the section where it is defined or indicate that it is an arrow. This can motivate to go see the predefined arrows.

@muzimuzhi
Copy link
Member Author

Changes in force pushed commits:

  • -to is now replaced by -To, in Section 3. Tutorial: A Petri-Net for Hagen.
  • Change that replaced \pgfsetarrows{-to} by \pgfsetarrows{->} is reverted, since to is one of default arrow tips and not deprecated.

@muzimuzhi
Copy link
Member Author

muzimuzhi commented Aug 3, 2020

@hmenke Has added a 0e9f8a6 to replace -to with ->.

I'm OK with either -> or -To, but there is a small flaw in using ->. (Sorry I've found it yesterday but didn't mention it in my previous #905 (comment).)

  • default style of > is used through out Subsection 3.12 Adding the Snaked Line and Multi-Line Text, hence here -> is equivalent to -To (pgfmanual loads arrows.meta).
    image

  • modified style of > is used in complete example in beginning and ending of Section 3. Tutorial: A Petri-Net for Hagen, where > is redefined to >={Stealth[round]}.
    image

Hence there is a gap, not sure if that would confuse new users.

@AndreC75
Copy link

AndreC75 commented Aug 3, 2020

@muzimuzhi @hmenke In my opinion, since in the original there is a predefined arrow -to, you have to keep a predefined arrow -To and not a shortcut -> that can be redefined. Thus, the example retains the original idea of Till Tantau.

@hmenke
Copy link
Member

hmenke commented Aug 12, 2020

Please resolve the merge conflicts.

@muzimuzhi
Copy link
Member Author

@hmenke What's your (current) opinion about arrow tip staff?

@hmenke
Copy link
Member

hmenke commented Aug 12, 2020

I've already replaced -to by -> in 0e9f8a6 and I will leave it at that. Of course, bikeshedding the manual and trying to come up with the best formulations is easy but also completely irrelevant because nobody actually reads the manual.

 - In drawing code `... circle (\diameter)`, \diameter actually
specifies the radius of circle. Hence I replaced it with \r.
 - Reported by https://tex.stackexchange.com/q/557016/.
@muzimuzhi
Copy link
Member Author

OK. e671fd1, which changed arrow tips, is reverted and the whole branch is rebased.

@muzimuzhi muzimuzhi changed the title [doc] Replace a) arrow tip to with >, b) \diameter representing radius with \r [doc] Replace \diameter representing radius with \r Aug 12, 2020
@hmenke hmenke merged commit eb2ab92 into pgf-tikz:master Aug 12, 2020
@muzimuzhi muzimuzhi deleted the doc-replace-arrow-tip branch August 12, 2020 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

4 participants