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

"sub-library" should load "main library" by default #720

Closed
Mo-Gul opened this issue Jul 25, 2019 · 3 comments
Closed

"sub-library" should load "main library" by default #720

Mo-Gul opened this issue Jul 25, 2019 · 3 comments

Comments

@Mo-Gul
Copy link
Contributor

Mo-Gul commented Jul 25, 2019

Loading the graphs.standard library without loading the graphs library as well leads to an error message. Wouldn't it be an improvement if the graphs.standard library would load the graph library itself (by default)?

\documentclass{standalone}
\usepackage{tikz}
    \usetikzlibrary{graphs.standard}
\begin{document}
\end{document}

Something similar holds for the graphdrawing library which also only makes sense when the graph library is loaded. In contrast to the previous MWE loading the graphdrawing only works fine, i.e. without raising an error.

\documentclass{standalone}
\usepackage{tikz}
    \usetikzlibrary{graphdrawing}
\begin{document}
\end{document}
@hmenke
Copy link
Member

hmenke commented Jul 27, 2019

Excellent idea. I think the decorations.<whatever> libraries already do this and always load the decorations library, so it would just be consistent to have that for all others as well.

@Mo-Gul
Copy link
Contributor Author

Mo-Gul commented Jul 27, 2019

You are right regarding the decorations libraries. Shall I include this already in the current Pull Request or wait?

@Mo-Gul
Copy link
Contributor Author

Mo-Gul commented Jul 28, 2019

I added loading graphs in the graphs.standard library in my last commit to Pull Request #711.

Up to now I decided not to load the graphs library when graphdrawing is loaded because of the text I just read here:

Note that in addition to the graph \emph{drawing} libraries, you may also wish
to load the normal \tikzname\ library |graphs|. It provides the powerful
|graph| path command with its easy-to-use syntax for specifying graphs, but you
can use the graph drawing engine independently of the |graphs| library, for
instance in conjunction with the |child| or the |edge| syntax. Here is a
typical setup:

I also could find some examples in the manual. One of them is

\begin{codeexample}[]
\tikz [grow'=up, binary tree layout, nodes={circle,draw}]
\node {1}
child { node {2}
child { node {3} }
child { node {4}
child { node {5} }
child { node {6} }
}
}
child { node {7}
child { node {8}
child[missing]
child { node {9} }
}
};
\end{codeexample}

I adapted the codeexamples accordingly in the above mentioned commit as well.

@Mo-Gul Mo-Gul closed this as completed Jul 28, 2019
@hmenke hmenke reopened this Jul 30, 2019
hmenke pushed a commit to hmenke/pgf that referenced this issue Aug 27, 2019
…y" by default)

  - therefore added loading `graphs` library in `graphs.standard` library
  - adjusted `preamble` code in `codeexample`s accordingly
 - there exist `graphdrawing` `codeexample`s in the manual that don't need the `graphs` library --> adjusted `codeexample`s accordingly
@hmenke hmenke added this to the 3.1.5 milestone Nov 3, 2019
@hmenke hmenke closed this as completed Nov 4, 2019
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