yishn / tikzcd-editor

A simple visual editor for creating commutative diagrams.

Home Page:https://tikzcd.yichuanshen.de/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add node style

LudwikJaniuk opened this issue · comments

For example, margin, circle, et.c.

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

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!