2

As per example on page 26 of the manual https://github.com/hackl/tikz-network/ when doing latexmk -pdflua -pvc or latexmk -pdfxe -pvc I get the following error below. Note: already tried https://github.com/hackl/tikz-network/issues/5:

! Package xkeyval Error: `R' undefined in families `vertex'.

See the xkeyval package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.6 \Vertices[RGB]{data/vertices_RGB.csv}

?

MWE:

\documentclass{article}
\usepackage{tikz-network}
\thispagestyle{empty}
\begin{document}
\begin{tikzpicture}
\Vertices[RGB]{data/vertices_RGB.csv}
\end{tikzpicture}
\end{document}

Edit: As @sebastiano requested here is the link to edges.csv https://github.com/hackl/tikz-network/blob/master/doc/data/edges.csv used for my MWE.

  • 1
    Is it possible that you can add data/vertices_RGB.csv? Thank you. – Sebastiano Jul 29 at 22:27
  • 1
    @Sebastiano I have edited the issue by placing at the end the link to the file I used for the edges.csv settings. – Diego Bnei Noah Jul 29 at 23:38
  • 1
    Just observe that the data/vertices_RGB.csv file should be replaced by edges.csv (or vice-versa). – Sigur Jul 30 at 0:57
  • 2
    Just to bring others up to speed: Diego made a bug report at github.com/hackl/tikz-network/issues/12. I tried in Overleaf with TL17 where it works, and TL19 where it fails, I'm guessing some recent change in a package broke this. – Torbjørn T. Jul 30 at 7:02
  • 1
    Grateful for the observation @Torbjøn, I hope that over time this can be resolved. – Diego Bnei Noah Jul 30 at 12:46
5

The problem are the spaces in the header. Due to a change in etoolbox (it uses \ifstrempty instead of \ifblank internally in a command), datatool is more picky here now. If you change the header in the data-file to

 id,x,y,size,color,opacity,label,R,G,B

it compiles again. The problematic spaces are the one after the R, G, B. That the definition is the problem can be tested by switching it:

\documentclass{article}
\usepackage{etoolbox}
\makeatletter
%old, ",R ," works
%\def\etb@ifdefempty #1{\expandafter \expandafter \expandafter \ifblank \expandafter \expandafter \expandafter {\expandafter \strip@prefix \meaning #1}}
%new, ",R ," fails
%\def\etb@ifdefempty #1{\expandafter \expandafter \expandafter \ifstrempty \expandafter \expandafter \expandafter {\expandafter \strip@prefix \meaning #1}}


\usepackage{tikz-network}
\thispagestyle{empty}
\begin{document}
\begin{tikzpicture}
\Vertices[RGB]{test-vertices.csv} 
\end{tikzpicture}
\end{document}

with the datafile with a space:

id,x,y,size,color,opacity,label,R ,G,B
 A, 0,  0, .4 , green,  .9   ,  a  ,255,  0,  0
 B, 1, .7, .6 ,      ,  .5   ,  b  ,  0,255,  0
 C, 2,  1, .8 ,orange,  .3   ,  c  ,  0,  0,255
 D, 2,  0, .5 ,   red,  .7   ,  d  , 10,120,255
 E,.2,1.5, .5 ,  gray,       ,  e  , 76, 55,255

Edit

You can try the following patch: (a similar patch is probaly also needed for @@edges and perhaps more commands, so it should be better done by the package author).

\documentclass{article}
\usepackage{expl3}
\usepackage{tikz-network}
\makeatletter
\ExplSyntaxOn
\cs_set_eq:NN\vertex@trim@spacesN\tl_trim_spaces:N
\ExplSyntaxOff
\patchcmd\@@vertices{\DTLifeq}{\vertex@trim@spacesN\dtlkey\DTLifeq}{}{\fail}
\makeatother
\thispagestyle{empty}
\begin{document}
\begin{tikzpicture}
\Vertices[RGB]{test-vertices.csv}
\end{tikzpicture}
\end{document}
  • Really, @Ulrike Fisher, the spacing in the header was the central detail. Grateful to you and everyone who helped me.. – Diego Bnei Noah Jul 30 at 12:43
  • 1
    I added a possible patch. – Ulrike Fischer Jul 30 at 13:44
  • 1
    @DiegoBneiNoah Thank you, sincerely for your collaboration for edit your question. Thanks to Ulrike Fischer to give you an answer. My best regards everyone. – Sebastiano Jul 30 at 14:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.