Label on two lines with tikz-network

The manual suggests to add [style={...}] to the \Vertices macro, but from the source code it seems that the texts in the nodes are done separately. Therefore I suggest to "hack" it (which has nothing to do with the name of the package author;-) by just setting

every label/.append style={text width=1cm,align=center}

in the tikzpicture options.

\documentclass[a4paper,12pt]{article}
\usepackage{filecontents}
\begin{filecontents*}{vert.csv}
id, label, x, y
A, {long label}, 0,  0
B, label 2,0.87,0.5
C, label 3, -0.87,  0.5
D, label 4,-0.87,  -0.5
E, label 5, 0.87,-0.5
\end{filecontents*}
\begin{filecontents*}{edg.csv}
u,v,label, bend
B,A,FC1,0
C,A,FC2,0
D,A,FC3,0
E,A,FC4,0
B,C,FP1,15
B,E,FP2,-40
\end{filecontents*}
\usepackage{tikz-network}
\begin{document}
\begin{tikzpicture}[every label/.append style={text width=1cm,align=center}]
\SetVertexStyle[MinSize=1.2cm]
\SetDistanceScale{3.0}
\Vertices{vert.csv}
\Edges{edg.csv}
\end{tikzpicture}
\end{document}

enter image description here

Tags:

Tikz Pgf