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
Add an import mechanism #1284
Comments
@@ -45,8 +45,8 @@
\NewDocumentCommand{\myNode}{O{}m}{
\node[
%% Try to uncomment this: it will all break, while this should technically also search in /tikz
- %/some other libraries/.cd,
- draw, .search also={/conf test}, /test/every node,
+ /some other libraries/.cd,
+ draw, .search also={/conf test,/tikz}, /test/every node,
#1]{#2};
} |
Thanks, but wouldn’t it be possible to create an additive version of Ideally, this version could also allow the import individual styles, like:
|
A # expressed as python import statements
# https://docs.python.org/3/reference/simple_stmts.html#the-import-statement
from group_style import *
from my_styles import style_A, style_B An additive Maybe both can start with third-party |
Isn't this what |
@hmenke |
Brief outline of the proposed feature
I often find myself creating nested styles like:
While it works nicely, it can quickly become a mess: for instance, to edit later
set fill
, I need to do something like/mystyle/.append style={set fill/.style={new def}}
, and it can quickly be hard to read and not super robust. Moreover, this makes it hard to to call a single style (e.g. how do I load the styleset fill
without loading all styles in mystyle?) I’m also even more worried by efficiency: in practice, I callmystyle
in every single node that I am drawing and it can be quite time consuming.I know it is possible to do
.search also={/conf my style}
, but then I need to start every single style with/tikz/.cd
, and, more importantly, this solution assumes that I run this into tikz, but in practice it might not be the case. For instance, I might call it inside atikzcd
matrix that starts with somtething like/tikzcd/commutative diagram/.cd
: so if I do/tikz/.cd
I am unable to see stuff defined in/tikzcd/commutative diagram
… and I also get some breakages that I cannot explain.It would be much more handy to have a
.import={/conf mystyle}
that takes all keys defined in/conf mystyle
and just "insert" them here, basically like if I did a copy paste of all keys in/conf mystyle/
.Usage example
Try to uncomment the line
/some other libraries/.cd,
, and you will see the issue. On the other hand,\myNodeInneficient
has this line uncommented and it works… but I need to copy/paste the whole definition and/or use nested styles, which I don't like.The text was updated successfully, but these errors were encountered: