The question might be dumb but I can't find an adequate solution.
If I put a comma separated value list as parameter using pgfkeys, then the result of pgfkeysvalueof is an atomic value and not a list.
The code (that is not working) is this:
\documentclass{article}
\usepackage{fontenc}
\usepackage{tikz}
\usepackage{color}
\usetikzlibrary{shapes,
shapes.geometric,
shapes.symbols,
shapes.arrows,
shapes.multipart,
shapes.callouts,
shapes.misc,
tikzmark,
arrows,
positioning,
calc,
math,
scopes,
}
\tikzstyle{every entity} = []
\tikzstyle{entity} = [shape=rectangle, draw, black, thick,
minimum width=6em, minimum height=3em,
every entity]
% \usepackage[active,pdftex,tightpage]{preview}
\newcommand{\rol}[3][type=normal,arcfmt=--,card=N,total=false]{
\pgfkeys{/incoMer/.cd,
startPoint/.initial={-},
endPoint/.initial={},
arcfmt/.initial={--},
rolname/.initial={},
rolnameParams/.initial={},
card/.initial={N},
cardpos/.initial={above},
#1,
}
\draw [-] (#2) \pgfkeysvalueof{/incoMer/arcfmt} node[pos=0.80,\pgfkeysvalueof{/incoMer/cardpos}]{\pgfkeysvalueof{/incoMer/card}}
node[\pgfkeysvalueof{/incoMer/rolnameParams}]{\pgfkeysvalueof{/incoMer/rolname}} (#3);
}
\title{prueba}
\begin{document}
% Comienza el Mer
\begin{tikzpicture}
% Entidad Estudiantes
\node[entity](st){Students};
\node[entity][left=5cm of st](cs){Courses};
\rol[%
arcfmt={edge[bend left,sloped]},
rolname={very very very long test},
rolnameParams={below,sloped},
%rolnameParams={below},
]{st}{cs};
\end{tikzpicture}
\end{document}
When the rolnameParams line is changed by commenting the line and removing the % in the next line, it all works fine.
The error is:
Package pgfkeys Error: I do not know the key '/tikz/below,sloped' and I am going to ignore it. Perhaps you misspelled it.
It must be noted that the arcfmt parameter works fine but if the same strategy is used for the node, it doesn't work.
Why is this and how can this be solved?