tikzcd-editor icon indicating copy to clipboard operation
tikzcd-editor copied to clipboard

Add node style

Open LudwikJaniuk opened this issue 6 years ago • 2 comments

For example, margin, circle, et.c.

LudwikJaniuk avatar Mar 09 '18 08:03 LudwikJaniuk

What are node styles? Can you elaborate with some code examples or direct to some documentation?

yishn avatar Mar 09 '18 09:03 yishn

Sure! I was surprised not to see that much of it in the tikzcd documentation (first time I hear of tikzcd, only used tikz), but for example, this code would produce nodes with boxes around them. The boxes are what I refer to as "node style".

\begin{tikzcd}[cells={nodes={draw=gray}}]
s_1 \arrow[rr] &  & s_2 \arrow[rr] &  & s_3 \\
\end{tikzcd}

Or red circles:

\begin{tikzcd}[cells={nodes={draw=red, circle}}]
s_1 \arrow[rr] &  & s_2 \arrow[rr] &  & s_3 \\
\end{tikzcd}

Ideally I would like to be able to specify different styles for the nodes separately, but I'm not sure what the syntax is in tikzcd. In tikz, you would write something like:

\node[circle] at (0,0) {text}; \node[draw=blue] at (2,0) {other text};

By the way, thank you so much for creating this tool, it's a small thing but it's really useful!

LudwikJaniuk avatar Mar 09 '18 09:03 LudwikJaniuk