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

Example uses a color that is not described in any way in documentation. #1159

Open
ismagilli opened this issue May 15, 2022 · 3 comments
Open
Labels

Comments

@ismagilli
Copy link

Version

3.1.9a

Details

Section 20.3 provides an example of a graph. To draw one of the lines, a color declared only in the documentation file:

\draw [-,line width=8pt,draw=graphicbackground]

2022-05-15_15-11-27

It seems to me that this example should be corrected.


I have two a suggestion to improve this example.

First based on using preaction:
replace

\draw [-,line width=8pt,draw=graphicbackground]
      (D) to [bend right, looseness=1] (A);
\draw (D) to [bend right, looseness=1]
      node [near start] {b} node [near end] {e} (A);

to

\draw [preaction={-,line width=8pt,draw=graphicbackground}]
      (D) to [bend right, looseness=1]
      node [near start] {b} node [near end] {e} (A);

Second based on this answer: replace

\begin{scope}[every node/.style={font=\small\itshape}]

to

\begin{scope}[every node/.style={font=\small\itshape},
              transparency group=knockout]

and replace draw=graphicbackground to draw,opacity=0. This will make the outline drawing independent of the background.

@ismagilli ismagilli changed the title The example uses a color that is not described in any way in documentation. Example uses a color that is not described in any way in documentation. May 15, 2022
@ismagilli
Copy link
Author

I found another example in the documentation where this color is used, but it clearly states that this is the background color:

fill=graphicbackground}}, % yellowish background

@muzimuzhi
Copy link
Member

I'm more in favor of adding similar comment to the first occurrence of graphicbackground.

Both examples use graphicbackground as the current background color, to manually implement some crossing/overlap effect. Not sure if an example for topic X should use advanced features in other topics or not. Using normal tricks may help newbies more focused on the current topic, while showing combinations of advanced features is a pursuit for perfection.

@Mo-Gul
Copy link
Contributor

Mo-Gul commented May 17, 2022

@a-is you are right, nowhere in the manual the definition of graphicbackground is given. But there are a lot of places in the manual where "information" is missing in examples. A few years ago even the needed libraries were missing. So that you get an impression, have a look at issue #640. I guess adding all needed information to all codeexamples would be an overkill. Therefore the idea was to have links to the individual codeexamples which then are fully defined and thus TeXable.

To support this you may have seen a few lines earlier to the quoted code line above that there is stated the definition of the color.

pre={\definecolor{graphicbackground}{rgb}{0.96,0.96,0.8}},

I agree that we could add a comment here as in the other example. Feel free to provide a PR.

@muzimuzhi, regarding the code improvement: For me this is ok for the first example, because in that particular case these are ...

\subsection{Examples}
The following examples are adapted from code by Mark Wibrow. The first two
redraw pictures from Timothy van Zandt's PStricks documentation:

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

No branches or pull requests

3 participants